[Insight-users] itkDeformationFieldInverseImageFilter

Luis Ibanez luis.ibanez at kitware.com
Tue, 03 Feb 2004 12:55:06 -0500


Hi Corinne,

You seem to be missing to provide the specification
for the image region, origin and spacing.

Note that filter is basically a variant of the
"ResampleImageFilter" but applied to a vector image
and using the KernelSpline as a sort of transform.
+ interpolator. Therefore you need to specify the
parameters of the sampling grid you want to use for
resampling the inverse deformation fields.

Please look at the file

    Insight/Testing/Code/Algorithms/
        itkDeformationFieldInverseImageFilterTest.cxx

for an example on the use of this filter.



In particular you should add the lines

   FieldInverser->SetOutputOrigin(  origin );
   FieldInverser->SetOutputSpacing(  spacing );
   FieldInverser->SetSize(  size );




Please let us know if you encounter any problems,



Thanks



   Luis



-----------------------
Corinne Mattmann wrote:

> Hi,
> 
> I just wanted to try the new DeformationFieldInverseImageFilter but it
> does not work with the deformable field I input. With the following code
> I get an empty output (size = [0, 0, 0]) with no exceptions thrown.
> 
>   typedef itk::DeformationFieldInverseImageFilter<DeformationFieldType,
> DeformationFieldType> FieldInverseType;
>     FieldInverseType::Pointer FieldInverser = FieldInverseType::New();
>     FieldInverser->SetInput(ImageReader->GetOutput());
>     FieldInverser->SetSubsamplingFactor(10);
>     try{
>       FieldInverser->Update();
>     }
>     catch( itk::ExceptionObject &excep ){
>       std::cerr << "Exception catched!" << std::endl;
>       std::cerr << excep << std::endl;
>     }
> 
> If I set the subsampling factor to 1, the program crashes at line 215 in
> itkDeformationFieldInverseImageFilter.txx
> (m_KernelTransform->ComputeWMatrix();), at line 416 in vnl_matrix.txx
> (this->data[i][j] = value;) because "data" does not exist (expression
> cannot be evaluated).
> 
> Any ideas what went wrong?
> Thanks,
> Corinne
> 
> ps: I could post the deformable field I use, if this helps.
> 
> _______________________________________________
> Insight-users mailing list
> Insight-users at itk.org
> http://www.itk.org/mailman/listinfo/insight-users
>