[slicer-users] Deformation field from ITK BSpline transform

Francois Budin budin at bwh.harvard.edu
Wed May 19 15:54:07 EDT 2010


Hi Dominik,

You could use the class itk::TransformDeformationFieldFilter available
in Slicer3 in ResampleDTI (
http://viewvc.slicer.org/viewcvs.cgi/trunk/Applications/CLI/DiffusionApplications/ResampleDTI/
).
This class gives you a deformation field image (3D image with 3
components x,y,z). If you do use this class, you have to set an input
deformation field. You can set it to the "0" image.

Here is a idea of code:

typedef itk::OrientedImage<DeformationPixelType, 3 > DeformationImageType;
typename DeformationImageType::Pointer field ;
typedef itk::Vector<double,3> DeformationPixelType;

field = DeformationImageType::New() ;
        field->SetSpacing( your_spacing  ) ;
        field->SetOrigin( your_origin ) ;
        field->SetRegions( your_regions ) ;
        field->SetDirection( your_direction ) ;
        field->Allocate() ;
        DeformationPixelType vectorNull ;
        vectorNull.Fill( 0.0 ) ;
        field->FillBuffer( vectorNull ) ;

        typedef itk::TransformDeformationFieldFilter< double , double
, 3 > itkTransformDeformationFieldFilterType ;
        typename itkTransformDeformationFieldFilterType::Pointer
transformDeformationFieldFilter =
itkTransformDeformationFieldFilterType::New() ;

        transformDeformationFieldFilter->SetInput( field ) ;
        transformDeformationFieldFilter->SetTransform(
your_BSpline_transform ) ;
        transformDeformationFieldFilter->Update() ;
        field = transformDeformationFieldFilter->GetOutput() ;



Francois

On Wed, May 19, 2010 at 15:09, Gregory Sharp <gcsharp at partners.org> wrote:
>
> I use itk::Image <itk::Vector < float, 3 >, 3>, then loop through voxels
> computing the difference between transformed point and origin.
>
> http://forge.abcd.harvard.edu/gf/project/plastimatch/scmsvn/?action=browse&path=%2Fplastimatch%2Ftrunk%2Fxform.cxx&revision=1275&view=markup
> (search for xform_itk_any_to_itk_vf).
>
> -Greg
>
>
> On Wed, 19 May 2010 14:54:43 -0400
> Dominik Meier <meier at bwh.harvard.edu> wrote:
>
>> Any suggestions on how to obtain a 3D deformation field from an ITK
>> BSpline transform, i.e. resample the transform into 3 deformation
>> images (dx,dy,dz)  ?
>>
>> Many thanks,
>> Dominik
>>
>>
>>
>
>
> --
> Greg Sharp, PhD
> Department of Radiation Oncology
> Massachusetts General Hospital
> _______________________________________________
> slicer-users mailing list
> slicer-users at bwh.harvard.edu
> http://massmail.spl.harvard.edu/mailman/listinfo/slicer-users
> To unsubscribe: send email to slicer-users-request at massmail.spl.harvard.edu with unsubscribe as the subject
>



More information about the slicer-users mailing list