Doxygen Source Code Documentation
dicom_to_raw.c File Reference
#include "mrilib.h"Go to the source code of this file.
| Functions | |
| int | main (int argc, char *argv[]) | 
Function Documentation
| 
 | ||||||||||||
| convert DTIStudio fiber format data to SUMA segment data Definition at line 3 of file dicom_to_raw.c. References argc, DESTROY_IMARR, IMARR_COUNT, IMARR_SUBIM, mri_read_dicom(), and mri_write(). 
 00004 {
00005   MRI_IMARR *imar ;
00006   int kk,ii , nn ;
00007   char iname[1024] ;
00008 
00009   if( argc < 2 || strcmp(argv[1],"-help") == 0 ){
00010     printf("Usage: dicom_to_raw fname ...\n"
00011            "Reads images from DICOM file 'fname' and writes them to raw\n"
00012            "file(s) 'fname.raw.0001' etc.\n"
00013           ) ;
00014     exit(0) ;
00015   }
00016            
00017   for( kk=1 ; kk < argc ; kk++ ){
00018     imar = mri_read_dicom( argv[kk] ) ;
00019     if( imar == NULL ){
00020       fprintf(stderr,"++ Can't read from file %s\n",argv[kk]) ; continue ;
00021     }
00022     nn = IMARR_COUNT(imar) ;
00023     for( ii=0 ; ii < nn ; ii++ ){
00024       sprintf(iname,"%s.raw.%04d",argv[kk],ii+1) ;
00025       mri_write( iname, IMARR_SUBIM(imar,ii) ) ;
00026     }
00027     DESTROY_IMARR(imar) ;
00028   }
00029 
00030   exit(0) ;
00031 }
 | 
 
                             
                             
                             
                             
                             
                             
                             
                             
                             
                             
                             
                             
 
 
 
 
       
	   
	   
	   
	  