8000 FIX: Address non-empty take from empty axes (anatomical IQMs) by oesteban · Pull Request #1077 · nipreps/mriqc · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

FIX: Address non-empty take from empty axes (anatomical IQMs) #1077

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Mar 8, 2023

Conversation

oesteban
Copy link
Member
@oesteban oesteban commented Mar 6, 2023

This patch addresses this problem encountered in some occassions, where the mask on which summary stats are to be calculated is too small.

Fixes: #1048.
Fixes: #868.

This patch addresses this problem encountered in some occassions,
where the mask on which summary stats are to be calculated is too small.

Fixes: #1048.
Fixes: #868.
@oesteban
Copy link
Member Author
oesteban commented Mar 6, 2023

@demidenm could you test this branch?

@demidenm
Copy link
demidenm commented Mar 6, 2023

@oesteban - Thanks for the help with this & the follow up!

I couldn't easily test the branch but I pulled the anatomical.py so I used the following to test it on two subjects:

...
sif_img=mriqc_22.0.6.sif
anatpy_new=anatomical.py
anatpy_old=/opt/conda/lib/python3.9/site-packages/mriqc/qc/anatomical.py
...
singularity run --cleanenv \
-B ${data_dir}/bids_dir/sub-${subj_id}_ses-${ses_id}:/bids_dir \
-B ${data_dir}/processed/mriqc_v22_0_6/sub-${subj_id}_ses-${ses_id}:/output_dir \
-B ${data_dir}/work_dir/mriqc_v22_0_6/sub-${subj_id}_ses-${ses_id}:/wd \
-B ${anatpy_new}:${anatpy_old} \
${sif_img} \ 
...

I got the following error:

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/functional.py", line 119, in _run_interface
    stats = summary_stats(epidata, mskdata, erode=True)
  File "/opt/conda/lib/python3.9/site-packages/mriqc/qc/anatomical.py", line 607, in summary_stats
    nvox = mask.sum()
AttributeError: 'tuple' object has no attribute 'sum'

@oesteban
Copy link
Member Author
oesteban commented Mar 7, 2023

@demidenm thanks for your patience -- I made a mistake, which I hope I fixed in the latest commit.

@demidenm
Copy link
demidenm commented Mar 7, 2023

@oesteban - thanks for the help and follow up. It looks like that error was resolved but I am getting the following issue now. Not sure whether this is because I am using mriqc v22.0.6 and there is a newer tag v23.0.0?

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 462, in art_qi2
    from nireports.reportlets.nuisance import plot_qi2
ModuleNotFoundError: No module named 'nireports'

@oesteban
Copy link
Member Author
oesteban commented Mar 8, 2023

Not sure whether this is because I am using mriqc v22.0.6 and there is a newer tag v23.0.0

Correct - we are preparing for a new 23.0.0 release. I will try to back-propagate this patch to the 22.x series though.

Thanks for the debugging!

@oesteban oesteban merged commit 9ee4e7d into master Mar 8, 2023
@oesteban oesteban deleted the fix/1048-non-empty-take branch March 8, 2023 16:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

MRIQC IndexError - 'Cannot do a non-empty take from an empty axes' IndexError: cannot do a non-empty take from an empty axes.
2 participants
0