Skip to content

AFNI/NIfTI Server

Sections
Personal tools
You are here: Home » AFNI » Documentation

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    Major portions of this software are copyrighted by the Medical College
00003    of Wisconsin, 1994-2000, and are released under the Gnu General Public
00004    License, Version 2.  See the file README.Copyright for details.
00005 ******************************************************************************/
00006    
00007 #include "mrilib.h"
00008 
00009 /*** 7D SAFE ***/
00010 
00011 /** int hist[256] **/
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 }
 

Powered by Plone

This site conforms to the following standards: