Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RF: Resume external nipype dependency #1133

Merged
merged 7 commits into from
May 31, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 13 additions & 13 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -296,10 +296,10 @@ jobs:
at: /tmp
- restore_cache:
keys:
- ds005-anat-v6-{{ .Branch }}-{{ epoch }}
- ds005-anat-v6-{{ .Branch }}
- ds005-anat-v6-master
- ds005-anat-v6-
- ds005-anat-v7-{{ .Branch }}-{{ epoch }}
- ds005-anat-v7-{{ .Branch }}
- ds005-anat-v7-master
- ds005-anat-v7-
- run:
name: Setting up test
command: |
Expand Down Expand Up @@ -333,7 +333,7 @@ jobs:
--debug --write-graph --mem_mb 4096 \
--nthreads 2 --anat-only -vv
- save_cache:
key: ds005-anat-v6-{{ .Branch }}-{{ epoch }}
key: ds005-anat-v7-{{ .Branch }}-{{ epoch }}
paths:
- /tmp/ds005/work
- /tmp/ds005/derivatives/fmriprep
Expand Down Expand Up @@ -425,10 +425,10 @@ jobs:
at: /tmp
- restore_cache:
keys:
- ds054-anat-v4-{{ .Branch }}-{{ epoch }}
- ds054-anat-v4-{{ .Branch }}
- ds054-anat-v4-master
- ds054-anat-v4-
- ds054-anat-v5-{{ .Branch }}-{{ epoch }}
- ds054-anat-v5-{{ .Branch }}
- ds054-anat-v5-master
- ds054-anat-v5-
- run:
name: Setting up test
command: |
Expand Down Expand Up @@ -462,7 +462,7 @@ jobs:
--fs-no-reconall --debug --write-graph \
--mem_mb 4096 --nthreads 2 --anat-only -vv
- save_cache:
key: ds054-anat-v4-{{ .Branch }}-{{ epoch }}
key: ds054-anat-v5-{{ .Branch }}-{{ epoch }}
paths:
- /tmp/ds054/work
- /tmp/ds054/derivatives
Expand Down Expand Up @@ -543,8 +543,8 @@ jobs:
at: /tmp
- restore_cache:
keys:
- ds210-anat-v1-{{ epoch }}
- ds210-anat-v1-
- ds210-anat-v2-{{ epoch }}
- ds210-anat-v2-
- run:
name: Setting up test
command: |
Expand Down Expand Up @@ -578,7 +578,7 @@ jobs:
--fs-no-reconall --debug --write-graph \
--mem_mb 4096 --nthreads 2 --anat-only -vv
- save_cache:
key: ds210-anat-v1-{{ epoch }}
key: ds210-anat-v2-{{ epoch }}
paths:
- /tmp/ds210/work
- /tmp/ds210/derivatives
Expand Down
2 changes: 1 addition & 1 deletion docs/environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,4 +28,4 @@ dependencies:
- svgutils
- nitime
- nilearn
- niworkflows>=0.3.13
- niworkflows>=0.4.0
2 changes: 1 addition & 1 deletion fmriprep/cli/fmriprep_bold_mask.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# vi: set ft=python sts=4 ts=4 sw=4 et:
"""Run the BOLD reference+mask workflow"""
import os
from niworkflows.nipype.utils.filemanip import hash_infile
from nipype.utils.filemanip import hash_infile


def get_parser():
Expand Down
4 changes: 2 additions & 2 deletions fmriprep/cli/run.py
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,7 @@ def get_parser():

def main():
"""Entry point"""
from niworkflows.nipype import logging as nlogging
from nipype import logging as nlogging
from multiprocessing import set_start_method, Process, Manager
from ..viz.reports import generate_reports
from ..info import __version__
Expand Down Expand Up @@ -335,7 +335,7 @@ def build_workflow(opts, retval):
a hard-limited memory-scope.

"""
from niworkflows.nipype import logging, config as ncfg
from nipype import logging, config as ncfg
from ..info import __version__
from ..workflows.base import init_fmriprep_wf
from ..utils.bids import collect_participants
Expand Down
3 changes: 2 additions & 1 deletion fmriprep/info.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,8 @@
'grabbit',
'pybids>=0.5.1',
'nitime',
'niworkflows>=0.3.13',
'nipype>=1.0.4',
'niworkflows>=0.4.0',
'statsmodels',
'nipype',
'seaborn',
Expand Down
10 changes: 5 additions & 5 deletions fmriprep/interfaces/bids.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@

Disable warnings:

>>> import niworkflows.nipype as nn
>>> nn.logging.getLogger('interface').setLevel('ERROR')
>>> from nipype import logging
>>> logging.getLogger('interface').setLevel('ERROR')

"""

Expand All @@ -26,13 +26,13 @@
import gzip
from shutil import copytree, rmtree, copyfileobj

from niworkflows.nipype import logging
from niworkflows.nipype.interfaces.base import (
from nipype import logging
from nipype.interfaces.base import (
traits, isdefined, TraitedSpec, BaseInterfaceInputSpec,
File, Directory, InputMultiPath, OutputMultiPath, Str,
SimpleInterface
)
from niworkflows.nipype.utils.filemanip import copyfile
from nipype.utils.filemanip import copyfile

LOGGER = logging.getLogger('interface')
BIDS_NAME = re.compile(
Expand Down
4 changes: 2 additions & 2 deletions fmriprep/interfaces/cifti.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,12 @@
import numpy as np
from nilearn.image import resample_to_img

from niworkflows.nipype.interfaces.base import (
from nipype.interfaces.base import (
BaseInterfaceInputSpec, TraitedSpec, File, traits,
SimpleInterface, Directory
)
from niworkflows.data import getters
from niworkflows.nipype.utils.filemanip import split_filename
from nipype.utils.filemanip import split_filename

# CITFI structures with corresponding FS labels
CIFTI_STRUCT_WITH_LABELS = {
Expand Down
6 changes: 3 additions & 3 deletions fmriprep/interfaces/confounds.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@
import shutil
import numpy as np
import pandas as pd
from niworkflows.nipype import logging
from niworkflows.nipype.utils.filemanip import fname_presuffix
from niworkflows.nipype.interfaces.base import (
from nipype import logging
from nipype.utils.filemanip import fname_presuffix
from nipype.interfaces.base import (
traits, TraitedSpec, BaseInterfaceInputSpec, File, Directory, isdefined,
SimpleInterface
)
Expand Down
14 changes: 7 additions & 7 deletions fmriprep/interfaces/fmap.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@

import numpy as np
import nibabel as nb
from niworkflows.nipype import logging
from niworkflows.nipype.utils.filemanip import fname_presuffix
from niworkflows.nipype.interfaces.base import (
from nipype import logging
from nipype.utils.filemanip import fname_presuffix
from nipype.interfaces.base import (
BaseInterfaceInputSpec, TraitedSpec, File, isdefined, traits,
SimpleInterface)

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

def _unwrap(fmap_data, mag_file, mask=None):
from math import pi
from niworkflows.nipype.interfaces.fsl import PRELUDE
from nipype.interfaces.fsl import PRELUDE
magnii = nb.load(mag_file)

if mask is None:
Expand Down Expand Up @@ -433,7 +433,7 @@ def _torads(in_file, fmap_range=None, newpath=None):
"""
from math import pi
import nibabel as nb
from niworkflows.nipype.utils.filemanip import fname_presuffix
from nipype.utils.filemanip import fname_presuffix

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

out_file = fname_presuffix(in_file, suffix='_hz', newpath=newpath)
fmapnii = nb.load(in_file)
Expand Down Expand Up @@ -485,7 +485,7 @@ def phdiff2fmap(in_file, delta_te, newpath=None):
import math
import numpy as np
import nibabel as nb
from niworkflows.nipype.utils.filemanip import fname_presuffix
from nipype.utils.filemanip import fname_presuffix
# GYROMAG_RATIO_H_PROTON_MHZ = 42.576

out_file = fname_presuffix(in_file, suffix='_fmap', newpath=newpath)
Expand Down
14 changes: 7 additions & 7 deletions fmriprep/interfaces/freesurfer.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@

Disable warnings:

>>> import niworkflows.nipype as nn
>>> nn.logging.getLogger('interface').setLevel('ERROR')
>>> from nipype import logging
>>> logging.getLogger('interface').setLevel('ERROR')

"""

Expand All @@ -28,13 +28,13 @@
from scipy.ndimage.morphology import binary_fill_holes
from nilearn.image import resample_to_img, new_img_like

from niworkflows.nipype.utils.filemanip import copyfile, filename_to_list, fname_presuffix
from niworkflows.nipype.interfaces.base import (
from nipype.utils.filemanip import copyfile, filename_to_list, fname_presuffix
from nipype.interfaces.base import (
isdefined, InputMultiPath, BaseInterfaceInputSpec, TraitedSpec, File, traits, Directory
)
from niworkflows.nipype.interfaces import freesurfer as fs
from niworkflows.nipype.interfaces.base import SimpleInterface
from niworkflows.nipype.interfaces.freesurfer.preprocess import ConcatenateLTA
from nipype.interfaces import freesurfer as fs
from nipype.interfaces.base import SimpleInterface
from nipype.interfaces.freesurfer.preprocess import ConcatenateLTA


class StructuralReference(fs.RobustTemplate):
Expand Down
12 changes: 6 additions & 6 deletions fmriprep/interfaces/images.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,12 @@
import nilearn.image as nli
from textwrap import indent

from niworkflows.nipype import logging
from niworkflows.nipype.utils.filemanip import fname_presuffix
from niworkflows.nipype.interfaces.base import (
from nipype import logging
from nipype.utils.filemanip import fname_presuffix
from nipype.interfaces.base import (
traits, TraitedSpec, BaseInterfaceInputSpec, SimpleInterface,
File, InputMultiPath, OutputMultiPath)
from niworkflows.nipype.interfaces import fsl
from nipype.interfaces import fsl

LOGGER = logging.getLogger('interface')

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

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

out_file = fname_presuffix(in_file, suffix='_demeaned',
newpath=os.getcwd())
Expand Down
14 changes: 7 additions & 7 deletions fmriprep/interfaces/itk.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,12 @@
import numpy as np
import nibabel as nb

from niworkflows.nipype import logging
from niworkflows.nipype.utils.filemanip import fname_presuffix
from niworkflows.nipype.interfaces.base import (
from nipype import logging
from nipype.utils.filemanip import fname_presuffix
from nipype.interfaces.base import (
traits, TraitedSpec, BaseInterfaceInputSpec, File, InputMultiPath, OutputMultiPath,
SimpleInterface)
from niworkflows.nipype.interfaces.ants.resampling import ApplyTransformsInputSpec
from nipype.interfaces.ants.resampling import ApplyTransformsInputSpec

LOGGER = logging.getLogger('interface')

Expand Down Expand Up @@ -222,8 +222,8 @@ def _run_interface(self, runtime):


def _mat2itk(args):
from niworkflows.nipype.interfaces.c3 import C3dAffineTool
from niworkflows.nipype.utils.filemanip import fname_presuffix
from nipype.interfaces.c3 import C3dAffineTool
from nipype.utils.filemanip import fname_presuffix

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

in_file, in_xform, ifargs, index, newpath = args
Expand Down
6 changes: 3 additions & 3 deletions fmriprep/interfaces/multiecho.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@
import nibabel as nb
from nilearn.masking import (apply_mask, unmask)

from niworkflows.nipype import logging
from niworkflows.nipype.utils.filemanip import (split_filename, fname_presuffix)
from niworkflows.nipype.interfaces.base import (
from nipype import logging
from nipype.utils.filemanip import (split_filename, fname_presuffix)
from nipype.interfaces.base import (
traits, TraitedSpec, File, InputMultiPath, SimpleInterface,
BaseInterfaceInputSpec)

Expand Down
6 changes: 3 additions & 3 deletions fmriprep/interfaces/nilearn.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@
from nilearn.masking import compute_epi_mask
from nilearn.image import concat_imgs

from niworkflows.nipype import logging
from niworkflows.nipype.utils.filemanip import fname_presuffix
from niworkflows.nipype.interfaces.base import (
from nipype import logging
from nipype.utils.filemanip import fname_presuffix
from nipype.interfaces.base import (
traits, isdefined, TraitedSpec, BaseInterfaceInputSpec,
File, InputMultiPath, SimpleInterface
)
Expand Down
2 changes: 1 addition & 1 deletion fmriprep/interfaces/patches.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
from time import sleep

from numpy.linalg.linalg import LinAlgError
from niworkflows.nipype.algorithms import confounds as nac
from nipype.algorithms import confounds as nac


class RobustACompCor(nac.ACompCor):
Expand Down
4 changes: 2 additions & 2 deletions fmriprep/interfaces/reports.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,11 @@
import re

from collections import Counter
from niworkflows.nipype.interfaces.base import (
from nipype.interfaces.base import (
traits, TraitedSpec, BaseInterfaceInputSpec,
File, Directory, InputMultiPath, Str, isdefined,
SimpleInterface)
from niworkflows.nipype.interfaces import freesurfer as fs
from nipype.interfaces import freesurfer as fs

from .bids import BIDS_NAME

Expand Down
2 changes: 1 addition & 1 deletion fmriprep/interfaces/surf.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
import numpy as np
import nibabel as nb

from niworkflows.nipype.interfaces.base import (
from nipype.interfaces.base import (
BaseInterfaceInputSpec, TraitedSpec, File, traits, isdefined,
SimpleInterface
)
Expand Down
8 changes: 4 additions & 4 deletions fmriprep/interfaces/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,13 @@
import nibabel as nb
import scipy.ndimage as nd

from niworkflows.nipype import logging
from niworkflows.nipype.utils.filemanip import fname_presuffix
from niworkflows.nipype.interfaces.base import (
from nipype import logging
from nipype.utils.filemanip import fname_presuffix
from nipype.interfaces.base import (
traits, isdefined, File, InputMultiPath,
TraitedSpec, DynamicTraitedSpec, BaseInterfaceInputSpec, SimpleInterface
)
from niworkflows.nipype.interfaces.io import add_traits
from nipype.interfaces.io import add_traits

IFLOGGER = logging.getLogger('interfaces')

Expand Down
Loading