[Insight-users] question about BSplineDefomableTransform

Luis Ibanez luis.ibanez at kitware.com
Thu Mar 18 13:29:49 EDT 2010


Hi Kaveh,


Please describe better the problem that you are trying to solve.


If you want to generate a synthetic deformation field,
then please look at the examples:


         Insight/Examples/Registration/
                                         BSplineWarping1.cxx
                                         BSplineWarping2.cxx
                                         LandmarkWarping2.cxx
                                         ThinPlateSplineWarp.cxx



    Thanks


           Luis


----------------------------------------------------------------------------------------
On Sun, Mar 7, 2010 at 10:36 PM, Kaveh Kohan <kaveh.kohan at yahoo.com> wrote:
> Hi All,
>
> I have a question about one of functions of itk::BSplineDeformableTransform
> and I would be thankful if somebody answers:
>
> I would like to simulate some deformation fields by changing the identity
> transformation locally. I thought that perhaps BSpline model is a good
> candidate but I don't know how to use  "SetCoefficientImages"  function. It
> seems that if I want to know which part of image is perturbed from identity
> map this is a good option because using parameter type is very implicit.
> Here is how I tried but apparently it is not correct:
>
> [...]
> typedef itk::BSplineDeformableTransform< double,
>                                            Dimension,
>                                            3 >     BSplineTransformType;
>
>     BSplineTransformType::Pointer bsplineTransform =
> BSplineTransformType::New();
>
>
>     typedef BSplineTransformType::RegionType RegionType;
>     RegionType bsplineRegion;
>     RegionType::SizeType   gridSizeOnImage;
>     RegionType::SizeType   gridBorderSize;
>     RegionType::SizeType   totalGridSize;
>
>     gridSizeOnImage.Fill( 8 );
>     gridBorderSize.Fill( 3 );
>     totalGridSize = gridSizeOnImage + gridBorderSize;
>
>     bsplineRegion.SetSize( totalGridSize );
>
>     typedef BSplineTransformType::SpacingType SpacingType;
>     SpacingType bsplineSpacing = reader->GetOutput()->GetSpacing();
>
>     typedef BSplineTransformType::OriginType OriginType;
>     OriginType bsplineOrigin = reader->GetOutput()->GetOrigin();;
>
>     InputImageType::SizeType ImageSize =
> reader->GetOutput()->GetLargestPossibleRegion().GetSize();
>
>     for(unsigned int r=0; r<Dimension; r++)
>     {
>       bsplineSpacing[r] *= floor( static_cast<double>(ImageSize[r] )  /
>           static_cast<double>(gridSizeOnImage[r] ) );
>       bsplineOrigin[r]  -=  bsplineSpacing[r];
>     }
>
>     bsplineTransform->SetGridSpacing( bsplineSpacing );
>     bsplineTransform->SetGridOrigin( bsplineOrigin );
>     bsplineTransform->SetGridRegion( bsplineRegion );
>
>
>     typedef BSplineTransformType::ImageType          ParamImageType ;
>
>
>     ParamImageType::Pointer  bsplineImageParameters[3] ;
>
> [...]
>
> then I don't know what to do next! should I go ahead and define image
> size,origin.direction and then allocate memory for each
> bsplineImageParameters[0,1,2] but I have already specified grid size! how do
> they relate?  I am confused how to use it.
>
> Any comment is highly appreciated.
>
> Regards,
> kaveh
>
>
>
>
>
>
> _____________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
>
> Kitware offers ITK Training Courses, for more information visit:
> http://www.kitware.com/products/protraining.html
>
> Please keep messages on-topic and check the ITK FAQ at:
> http://www.itk.org/Wiki/ITK_FAQ
>
> Follow this link to subscribe/unsubscribe:
> http://www.itk.org/mailman/listinfo/insight-users
>
>


More information about the Insight-users mailing list