Skip to content
This repository was archived by the owner on Dec 27, 2022. It is now read-only.

Commit 1e20804

Browse files
author
Adam Richie-Halford
committed
Respond to Anisha's suggestions
1 parent 9a02b6d commit 1e20804

File tree

1 file changed

+7
-8
lines changed

1 file changed

+7
-8
lines changed

dmriprep/run.py

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -321,36 +321,33 @@ def num_outliers(scan, outliers):
321321
wf.connect(prep, "fsl_eddy.out_outlier_report",
322322
drop_outliers, "outlier_report")
323323

324-
def save_outlier_list(drop_scans, outpath):
324+
def save_outlier_list(drop_scans):
325325
"""Save list of outlier scans to file
326326
327327
Parameters
328328
----------
329329
drop_scans: numpy.ndarray
330330
Path to the fsl_eddy outlier report
331331
332-
outpath: string
333-
Path to output file where list is saved
334-
335332
Returns
336333
-------
337334
outpath: string
338335
Path to output file where list is saved
339336
"""
340337
import numpy as np
338+
import os.path as op
339+
outpath = op.abspath("dropped_scans.txt")
341340
np.savetxt(outpath, drop_scans, fmt="%d")
342341
return outpath
343342

344343
save_drop_scans = pe.Node(niu.Function(
345-
input_names=["drop_scans", "outpath"],
344+
input_names=["drop_scans"],
346345
output_names=["outpath"],
347346
function=save_outlier_list),
348347
name="save_drop_scans"
349348
)
350349

351-
wf.connect(drop_outliers, "drop_scans",
352-
save_drop_scans, "drop_scans")
353-
save_drop_scans.inputs.outpath = op.join(working_dir, 'outlier_report.txt')
350+
wf.connect(drop_outliers, "drop_scans", save_drop_scans, "drop_scans")
354351

355352
merge = pe.Node(fsl.Merge(dimension='t'), name="mergeAPPA")
356353
merge.inputs.in_files = [dwi_file_AP, dwi_file_PA]
@@ -471,6 +468,8 @@ def get_orig(subjects_dir, sub):
471468
wf.connect(prep, "fsl_eddy.out_shell_alignment_parameters",
472469
datasink, "dmriprep.qc.@eddyparamsshellalign")
473470

471+
wf.connect(save_drop_scans, "outpath", datasink, "dmriprep.qc.@droppedscans")
472+
474473
wf.connect(get_tensor, "out_file", datasink, "dmriprep.dti.@tensor")
475474
wf.connect(get_tensor, "fa_file", datasink, "dmriprep.dti.@fa")
476475
wf.connect(get_tensor, "md_file", datasink, "dmriprep.dti.@md")

0 commit comments

Comments
 (0)