[Insight-users] Registration Examples in 3D

Luis Ibanez luis . ibanez at kitware . com
Fri, 27 Jun 2003 00:15:27 -0400


Hi David,

We didn't include 3D registration examples on the software
guide basically due to the difficulty for displaying results.

However, any of the current examples on the

         Insight/Examples/Registration  

Should work in 3D just by changing the instantiation
of the image types.

Therer will be, as always, a need for some parameter
tunning. This depend on the types of images on which
you apply the registration.

You will find 3D brain data sets pre-arranged for
registration in the ftp server:

  ftp://public . kitware . com/pub/itk/Data/BrainWeb/

some of these data sets have been intentionally
rotated and translated by known amounts so you
can use them as test cases for registration  methods.

Please let us know if you find any problems
modifying and/or using these examples in 3D



Thanks



     Luis


----------------------------
David Nichols wrote:

> Luis,
>
> Thanks for the suggestions.  I used the MetaImage route, since that 
> involved no change in the actual image data.  One I get things figured 
> out I will probably go the CVS route (especially now that you have 
> added Python support :-)
>
> One further question ... Are there examples showing  3D registration? 
> The ones in the ITK Software Guide are 2D, so they sometimes 
> generalize easily but more often don't do so.  Any pointers would be 
> appreciated.
>
> Thanks again,
>
> David Nichols
> Source Signal Imaging
> dnichols at sourcesignal . com
>
> Luis Ibanez wrote:
>
>> Hi David,
>>
>> There were a couple of problems with the Analyze
>> reader in the release 1.2.  These problems were
>> fixed after the release.
>>
>> We are starting to prepare for release 1.4, which
>> should be available by september.
>>
>>
>>
>> In the meantime, you may want to try one of the
>> following options:
>>
>>
>>
>> 1) Since the readers are relatively self-contained,
>>    you could try simply downloading the current
>>    version of the Analyze readers.
>>
>>    You can easily do this through the CVS-Web interface:
>> http://www . itk . org/cgi-bin/cvsweb . cgi/Insight/Code/IO/?cvsroot=Insight
>>
>>
>> 2) You could move to fully use the CVS version of
>>    the toolkit. In that case the safest way to go
>>    is to check the Dashboard for a 'green' date and
>>    download the CVS snapshot at that day using the
>>    "-D date" option of the 'cvs checkout' command.
>>
>> 3) You could use any of the other formats supported
>>    by the toolkit. For example,
>>
>>    - MetaImage
>>    - GIPL
>>    - VTK
>>
>>
>> I would suggest you to use MetaImage, since you can reuse
>> the binary file of your current Analyze data. MetaImage,
>> as Analyze use a dual-file format, with a header file
>> with meta-data information, and a binary file with pixel
>> information.
>>
>> You can easily create the MetaImage header that will
>> load the data in the binary Analyze file. This will
>> prevent duplication of data in your disk.
>>
>>
>> BTW, you are absolutely right in that there is no
>> use in trying any segmentation or registration method
>> until it is clear that data is being read correctly into
>> memory.
>>
>>
>>
>> Please let us know if you encounter any problems,
>>
>>
>>
>> Regads
>>
>>
>>    Luis
>>
>>
>>
>>
>> ---------------------------
>> David Nichols wrote:
>>
>>> I'm having trouble reading analyze images with itk (Version 1.2.0, the
>>> standard release on the website, compiled with Visual C++ 6.0, running
>>> Windows XP).  The program below seems as if it should simply copy the
>>> input file to the output file, but this doesn't happen.  With the
>>> program below, if I feed it an Analyze file with 16-bit input the
>>> output is byte-swapped.  If I change the data type to float (using
>>> typedef float PixelType;) and provide as input a 32 bit floating point
>>> set of images the output voxels are all zero.  I can read both of the
>>> input files with MRIcro, so they seem to be correct.  Does anyone have
>>> any ideas how to fix this?  Alternatively, is there another way to
>>> read in 3D data?
>>>
>>> I'd like to register two data sets, but I'd have no confidence in the
>>> results if I have no confidence that the image data is being read
>>> correctly.  My initial attempt (using the "Hello world registration"
>>> from the users guide and changing the dimension from 2 to 3) was
>>> unimpressive, terminating after 14 iterations with an optimized value
>>> of about 1.0e6 and producing an output image (the transformed moving
>>> image) looked like hash.
>>>
>>> Thanks for any advice,
>>>
>>> David Nichols
>>> Source Signal Imaging
>>> dnichols at sourcesignal . com
>>>
>>> ============================================================
>>>
>>> #include "itkImageFileReader.h"
>>> #include "itkImageFileWriter.h"
>>> #include "itkImage.h"
>>>
>>> // Define input image characteristics
>>> typedef short int PixelType;
>>> const unsigned int Dimension = 3;
>>> typedef itk::Image< PixelType, Dimension> ImageType;
>>> typedef itk::ImageFileReader< ImageType > ReaderType;
>>> typedef itk::ImageFileWriter< ImageType > WriterType;
>>>
>>> int
>>> main(int argc, char *argv[])
>>> {
>>>  if( argc < 3 ){
>>>    std::cerr << "Usage : TestReadWriteAnalyze InFile OutFile\n";
>>>    return( -2 );
>>>  }
>>>  // Instantiate reader and writer
>>>  ReaderType::Pointer reader = ReaderType::New();
>>>  WriterType::Pointer writer = WriterType::New();
>>>  // Hook up file names
>>>  reader->SetFileName( argv[1]);
>>>  writer->SetFileName( argv[2]);
>>>  // Connect reader and writer
>>>  writer->SetInput( reader->GetOutput() );
>>>  // Ready to roll
>>>  try {
>>>    writer->Update();
>>>  } catch( itk::ExceptionObject &err ){
>>>    std::cerr << "Exception object caught!" << std::endl;
>>>    std::cerr << err << std::endl;
>>>    return( -1 );
>>>  }
>>>  return( 1 );
>>> }
>>>
>>>
>>>
>>>
>>> _______________________________________________
>>> Insight-users mailing list
>>> Insight-users at itk . org
>>> http://www . itk . org/mailman/listinfo/insight-users
>>>
>>
>>
>>
>> _______________________________________________
>> Insight-users mailing list
>> Insight-users at itk . org
>> http://www . itk . org/mailman/listinfo/insight-users
>>
>
>
>
> _______________________________________________
> Insight-users mailing list
> Insight-users at itk . org
> http://www . itk . org/mailman/listinfo/insight-users
>