[Insight-users] some questions on BSpline Registration
Luis Ibanez
luis.ibanez at kitware.com
Mon Jul 12 13:59:17 EDT 2004
Hi he smth,
1) You don't need to register the factory
for the DICOMImageIO2 object. This factory
is already registered during the initialization
process.
2) You *should not* set the origin and spacing
manually. If those values are missing from
your DICOM files, you should doubt of the
integrity of your file.
In the extreme case where you find that the
valued in the file are not valid, then,
you should use the ChangeInformationImageFilter
http://www.itk.org/Insight/Doxygen/html/classitk_1_1ChangeInformationImageFilter.html
in order to modify the output of the file reader.
Altering image spacing or origin is a very poor
(not to mention Dangerous) practice when you are
dealing with medical images.
3) It is unlikely that spacing and origin of your
image are related at all to the Exception that
you are getting.
This exception is thrown when the number of
paramters passed to the transform do not match
the expected number.
In the case of this example, the BSpline grid has
8 x 8 = 64 nodes, and because this is a 2D example,
the total number of parameters is = 2 * 64.
Therefore the Transform expects an array of 128
doubles in the array of parameters. For some reason
the array that is receiving has a different size.
It is likely that you made additional changes to this
example and altered the predefined size of the grid.
Please post to the list the *full* file that you
modified, so we can take a look at your code.
Thanks
Luis
-----------------
he smth wrote:
> thx for your help, I will see those documents.
>
> for question3, I replace with these codes to read DICOM files:
> typedef short PixelType;
> itk::DICOMImageIO2Factory::RegisterOneFactory();
>
> but when running r
> egistration method, an exception is throw: Mismatched between
> prarmeters size and region size.
>
> so I have to set the value of spacing and origin:
> typedef TransformType::SpacingType SpacingType;
> SpacingType spacing =
> fixedImage->GetSpacing();//spacing[0]=1.5625;spacing[1]=1.5625;
> spacing.Fill(1); //Added codes
>
> typedef TransformType::OriginType OriginType;
> OriginType origin =
> fixedImage->GetOrigin();;//origin[0]=-9.0569601058959961;origin[1]=-191.00799560546875;
> origin.Fill(0); //Added codes
>
> this time the example can run successfully, but it seems that there is
> something wrong with the resample origin and spacing.
>
> On Sun, 11 Jul 2004 09:51:47 -0400, Luis Ibanez <luis.ibanez at kitware.com> wrote:
>
>>
>>Hi he smth,
>>
>>ParaView will read MetaImage files directly.
>>They can be both scalar images and vector images.
>>
>>1) If you save all your outputs from DeformableRegistration4
>> as MetaImages you will be able to load them directly in
>> ParaView. Simply use extensions .mhd in the filenames.
>>
>> For examples of visualization done with ParaView for
>> deformable registration, you should look at the course
>> on Image Registration Techniques at
>>
>> http://www.cs.rpi.edu/courses/spring04/imagereg/
>>
>> in particular to Lecture 25
>>
>> http://www.cs.rpi.edu/courses/spring04/imagereg/lectureDemons.ppt
>>
>>2) You don't need to touch the origin and spacing when you
>> use DICOM files. ITK will read those parameters directly
>> from the DICOM files and will use them during the
>> registration process.
>>
>>3) The parameters of a BSpline deformable transform are the
>> displacement values in all the nodes the grid. That becomes
>>
>> Number of Parameter = Number of Nodes * Image Dimension
>>
>> Please read the documentation of this transform
>>
>>http://www.itk.org/Insight/Doxygen/html/classitk_1_1BSplineDeformableTransform.html
>>
>>4) BSplines require 4 nodes in order to evaluate any internal
>> point. Therefore your grid must have 3 extra nodes outside
>> the extent of the image. You can initialize the values of
>> all the grid nodes to zero (zero displacement) at the
>> moment of starting the registration.
>>
>> For details on the parameterization of this transform you should
>> look at the course on Image Registration Techniques at
>>
>> http://www.cs.rpi.edu/courses/spring04/imagereg/
>>
>> in particular to Lecture 26
>>
>>http://www.cs.rpi.edu/courses/spring04/imagereg/lectureBSplines.ppt
>>
>>Regards,
>>
>> Luis
>>
>>-----------------
>>
>>
>>he smth wrote:
>>
>>
>>>hi all,
>>>I have some questions in using DeformableRegistration4.
>>>
>>>1. I run the programe DeformableRegistration4.exe and get the
>>>deformable field. but then I have a question when viewing the result
>>>and the two input file(RatLungSlice1.mha and RatLungSlice2.mha) in
>>>paraview: can the result be accepted? I have save it to a .png file in
>>>the attachment. I hope that it is my fault and please tell me why.
>>>
>>>2. when I make it in use of dicom file registration, I am confused
>>>with the parameters of origin and spacing. please tell me how to set
>>>these values if any successful experience.
>>>
>>>3. what the parameters means? is it the motion field of each grid
>>>node? I have red the code for itkBSplineDeformableTransform, and found
>>>that the number of parameters is defined by the size of grid node.
>>>
>>>4. how to define the parameters of the BSplineDeformableTransform
>>>grid? In this example, we set gridSizeOnImage as 5 and gridBorderSize
>>>as 3, and so the size of grid node is 8*8.
>>>
>>>thanks for any help!
>>>
>>>
>>
>>
>
More information about the Insight-users
mailing list