Skip to content

Commit 69d82d8

Browse files
committed
ENH: Allow adjusting histogram matching of configuration files
1 parent 7bd6a53 commit 69d82d8

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

niworkflows/interfaces/norm.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,7 @@ class _SpatialNormalizationInputSpec(BaseInterfaceInputSpec):
114114
""",
115115
)
116116
initial_moving_transform = File(exists=True, desc='transform for initialization')
117+
use_histogram_matching = traits.Bool(desc='determine use of histogram matching')
117118
float = traits.Bool(False, usedefault=True, desc='use single precision calculations')
118119

119120

@@ -196,6 +197,15 @@ def _run_interface(self, runtime):
196197
NIWORKFLOWS_LOG.info('Loading settings from file %s.', ants_settings)
197198
# Configure an ANTs run based on these settings.
198199
self.norm = Registration(from_file=ants_settings, **ants_args)
200+
if isdefined(self.inputs.use_histogram_matching):
201+
# Most (all?) configuration files use histogram matching, so more important
202+
# to allow disabling, such as in the case of intermodality normalization
203+
NIWORKFLOWS_LOG.info(
204+
'Overriding (%sabling) histogram matching for file %s',
205+
'en' if self.inputs.use_histogram_matching else 'dis',
206+
ants_settings,
207+
)
208+
self.norm.inputs.use_histogram_matching = self.inputs.use_histogram_matching
199209
self.norm.resource_monitor = False
200210
self.norm.terminal_output = self.terminal_output
201211

0 commit comments

Comments
 (0)