Skip to content

Commit 01a2b65

Browse files
committed
fix: revise some imports from nipype, rework ImageMaths temporary patch
1 parent dc654bb commit 01a2b65

File tree

2 files changed

+13
-7
lines changed

2 files changed

+13
-7
lines changed

niworkflows/anat/ants.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,12 @@
1313
from nipype.pipeline import engine as pe
1414
from nipype.interfaces import utility as niu
1515
from nipype.interfaces.ants import (
16-
AI,
1716
Atropos,
1817
MultiplyImages,
1918
N4BiasFieldCorrection,
20-
ResampleImageBySpacing,
2119
ThresholdImage,
2220
)
21+
from nipype.interfaces.ants.utils import AI, ResampleImageBySpacing
2322

2423
from ..utils.misc import get_template_specs
2524
from ..utils.connections import pop_file as _pop

niworkflows/interfaces/ants.py

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,17 @@
22
# vi: set ft=python sts=4 ts=4 sw=4 et:
33
"""Patch ImageMath until https://github.com/nipy/nipype/pull/3210 is merged."""
44
from nipype.interfaces.base import Str
5-
from nipype.interfaces.ants.utils import ImageMath as _ImageMath
5+
from nipype.interfaces.ants.utils import (
6+
ImageMath as _ImageMath,
7+
ImageMathInputSpec as _InputSpec
8+
)
69

710

8-
ImageMath = _ImageMath
9-
ImageMath.input_spec.operation = Str(
10-
mandatory=True, position=3, argstr="%s", desc="operations and intputs"
11-
)
11+
class _ImageMathInputSpec(_InputSpec):
12+
operation = Str(
13+
mandatory=True, position=3, argstr="%s", desc="operations and intputs"
14+
)
15+
16+
17+
class ImageMath(_ImageMath):
18+
input_spec = _ImageMathInputSpec

0 commit comments

Comments
 (0)