[Insight-users] Re: how to read analyze files

Luis Ibanez luis.ibanez at kitware.com
Sun Sep 12 12:48:04 EDT 2004


Hi Dhaval,

Regarding your questions on DeformableRegistration4.cxx

1) "How to change the code for 3D images?"

   A) Just edit the file, go to line 106, and replace

         "const unsigned int Dimension = 2;"

      with

         "const unsigned int Dimension = 3;"


   B)  in line 208 add the third component of the initial
       parameters (for the Z axis)

   initialParameters[0] = 0.0;  // Initial offset in mm along X
   initialParameters[1] = 0.0;  // Initial offset in mm along Y
   initialParameters[2] = 0.0;  // Initial offset in mm along Z


               Then recompile...




2)  "How do i change the code in there to read analyze files?"

            You have not done your homework !

from the previous email:

 > You don't need anything especial for reading Analyze
 > images. The Analyze reader is used by default by the
 > ImageIO factory.
 >
 > You just need to instantiate an ImageFileReader and
 > to pass the filename of your image to the reader.
 > The image file and header must be located in the
 > same directory. ITK will expect your header file to
 > have extension ".hdr".
 >
 > Please read the IO Chapter from the ITK Software Guide
 >
 >      http://www.itk.org/ItkSoftwareGuide.pdf
 >
 > Chapter 7, pdf-page 219-240.
 >
 >

    If you do your homework, there will be no need for
    repeating the same question over and over again.




Regards,



     Luis


-------------------
Dalal, Dhaval wrote:

>  Hi Luis
>  Thanx so much for your reply.
> I want to use Deformable regitration4 example based on bsplines.
> I have successfully tested the algorithm for 2D .tif files, running the
> executables from ms-dos.
> Can you please tell me
> - How to change the code for 3D images
> - How do i change the code in there to read analyze files
> i am not fluent in C++ so i am confused regarding which specific class to
> intantiate.
> PLease let me know.
> thanx
> Dhaval
> 
> -----Original Message-----
> From: Luis Ibanez
> To: Dalal, Dhaval
> Cc: Insight-users at itk.org
> Sent: 9/10/2004 5:45 PM
> Subject: Re: how to read analyze files
> 
> 
> Hi Dalal,
> 
> 
> Please read the IO Chapter from the ITK Software Guide
> 
>      http://www.itk.org/ItkSoftwareGuide.pdf
> 
> Chapter 7, pdf-page 219-240.
> 
> ---
> 
> You don't need anything especial for reading Analyze
> images. The Analyze reader is used by default by the
> ImageIO factory.
> 
> You just need to instantiate an ImageFileReader and
> to pass the filename of your image to the reader.
> The image file and header must be located in the
> same directory. ITK will expect your header file to
> have extension ".hdr".
> 
> --
> 
> Most of the examples in ITK are designed to be run
> from the command line. There are not intended to be
> GUI applications. You need to run them from an MS_DOS
> command window or from a Cygwin shell.
> 
> Please read the ITK software guide, all the examples
> are described there.
> 
> 
> If you are interested in GUI applications, you could
> try the ones in the InsightApplications module.
> 
> However, it will be much more efficient for you to
> first get familiar with ITK by reading the software
> guide and by looking at the Tutorial sessions.
> 
>      http://www.itk.org/HTML/Tutorials.htm
> 
> 
> 
> Regards,
> 
> 
>     Luis
> 
> ---------------------
> Dalal, Dhaval wrote:
> 
> 
>> 
>>
>>Hi Luis
>>I DOn't now how to read in analyze file format, i did not see any
> 
> examples
> 
>>on this and even the software guide does not explain this.
>>can you tell me which files to use, so that i can write the cmake.txt
> 
> file
> 
>>with the included libraries.
>>also shuld my image files and header files should be stored in the
> 
> same
> 
>>directory.
>>I am not so fluent in C++, also whenever i run any exe file(generated
> 
> from
> 
>>buildiing examples), the exe file just appears on the screen and
> 
> disappears,
> 
>>how can i see the output? or do i have to add some getc statement in
> 
> the c++
> 
>>code and generate the build again?
>>i am sorry for asking such questions..
>>thanx in advance for yr help.
>>Dhaval  
>>
> 
> 
> 
> 
> 






More information about the Insight-users mailing list