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

ENH: Allow adjusting histogram matching of configuration files #911

Merged
merged 1 commit into from
Dec 12, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions niworkflows/interfaces/norm.py
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,7 @@
""",
)
initial_moving_transform = File(exists=True, desc='transform for initialization')
use_histogram_matching = traits.Bool(desc='determine use of histogram matching')
float = traits.Bool(False, usedefault=True, desc='use single precision calculations')


Expand Down Expand Up @@ -196,6 +197,15 @@
NIWORKFLOWS_LOG.info('Loading settings from file %s.', ants_settings)
# Configure an ANTs run based on these settings.
self.norm = Registration(from_file=ants_settings, **ants_args)
if isdefined(self.inputs.use_histogram_matching):
mgxd marked this conversation as resolved.
Show resolved Hide resolved
# Most (all?) configuration files use histogram matching, so more important
# to allow disabling, such as in the case of intermodality normalization
NIWORKFLOWS_LOG.info(

Check warning on line 203 in niworkflows/interfaces/norm.py

View check run for this annotation

Codecov / codecov/patch

niworkflows/interfaces/norm.py#L203

Added line #L203 was not covered by tests
'Overriding (%sabling) histogram matching for file %s',
'en' if self.inputs.use_histogram_matching else 'dis',
ants_settings,
)
self.norm.inputs.use_histogram_matching = self.inputs.use_histogram_matching

Check warning on line 208 in niworkflows/interfaces/norm.py

View check run for this annotation

Codecov / codecov/patch

niworkflows/interfaces/norm.py#L208

Added line #L208 was not covered by tests
self.norm.resource_monitor = False
self.norm.terminal_output = self.terminal_output

Expand Down
Loading