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

Error occurence in the process of conducting linear_registration for 2D dicom image #206

Open
ShangWeiKuo opened this issue May 16, 2023 · 1 comment

Comments

@ShangWeiKuo
Copy link

Hello.

I tried conducting mask registration with two 2D dicom masks.

However. I got the error message which shows that **The number of pixels along dimension 2 is less than 4. **

How should I do to apply linear_registration to the 2D dicom files ?

This are my codes.

import SimpleITK as sitk
from platipy.imaging.registration.linear import linear_registration

bin_mask_1 = sitk.ReadImage(path_to_dcm_file, sitk.sitkUInt8)
bin_mask_2 = sitk.ReadImage(path_to_dcm_file, sitk.sitkUInt8)

bin_mask_2_reg, tfm = linear_registration(bin_mask_1, bin_mask_2)

This is the error message

RuntimeError: Exception thrown in SimpleITK ImageRegistrationMethod_Execute: /tmp/SimpleITK-build/ITK-prefix/include/ITK-5.3/itkSmoothingRecursiveGaussianImageFilter.hxx:214:
ITK ERROR: SmoothingRecursiveGaussianImageFilter(0x55a03712d3e0): The number of pixels along dimension 2 is less than 4. This filter requires a minimum of four pixels along the dimension to be processed.

Thank you for your help in advance.

@pchlap
Copy link
Contributor

pchlap commented May 18, 2023

Hi @ShangWeiKuo, to be honest our code in platipy doesn't support 2D data very well. This is because so far this has been used mostly for radiotherapy projects where we typically have 3D image volumes available.

We could probably amend the linear_registration function to support 2D, however @rnfinnegan and I don't have the capacity for this at the moment. We would be open to contributions from the community though.

This function relies entirely on SimpleITK, so I would recommend taking a look at that for the 2D registration use case. You should be able to get a registration running using SimpleITK directly. The class we use is ImageRegistrationMethod you can find the documentation here: https://simpleitk.org/doxygen/latest/html/classitk_1_1simple_1_1ImageRegistrationMethod.html

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