iMath TruncateImageIntensity segfaults on certain input
cookpa opened this issue · comments
Philip Cook commented
As reported in ANTsX/ANTsPy#597
To Reproduce
See ANTsX/ANTsPy#597 for data and code
System information (please complete the following information)
- OS: Mac
- OS version: 12.7
- Type of system: Desktop
- CPU architecture: x86
ANTs version information
- ANTs code version: 2.5.1.post24-g6c29d9d
- ANTs installation type: Compiled from source
Philip Cook commented
@stnava this appears to be an error with images that have negative intensities. The range of your T1w is [-32768, -31932]. The seg fault goes away if I multiply it by -1.
Philip Cook commented
The mask step will not contain any voxels in an image that is all negative. Should I change it to default to use the full range of pixel type?
ANTs/Examples/iMathFunctions1.hxx
Lines 622 to 630 in 2236a75