Skip to content

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

@romangrothausmann

Description

@romangrothausmann

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    status:Use_Milestone_BacklogUse "Backlog" milestone instead of label for issues without a fixed deadlinetype:DesignImprovement in the design of a given areatype:DocumentationDocumentation improvement or change

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions