Doxygen Source Code Documentation
mri_uncat2D.c File Reference
#include "mrilib.h"
Go to the source code of this file.
Functions | |
MRI_IMARR * | mri_uncat2D (int nx, int ny, MRI_IMAGE *im) |
Function Documentation
|
Definition at line 15 of file mri_uncat2D.c. References ADDTO_IMARR, ENTRY, INIT_IMARR, MRI_IMAGE::kind, mri_cut_2D(), MRI_IMAGE::nx, nxim, MRI_IMAGE::ny, nyim, and RETURN. Referenced by main().
00016 { 00017 MRI_IMARR * imar ; 00018 MRI_IMAGE * qim ; 00019 int nxim , nyim , ii,jj,kk , kind ; 00020 00021 ENTRY("mri_uncat2D") ; 00022 00023 if( nx < 1 || ny < 1 || im == NULL ) RETURN(NULL) ; 00024 00025 kind = im->kind ; 00026 00027 nxim = im->nx / nx ; 00028 nyim = im->ny / ny ; 00029 if( nxim < 1 || nyim < 1 ) RETURN(NULL) ; 00030 00031 INIT_IMARR(imar) ; 00032 00033 for( jj=0 ; jj < nyim ; jj++ ){ 00034 for( ii=0 ; ii < nxim ; ii++ ){ 00035 qim = mri_cut_2D( im , ii*nx , (ii+1)*nx-1 , jj*ny , (jj+1)*ny-1 ) ; 00036 if( qim != NULL ) ADDTO_IMARR(imar,qim) ; 00037 else fprintf(stderr,"mri_uncat2D: NULL image error!\n") ; 00038 } 00039 } 00040 00041 RETURN(imar) ; 00042 } |