Doxygen Source Code Documentation
Main Page Alphabetical List Data Structures File List Data Fields Globals Search
mri_histobyte.c
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007 #include "mrilib.h"
00008
00009
00010
00011
00012
00013 void mri_histobyte( MRI_IMAGE * im , int * hist )
00014 {
00015 register int ih , npix , ii ;
00016 byte * bar ;
00017
00018 ENTRY("mri_histobyte") ;
00019
00020 if( im == NULL || im->kind != MRI_byte || hist == NULL ) EXRETURN ;
00021
00022 npix = im->nvox ;
00023 bar = MRI_BYTE_PTR(im) ;
00024
00025 for( ih=0 ; ih < 256 ; ih++ ) hist[ih] = 0 ;
00026
00027 for( ii=0 ; ii < npix ; ii++ )
00028 hist[ bar[ii] ] ++ ;
00029
00030 EXRETURN ;
00031 }