Skip to content

Commit 10c641d

Browse files
committed
RF: Local absolute imports to file-level relative
1 parent b96180c commit 10c641d

File tree

5 files changed

+7
-12
lines changed

5 files changed

+7
-12
lines changed

nipype/interfaces/dipy/preprocess.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@
1313
import nibabel as nb
1414
import numpy as np
1515

16+
from ...utils import NUMPY_MMAP
17+
1618
from ... import logging
1719
from ..base import (traits, TraitedSpec, File, isdefined)
1820
from .base import DipyBaseInterface
@@ -179,7 +181,6 @@ def resample_proxy(in_file, order=3, new_zooms=None, out_file=None):
179181
Performs regridding of an image to set isotropic voxel sizes using dipy.
180182
"""
181183
from dipy.align.reslice import reslice
182-
from nipype.utils import NUMPY_MMAP
183184

184185
if out_file is None:
185186
fname, fext = op.splitext(op.basename(in_file))
@@ -223,7 +224,6 @@ def nlmeans_proxy(in_file, settings,
223224
from dipy.denoise.nlmeans import nlmeans
224225
from scipy.ndimage.morphology import binary_erosion
225226
from scipy import ndimage
226-
from nipype.utils import NUMPY_MMAP
227227

228228
if out_file is None:
229229
fname, fext = op.splitext(op.basename(in_file))

nipype/interfaces/petpvc.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,8 @@
1313
import os
1414

1515
from .base import TraitedSpec, CommandLineInputSpec, CommandLine, File, isdefined, traits
16-
from ..external.due import due, Doi, BibTeX
16+
from ..utils.filemanip import fname_presuffix
17+
from ..external.due import BibTeX
1718

1819
pvc_methods = ['GTM',
1920
'IY',
@@ -200,8 +201,6 @@ def _gen_fname(self, basename, cwd=None, suffix=None, change_ext=True,
200201
New filename based on given parameters.
201202
202203
"""
203-
from nipype.utils.filemanip import fname_presuffix
204-
205204
if basename == '':
206205
msg = 'Unable to generate filename for command %s. ' % self.cmd
207206
msg += 'basename is not set!'

nipype/interfaces/utility/wrappers.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121

2222
from ... import logging
2323
from ..base import (traits, DynamicTraitedSpec, Undefined, isdefined, runtime_profile,
24-
BaseInterfaceInputSpec)
24+
BaseInterfaceInputSpec, get_max_resources_used)
2525
from ..io import IOBase, add_traits
2626
from ...utils.filemanip import filename_to_list
2727
from ...utils.misc import getsource, create_function_from_source
@@ -138,7 +138,6 @@ def _add_output_traits(self, base):
138138

139139
def _run_interface(self, runtime):
140140
# Get workflow logger for runtime profile error reporting
141-
from nipype import logging
142141
logger = logging.getLogger('workflow')
143142

144143
# Create function handle
@@ -163,7 +162,6 @@ def _function_handle_wrapper(queue, **kwargs):
163162

164163
# Profile resources if set
165164
if runtime_profile:
166-
from nipype.interfaces.base import get_max_resources_used
167165
import multiprocessing
168166
# Init communication queue and proc objs
169167
queue = multiprocessing.Queue()

nipype/workflows/dmri/fsl/artifacts.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@
99
from ....interfaces import ants
1010
from ....interfaces import fsl
1111
from ....pipeline import engine as pe
12+
from ...data import get_flirt_schedule
13+
1214
from .utils import (b0_indices, time_avg, apply_all_corrections, b0_average,
1315
hmc_split, dwi_flirt, eddy_rotate_bvecs, rotate_bvecs,
1416
insert_mat, extract_bval, recompose_dwi, recompose_xfm,
@@ -352,8 +354,6 @@ def hmc_pipeline(name='motion_correct'):
352354
outputnode.out_xfms - list of transformation matrices
353355
354356
"""
355-
from nipype.workflows.data import get_flirt_schedule
356-
357357
params = dict(dof=6, bgvalue=0, save_log=True, no_search=True,
358358
# cost='mutualinfo', cost_func='mutualinfo', bins=64,
359359
schedule=get_flirt_schedule('hmc'))
@@ -454,7 +454,6 @@ def ecc_pipeline(name='eddy_correct'):
454454
outputnode.out_xfms - list of transformation matrices
455455
"""
456456

457-
from nipype.workflows.data import get_flirt_schedule
458457
params = dict(dof=12, no_search=True, interp='spline', bgvalue=0,
459458
schedule=get_flirt_schedule('ecc'))
460459
# cost='normmi', cost_func='normmi', bins=64,

nipype/workflows/smri/freesurfer/recon.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -206,7 +206,6 @@ def setconfig(reg_template=None,
206206
awk_file=None,
207207
rb_date=None):
208208
"""Set optional configurations to the default"""
209-
from nipype.workflows.smri.freesurfer.utils import getdefaultconfig
210209
def checkarg(arg, default):
211210
"""Returns the value if defined; otherwise default"""
212211
if arg:

0 commit comments

Comments
 (0)