[Insight-users] Problem on 3d Registration

cspl affable@hd2.dot.net.in
Mon, 21 Apr 2003 18:26:37 +0530


Hi Lius,
   Thanks for ur mail.
   As u said initialization is quite off. There was a problem in image
reader which created all this mess till now. I could solve this problem by
correcting ImageFileReader.
   I tested the application with 2d images and is working good.
   I have listed below the final parameters values. Can u tell how much the
moving image has rotated when compared to the fixed image using these
values. I don't have any idea of it.

My Initial paramters are
 [1, 0, 0, 1, 250, 250, 0.000128, 0.000128]
and final paramters are
199   -0.357571   [1.43606, -0.556968, -1.62759, 0.275343, 251.287,
249.49, -0.104085, -4.09714]

   As u asked, the content of the image is centered in the slice.
   I was using OnMoments() function before but i changed to Geometry mode
right now.
   Now the origin values are (0,0) before applying CenteredAffineTransform.


   Now, i changed the code to run for 3d images i.e. for a volume. This time
my data sets are 512x512x35 for CT and 128x128x35 for PET. But this time too
i face problem.
   Reader could not able to read all the 35 slices. It is giving the
following exception.
ExceptionObject caught !

itk::ExceptionObject (0012F444)
Location: "Unknown"
File: G:\NEWITKFILES\NewVersionITK7_4_2003\itksrc\Code\IO\itkRawImageIO.txx
Line: 196
Description: itk::ERROR: RawImageIO(00305320): Read failed: Wanted 18350080
bytes, but read 524288 bytes.

   This error tells that it could read only one slice out of 35 slices. I
changes the dimension from 2 to 3. Even then it gives this error. Why is
this so?? I am using "itkImageFileReader" class to read image. To it i give
the object of "itkRawImageIO" which reads the Raw image data.
   Is itkImageFileReader cannot read 3d images i.e. a volume??? Then which
class will help in this regard.

   This is a snippet of my code...
     fixedImageReader->SetFileName( argv[1] );

 int Image1x = 512,Image1y = 512, Image1z = 35;
 FixedRawReader->SetDimensions( 0, Image1x );
 FixedRawReader->SetDimensions( 1, Image1y );
 FixedRawReader->SetDimensions( 2, Image1z );

 fixedImageReader->SetImageIO( FixedRawReader );

 try
 {
    fixedImageReader->Update();
 }
 catch( itk::ExceptionObject & err )
 {
    std::cout << "ExceptionObject caught !" << std::endl;
    std::cout << err << std::endl;
    return -1;
 }


   Please help me in this regard.

   Thanks in adance.

-Regard,
   Sateesh