Skip to content

Commit

Permalink
changelog + func skullstrip
Browse files Browse the repository at this point in the history
  • Loading branch information
chrisgorgo committed Nov 17, 2017
1 parent f25bceb commit 51fc495
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 12 deletions.
6 changes: 5 additions & 1 deletion CHANGES.txt
Original file line number Diff line number Diff line change
@@ -1,9 +1,13 @@
0.9.10
======

* [FIX] Updated AFNI to 17.3.03. Resolves errors regarding opening display by 3dSkullStrip (#669)

0.9.9
=====

* [ENH] Update nipype to fix $DISPLAY problem of AFNI's 3dSkullStrip


0.9.8
=====

Expand Down
14 changes: 3 additions & 11 deletions mriqc/workflows/anatomical.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@
from ..interfaces import (StructuralQC, ArtifactMask, ReadSidecarJSON,
ConformImage, ComputeQI2, IQMFileSink, RotationMask)
from ..utils.misc import check_folder
from distutils.version import StrictVersion
from .utils import get_fwhmx
WFLOGGER = logging.getLogger('mriqc.workflow')


Expand Down Expand Up @@ -242,16 +242,7 @@ def compute_iqms(settings, modality='T1w', name='ComputeIQMs'):
}

# AFNI check smoothing
fwhm_args = {"combine": True,
"detrend": True}
afni_version_tpl = afni.Info.version()
afni_version = StrictVersion(".".join([str(afni_version_tpl[0]),
str(afni_version_tpl[1]),
str(afni_version_tpl[2])]))
if afni_version >= StrictVersion("2017.2.3"):
fwhm_args['args'] = '-ShowMeClassicFWHM'
fwhm_args['acf'] = True
fwhm_interface = afni.FWHMx(**fwhm_args)
fwhm_interface = get_fwhmx()

fwhm = pe.Node(fwhm_interface, name='smoothness')

Expand Down Expand Up @@ -319,6 +310,7 @@ def _getwm(inlist):
])
return workflow


def individual_reports(settings, name='ReportsWorkflow'):
"""
Encapsulates nodes writing plots
Expand Down
2 changes: 2 additions & 0 deletions mriqc/workflows/functional.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@
from niworkflows.nipype.interfaces import utility as niu
from niworkflows.nipype.interfaces import afni, ants, fsl

from .utils import get_fwhmx
from .. import DEFAULTS, logging
from ..interfaces import ReadSidecarJSON, FunctionalQC, Spikes, IQMFileSink
from ..utils.misc import check_folder, reorient_and_discard_non_steady
Expand Down Expand Up @@ -222,6 +223,7 @@ def compute_iqms(settings, name='ComputeIQMs'):
mem_gb=biggest_file_gb * 3)

# AFNI quality measures
fwhm_interface = get_fwhmx()
fwhm = pe.Node(afni.FWHMx(combine=True, detrend=True), name='smoothness')
# fwhm.inputs.acf = True # add when AFNI >= 16
outliers = pe.Node(afni.OutlierCount(fraction=True, out_file='outliers.out'),
Expand Down
15 changes: 15 additions & 0 deletions mriqc/workflows/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@
# @Last modified by: oesteban
"""Helper functions for the workflows"""
from __future__ import print_function, division, absolute_import, unicode_literals
from distutils.version import StrictVersion
from niworkflows.nipype.interfaces import afni
from builtins import range

def _tofloat(inlist):
Expand Down Expand Up @@ -160,3 +162,16 @@ def slice_wise_fft(in_file, ftmask=None, spike_thres=3., out_prefix=None):
np.savetxt(out_spikes, spikes_list, fmt=b'%d', delimiter=b'\t', header='TR\tZ')

return len(spikes_list), out_spikes, out_fft

def get_fwhmx():
fwhm_args = {"combine": True,
"detrend": True}
afni_version_tpl = afni.Info.version()
afni_version = StrictVersion(".".join([str(afni_version_tpl[0]),
str(afni_version_tpl[1]),
str(afni_version_tpl[2])]))
if afni_version >= StrictVersion("2017.2.3"):
fwhm_args['args'] = '-ShowMeClassicFWHM'
fwhm_args['acf'] = True
fwhm_interface = afni.FWHMx(**fwhm_args)
return fwhm_interface

0 comments on commit 51fc495

Please sign in to comment.