nipreps / smriprep

Structural MRI PREProcessing (sMRIPrep) workflows for NIPreps (NeuroImaging PREProcessing tools)

Home Page:https://nipreps.github.io/smriprep

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

`FSSurfaceReport` MGHImage incompatibility

mgxd opened this issue · comments

This has started popping up in nibabies CI

Node: nibabies_23_0_wf.single_subject_01_1mo_wf.infant_anat_wf.anat_reports_wf.recon_report
Working directory: /scratch/nibabies_23_0_wf/single_subject_01_1mo_wf/infant_anat_wf/anat_reports_wf/recon_report

Node inputs:

compress_report = auto
hemi = both
out_report = report.svg
subject_id = <undefined>
subjects_dir = <undefined>

Traceback (most recent call last):
  File "/opt/conda/lib/python3.9/site-packages/nipype/pipeline/plugins/multiproc.py", line 67, in run_node
    result["result"] = node.run(updatehash=updatehash)
  File "/opt/conda/lib/python3.9/site-packages/nipype/pipeline/engine/nodes.py", line 527, in run
    result = self._run_interface(execute=True)
  File "/opt/conda/lib/python3.9/site-packages/nipype/pipeline/engine/nodes.py", line 645, in _run_interface
    return self._run_command(execute)
  File "/opt/conda/lib/python3.9/site-packages/nipype/pipeline/engine/nodes.py", line 771, in _run_command
    raise NodeExecutionError(msg)
nipype.pipeline.engine.nodes.NodeExecutionError: Exception raised while executing Node recon_report.

Traceback:
	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/smriprep/interfaces/reports.py", line 197, in _run_interface
	    plot_registration(
	  File "/opt/conda/lib/python3.9/site-packages/niworkflows/viz/utils.py", line 377, in plot_registration
	    display = plot_anat(anat_nii, **plot_params)
	  File "/opt/conda/lib/python3.9/site-packages/nilearn/plotting/img_plotting.py", line 472, in plot_anat
	    display = plot_img(anat_img, cut_coords=cut_coords,
	  File "/opt/conda/lib/python3.9/site-packages/nilearn/plotting/img_plotting.py", line 264, in plot_img
	    display = _plot_img_with_bg(
	  File "/opt/conda/lib/python3.9/site-packages/nilearn/plotting/img_plotting.py", line 201, in _plot_img_with_bg
	    display.add_overlay(new_img_like(img, data, affine),
	  File "/opt/conda/lib/python3.9/site-packages/nilearn/plotting/displays/_slicers.py", line 273, in add_overlay
	    ims = self._map_show(img, type='imshow', threshold=threshold, **kwargs)
	  File "/opt/conda/lib/python3.9/site-packages/nilearn/plotting/displays/_slicers.py", line 349, in _map_show
	    img = reorder_img(img, resample=resampling_interpolation)
	  File "/opt/conda/lib/python3.9/site-packages/nilearn/image/resampling.py", line 740, in reorder_img
	    return resample_img(img, target_affine=target_affine,
	  File "/opt/conda/lib/python3.9/site-packages/nilearn/image/resampling.py", line 451, in resample_img
	    sform, sform_code = img.get_sform(coded=True)
	AttributeError: 'MGHImage' object has no attribute 'get_sform'

The problematic section

_anat_file = str(rootdir / "mri" / "brain.mgz")
_contour_file = str(rootdir / "mri" / "ribbon.mgz")

Tested coercing these MGHImages into Nifti1Images, and it seemed to do the trick. I'm not entirely sure what package upgrade is causing this..

Nilearn had a recent release. This doesn't look like anything that would have changed in nibabel.