Open romangrothausmann opened 5 years ago
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
I think this is still relevant and it is not clear to me when this happens. @richardbeare Do you have an idea when this can happen?
I suspect it occurs when the speed function doesn't conform to the range rules (0-1).
Hm, oddly I did get this exception even with the min-path_seg
CLI where a RescaleIntensityImageFilter
makes sure that the rane is within [0, 1]:
https://github.com/romangrothausmann/ITK-CLIs/blob/ee05ceb349fe012bff89718f46786bf847877975/min-path_seg.cxx#L165-L169
Are there cases where the RescaleIntensityImageFilter
is not sufficiently precise such that values outside [0, 1] ought to be expected?
Perhaps some issue with scaling of time step size when the voxels are small? I'm guessing as I don't know the fast marching internals. A test might be to reset voxel sizes of the problem images and see if the error disappears.
A test might be to reset voxel sizes of the problem images and see if the error disappears.
Yes, this might be the problem, will test this.
The speed function that lead to this error is constructed by the sigmoid of a fast-marching map run inside a binary segmentation starting from the centerlines extracted by itkBinaryThinningImageFilter3D.
@romangrothausmann out of curiosity, what does this look like?
I haven't got a 2D exmple ready, but basically it is a speed image whose profile perpendicular to the centerlines resembles a (cropped) sigmoid independent of the local extent of the orginal structure of the binary segmentation.
This issue has been automatically marked as stale because it has not had recent activity. Thank you for your contributions.
This issue has been automatically marked as stale because it has not had recent activity. Thank you for your contributions.
Description
itkFastMarchingImageFilter
is called when executingitkSpeedFunctionToPathFilter
. Under some circumstancesitkFastMarchingImageFilter
issues an exception with the description:Discriminant of quadratic equation is negative
https://github.com/InsightSoftwareConsortium/ITK/blob/bd8169b433679930c8acfe0e24c8b5a5c663a833/Modules/Filtering/FastMarching/include/itkFastMarchingImageFilter.hxx#L498 However it is not obvious what the reason is that causes this problem. It is unclear when this condition is reached and how to avoid it (and if it depends onitkSpeedFunctionToPathFilter
).Impact analysis
It is good to have an error thrown and a description of the actual problem, as is the current case, but it would be good to have more details on why this happened and possibly how to avoid it.
Expected behavior
Actual behavior
I'm hitting this problem with one of my ITK-CLIs here: https://github.com/romangrothausmann/ITK-CLIs/blob/e883088ebf6b19cf945ac01dec1ce81878f8c181/min-path_seg.cxx#L285-L291
It seems to be very input data dependent. The speed function that lead to this error is constructed by the sigmoid of a fast-marching map run inside a binary segmentation starting from the centerlines extracted by
itkBinaryThinningImageFilter3D
. When using e.g.ParabolicOpenImageFilter
on the binary segmentation (as built in) this error does not arise for otherwise same parameters.Versions
Tested with ITK-4.13.1