[Insight-users] Wrapping an Image according to PointSet to PointSet Registration

Luis Ibanez luis.ibanez at kitware.com
Tue Jul 8 15:36:52 EDT 2008


Hi Yoav,

You are right,

         There is indeed a shorter path.

Once you have computed the kernelTransform, simply
connect the Transform to the ResampleImageFilter,
set the grid parameters of the output image (origin,
spacing, orientation, size), and run the resample
filter.

The ResampleFilter will ask the KernelTransform
for the deformation to apply to every pixel in
the image.

WARNING: You will have to determine what it the
          correct direction of the deformation,
          so, be prepared to switch the collection
          of Source and Target landmarks.


    Regards,


        Luis


-----------------
yoav levy wrote:
> Hi,
> 
> I want to wrap a moving image according to several known landmarks. I 
> know that I can use one of the Kernel transforms to calculate  a 
> deformation field point by point and than use a WarpImageFilter to wrap 
> my image.
> 
> something like this (many lines were skipped):
> 
>   kernelTransform->SetSourceLandmarks( inputPointSet1 );
>   kernelTransform->SetTargetLandmarks( inputPointSet2 );
>   kernelTransform->ComputeWMatrix();
> 
> 
>   deformationField->Allocate();
>   DeformationFieldIteratorType iterator(
>   deformationField, deformationField->GetLargestPossibleRegion() );
>   iterator.GoToBegin();
> 
>   while ( !iterator.IsAtEnd() ) 
>   {
>     PointType pointin;
>     const IndexType & index = iterator.GetIndex();
>     deformationField->TransformIndexToPhysicalPoint( index, pointin);
>     PointType pointout = kernelTransform->TransformPoint( pointin );
>     DeformationVectorType vec = pointout - pointin;
>     iterator.Set( vec );
>     ++iterator;
>   }
> 
>   typedef itk::WarpImageFilter<
>                           MovingImageType,
>                           MovingImageType,
>                           DeformationFieldType  >     WarperType;
> 
>   WarperType::Pointer warper = WarperType::New();
>   warper->SetInput( ImageReader->GetOutput() );
>   warper->SetDeformationField( deformationField );
> 
>   WriterType::Pointer      writer =  WriterType::New();
>   writer->SetInput( warper->GetOutput()   );
>   writer->Update();
> 
> 
> 
> Nevertheless, I believe that there should be a straightforward way. Any 
> suggestions?
> 
> Thanks,
> Yoav.
> 
> 
> ------------------------------------------------------------------------
> 
> _______________________________________________
> Insight-users mailing list
> Insight-users at itk.org
> http://www.itk.org/mailman/listinfo/insight-users


More information about the Insight-users mailing list