Skip to content

Commit

Permalink
Merge pull request #175 from josephmje/output-dwi
Browse files Browse the repository at this point in the history
FIX: Output eddy parameter files to work dir instead of input dir
  • Loading branch information
josephmje authored Sep 7, 2021
2 parents 5f6cced + a26d493 commit 510ed0e
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions dmriprep/workflows/dwi/eddy.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
from niworkflows.engine.workflows import LiterateWorkflow as Workflow


def gen_eddy_textfiles(in_file, in_meta):
def gen_eddy_textfiles(in_file, in_meta, newpath=None):
"""
Generate the acquisition-parameters and index files for FSL ``eddy_openmp``.
Expand All @@ -58,10 +58,12 @@ def gen_eddy_textfiles(in_file, in_meta):
from nipype.utils.filemanip import fname_presuffix

# Generate output file name
newpath = Path(newpath or ".")
out_acqparams = fname_presuffix(
in_file,
suffix="_acqparams.txt",
use_ext=False,
newpath=str(newpath.absolute()),
)

pe_dir = in_meta["PhaseEncodingDirection"]
Expand All @@ -80,6 +82,7 @@ def gen_eddy_textfiles(in_file, in_meta):
in_file,
suffix="_index.txt",
use_ext=False,
newpath=str(newpath.absolute()),
)
Path(out_index).write_text(f"{' '.join(['1'] * nb.load(in_file).shape[3])}")
return out_acqparams, out_index
Expand All @@ -102,7 +105,7 @@ def init_eddy_wf(debug=False, name="eddy_wf"):
Outputs
-------
out_eddy
The eddy corrected diffusion image..
The eddy corrected diffusion image
"""
from nipype.interfaces.fsl import Eddy, ExtractROI
Expand Down

0 comments on commit 510ed0e

Please sign in to comment.