Skip to content

Resume external nipype dependency #241

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

Merged
merged 5 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
17 changes: 0 additions & 17 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,15 +23,6 @@ jobs:
- /tmp/cache/docker.tar.gz
- /tmp/cache/ubuntu.tar.gz
- checkout
- run:
name: Checkout Nipype
command: |
git submodule init
git submodule update || true
git submodule sync
git -C nipype fetch origin
git submodule update

- run:
name: Update Niworkflows version
command: |
Expand Down Expand Up @@ -130,14 +121,6 @@ jobs:
working_directory: /tmp/src/niworkflows
steps:
- checkout
- run:
name: Checkout Nipype
command: |
git submodule init
git submodule update || true
git submodule sync
git -C nipype fetch origin
git submodule update

- run:
name: Update Niworkflows version
Expand Down
3 changes: 0 additions & 3 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -1,3 +0,0 @@
[submodule "niworkflows/nipype"]
path = nipype
url = https://github.com/nipy/nipype.git
1 change: 0 additions & 1 deletion nipype
Submodule nipype deleted from fed0bd
8 changes: 2 additions & 6 deletions niworkflows/__about__.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,6 @@
"""
from __future__ import absolute_import, division, print_function
import datetime
from os import path as op
import runpy

nipype_info = runpy.run_path(op.join(op.abspath(op.dirname(__file__)),
'nipype', 'info.py'))

__version__ = '0.3.14-dev'
__packagename__ = 'niworkflows'
Expand Down Expand Up @@ -53,7 +48,8 @@
'Programming Language :: Python :: 3.6',
]

REQUIRES = nipype_info['REQUIRES'] + [
REQUIRES = [
'nipype>=1.0.4',
'nilearn>=0.2.6',
'sklearn',
'pandas',
Expand Down
4 changes: 2 additions & 2 deletions niworkflows/anat/skullstrip.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
# emacs: -*- mode: python; py-indent-offset: 4; indent-tabs-mode: nil -*-
# vi: set ft=python sts=4 ts=4 sw=4 et:
from __future__ import absolute_import, division, print_function, unicode_literals
from ..nipype.interfaces import ants, afni, fsl, utility as niu
from ..nipype.pipeline import engine as pe
from nipype.interfaces import ants, afni, fsl, utility as niu
from nipype.pipeline import engine as pe


def afni_wf(name='AFNISkullStripWorkflow', unifize=False, n4_nthreads=1):
Expand Down
4 changes: 2 additions & 2 deletions niworkflows/common/orient.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
# vi: set ft=python sts=4 ts=4 sw=4 et:
from __future__ import absolute_import, division, print_function, unicode_literals

from ..nipype.pipeline import engine as pe
from ..nipype.interfaces import afni, utility as niu
from nipype.pipeline import engine as pe
from nipype.interfaces import afni, utility as niu


def reorient_wf(name='ReorientWorkflow'):
Expand Down
4 changes: 2 additions & 2 deletions niworkflows/interfaces/fixes.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
from .. import __version__
from .utils import _copyxform

from ..nipype.interfaces.ants.resampling import ApplyTransforms
from ..nipype.interfaces.ants.registration import Registration
from nipype.interfaces.ants.resampling import ApplyTransforms
from nipype.interfaces.ants.registration import Registration


class FixHeaderApplyTransforms(ApplyTransforms):
Expand Down
8 changes: 4 additions & 4 deletions niworkflows/interfaces/masks.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,11 @@
import scipy.ndimage as nd

from .. import NIWORKFLOWS_LOG
from ..nipype.interfaces import fsl, ants
from ..nipype.interfaces.base import (
from nipype.interfaces import fsl, ants
from nipype.interfaces.base import (
File, BaseInterfaceInputSpec, traits, isdefined, InputMultiPath, Str)
from ..nipype.interfaces.mixins import reporting
from ..nipype.algorithms import confounds
from nipype.interfaces.mixins import reporting
from nipype.algorithms import confounds
from . import report_base as nrc


Expand Down
6 changes: 3 additions & 3 deletions niworkflows/interfaces/mni.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@
import nibabel as nb
import numpy as np

from ..nipype.interfaces.ants.registration import RegistrationOutputSpec
from ..nipype.interfaces.ants import AffineInitializer
from ..nipype.interfaces.base import (
from nipype.interfaces.ants.registration import RegistrationOutputSpec
from nipype.interfaces.ants import AffineInitializer
from nipype.interfaces.base import (
traits, isdefined, BaseInterface, BaseInterfaceInputSpec, File)

from ..data import getters
Expand Down
4 changes: 2 additions & 2 deletions niworkflows/interfaces/plotting.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@
import numpy as np
import pandas as pd

from ..nipype.utils.filemanip import fname_presuffix
from ..nipype.interfaces.base import (
from nipype.utils.filemanip import fname_presuffix
from nipype.interfaces.base import (
File, BaseInterfaceInputSpec, TraitedSpec, SimpleInterface, traits
)
from ..viz.plots import fMRIPlot
Expand Down
12 changes: 6 additions & 6 deletions niworkflows/interfaces/registration.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,12 @@
from nilearn import image as nli
from nilearn.image import index_img
from .. import NIWORKFLOWS_LOG
from ..nipype.utils.filemanip import fname_presuffix
from ..nipype.interfaces.base import (
from nipype.utils.filemanip import fname_presuffix
from nipype.interfaces.base import (
traits, isdefined, TraitedSpec, BaseInterfaceInputSpec, File, SimpleInterface)
from ..nipype.interfaces.mixins import reporting
from ..nipype.interfaces import freesurfer as fs
from ..nipype.interfaces import fsl, ants, afni
from nipype.interfaces.mixins import reporting
from nipype.interfaces import freesurfer as fs
from nipype.interfaces import fsl, ants, afni

from . import report_base as nrc
from .mni import (
Expand Down Expand Up @@ -417,7 +417,7 @@ def _run_interface(self, runtime):


def _get_vols_to_discard(img):
from niworkflows.nipype.algorithms.confounds import is_outlier
from nipype.algorithms.confounds import is_outlier
data_slice = img.dataobj[:, :, :, :50]
global_signal = data_slice.mean(axis=0).mean(axis=0).mean(axis=0)
return is_outlier(global_signal)
4 changes: 2 additions & 2 deletions niworkflows/interfaces/report_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
from nilearn.masking import apply_mask, unmask
from nilearn.image import threshold_img, load_img

from ..nipype.interfaces.base import File, traits
from ..nipype.interfaces.mixins import reporting
from nipype.interfaces.base import File, traits
from nipype.interfaces.mixins import reporting
from .. import NIWORKFLOWS_LOG
from ..viz.utils import cuts_from_bbox, compose_view

Expand Down
6 changes: 3 additions & 3 deletions niworkflows/interfaces/segmentation.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@
from __future__ import absolute_import, division, print_function, unicode_literals
import os

from ..nipype.interfaces.base import File
from ..nipype.interfaces import fsl, freesurfer
from ..nipype.interfaces.mixins import reporting
from nipype.interfaces.base import File
from nipype.interfaces import fsl, freesurfer
from nipype.interfaces.mixins import reporting
from . import report_base as nrc
from .. import NIWORKFLOWS_LOG

Expand Down
8 changes: 4 additions & 4 deletions niworkflows/interfaces/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@
from textwrap import indent

from .. import __version__
from ..nipype import logging
from ..nipype.utils.filemanip import fname_presuffix
from ..nipype.utils.misc import normalize_mc_params
from ..nipype.interfaces.base import (
from nipype import logging
from nipype.utils.filemanip import fname_presuffix
from nipype.utils.misc import normalize_mc_params
from nipype.interfaces.base import (
File, BaseInterfaceInputSpec, TraitedSpec, traits, SimpleInterface
)

Expand Down
1 change: 0 additions & 1 deletion niworkflows/nipype

This file was deleted.

2 changes: 1 addition & 1 deletion niworkflows/tests/test_registration.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
import os
from shutil import copy

from niworkflows.nipype.interfaces.base import Bunch
from nipype.interfaces.base import Bunch
from niworkflows.interfaces.registration import (
FLIRTRPT, RobustMNINormalizationRPT, ANTSRegistrationRPT, BBRegisterRPT,
MRICoregRPT, ApplyXFMRPT, SimpleBeforeAfterRPT)
Expand Down
4 changes: 2 additions & 2 deletions niworkflows/tests/test_segmentation.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
from shutil import copy
import pytest

from niworkflows.nipype.interfaces.base import Bunch
from nipype.interfaces.base import Bunch
from niworkflows.interfaces.segmentation import FASTRPT, ReconAllRPT
from niworkflows.interfaces.masks import (
BETRPT, BrainExtractionRPT, SimpleShowMaskRPT, ROIsPlot
Expand Down Expand Up @@ -102,7 +102,7 @@ def _agg(objekt, runtime):
@pytest.mark.parametrize("segments", [True, False])
def test_FASTRPT(monkeypatch, segments, reference, reference_mask):
""" test FAST with the two options for segments """
from niworkflows.nipype.interfaces.fsl.maths import ApplyMask
from nipype.interfaces.fsl.maths import ApplyMask

def _agg(objekt, runtime):
outputs = Bunch(tissue_class_map=os.path.join(
Expand Down
2 changes: 1 addition & 1 deletion niworkflows/viz/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
from seaborn import color_palette

from .. import NIWORKFLOWS_LOG
from ..nipype.utils import filemanip
from nipype.utils import filemanip

try:
from shutil import which
Expand Down
4 changes: 1 addition & 3 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,7 @@ def main():
tests_require=ldict['TESTS_REQUIRES'],
extras_require=ldict['EXTRA_REQUIRES'],
# Data
package_data={'niworkflows': ['data/t1-mni_registration*.json',
'nipype/pipeline/engine/report_template.html',
'nipype/external/d3.js']},
package_data={'niworkflows': ['data/t1-mni_registration*.json']},
include_package_data=True,
)

Expand Down