preprocessed-connectomes-project / quality-assessment-protocol

Scripts and documentation for the PCP's protocol for assessing data quality.
BSD 3-Clause "New" or "Revised" License
40 stars 23 forks source link

Anatomical spatial: 3dFWHMx ValueError #116

Open sgiavasis opened 6 years ago

sgiavasis commented 6 years ago

A QAP user was getting this error when running anatomical spatial:

Traceback (most recent call last): File "/usr/local/lib/python2.7/dist-packages/nipype/pipeline/plugins/multiproc.py", line 49, in run_node result['result'] = node.run(updatehash=updatehash) File "/usr/local/lib/python2.7/dist-packages/nipype/pipeline/engine/nodes.py", line 394, in run self._run_interface() File "/usr/local/lib/python2.7/dist-packages/nipype/pipeline/engine/nodes.py", line 504, in _run_interface self._result = self._run_command(execute) File "/usr/local/lib/python2.7/dist-packages/nipype/pipeline/engine/nodes.py", line 630, in _run_command result = self._interface.run() File "/usr/local/lib/python2.7/dist-packages/nipype/interfaces/base.py", line 1043, in run runtime = self._run_wrapper(runtime) File "/usr/local/lib/python2.7/dist-packages/nipype/interfaces/base.py", line 1000, in _run_wrapper runtime = self._run_interface(runtime) File "/usr/local/lib/python2.7/dist-packages/nipype/interfaces/utility.py", line 499, in _run_interface out = function_handle(**args) File "", line 97, in qap_anatomical_spatial File "/home/pbosco/.local/lib/python2.7/site-packages/qap/spatial_qc.py", line 351, in fwhm vals = vals / pixdim ValueError: operands could not be broadcast together with shapes (8,) (4,) Interface Function failed to run.

He proposed this fix in spatial_qc.py, as 3dFWHMx now produces 8 values instead of 4:

vals_full = np.array(retcode.split(), dtype=np.float)
ind_pos = np.array([4,5,6,7])
vals = vals_full[ind_pos]