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_isgray.c

Go to the documentation of this file.
00001 #include "mrilib.h"
00002 
00003 /*! Returns 1 if the image is RGB and R=G=B for
00004     all voxels, otherwise returns 0.  [03 Dec 2003] */
00005 
00006 int mri_isgray( MRI_IMAGE *im )
00007 {
00008    register int nvox , ii ;
00009    register byte *bar ;
00010 
00011 ENTRY("mri_isgray") ;
00012 
00013    if( im == NULL || im->kind != MRI_rgb ) RETURN( 0 );
00014 
00015    nvox = im->nvox ;
00016    bar  = MRI_RGB_PTR(im) ;
00017    for( ii=0 ; ii < nvox ; ii++ )
00018      if( bar[3*ii] != bar[3*ii+1] ||
00019          bar[3*ii] != bar[3*ii+2]   ) RETURN( 0 );
00020 
00021    RETURN( 1 ) ;
00022 }
 

Powered by Plone

This site conforms to the following standards: