-
Notifications
You must be signed in to change notification settings - Fork 7
Changed workflow for setting the masking value in the skull stripping #171
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
base: main
Are you sure you want to change the base?
Changes from all commits
c5859c4
2395565
776cf77
9a523df
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -21,7 +21,9 @@ | |
|
|
||
| class SynthStripExtractor(BrainExtractor): | ||
|
|
||
| def __init__(self, border: int = 1): | ||
| def __init__( | ||
| self, border: int = 1, masking_value: Optional[Union[int, float]] = None | ||
| ): | ||
|
Comment on lines
+24
to
+26
|
||
| """ | ||
| Brain extraction using SynthStrip with preprocessing conforming to model requirements. | ||
|
|
||
|
|
@@ -31,9 +33,10 @@ def __init__(self, border: int = 1): | |
|
|
||
| Args: | ||
| border (int): Mask border threshold in mm. Defaults to 1. | ||
| """ | ||
| masking_value (Optional[Union[int, float]], optional): global value to be inserted in the masked areas. Default is None which leads to the minimum of each respective image. | ||
|
|
||
| super().__init__() | ||
| """ | ||
| super().__init__(masking_value=masking_value) | ||
| self.border = border | ||
|
|
||
| def _setup_model(self, device: torch.device) -> StripModel: | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
apply_mask()now supports a globalmasking_valueand falls back to per-image minimum when unset, but the existing unit test only asserts that an output file is created. Please extend tests to assert that voxels outside the mask are set to the expected value for both cases (default min-per-image and a custommasking_value).