-
-
Notifications
You must be signed in to change notification settings - Fork 664
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
Improve description of itkFastMarchingImageFilter exception: Discriminant of quadratic equation is negative #715
Comments
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. |
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 |
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. |
Yes, this might be the problem, will test this. |
@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. |
Related but not limited to: |
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
ITK/Modules/Filtering/FastMarching/include/itkFastMarchingImageFilter.hxx
Line 498 in bd8169b
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 on
itkSpeedFunctionToPathFilter
).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
err.SetDescription("Discriminant of quadratic equation is negative. This happens when ... and can possibly be avoided by ...");
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
The text was updated successfully, but these errors were encountered: