pyushkevich / itksnap

ITK-SNAP medical image segmentation tool
http://www.itksnap.org
GNU General Public License v3.0
281 stars 78 forks source link

Export of speed image fails with exception #123

Open a-a-danilov opened 5 months ago

a-a-danilov commented 5 months ago

When trying to save the speed image during active contour segmentation, the following errors pops up: Error: exception occured during image IO. Exception: std::exception

The problem happens with recent Linux builds. At least versions 4.2.0-alpha.1 and 4.2.0-alpha.3 are affected.

The export works fine in previous stable version 4.0.2.

I traced the exception to template class CreateCastToTargetTypePipelinePartialSpecializationTraits with implementation which always throws exception (CreateCastToTargetTypePipelinePartialSpecializationTraits<itk::Image<short, 3u>, itk::Image<float, 3u>, SpeedImageInternalToNativeIntensityMapping, false, true>::CreatePipeline). It looks like the caller ImageWrapper<SpeedImageWrapperTraits>::CreateCastToFloatPipeline fails to select the correct template version of this class.

My guess is that IsLinear value is not computed correctly: it should be true for SpeedImage, not false.