Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Elastix compatibility "Too many samples map outside moving image buffer" #8

Open
Young-JZ-Wang opened this issue Nov 30, 2022 · 2 comments

Comments

@Young-JZ-Wang
Copy link

I was excited when I found out about this module, and thank you for all your work. Currently I'm stuck at step 2 and I got the error message saying:
"command elsatix return to non-zero exit status 1 error."

Screenshot 2022-11-30 at 14 18 11

Any help is greatly appreciated.
@ben-connors @jamesobutler @e-simpson

@e-simpson
Copy link
Member

Hi @young-oct,

Thank you for bringing this to my attention. I've tested the module and was able to reproduce this issue.

It seems the Elastix module has changed the way it processes image registrations or the error handling it does since I last worked on this portion of the module. It seems a step has been removed that prevents an error that occurs when images are too far apart. There is a metric that Elastix computes that requires the images to reasonably close. A fiducial registration solves this, as it will register the images so that they are close enough for the rigid registration. Although, that is not working anymore.

I see in the screenshot above that you posted, you began to process the Step 1. Fiducial Registration, but did not Harden the change. In this way, the registration was not applied. Please see that once applied, the Moving Volume's name will have "_fiducial" appended to it. Give this a try.

Otherwise, the code will have to be updated to ensure additional checks or actions are performed before the Rigid Registration takes place.

As a last resort (no programming involved), you could potentially revert Slicer, Elastix Slicer Extension, and this module's primary Python dependencies (vtk, ctk, SimpleITK, and sitkUtils) to the versions that were available on Sep 1. 2020 (the last date I ensured the module was tested and working). To do this, you would need to get a custom python environment going and select the versions using python's PIP as well as installing a local copy of the Elastix slicer extension that was available on that day.

This issue has also been referenced in the following places:

@e-simpson e-simpson changed the title command elsatix return to non-zero exit status 1 error. Elastix compatibility error Too many samples map outside moving image buffer" Command return to non-zero exit status 1 error. Dec 9, 2022
@e-simpson e-simpson changed the title Elastix compatibility error Too many samples map outside moving image buffer" Command return to non-zero exit status 1 error. Elastix compatibility "Too many samples map outside moving image buffer" Dec 9, 2022
@e-simpson
Copy link
Member

Python error:

itk::ExceptionObject (0x600001ec12a0)
Location: "ElastixTemplate - Run()"
File: /Volumes/D/S/S-0-E-b/SlicerElastix-build/elastix/Common/CostFunctions/itkAdvancedImageToImageMetric.hxx
Line: 916
Description: ITK ERROR: AdvancedMattesMutualInformationMetric(0x7fa98701d400): Too many samples map outside moving image buffer: 151 / 1117


Error occurred during actual registration.


Errors occurred!
Error: Command 'elastix' returned non-zero exit status 1.
Traceback (most recent call last):
  File "/Users/Home/Documents/Development/Personal/Slicer/Slicer-ABLTemporalBoneSegmentation/ABLTemporalBoneSegmentationModule/ABLTemporalBoneSegmentationModule.py", line 635, in process_transform
    output = function()
  File "/Users/Home/Documents/Development/Personal/Slicer/Slicer-ABLTemporalBoneSegmentation/ABLTemporalBoneSegmentationModule/ABLTemporalBoneSegmentationModule.py", line 808, in transform
    return ABLTemporalBoneSegmentationModuleLogic().apply_elastix_rigid_registration(elastix=self.elastixLogic,
  File "/Users/Home/Documents/Development/Personal/Slicer/Slicer-ABLTemporalBoneSegmentation/ABLTemporalBoneSegmentationModule/ABLTemporalBoneSegmentationModule.py", line 1324, in apply_elastix_rigid_registration
    elastix.registerVolumes(
  File "/Applications/Slicer.app/Contents/Extensions-31317/SlicerElastix/lib/Slicer-5.2/qt-scripted-modules/Elastix.py", line 818, in registerVolumes
    self.logProcessOutput(ep)
  File "/Applications/Slicer.app/Contents/Extensions-31317/SlicerElastix/lib/Slicer-5.2/qt-scripted-modules/Elastix.py", line 739, in logProcessOutput
    raise subprocess.CalledProcessError(return_code, "elastix")
subprocess.CalledProcessError: Command 'elastix' returned non-zero exit status 1.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants