[Insight-users] about the transform parameters

Luis Ibanez luis.ibanez at kitware.com
Fri Apr 9 10:07:29 EDT 2010


Hi Renji,

The VectorLinearInterpolateImageFunction class expects
your image to have a PixelType of VectorType.

Instead of:

   typedef itk::Image< float,2>                   TImageType;

you probably should use:

  typedef itk::Vector< float, 2 >                PixelType;
  typedef itk::Image< PixelType, 2 >        TImageType;


      Regards,


            Luis


----------------------------------------------------------
On Fri, Apr 9, 2010 at 3:01 AM, renji yu <yurenji at gmail.com> wrote:
> Dear Luis,
>
> I tried to use the VectorLinearInterpolateImageFunction, but I got some
> error messages when compiling. According to the error messages, I think my
> TInputImage is not correct, but I don't know what the type of TInputImage
> should be.
>
> The code is like this:
> #include <itkVectorLinearInterpolateImageFunction.h>
>
>  typedef itk::Image< float,2>                               TImageType;
>  typedef  itk::VectorLinearInterpolateImageFunction<TImageType , double >
> InterpolatorType;
>  InterpolatorType::Pointer vectorImageInterpolator =
> InterpolatorType::New();
>  vectorImageInterpolator->SetImage( "VectorDeformationField.mhd");
>
> The error message:
> Compiling...
> DeformableRegistration1.cxx
> F:\itk\InsightToolkit\Code\Common\itkVectorInterpolateImageFunction.h(65) :
> error C2510: 'PixelType' : left of '::' must be a class/struct/union
>
> F:\itk\InsightToolkit\Code\Common\itkVectorLinearInterpolateImageFunction.h(44)
> : see reference to class template instantiation
> 'itk::VectorInterpolateImageFunction<class itk::Image<float,2>,double>'
> being compiled
>         F:\imaging\Deformable\DeformableRegistration1.cxx(386) : see
> reference to class template instantiation
> 'itk::VectorLinearInterpolateImageFunction<class
> itk::Image<float,2>,double>' being compiled
>
>
> Regards,
>
> Renji Yu
>
> 2010/4/8 Luis Ibanez <luis.ibanez at kitware.com>
>>
>> Hi Renji,
>>
>> Your observation is correct.
>>
>> When doing deformable registration, some methods
>> produce as output a deformation field.
>>
>> This field is indeed equivalent to a Transform.
>>
>> If you want to know where point P from the fixed
>> image maps in the moving image, you can do
>>
>>  vectorImageInterpolator->SetImage( deformationField );
>>
>>  Vector V = vectorImageInterpolator->Evaluate( P );
>>
>>  Point  Q = P + V;
>>
>>
>> the point Q will be in the coordinate system of the moving
>> image.
>>
>> The vector interpolator that you may want to use is
>>
>> http://public.kitware.com/Insight/Doxygen/html/classitk_1_1VectorLinearInterpolateImageFunction.html
>>
>>
>> On the other hand, if what you want is to map the full
>> image, then you may want to use the WarpImageFilter.
>>
>> http://public.kitware.com/Insight/Doxygen/html/classitk_1_1WarpImageFilter.html
>>
>>
>>     Regards,
>>
>>
>>            Luis
>>
>>
>> --------------------------------------------------------------------------
>> On Wed, Apr 7, 2010 at 4:44 AM, renji yu <yurenji at gmail.com> wrote:
>> > Dear Luis,
>> >
>> > For  rigid registration, it is easy for us to get the final tranfrom
>> > parameters. For example, for a 2D AffineTransfrom, we can get the final
>> > parameters by using the method GetLastTransfromParameters,like this:
>> >
>> >   OptimizerType::ParametersType finalParameters =
>> >                     registration->GetLastTransformParameters();
>> > The parameter is actually a 2x3 vector.
>> >
>> > However, for a deformable registration,  points in one image have
>> > different
>> > transform parameters. If I want to know all the points(in the fixed
>> > image)'
>> > correspoinding coordinates after registration, how should I do?
>> > I find the first example of deformabe registration
>> > (DeformableRegistraion1.cxx) outputs a file named
>> > VectorDeformationField.mhd, can I get the transform information of every
>> > points from it?
>> >
>> >
>> >
>> > Your Sincerely,
>> >
>> > Renji Yu
>
>


More information about the Insight-users mailing list