Skip to content

Commit 354371c

Browse files
committed
Merge branch 'master' into enh/DipyMultiTensorSimulate
Conflicts: CHANGES
2 parents 3091e7e + 82107dd commit 354371c

File tree

7 files changed

+33
-5
lines changed

7 files changed

+33
-5
lines changed

CHANGES

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
Next release
22
============
33

4+
* FIX: Enable absolute path definitions in DCMStack (https://github.com/nipy/nipype/pull/1089)
5+
* ENH: New algorithm: mesh.WarpPoints applies displacements fields to point sets.
6+
* ENH: Improved FieldMap-Based (FMB) workflow for correction of susceptibility distortions
7+
in EPI seqs. (https://github.com/nipy/nipype/pull/1019)
48
* ENH: Added interface to simulate DWIs using the multi-tensor model
59
(https://github.com/nipy/nipype/pull/1085)
610
* ENH: New mesh.MeshWarpMaths to operate on surface-defined warpings
@@ -52,6 +56,7 @@ Next release
5256
* ENH: ANTs JointFusion() (https://github.com/nipy/nipype/pull/1042)
5357
* ENH: Added csvReader() utility (https://github.com/nipy/nipype/pull/1044)
5458
* FIX: typo in nipype.interfaces.freesurfer.utils.py Tkregister2 (https://github.com/nipy/nipype/pull/1083)
59+
* FIX: SSHDataGrabber outputs now return full path to the grabbed/downloaded files. (https://github.com/nipy/nipype/pull/1086)
5560

5661
Release 0.10.0 (October 10, 2014)
5762
============

nipype/interfaces/dcmstack.py

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,12 +42,15 @@ def sanitize_path_comp(path_comp):
4242
result.append(char)
4343
return ''.join(result)
4444

45+
4546
class NiftiGeneratorBaseInputSpec(TraitedSpec):
4647
out_format = traits.Str(desc="String which can be formatted with "
4748
"meta data to create the output filename(s)")
48-
out_ext = traits.Str('.nii.gz',
49-
usedefault=True,
49+
out_ext = traits.Str('.nii.gz', usedefault=True,
5050
desc="Determines output file type")
51+
use_cwd = traits.Bool(True, usedefault=True,
52+
desc='use interface\'s current working directory')
53+
5154

5255
class NiftiGeneratorBase(BaseInterface):
5356
'''Base class for interfaces that produce Nifti files, potentially with
@@ -73,7 +76,12 @@ def _get_out_path(self, meta, idx=None):
7376
out_fmt = '-'.join(out_fmt)
7477
out_fn = (out_fmt % meta) + self.inputs.out_ext
7578
out_fn = sanitize_path_comp(out_fn)
76-
return path.join(os.getcwd(), out_fn)
79+
80+
if self.inputs.use_cwd:
81+
return path.join(os.getcwd(), out_fn)
82+
else:
83+
return path.abspath(out_fn)
84+
7785

7886
class DcmStackInputSpec(NiftiGeneratorBaseInputSpec):
7987
dicom_files = traits.Either(InputMultiPath(File(exists=True)),

nipype/interfaces/io.py

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1775,13 +1775,20 @@ def _list_outputs(self):
17751775
outputs[key].append(list_to_filename(outfiles))
17761776
if self.inputs.download_files:
17771777
for f in outfiles:
1778-
sftp.get(os.path.join(filledtemplate_dir, f), f)
1778+
try:
1779+
sftp.get(os.path.join(filledtemplate_dir, f), f)
1780+
except IOError:
1781+
iflogger.info('remote file %s not found' % f)
17791782
if any([val is None for val in outputs[key]]):
17801783
outputs[key] = []
17811784
if len(outputs[key]) == 0:
17821785
outputs[key] = None
17831786
elif len(outputs[key]) == 1:
17841787
outputs[key] = outputs[key][0]
1788+
1789+
for k, v in outputs.items():
1790+
outputs[k] = os.path.join(os.getcwd(), v)
1791+
17851792
return outputs
17861793

17871794
def _get_ssh_client(self):
@@ -1944,7 +1951,7 @@ def _list_outputs(self):
19441951
if not isdefined(self.inputs.out_file):
19451952
out_file = op.abspath('datasink.json')
19461953
else:
1947-
out_file = self.inputs.out_file
1954+
out_file = op.abspath(self.inputs.out_file)
19481955

19491956
out_dict = self.inputs.in_dict
19501957

nipype/interfaces/tests/test_auto_DcmStack.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@ def test_DcmStack_inputs():
1313
out_ext=dict(usedefault=True,
1414
),
1515
out_format=dict(),
16+
use_cwd=dict(usedefault=True,
17+
),
1618
)
1719
inputs = DcmStack.input_spec()
1820

nipype/interfaces/tests/test_auto_GroupAndStack.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@ def test_GroupAndStack_inputs():
1313
out_ext=dict(usedefault=True,
1414
),
1515
out_format=dict(),
16+
use_cwd=dict(usedefault=True,
17+
),
1618
)
1719
inputs = GroupAndStack.input_spec()
1820

nipype/interfaces/tests/test_auto_MergeNifti.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@ def test_MergeNifti_inputs():
1010
),
1111
out_format=dict(),
1212
sort_order=dict(),
13+
use_cwd=dict(usedefault=True,
14+
),
1315
)
1416
inputs = MergeNifti.input_spec()
1517

nipype/interfaces/tests/test_auto_SplitNifti.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@ def test_SplitNifti_inputs():
99
),
1010
out_format=dict(),
1111
split_dim=dict(),
12+
use_cwd=dict(usedefault=True,
13+
),
1214
)
1315
inputs = SplitNifti.input_spec()
1416

0 commit comments

Comments
 (0)