Skip to content

Commit

Permalink
Merge pull request #76 from emdupre/outdir-name
Browse files Browse the repository at this point in the history
[FIX] Add fname to TED dirname
  • Loading branch information
emdupre authored Jun 4, 2018
2 parents aed2ecc + 7adb9fe commit 7b197d6
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 6 deletions.
2 changes: 1 addition & 1 deletion circle.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,4 +42,4 @@ jobs:
post: bash <(curl -s https://codecov.io/bash)

- store_artifacts:
path: /home/neuro/code/TED/
path: /home/neuro/code/TED.zcat_ffd/
3 changes: 2 additions & 1 deletion tedana/tests/test_tedana.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,4 +63,5 @@ def test_outputs():
'sphis_hik.nii'
]
for fn in nifti_test_list:
compare_nifti(fn, Path('/home/neuro/data/TED/'), Path('/home/neuro/code/TED/'))
compare_nifti(fn, Path('/home/neuro/data/TED/'),
Path('/home/neuro/code/TED.zcat_ffd/'))
4 changes: 2 additions & 2 deletions tedana/utils/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -125,8 +125,8 @@ def load_data(data, n_echos=None):
-------
fdata : (S x E x T) :obj:`numpy.ndarray`
Output data where `S` is samples, `E` is echos, and `T` is time
ref_img : str
Filepath to reference image for saving output files
ref_img : str or :obj:`numpy.ndarray`
Filepath to reference image for saving output files or NIFTI-like array
"""
if n_echos is None:
raise ValueError('Number of echos must be specified. '
Expand Down
9 changes: 7 additions & 2 deletions tedana/workflows/tedana.py
Original file line number Diff line number Diff line change
Expand Up @@ -102,10 +102,15 @@ def tedana(data, tes, mixm=None, ctab=None, manacc=None, strict=False,

kdaw, rdaw = float(kdaw), float(rdaw)

try:
ref_label = os.path.basename(ref_img).split('.')[0]
except TypeError:
ref_label = os.path.basename(str(data[0])).split('.')[0]

if label is not None:
out_dir = 'TED.{0}'.format(label)
out_dir = 'TED.{0}.{1}'.format(ref_label, label)
else:
out_dir = 'TED'
out_dir = 'TED.{0}'.format(ref_label)
out_dir = op.abspath(out_dir)
if not op.isdir(out_dir):
LGR.info('Creating output directory: {}'.format(out_dir))
Expand Down

0 comments on commit 7b197d6

Please sign in to comment.