[Insight-users] applied resample vector filed at a RT image

Luis Ibanez luis.ibanez at kitware.com
Sun Nov 22 19:05:17 EST 2009


Hi Howard,

It is always possible that the VectorResampleImageFilter may have a bug,
but... there are several things to check before we get to that conclusion.


One thing that you are missing from your code is the following line:

        warper->SetOutputDirection( fixedImage->GetDirection() );

It this still doesn't make a difference,
Then what you want to do is to create a display of the low resolution
deformation field overlapped to the RT contours.

Then, in the same visualization, you should overlap the resampled
deformation field.

This can easily be done with ParaView, as described in the
ITK Software Guide

            http://www.itk.org/ItkSoftwareGuide.pdf


BTW
How are you generating the contours of the "expected" locations ?


---

If you want to build confidence on the Vector resampler, what you
can do is to run it in some trivial cases.

For example, resample the deformation field in its own grid
(a 1:1 resampling) and check that you get the same field.

Then, also resample it to a 1:2 scale (double its resolution).


    Please let us know what you find,


          Thanks


              Luis


-------------------------------------------------------------------
On Fri, Nov 20, 2009 at 12:19 AM, Hsiang-Chi Kuo <kuoxgx at gmail.com> wrote:
> Hi Luis,
> Both of the jmages are aligned to each other with the same patient position.
>
> I re-calculated the dose image with 1mm grid size (1x1x1mm) and applied the
> vector resample filter with 1mmx1mmx1mm resolution. The results look
> reasonable.
>
> Attached please see the *.PNG files which are dose image with 1mm grid. The
> *.TIF files are dose contours calculated with 2.5mm grid size.
>
> This really bother me if the vector resample filter has bug?
>
> Thank you for your response,
>
> Howard
> On Sun, Nov 15, 2009 at 11:14 AM, Luis Ibanez <luis.ibanez at kitware.com>
> wrote:
>>
>> Hi Kuo,
>>
>> Was the original RT dose image already aligned with the original CT image
>> ?
>>
>> --
>>
>> Your process of resampling the deformation field using the RT dose image
>> sounds reasonable (assuming that the RT image was co-registered with
>> the original CT image).
>>
>> Are the mis-alignments of the dose image comparable to the pixel size of
>> the RT image ?
>>
>> One thing you may want to do is to upload the RT image in Paraview,
>> along with the resampled deformation field, to verify if things still
>> align
>> correctly.
>>
>> You could also do this with VV (the 4D Slicer).
>> http://www.creatis.insa-lyon.fr/rio/vv
>>
>>
>>      Please let us know what you find.
>>
>>
>>           Thanks
>>
>>
>>                 Luis
>>
>>
>> ---------------------------------------
>> On Sun, Nov 8, 2009 at 10:10 PM, Hsiang-Chi Kuo <kuoxgx at gmail.com> wrote:
>> > Hi Luis,
>> >
>> > I am trying to warp a RT dose image file with a deformation field
>> > obtained
>> > from Demon registration. The original deformation field has resolution
>> > of
>> > 1mmx1mmx2.5mm. The dose image file has resolution of 2.5mmx2.5mmx2.5mm.
>> > I
>> > applied VectorResampleImageFilter to resample the deformation filed with
>> > the
>> > same resolution, size and origin as those of the dose image. ( I checked
>> > the
>> > old and new deformed image in para view, they look alike.) After I warp
>> > the
>> > dose image with the new deformation file, the new deform dose image look
>> > good at the z direction, however, the displacement of the dose image at
>> > x
>> > and y direction did not look the same as the displacement in the x and y
>> > direction of the deformation field (Images attached). Following is my
>> > code
>> > the resample the deformed field and wrap the deformed filed with the
>> > original dose image. It looks like my code only do a good job in the z
>> > direction where no resample of the resolution (and position) is needed.
>> > Anything wrong in my code?
>> >
>> > Thanks a lot for any of your input,
>> >
>> > Howard.
>> >
>> >   typedef
>> > itk::VectorResampleImageFilter<deFormImageType,deFormImageType>
>> > FilterType;
>> >    FilterType::Pointer nearestResampleFilter = FilterType::New();
>> >
>> >   typedef itk::IdentityTransform< double, Dimension >  TransformType;
>> >
>> >   TransformType::Pointer transform = TransformType::New();
>> >   nearestResampleFilter->SetTransform( transform );
>> >
>> >   typedef
>> > itk::VectorLinearInterpolateNearestNeighborExtrapolateImageFunction<
>> >                        deFormImageType, double >  InterpolatorType;
>> >
>> >   InterpolatorType::Pointer vectorInterpolator =
>> > InterpolatorType::New();
>> >
>> >   InputImageType::Pointer fixedImage = reader->GetOutput();
>> >
>> >   InputImageType::SpacingType spacing;
>> >   spacing[0] = 2.5; // pixel spacing in millimeters along X
>> >   spacing[1] = 2.5; // pixel spacing in millimeters along Y
>> >   spacing[2] = 2.5; // pixel spacing in millimeters along Z
>> >
>> >  // typedef InputImageType::SpacingType    SpacingType;
>> >   typedef InputImageType::PointType      OriginType;
>> >   typedef InputImageType::RegionType     RegionType;
>> >   typedef InputImageType::SizeType       SizeType;
>> >
>> >  // const SpacingType spacing= fixedImage->GetSpacing();
>> >    const OriginType origin= fixedImage->GetOrigin();
>> >   const RegionType region= fixedImage->GetLargestPossibleRegion();
>> >   const SizeType size= region.GetSize();
>> >    nearestResampleFilter->SetInterpolator( vectorInterpolator );
>> >    nearestResampleFilter->SetOutputOrigin( origin );
>> >    nearestResampleFilter->SetOutputSpacing( spacing );
>> >    nearestResampleFilter->SetSize( size );
>> >    nearestResampleFilter->SetInput( deFormReader->GetOutput() );
>> >
>> > *********************************
>> >
>> >   typedef itk::WarpImageFilter< InputImageType, InputImageType,
>> > deFormImageType > WarperType;
>> >   typedef itk::LinearInterpolateImageFunction< InputImageType, double >
>> > LinearInterpolatorType;
>> >   WarperType::Pointer warper = WarperType::New();
>> >   LinearInterpolatorType::Pointer interpolator =
>> > LinearInterpolatorType::New();
>> >   warper->SetInput( fixedImage );
>> >   warper->SetInterpolator( interpolator );
>> >   warper->SetOutputSpacing( fixedImage->GetSpacing() );
>> >   warper->SetOutputOrigin( fixedImage->GetOrigin() );
>> >   warper->SetDeformationField( newDeFormReader->GetOutput() );
>> >
>> > ******************************
>
>


More information about the Insight-users mailing list