You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am aware of sitk.BSplineTransformInitializer(image1, transformDomainMeshSize, order) for performing BSpline registrations, but I am trying to initialize the registration using LandmarkBasedTransformInitializer.
Following is how I attempt to obtain a landmark-based transform for a 'rigid', 'affine' or 'bspline' transform:
def GetLandmarkTx(FixIm, MovIm, FixPts, MovPts,
Transform='rigid', NumControlPts=8):
import SimpleITK as sitk
if Transform == 'rigid':
SitkTransform = sitk.VersorRigid3DTransform()
elif Transform == 'affine':
SitkTransform = sitk.AffineTransform(FixIm.GetDimension())
elif Transform == 'bspline':
SitkTransform = sitk.BSplineTransform(FixIm.GetDimension())
else:
msg = "Transform must be either 'rigid', 'affine' or 'bspline'."
raise Exception(msg)
if Transform == 'bspline':
LandmarkTx =sitk.LandmarkBasedTransformInitializer(transform=SitkTransform,
fixedLandmarks=FixPts,
movingLandmarks=MovPts,
referenceImage=FixIm,
numberOfControlPoints=NumControlPts)
else:
LandmarkTx = sitk.LandmarkBasedTransformInitializer(transform=SitkTransform,
fixedLandmarks=FixPts,
movingLandmarks=MovPts,
referenceImage=FixIm)
return LandmarkTx
The above works fine for 'rigid' and 'affine', but the following error occurs for 'bspline':
Exception thrown in SimpleITK LandmarkBasedTransformInitializer: C:...\ITK\Modules\Core\Common\src\itkMultiThreader.cxx:395:
itk::ERROR: MultiThreader(0000025C4E20D020): Exception occurred during SingleMethodExecute
Any advice would be much appreciated.
The text was updated successfully, but these errors were encountered:
Hello,
I am aware of
sitk.BSplineTransformInitializer(image1, transformDomainMeshSize, order)
for performing BSpline registrations, but I am trying to initialize the registration usingLandmarkBasedTransformInitializer
.Following is how I attempt to obtain a landmark-based transform for a 'rigid', 'affine' or 'bspline' transform:
The above works fine for 'rigid' and 'affine', but the following error occurs for 'bspline':
Any advice would be much appreciated.
The text was updated successfully, but these errors were encountered: