Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,12 @@ TBA

**Changed**:

* Fixed issue where eddy correction would attempt
to QC and fail despite parsing the ``--noqc`` flag.
* SNR plotting works in very specific scenarious when
input DWIs are of the same same dimensions. A try/except
loop now ensure that the entire pipeline doesn't halt
due to errors in plotting.

**Removed**:

Expand Down
4 changes: 2 additions & 2 deletions designer/preprocessing/mrpreproc.py
Original file line number Diff line number Diff line change
Expand Up @@ -303,8 +303,8 @@ def undistort(input, output, rpe='rpe_header', epib0=1,
epib0 : int
Number of reverse PE dir B0 pairs to use in TOPUP correction
(Default: 1)
qc : bool
Specify whether to generate eddy QC metrics (Default: True)
qc : str
Specify path to QC directior. No QC metrics generated if None
nthreads : int, optional
Specify the number of threads to use in processing
(Default: all available threads)
Expand Down
31 changes: 19 additions & 12 deletions designer/pydesigner.py
Original file line number Diff line number Diff line change
Expand Up @@ -591,6 +591,8 @@ def main():
undistorted_name_full = str(step_count)+ '_' + undistorted_name
nii_undistorted = op.join(intermediatepath, undistorted_name_full + '.nii')
mif_undistorted = op.join(outpath, undistorted_name_full + '.mif')
if args.noqc:
eddyqcpath = None
# check to see if this already exists
if not (args.resume and op.exists(nii_undistorted)):
# run undistort function
Expand Down Expand Up @@ -764,15 +766,19 @@ def main():
files = []
files.append(init_nii)
files.append(filetable['HEAD'].getFull())
if 'mask' in filetable:
snr = snrplot.makesnr(dwilist=files,
noisepath=nii_noisemap,
maskpath=filetable['mask'].getFull())
else:
snr = snrplot.makesnr(dwilist=files,
noisepath=filetable['noisemap'].getFull(),
maskpath=None)
snr.makeplot(path=qcpath, smooth=True, smoothfactor=3)
try:
if 'mask' in filetable:
snr = snrplot.makesnr(dwilist=files,
noisepath=nii_noisemap,
maskpath=filetable['mask'].getFull())
else:
snr = snrplot.makesnr(dwilist=files,
noisepath=filetable['noisemap'].getFull(),
maskpath=None)
snr.makeplot(path=qcpath, smooth=True, smoothfactor=3)
except:
print('[WARNING] SNR plotting failed, see above. '
'Proceeding with processing.')

#-----------------------------------------------------------------
# Write logs
Expand Down Expand Up @@ -875,9 +881,10 @@ def main():
if (img.isdti() or img.isdki()) and not args.noakc:
akc_out = img.akcoutliers()
img.akccorrect(akc_out)
dp.writeNii(akc_out,
img.hdr,
op.join(fitqcpath, 'outliers_akc'))
if not args.noqc:
dp.writeNii(akc_out,
img.hdr,
op.join(fitqcpath, 'outliers_akc'))

# reorder tensor for mrtrix3
if 'dki' in img.tensorType():
Expand Down