Hi,<br><br>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.<br>
<br>something like this (many lines were skipped):<br><br> kernelTransform->SetSourceLandmarks( inputPointSet1 );<br> kernelTransform->SetTargetLandmarks( inputPointSet2 );<br> kernelTransform->ComputeWMatrix();<br>
<br><br> deformationField->Allocate();<br> DeformationFieldIteratorType iterator(<br> deformationField, deformationField->GetLargestPossibleRegion() );<br> iterator.GoToBegin();<br><br> while ( !iterator.IsAtEnd() ) <br>
{<br> PointType pointin;<br> const IndexType & index = iterator.GetIndex();<br> deformationField->TransformIndexToPhysicalPoint( index, pointin);<br> PointType pointout = kernelTransform->TransformPoint( pointin );<br>
DeformationVectorType vec = pointout - pointin;<br> iterator.Set( vec );<br> ++iterator;<br> }<br><br> typedef itk::WarpImageFilter<<br> MovingImageType, <br> MovingImageType,<br>
DeformationFieldType > WarperType;<br><br> WarperType::Pointer warper = WarperType::New();<br> warper->SetInput( ImageReader->GetOutput() );<br> warper->SetDeformationField( deformationField );<br>
<br> WriterType::Pointer writer = WriterType::New();<br> writer->SetInput( warper->GetOutput() );<br> writer->Update();<br><br><br><br>Nevertheless, I believe that there should be a straightforward way. Any suggestions?<br>
<br>Thanks,<br>Yoav.<br>