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

Improve description of itkFastMarchingImageFilter exception: Discriminant of quadratic equation is negative #715

Open
romangrothausmann opened this issue Apr 10, 2019 · 0 comments

Comments

Projects
None yet
2 participants
@romangrothausmann
Copy link
Contributor

commented Apr 10, 2019

Description

itkFastMarchingImageFilter is called when executing itkSpeedFunctionToPathFilter. Under some circumstances itkFastMarchingImageFilter issues an exception with the description:
Discriminant of quadratic equation is negative

err.SetDescription("Discriminant of quadratic equation is negative");

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.