Skip to content

[MAINT] Reorganize nipype.interfaces.base #2303

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 31 commits into from
Dec 5, 2017
Merged
Show file tree
Hide file tree
Changes from 22 commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
7b2b350
move _exists_in_path to filemanip, and update
oesteban Nov 22, 2017
f6f97b6
use nipype's which in nifty package
oesteban Nov 22, 2017
a984f9f
ensure which call in ants/segmentation is correct)
oesteban Nov 22, 2017
8b56e12
ensure which calls in interfaces/base are correct
oesteban Nov 22, 2017
6676d22
cleaning up imports
oesteban Nov 22, 2017
d6a4b90
move from base with deprecation the load_template method
oesteban Nov 23, 2017
833d716
mv Multi- traits to traits_extension
oesteban Nov 23, 2017
82411ae
deep refactor of nipype.interfaces.base
oesteban Nov 23, 2017
d9c7f3d
fix final errors and wrong imports
oesteban Nov 23, 2017
d663e2f
test passing locally
oesteban Nov 23, 2017
8629376
remove some unicode prefixes
oesteban Nov 23, 2017
6949323
simplify fname_presuffix adding test
oesteban Nov 23, 2017
4e37641
run test in temp directory
oesteban Nov 23, 2017
672d1a0
add some docstrings
oesteban Nov 23, 2017
92a8ce5
fixup DictStrStr
oesteban Nov 26, 2017
3b83940
member could be function, and use filemanip.hash_infile
oesteban Nov 26, 2017
59ae74c
amend to previous commit
oesteban Nov 26, 2017
290eb77
minor fixes
oesteban Nov 26, 2017
67491af
Merge remote-tracking branch 'upstream/master' into ref/interface-base
oesteban Nov 29, 2017
e5bb856
Merge branch 'ref/interface-base' of github.com:oesteban/nipype into …
oesteban Nov 29, 2017
281c0e7
Merge remote-tracking branch 'upstream/master' into ref/interface-base
oesteban Dec 2, 2017
5758373
change dict_ when they are list_
oesteban Dec 2, 2017
b454961
set base_dir
oesteban Dec 3, 2017
98f5c31
move fsl.model templates
oesteban Dec 3, 2017
79c22ee
final fixes
oesteban Dec 3, 2017
9147408
move tests, update specs
oesteban Dec 4, 2017
86792b9
split huge test_base into pieces
oesteban Dec 4, 2017
15cd86f
fix imports in new tests
oesteban Dec 4, 2017
609c505
Merge branch 'ref/interface-base' of github.com:oesteban/nipype into …
oesteban Dec 4, 2017
50580aa
fix tests
oesteban Dec 4, 2017
5512779
update specs [skip ci]
oesteban Dec 5, 2017
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
2 changes: 1 addition & 1 deletion nipype/interfaces/ants/registration.py
Original file line number Diff line number Diff line change
Expand Up @@ -1303,7 +1303,7 @@ class MeasureImageSimilarity(ANTSCommand):
>>> sim.inputs.fixed_image_mask = 'mask.nii'
>>> sim.inputs.moving_image_mask = 'mask.nii.gz'
>>> sim.cmdline
u'MeasureImageSimilarity --dimensionality 3 --masks ["mask.nii","mask.nii.gz"] \
'MeasureImageSimilarity --dimensionality 3 --masks ["mask.nii","mask.nii.gz"] \
--metric MI["T1.nii","resting.nii",1.0,5,Regular,1.0]'
"""
_cmd = 'MeasureImageSimilarity'
Expand Down
9 changes: 4 additions & 5 deletions nipype/interfaces/ants/segmentation.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,8 @@

import os
from ...external.due import BibTeX
from ...utils.filemanip import split_filename, copyfile
from ..base import (TraitedSpec, File, traits, InputMultiPath, OutputMultiPath, isdefined,
_exists_in_path)
from ...utils.filemanip import split_filename, copyfile, which
from ..base import TraitedSpec, File, traits, InputMultiPath, OutputMultiPath, isdefined
from .base import ANTSCommand, ANTSCommandInputSpec


Expand Down Expand Up @@ -724,7 +723,7 @@ def _run_interface(self, runtime, correct_return_codes=(0,)):
if ants_path is None:
# Check for antsRegistration, which is under bin/ (the $ANTSPATH) instead of
# checking for antsBrainExtraction.sh which is under script/
_, cmd_path = _exists_in_path('antsRegistration', runtime.environ)
cmd_path = which('antsRegistration', env=runtime.environ)
if not cmd_path:
raise RuntimeError(
'The environment variable $ANTSPATH is not defined in host "%s", '
Expand Down Expand Up @@ -1326,7 +1325,7 @@ class KellyKapowski(ANTSCommand):
>>> kk.inputs.number_integration_points = 10
>>> kk.inputs.thickness_prior_estimate = 10
>>> kk.cmdline
u'KellyKapowski --convergence "[45,0.0,10]" \
'KellyKapowski --convergence "[45,0.0,10]" \
--output "[segmentation0_cortical_thickness.nii.gz,segmentation0_warped_white_matter.nii.gz]" \
--image-dimensionality 3 --gradient-step 0.025000 --number-of-integration-points 10 \
--segmentation-image "[segmentation0.nii.gz,2,3]" --smoothing-variance 1.000000 \
Expand Down
31 changes: 31 additions & 0 deletions nipype/interfaces/base/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# -*- coding: utf-8 -*-
# emacs: -*- mode: python; py-indent-offset: 4; indent-tabs-mode: nil -*-
# vi: set ft=python sts=4 ts=4 sw=4 et:
"""
Nipype base interfaces
----------------------

This module defines the API of all nipype interfaces.

"""
from .core import (
Interface, BaseInterface, SimpleInterface,
CommandLine, StdOutCommandLine,
MpiCommandLine, SEMLikeCommandLine, PackageInfo
)

from .specs import (
BaseTraitedSpec, TraitedSpec, DynamicTraitedSpec,
BaseInterfaceInputSpec, CommandLineInputSpec,
StdOutCommandLineInputSpec
)

from .traits_extension import (
traits, Undefined, TraitDictObject, TraitListObject, TraitError, isdefined,
File, Directory, Str, DictStrStr, has_metadata, ImageFile,
MultiPath, OutputMultiPath, InputMultiPath)

from .support import (
Bunch, InterfaceResult, load_template,
NipypeInterfaceError
)
Loading