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

Update GeodesicSegmentation CLI #1496

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

AlexanderGetka-cbica
Copy link
Contributor

Fixes an issue where GeodesicSegmentation's CLI was broken -- threshold values could never be read, the generated masks/distance maps were not being written for any voxels other than what was already labelled, and the threshold filter was wrongly inverted.

thresholder->SetInput(geosOutput);
thresholder->SetOutsideValue(0);
thresholder->SetInsideValue(1);
thresholder->SetLowerThreshold(threshold);
thresholder->SetUpperThreshold(maxVal);
thresholder->SetLowerThreshold(0);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
thresholder->SetLowerThreshold(0);
thresholder->SetLowerThreshold(threshold);

This should use threshold instead of a hard-coded 0.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Your suggestion is what it was before. The geodesic distance map that is created before the thresholding step is represented as increasing values away from the original segmentation/seeds. So setting it as you suggest will yield a 1 label in everything outside the predicted region of interest.

I tested this and compared to the GUI version with my changes, and this makes them consistent.

thresholder->SetLowerThreshold(threshold);
thresholder->SetUpperThreshold(maxVal);
thresholder->SetLowerThreshold(0);
thresholder->SetUpperThreshold(threshold);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
thresholder->SetUpperThreshold(threshold);
thresholder->SetUpperThreshold(maxVal);

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants