diff --git a/niworkflows/func/util.py b/niworkflows/func/util.py index 0992b09df9a..b8a5955050c 100644 --- a/niworkflows/func/util.py +++ b/niworkflows/func/util.py @@ -6,7 +6,6 @@ from nipype.pipeline import engine as pe from nipype.interfaces import utility as niu, fsl, afni -from nipype.interfaces.ants.utils import AI from templateflow.api import get as get_template @@ -408,6 +407,7 @@ def init_enhance_and_skullstrip_bold_wf( apply_mask = pe.Node(fsl.ApplyMask(), name="apply_mask") if not pre_mask: + from nipype.interfaces.ants.utils import AI from ..interfaces.nibabel import Binarize bold_template = get_template( diff --git a/niworkflows/interfaces/fixes.py b/niworkflows/interfaces/fixes.py index f8d45d29da6..b59b3ad4deb 100644 --- a/niworkflows/interfaces/fixes.py +++ b/niworkflows/interfaces/fixes.py @@ -17,7 +17,7 @@ from .utils import _copyxform -class FixTraitApplyTransformsInputSpec(ApplyTransformsInputSpec): +class _FixTraitApplyTransformsInputSpec(ApplyTransformsInputSpec): transforms = InputMultiObject( traits.Either(File(exists=True), 'identity'), argstr="%s", @@ -26,13 +26,15 @@ class FixTraitApplyTransformsInputSpec(ApplyTransformsInputSpec): "example, the last specified transform will be applied first.", ) + class FixHeaderApplyTransforms(ApplyTransforms): """ A replacement for nipype.interfaces.ants.resampling.ApplyTransforms that fixes the resampled image header to match the xform of the reference image """ - input_spec = FixTraitApplyTransformsInputSpec + + input_spec = _FixTraitApplyTransformsInputSpec def _run_interface(self, runtime, correct_return_codes=(0,)): # Run normally diff --git a/niworkflows/interfaces/itk.py b/niworkflows/interfaces/itk.py index 163993bb1b5..21877dbb462 100644 --- a/niworkflows/interfaces/itk.py +++ b/niworkflows/interfaces/itk.py @@ -16,7 +16,7 @@ OutputMultiObject, SimpleInterface, ) -from niworkflows.interfaces.fixes import FixTraitApplyTransformsInputSpec +from niworkflows.interfaces.fixes import _FixTraitApplyTransformsInputSpec LOGGER = logging.getLogger("nipype.interface") @@ -96,7 +96,7 @@ def _run_interface(self, runtime): return runtime -class _MultiApplyTransformsInputSpec(FixTraitApplyTransformsInputSpec): +class _MultiApplyTransformsInputSpec(_FixTraitApplyTransformsInputSpec): input_image = InputMultiObject( File(exists=True), mandatory=True,