Doxygen Source Code Documentation
mri_equal.c File Reference
#include "mrilib.h"Go to the source code of this file.
Functions | |
| int | mri_equal (MRI_IMAGE *aim, MRI_IMAGE *bim) |
Function Documentation
|
||||||||||||
|
Test if 2 images are equal. Returns 1 if they are, 0 if they are not. [30 Jun 2003] Definition at line 6 of file mri_equal.c. References ENTRY, MRI_IMAGE::kind, memcmp(), mri_data_pointer(), MRI_IMAGE::nvox, MRI_IMAGE::pixel_size, and RETURN. Referenced by SNAP_store_image().
00007 {
00008 char *aar , *bar ;
00009 int nn ;
00010
00011 ENTRY("mri_equal") ;
00012
00013 if( aim == bim ) RETURN( 1 );
00014 if( aim == NULL || bim == NULL ) RETURN( 0 );
00015
00016 if( aim->nvox != bim->nvox ) RETURN( 0 );
00017 if( aim->kind != bim->kind ) RETURN( 0 );
00018
00019 aar = mri_data_pointer(aim) ; if( aar == NULL ) RETURN( 0 );
00020 bar = mri_data_pointer(bim) ; if( bar == NULL ) RETURN( 0 );
00021
00022 nn = memcmp( aar , bar , aim->nvox * aim->pixel_size ) ;
00023 if( nn != 0 ) nn = 0 ;
00024 else nn = 1 ;
00025 RETURN( nn);
00026 }
|