Skip to content
Snippets Groups Projects
Commit 94938a8d authored by Julien Michel's avatar Julien Michel
Browse files

BUG: Patching InverseDeformationFieldImageFilter to get a proper field inversion

parent 78712006
Branches
Tags
No related merge requests found
......@@ -189,7 +189,7 @@ InverseDeformationFieldImageFilter<TInputImage,TOutputImage>
for(unsigned int i=0; i < ImageDimension; i++)
{
targetPoint[i] = -value[i];
targetPoint[i] = sourcePoint[i]+value[i];
}
target->InsertElement( landmarkId, targetPoint ); // revert direction of displacement
......@@ -199,8 +199,8 @@ InverseDeformationFieldImageFilter<TInputImage,TOutputImage>
itkDebugMacro( << "Number of Landmarks created = " << numberOfLandmarks );
m_KernelTransform->GetTargetLandmarks()->SetPoints( target );
m_KernelTransform->GetSourceLandmarks()->SetPoints( source );
m_KernelTransform->GetTargetLandmarks()->SetPoints( source );
m_KernelTransform->GetSourceLandmarks()->SetPoints( target );
itkDebugMacro( << "Before ComputeWMatrix() ");
......@@ -269,7 +269,7 @@ InverseDeformationFieldImageFilter<TInputImage,TOutputImage>
for(unsigned int i=0; i < ImageDimension; i++)
{
inverseDisplacement[i] = interpolation[i];
inverseDisplacement[i] = interpolation[i]-outputPoint[i];
}
outIt.Set( inverseDisplacement ); // set inverse displacement.
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment