SuperElastix / SimpleElastix

Multi-lingual medical image registration library
http://simpleelastix.github.io
Apache License 2.0
507 stars 149 forks source link

Affine groupwise registration & transform #463

Open DudleA opened 2 years ago

DudleA commented 2 years ago

Hello,

I'm trying to run a groupwise registration on a set of segmentations (seg_stack) and then transform the corresponding images (img_stack) using the obtained parameter map. Everything runs fine if I use the default parameters for a groupwise registration:

elastixImageFilter = sitk.ElastixImageFilter elastixImageFilter.SetFixedImage(seg_stack) elastixImageFilter.SetMovingImage(seg_stack) paramMap = sitk.GetDefaultParameterMap("groupwise") # paramMap['Transform'] = ["EulerStackTransform"] # paramMap['Transform'] = ["AffineLogStackTransform"]

elastixImageFilter.SetParameterMap(paramMap) seg_stack = elastixImageFilter.Execute()

transformixImageFilter = sitk.TransformixImageFilter() transformixImageFilter.SetTransformParameterMap(elastixImageFilter.GetTransformParameterMap()) transformixImageFilter.SetMovingImage(img_stack) img_stack = transformixImageFilter.Execute()

I believe this runs BSplineStackTransform, however, I would like to test rigid and affine groupwise registrations too. When setting the transform to EulerStackTransform or AffineLogStackTransform, the registration runs fine but the transformation raises the following exception: Description: itk::ERROR: EulerStackTransform(0x24358a0): Transform parameter file is corrupt. respectively Description: itk::ERROR: AffineLogStackTransform(0x1b2e950): Transform parameter file is corrupt.

Any ideas how I could fix this? Thanks in advance for your help!

Alice

adrtsc commented 2 years ago

Hi, Just wanted to remark that I am encountering the same problem. When I try to use AffineLogStackTransform (even alone) the registration seems to work, but applying the transformation to a different set of images fails with the exact same error described above.

Would be great to get some feedback. Is this a bug or are there other things to consider when using AffineLogStackTransform or EulerStackTransform?

Thanks!