1 /***************************************************************************** 2 Major portions of this software are copyrighted by the Medical College 3 of Wisconsin, 1994-2000, and are released under the Gnu General Public 4 License, Version 2. See the file README.Copyright for details. 5 ******************************************************************************/ 6 7 #include "mrilib.h" 8 9 /*** 7D SAFE ***/ 10 11 /** declare int hist[256] **/ 12 mri_histobyte(MRI_IMAGE * im,int * hist)13void mri_histobyte( MRI_IMAGE *im , int *hist ) 14 { 15 register int ih , npix , ii ; 16 byte *bar ; 17 18 ENTRY("mri_histobyte") ; 19 20 if( im == NULL || im->kind != MRI_byte || hist == NULL ) EXRETURN ; 21 22 npix = im->nvox ; 23 bar = MRI_BYTE_PTR(im) ; 24 25 for( ih=0 ; ih < 256 ; ih++ ) hist[ih] = 0 ; 26 27 for( ii=0 ; ii < npix ; ii++ ) hist[ bar[ii] ] ++ ; 28 29 EXRETURN ; 30 } 31