Doxygen Source Code Documentation
mri_histoshort.c File Reference
#include "mrilib.h"Go to the source code of this file.
| Defines | |
| #define | NUM_SHORT 65536 | 
| #define | OFF_SHORT 32768 | 
| Functions | |
| void | mri_histoshort_all (MRI_IMAGE *im, int *hist) | 
| void | mri_histoshort_nonneg (MRI_IMAGE *im, int *hist) | 
Define Documentation
| 
 | 
| 
 Definition at line 5 of file mri_histoshort.c. Referenced by mri_histoshort_all(). | 
| 
 | 
| 
 Definition at line 6 of file mri_histoshort.c. Referenced by mri_histoshort_all(), and mri_histoshort_nonneg(). | 
Function Documentation
| 
 | ||||||||||||
| 
 Definition at line 10 of file mri_histoshort.c. References ENTRY, MRI_IMAGE::kind, MRI_SHORT_PTR, NUM_SHORT, MRI_IMAGE::nvox, and OFF_SHORT. 
 00011 {
00012    register int ih , npix , ii ;
00013    short * sar ;
00014 
00015 ENTRY("mri_histoshort_all") ;
00016 
00017    if( im == NULL || im->kind != MRI_short || hist == NULL ) EXRETURN ;
00018 
00019    npix = im->nvox ;
00020    sar  = MRI_SHORT_PTR(im) ;
00021 
00022    for( ih=0 ; ih < NUM_SHORT ; ih++ ) hist[ih] = 0 ;
00023 
00024    for( ii=0 ; ii < npix ; ii++ )
00025       hist[ sar[ii]+OFF_SHORT ] ++ ;
00026 
00027    EXRETURN ;
00028 }
 | 
| 
 | ||||||||||||
| 
 Definition at line 32 of file mri_histoshort.c. References ENTRY, MRI_IMAGE::kind, MRI_SHORT_PTR, MRI_IMAGE::nvox, and OFF_SHORT. 
 00033 {
00034    register int ih , npix , ii ;
00035    short * sar ;
00036 
00037 ENTRY("mri_histoshort_nonneg") ;
00038 
00039    if( im == NULL || im->kind != MRI_short || hist == NULL ) EXRETURN ;
00040 
00041    npix = im->nvox ;
00042    sar  = MRI_SHORT_PTR(im) ;
00043 
00044    for( ih=0 ; ih < OFF_SHORT ; ih++ ) hist[ih] = 0 ;
00045 
00046    for( ii=0 ; ii < npix ; ii++ )
00047       if( sar[ii] >= 0 ) hist[ sar[ii] ] ++ ;
00048 
00049    EXRETURN ;
00050 }
 | 
 
                             
                             
                             
                             
                             
                             
                             
                             
                             
                             
                             
                             
 
 
 
 
       
	   
	   
	   
	  