poldracklab / tacc-openneuro

0 stars 1 forks source link

ds003688-mriqc: "ValueError: zero-size array to reduction operation minimum which has no identity" #54

Open jbwexler opened 1 year ago

jbwexler commented 1 year ago

Just sub-30.

Node: mriqc_wf.anatMRIQC.ComputeIQMs.ComputeQI2 Working directory: /scratch1/03201/jbwexler/work_dir/mriqc/ds003688_sub-30/mriqc_wf/anatMRIQC/ComputeIQMs/_infile..scratch1..03201..jbwexler..openneuro_derivatives..derivatives..mriqc..ds003688-mriqc..sourcedata..raw..sub-30..ses-7t1..anat..sub-30_ses-7t1_run-1_T1w.nii.gz/ComputeQI2

Node inputs:

air_msk = in_file =

Traceback (most recent call last): File "/opt/conda/lib/python3.9/site-packages/mriqc/engine/plugin.py", line 60, in run_node result["result"] = node.run(updatehash=updatehash) File "/opt/conda/lib/python3.9/site-packages/nipype/pipeline/engine/nodes.py", line 524, in run result = self._run_interface(execute=True) File "/opt/conda/lib/python3.9/site-packages/nipype/pipeline/engine/nodes.py", line 642, in _run_interface return self._run_command(execute) File "/opt/conda/lib/python3.9/site-packages/nipype/pipeline/engine/nodes.py", line 750, in _run_command raise NodeExecutionError( nipype.pipeline.engine.nodes.NodeExecutionError: Exception raised while executing Node ComputeQI2.

Traceback (most recent call last): File "/opt/conda/lib/python3.9/site-packages/nipype/interfaces/base/core.py", line 398, in run runtime = self._run_interface(runtime) File "/opt/conda/lib/python3.9/site-packages/mriqc/interfaces/anatomical.py", line 386, in _run_interface qi2, out_file = art_qi2(imdata, airdata) File "/opt/conda/lib/python3.9/site-packages/mriqc/qc/anatomical.py", line 494, in art_qi2 param = chi2.fit(modelx[modelx < np.percentile(data, 95)], 32) File "/opt/conda/lib/python3.9/site-packages/scipy/stats/_distn_infrastructure.py", line 2513, in fit start = self._fitstart(data) File "/opt/conda/lib/python3.9/site-packages/scipy/stats/_distn_infrastructure.py", line 2279, in _fitstart loc, scale = self._fit_loc_scale_support(data, *args) File "/opt/conda/lib/python3.9/site-packages/scipy/stats/_distn_infrastructure.py", line 2590, in _fit_loc_scale_support data_a = np.min(data) File "<__array_function__ internals>", line 180, in amin File "/opt/conda/lib/python3.9/site-packages/numpy/core/fromnumeric.py", line 2916, in amin return _wrapreduction(a, np.minimum, 'min', axis, None, out, File "/opt/conda/lib/python3.9/site-packages/numpy/core/fromnumeric.py", line 86, in _wrapreduction return ufunc.reduce(obj, axis, dtype, out, **passkwargs) ValueError: zero-size array to reduction operation minimum which has no identity

jbwexler commented 1 year ago

So this image is a 7T T1w and is the only 7T in the dataset. I can't tell if there's an issue with the image https://openneuro.org/datasets/ds003688/versions/1.0.7/file-display/sub-30:ses-7t1:anat:sub-30_ses-7t1_run-1_T1w.nii.gz

@effigies, take a look if you get a chance.

effigies commented 1 year ago

Looking at the traceback, we almost certainly got an empty mask when calling modelx[modelx < np.percentile(data, 95)]. This needs to program more defensively, either checking for an empty mask or catching an exception. This is a problem for MRIQC and because it's MP2RAGE it may be out-of-scope. I would skip this subject for now.

jbwexler commented 1 year ago

Should we make an mriqc issue for this? Or did you already?

effigies commented 1 year ago

No, I haven't. We need to.