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

LesionFilling error #1201

Closed
enrit opened this issue Jun 9, 2021 · 3 comments · Fixed by #1716
Closed

LesionFilling error #1201

enrit opened this issue Jun 9, 2021 · 3 comments · Fixed by #1716
Labels
wouldbenice Nice ideas not under development (pull requests welcome)

Comments

@enrit
Copy link

enrit commented Jun 9, 2021

Hi All,

I have segmented MS lesions and as a next step, I am using LesionFilling to 'paint' the lesions on a T1 image.

However, I am encountering the following errror -

LesionFilling 3 T1.nii.gz Lesion.nii.gz test.nii.gz
libc++abi: terminating with uncaught exception of type itk::ExceptionObject: /Applications/ANTs/build/staging/include/ITK-5.2/itkConnectedComponentImageFilter.hxx:145:
itk::ERROR: itk::ERROR: ConnectedComponentImageFilter(0x7fb53a605330): Number of objects (258) greater than maximum of output pixel type (255).
Abort trap: 6

Can you suggest how do I fix it ?

Many thanks

Rito

@ntustison
Copy link
Member

I'm guessing you have more than 255 separate "lesions" in your mask which means that for the output image type (char?) specified in the LesionFilling program, that's causing the connected components filter to throw the exception. For the short term, you might want to run your mask through LabelClustersUniquely to return only 255 lesions and then run LesionFilling on that pruned mask. A longer term solution would probably be to change the output image type in LesionFilling if the shorter term solution works as expected.

@cookpa cookpa added the wouldbenice Nice ideas not under development (pull requests welcome) label Mar 16, 2022
@BennoGesierich
Copy link

Hi All,

I encountered the same bug: With more than 255 lesion clusters in the (binary) input lesion mask, I get following error:

terminate called after throwing an instance of 'itk::ExceptionObject'
what(): /opt/build/staging/include/ITK-5.3/itkConnectedComponentImageFilter.hxx:144:
ITK ERROR: ConnectedComponentImageFilter(0x2fe50b0): Number of objects (257) greater than maximum of output pixel type (255).

However, I would assume that the problem is not the data type of the "output image", but instead the data type of the image internally used to label the lesions in the input mask.
Instead, the only output image provided is the lesion filled grey scale image, which is of type float64.

I tried to provide the input lesion mask as uint16, but this didn't help.

Would you be able to change the data type used internally for labelling the lesions in the input lesion mask to something larger than char, e.g. uint16?

Thank you very much, in advance!
Benno

@cookpa
Copy link
Member

cookpa commented Apr 10, 2024

Working on it now - you might also be interested in the inpainting utility in ANTsPyNet

https://github.com/ANTsX/ANTsPyNet/blob/master/antspynet/utilities/inpainting.py

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
wouldbenice Nice ideas not under development (pull requests welcome)
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants