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

yoav levy yoav.itk at gmail.com
Thu Jul 3 06:07:51 EDT 2008


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.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.itk.org/pipermail/insight-users/attachments/20080703/5808af12/attachment.htm>


More information about the Insight-users mailing list