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

Extend resegmenting functionality #420

Merged
merged 2 commits into from
Sep 10, 2018

Conversation

JoostJM
Copy link
Collaborator

@JoostJM JoostJM commented Aug 28, 2018

In addition to the original mode (now default mode "absolute"), add new modes "relative" and "sigma", which allow for a dynamic threshold defined as either a threshold relative to the maximum value found in the ROI ("relative") or as a n * sigma difference from the mean ("sigma").

Additionally, it is now allowed to provide either 1 or 2 thresholds, where in case of 1 threshold it is interpreted as the lower threshold (i.e. retaining everything equal to or higher than that threshold).

In case the function fails, a ValueError is raised. The checks to determine the validity of the resegmented mask is not determined in this function, but is applied in the pipeline defined by featureextractor.

@JoostJM
Copy link
Collaborator Author

JoostJM commented Aug 28, 2018

This PR now also contains some updates for the provenance info and the behavior in case of failing checks:
The general info class is now updated at multiple points during the extraction, allowing for information reflecting the input data in various stages of pre-processing

Instead of logging an error and returning an empty feature vector when checks fail, raise a ValueError detailing the cause of the failing check.

In addition to the original mode (now default mode "absolute"), add new modes "relative" and "sigma", which allow for a dynamic threshold defined as either a threshold relative to the maximum value found in the ROI ("relative") or as a n * sigma difference from the mean ("sigma").

Additionally, it is now allowed to provide either 1 or 2 thresholds, where in case of 1 threshold it is interpreted as the lower threshold (i.e. retaining everything equal to or higher than that threshold).

In case the function fails, a ValueError is raised. The checks to determine the validity of the resegmented mask is not determined in this function, but is applied in the pipeline defined by featureextractor.
Update the general info class, which will now be updated at multiple points in the extraction pipeline. This enables reflecting the various changes introduced by the pre-processing.

Instead of returning "None" when checks fail, raise a ValueError. This removes the need for checking for "None" and ensures that the extraction is cancelled, with a warning message shown to the user.
@JoostJM JoostJM merged commit e4eaf85 into AIM-Harvard:master Sep 10, 2018
@JoostJM JoostJM deleted the update-resegmentation branch September 10, 2018 12:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant