Skip to content

Commit 59c38d7

Browse files
committed
Merge branch 'master' into enh/DipyImproveTDI
Conflicts: CHANGES
2 parents 3c072e8 + 82107dd commit 59c38d7

File tree

7 files changed

+26
-4
lines changed

7 files changed

+26
-4
lines changed

CHANGES

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,12 @@ Next release
22
============
33

44
* ENH: Improved TrackDensityMap of dipy (https://github.com/nipy/nipype/pull/1091)
5+
* FIX: Enable absolute path definitions in DCMStack (https://github.com/nipy/nipype/pull/1089)
6+
* ENH: New algorithm: mesh.WarpPoints applies displacements fields to point sets.
7+
* ENH: Improved FieldMap-Based (FMB) workflow for correction of susceptibility distortions
8+
in EPI seqs. (https://github.com/nipy/nipype/pull/1019)
9+
* ENH: Added interface to simulate DWIs using the multi-tensor model
10+
(https://github.com/nipy/nipype/pull/1085)
511
* ENH: New mesh.MeshWarpMaths to operate on surface-defined warpings
612
(https://github.com/nipy/nipype/pull/1016)
713
* FIX: Refactor P2PDistance, change name to ComputeMeshWarp, add regression tests,

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: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1951,7 +1951,7 @@ def _list_outputs(self):
19511951
if not isdefined(self.inputs.out_file):
19521952
out_file = op.abspath('datasink.json')
19531953
else:
1954-
out_file = self.inputs.out_file
1954+
out_file = op.abspath(self.inputs.out_file)
19551955

19561956
out_dict = self.inputs.in_dict
19571957

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)