Doxygen Source Code Documentation
nsize.c File Reference
#include "mrilib.h"
#include "string.h"
Go to the source code of this file.
Defines | |
#define | ERREX(str) ( fprintf(stderr,"ERROR: %s\a\n",str) , exit(1) ) |
Functions | |
int | main (int argc, char *argv[]) |
Define Documentation
|
Definition at line 10 of file nsize.c. Referenced by main(). |
Function Documentation
|
\** File : SUMA.c
Input paramters :
Definition at line 12 of file nsize.c. References argc, ERREX, IMAGE_IN_IMARR, machdep(), mri_nsize(), mri_read_file(), mri_write(), and MRI_IMARR::num.
00013 { 00014 MRI_IMAGE * imin , * imout ; 00015 MRI_IMARR * imar ; 00016 00017 if( argc < 3 || strncmp(argv[1],"-help",2) == 0 ){ 00018 printf( 00019 "Usage: nsize image_in image_out\n" 00020 " Zero pads 'image_in' to NxN, N=64,128,256,512, or 1024, \n" 00021 " whichever is the closest size larger than 'image_in'.\n" 00022 " [Works only for byte and short images.]\n" ) ; 00023 exit(0) ; 00024 } 00025 00026 machdep() ; 00027 00028 imar = mri_read_file( argv[1] ) ; if( imar == NULL ) ERREX("can't continue!") ; 00029 if( imar->num != 1 ) ERREX("more than 1 image in input file!") ; 00030 imin = IMAGE_IN_IMARR(imar,0) ; 00031 00032 imout = mri_nsize( imin ) ; 00033 if( imout == NULL ){ 00034 fprintf(stderr,"*** failed to scale image! error exit!\n") ; 00035 exit(-1) ; 00036 } 00037 00038 mri_write( argv[2] , imout ) ; 00039 exit(0) ; 00040 } |