Skip to content

Commit 208d2c1

Browse files
committed
RF: niworkflows.nipype -> nipype
1 parent 01781fa commit 208d2c1

35 files changed

+114
-116
lines changed

fmriprep/cli/fmriprep_bold_mask.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
# vi: set ft=python sts=4 ts=4 sw=4 et:
44
"""Run the BOLD reference+mask workflow"""
55
import os
6-
from niworkflows.nipype.utils.filemanip import hash_infile
6+
from nipype.utils.filemanip import hash_infile
77

88

99
def get_parser():

fmriprep/cli/run.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -228,7 +228,7 @@ def get_parser():
228228

229229
def main():
230230
"""Entry point"""
231-
from niworkflows.nipype import logging as nlogging
231+
from nipype import logging as nlogging
232232
from multiprocessing import set_start_method, Process, Manager
233233
from ..viz.reports import generate_reports
234234
from ..info import __version__
@@ -335,7 +335,7 @@ def build_workflow(opts, retval):
335335
a hard-limited memory-scope.
336336
337337
"""
338-
from niworkflows.nipype import logging, config as ncfg
338+
from nipype import logging, config as ncfg
339339
from ..info import __version__
340340
from ..workflows.base import init_fmriprep_wf
341341
from ..utils.bids import collect_participants

fmriprep/interfaces/bids.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@
1414
1515
Disable warnings:
1616
17-
>>> import niworkflows.nipype as nn
18-
>>> nn.logging.getLogger('interface').setLevel('ERROR')
17+
>>> import nipype import logging
18+
>>> logging.getLogger('interface').setLevel('ERROR')
1919
2020
"""
2121

@@ -26,13 +26,13 @@
2626
import gzip
2727
from shutil import copytree, rmtree, copyfileobj
2828

29-
from niworkflows.nipype import logging
30-
from niworkflows.nipype.interfaces.base import (
29+
from nipype import logging
30+
from nipype.interfaces.base import (
3131
traits, isdefined, TraitedSpec, BaseInterfaceInputSpec,
3232
File, Directory, InputMultiPath, OutputMultiPath, Str,
3333
SimpleInterface
3434
)
35-
from niworkflows.nipype.utils.filemanip import copyfile
35+
from nipype.utils.filemanip import copyfile
3636

3737
LOGGER = logging.getLogger('interface')
3838
BIDS_NAME = re.compile(

fmriprep/interfaces/cifti.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,12 +17,12 @@
1717
import numpy as np
1818
from nilearn.image import resample_to_img
1919

20-
from niworkflows.nipype.interfaces.base import (
20+
from nipype.interfaces.base import (
2121
BaseInterfaceInputSpec, TraitedSpec, File, traits,
2222
SimpleInterface, Directory
2323
)
2424
from niworkflows.data import getters
25-
from niworkflows.nipype.utils.filemanip import split_filename
25+
from nipype.utils.filemanip import split_filename
2626

2727
# CITFI structures with corresponding FS labels
2828
CIFTI_STRUCT_WITH_LABELS = {

fmriprep/interfaces/confounds.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,9 @@
1313
import shutil
1414
import numpy as np
1515
import pandas as pd
16-
from niworkflows.nipype import logging
17-
from niworkflows.nipype.utils.filemanip import fname_presuffix
18-
from niworkflows.nipype.interfaces.base import (
16+
from nipype import logging
17+
from nipype.utils.filemanip import fname_presuffix
18+
from nipype.interfaces.base import (
1919
traits, TraitedSpec, BaseInterfaceInputSpec, File, Directory, isdefined,
2020
SimpleInterface
2121
)

fmriprep/interfaces/fmap.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,9 @@
1717

1818
import numpy as np
1919
import nibabel as nb
20-
from niworkflows.nipype import logging
21-
from niworkflows.nipype.utils.filemanip import fname_presuffix
22-
from niworkflows.nipype.interfaces.base import (
20+
from nipype import logging
21+
from nipype.utils.filemanip import fname_presuffix
22+
from nipype.interfaces.base import (
2323
BaseInterfaceInputSpec, TraitedSpec, File, isdefined, traits,
2424
SimpleInterface)
2525

@@ -241,7 +241,7 @@ def _despike2d(data, thres, neigh=None):
241241

242242
def _unwrap(fmap_data, mag_file, mask=None):
243243
from math import pi
244-
from niworkflows.nipype.interfaces.fsl import PRELUDE
244+
from nipype.interfaces.fsl import PRELUDE
245245
magnii = nb.load(mag_file)
246246

247247
if mask is None:
@@ -433,7 +433,7 @@ def _torads(in_file, fmap_range=None, newpath=None):
433433
"""
434434
from math import pi
435435
import nibabel as nb
436-
from niworkflows.nipype.utils.filemanip import fname_presuffix
436+
from nipype.utils.filemanip import fname_presuffix
437437

438438
out_file = fname_presuffix(in_file, suffix='_rad', newpath=newpath)
439439
fmapnii = nb.load(in_file)
@@ -452,7 +452,7 @@ def _tohz(in_file, range_hz, newpath=None):
452452
"""Convert a field map to Hz units"""
453453
from math import pi
454454
import nibabel as nb
455-
from niworkflows.nipype.utils.filemanip import fname_presuffix
455+
from nipype.utils.filemanip import fname_presuffix
456456

457457
out_file = fname_presuffix(in_file, suffix='_hz', newpath=newpath)
458458
fmapnii = nb.load(in_file)
@@ -485,7 +485,7 @@ def phdiff2fmap(in_file, delta_te, newpath=None):
485485
import math
486486
import numpy as np
487487
import nibabel as nb
488-
from niworkflows.nipype.utils.filemanip import fname_presuffix
488+
from nipype.utils.filemanip import fname_presuffix
489489
# GYROMAG_RATIO_H_PROTON_MHZ = 42.576
490490

491491
out_file = fname_presuffix(in_file, suffix='_fmap', newpath=newpath)

fmriprep/interfaces/freesurfer.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@
1515
1616
Disable warnings:
1717
18-
>>> import niworkflows.nipype as nn
19-
>>> nn.logging.getLogger('interface').setLevel('ERROR')
18+
>>> from nipype import logging
19+
>>> logging.getLogger('interface').setLevel('ERROR')
2020
2121
"""
2222

@@ -28,13 +28,13 @@
2828
from scipy.ndimage.morphology import binary_fill_holes
2929
from nilearn.image import resample_to_img, new_img_like
3030

31-
from niworkflows.nipype.utils.filemanip import copyfile, filename_to_list, fname_presuffix
32-
from niworkflows.nipype.interfaces.base import (
31+
from nipype.utils.filemanip import copyfile, filename_to_list, fname_presuffix
32+
from nipype.interfaces.base import (
3333
isdefined, InputMultiPath, BaseInterfaceInputSpec, TraitedSpec, File, traits, Directory
3434
)
35-
from niworkflows.nipype.interfaces import freesurfer as fs
36-
from niworkflows.nipype.interfaces.base import SimpleInterface
37-
from niworkflows.nipype.interfaces.freesurfer.preprocess import ConcatenateLTA
35+
from nipype.interfaces import freesurfer as fs
36+
from nipype.interfaces.base import SimpleInterface
37+
from nipype.interfaces.freesurfer.preprocess import ConcatenateLTA
3838

3939

4040
class StructuralReference(fs.RobustTemplate):

fmriprep/interfaces/images.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,12 @@
1515
import nilearn.image as nli
1616
from textwrap import indent
1717

18-
from niworkflows.nipype import logging
19-
from niworkflows.nipype.utils.filemanip import fname_presuffix
20-
from niworkflows.nipype.interfaces.base import (
18+
from nipype import logging
19+
from nipype.utils.filemanip import fname_presuffix
20+
from nipype.interfaces.base import (
2121
traits, TraitedSpec, BaseInterfaceInputSpec, SimpleInterface,
2222
File, InputMultiPath, OutputMultiPath)
23-
from niworkflows.nipype.interfaces import fsl
23+
from nipype.interfaces import fsl
2424

2525
LOGGER = logging.getLogger('interface')
2626

@@ -570,7 +570,7 @@ def reorient(in_file, newpath=None):
570570
def extract_wm(in_seg, wm_label=3, newpath=None):
571571
import nibabel as nb
572572
import numpy as np
573-
from niworkflows.nipype.utils.filemanip import fname_presuffix
573+
from nipype.utils.filemanip import fname_presuffix
574574

575575
nii = nb.load(in_seg)
576576
data = np.zeros(nii.shape, dtype=np.uint8)
@@ -622,7 +622,7 @@ def demean(in_file, in_mask, only_mask=False, newpath=None):
622622
import os
623623
import numpy as np
624624
import nibabel as nb
625-
from niworkflows.nipype.utils.filemanip import fname_presuffix
625+
from nipype.utils.filemanip import fname_presuffix
626626

627627
out_file = fname_presuffix(in_file, suffix='_demeaned',
628628
newpath=os.getcwd())

fmriprep/interfaces/itk.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,12 @@
1414
import numpy as np
1515
import nibabel as nb
1616

17-
from niworkflows.nipype import logging
18-
from niworkflows.nipype.utils.filemanip import fname_presuffix
19-
from niworkflows.nipype.interfaces.base import (
17+
from nipype import logging
18+
from nipype.utils.filemanip import fname_presuffix
19+
from nipype.interfaces.base import (
2020
traits, TraitedSpec, BaseInterfaceInputSpec, File, InputMultiPath, OutputMultiPath,
2121
SimpleInterface)
22-
from niworkflows.nipype.interfaces.ants.resampling import ApplyTransformsInputSpec
22+
from nipype.interfaces.ants.resampling import ApplyTransformsInputSpec
2323

2424
LOGGER = logging.getLogger('interface')
2525

@@ -222,8 +222,8 @@ def _run_interface(self, runtime):
222222

223223

224224
def _mat2itk(args):
225-
from niworkflows.nipype.interfaces.c3 import C3dAffineTool
226-
from niworkflows.nipype.utils.filemanip import fname_presuffix
225+
from nipype.interfaces.c3 import C3dAffineTool
226+
from nipype.utils.filemanip import fname_presuffix
227227

228228
in_file, in_ref, in_src, index, newpath = args
229229
# Generate a temporal file name
@@ -247,7 +247,7 @@ def _applytfms(args):
247247
multiprocessing's map
248248
"""
249249
import nibabel as nb
250-
from niworkflows.nipype.utils.filemanip import fname_presuffix
250+
from nipype.utils.filemanip import fname_presuffix
251251
from niworkflows.interfaces.fixes import FixHeaderApplyTransforms as ApplyTransforms
252252

253253
in_file, in_xform, ifargs, index, newpath = args

fmriprep/interfaces/multiecho.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,9 @@
2121
import nibabel as nb
2222
from nilearn.masking import (apply_mask, unmask)
2323

24-
from niworkflows.nipype import logging
25-
from niworkflows.nipype.utils.filemanip import (split_filename, fname_presuffix)
26-
from niworkflows.nipype.interfaces.base import (
24+
from nipype import logging
25+
from nipype.utils.filemanip import (split_filename, fname_presuffix)
26+
from nipype.interfaces.base import (
2727
traits, TraitedSpec, File, InputMultiPath, SimpleInterface,
2828
BaseInterfaceInputSpec)
2929

0 commit comments

Comments
 (0)