[Insight-users] any MRI data

Luis Ibanez luis.ibanez at kitware.com
Sun Dec 19 10:56:19 EST 2004



Hi Jose,


Please read the code of the example:

    Insight/Examples/IO/ImageReadWrite.cxx

you will notice that you don't need to hardcode the
filename of the input or output images.  The filenames
are taken from the command line. Thats the purpose of
line 134-135:


      const char * inputFilename  = argv[1];
      const char * outputFilename = argv[2];





The only thing that you have to do in the code
is to select the correct pixel type and dimension
for this images. Which in this case is:

      PixelType  =  signed short
      Dimension  =  3


Just change lines  87-88 from

   typedef unsigned short      PixelType;
   const   unsigned int        Dimension = 2;

into

   typedef signed short        PixelType;
   const   unsigned int        Dimension = 3;

then recompile the program.





After you have an executable, then you simply invoke
this executable from the command line (a MS-DOS console,
or a Unix shell) with filenames for each one of the
images.


Like:

   ImageReadWrite.exe   126_1.mhd       126_1.hdr
   ImageReadWrite.exe   126_10.mhd      126_10.hdr
   ImageReadWrite.exe   126_13.mhd      126_13.hdr
   ImageReadWrite.exe   126_21.mhd      126_21.hdr
   ImageReadWrite.exe   126_26.mhd      126_26.hdr
   ImageReadWrite.exe   126_31.mhd      126_31.hdr
   ImageReadWrite.exe   126_37.mhd      126_37.hdr

Note that the extension ".exe" is only needed if you are
doing this on MS-Windows.  On Unix systems the executable
will not have any extension.

The extension ".mhd" will be for the input images
and the extension ".hdr" will be for the output
images in Analyze format.




In order to understand this program you *MUST* read
the IO chapter from the ITK Software Guide

        http://www.itk.org/ItkSoftwareGuide.pdf



Please let us know if you encounter any problems,


    Thanks


      Luis



-----------------------
jose santamaria wrote:
> Hi Luis,
> 
>   firstly of all, thanks a lot. I have downloaded 
> 
> SingleWithTumorMetaImageHeaders.tgz 
> 
> and added each .mhd metaimage file inside its 
> corresponding 126_*/ folder.
> 
> I have built the Insight/Examples/IO/ImageReadWrite.cxx
> example but I have not yet probed it. My doubt is if
> to convert each scan images to the Analyze format I must
> to do as follow:
> 
> 1) Loading given scan by its .mhd header file with
>     
> reader->SetFileName( headerfilename.mhd );
> 
> 2) Once loaded it and instantiated the itk::ImageFileWriter class,
> should I use the itkAnalyzeImageIO class to convert the loaded 
> volume to the Analyze format? I do not understand very much
> how to do this.
> 
> Kind regards Luis.
> 
> Jose.
> 
> El vie, 17 de 12 de 2004 a las 22:18, Luis Ibanez escribió:
> 
>>Hi Jose,
>>
>>You will find MRI data for the same patient over time at
>>the IBSR (Internet Brain Segmentation Repository) project
>>
>>        http://www.cma.mgh.harvard.edu/ibsr/
>>
>>You can download this data for free. Just need to register
>>with them, and make sure that they give them credit on any
>>potential publication.
>>
>>Note that the images they provide are in files with extension
>>.img, but are not in Analyze format. These images are in .raw
>>format. You should create MetaImage headers for them, and you
>>can use simple ITK code for converting them to Analyze format.
>>
>>For example you can use the program
>>
>>      Insight/Examples/IO/ImageReadWrite.cxx
>>
>>
>>Regards,
>>
>>
>>     Luis
>>
>>
>>---------------------
>>jose santamaria wrote:
>>
>>
>>>Hi,
>>>
>>>   I will be pleasure with anyone who could send me two brain MRI 
>>>data in the Analyse file format (.hdr + .img) from the same patient 
>>>but in two different times. I need it for registering.
>>>
>>>Thanks at all,
>>>
>>>Bye, jose.
>>>
>>>_______________________________________________
>>>Insight-users mailing list
>>>Insight-users at itk.org
>>>http://www.itk.org/mailman/listinfo/insight-users
>>>
>>>
>>
>>
>>
>>
> 
> 
> 






More information about the Insight-users mailing list