Skip to content

Conversation

effigies
Copy link
Member

I haven't yet started stripping down FreeSurfer, but this includes a few baseline changes that I'd like to ensure don't break things before I do.

@effigies effigies force-pushed the maint/streamline branch 2 times, most recently from d166dec to 4157da8 Compare August 19, 2025 13:19
@effigies
Copy link
Member Author

@bilgelm Were you able to test this?

@bilgelm
Copy link

bilgelm commented Aug 19, 2025

@effigies it is currently running on the 4D example data that Martin had provided for the sprint, at smriprep.interfaces.msm.MSM and no errors so far.

I'm getting an error when trying to run on a 3D PET image, though, coming from L390 of interfaces.resampling: mapped_coordinates = ref2vox.map(coordinates) about affine dimension mismatch.

@bilgelm
Copy link

bilgelm commented Aug 20, 2025

Getting the same error with the 4D PET image as well, it just takes some time to get there:

nipype.pipeline.engine.nodes.NodeExecutionError: Exception raised while executing Node petref_pet.

Traceback:
        Traceback (most recent call last):
          File "/opt/conda/envs/petprep/lib/python3.12/site-packages/nipype/interfaces/base/core.py", line 401, in run
            runtime = self._run_interface(runtime)
                      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
          File "/opt/conda/envs/petprep/lib/python3.12/site-packages/petprep/interfaces/resampling.py", line 79, in _run_interface
            resampled = resample_image(
                        ^^^^^^^^^^^^^^^
          File "/opt/conda/envs/petprep/lib/python3.12/site-packages/petprep/interfaces/resampling.py", line 390, in resample_image
            mapped_coordinates = ref2vox.map(coordinates)
                                 ^^^^^^^^^^^^^^^^^^^^^^^^
          File "/opt/conda/envs/petprep/lib/python3.12/site-packages/nitransforms/manip.py", line 155, in map
            x = xfm.map(x, inverse=inverse)
                ^^^^^^^^^^^^^^^^^^^^^^^^^^^
          File "/opt/conda/envs/petprep/lib/python3.12/site-packages/nitransforms/linear.py", line 282, in map
            return affine.dot(coords).T[..., :-1]
                   ^^^^^^^^^^^^^^^^^^
        ValueError: shapes (4,4) and (4619377,3) not aligned: 4 (dim 1) != 4619377 (dim 0)


250819-21:09:27,711 nipype.workflow CRITICAL:
         PETPrep failed: Traceback (most recent call last):
  File "/opt/conda/envs/petprep/lib/python3.12/site-packages/nipype/pipeline/plugins/multiproc.py", line 67, in run_node
    result["result"] = node.run(updatehash=updatehash)
                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/conda/envs/petprep/lib/python3.12/site-packages/nipype/pipeline/engine/nodes.py", line 525, in run
    result = self._run_interface(execute=True)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/conda/envs/petprep/lib/python3.12/site-packages/nipype/pipeline/engine/nodes.py", line 643, in _run_interface
    return self._run_command(execute)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/conda/envs/petprep/lib/python3.12/site-packages/nipype/pipeline/engine/nodes.py", line 769, in _run_command
    raise NodeExecutionError(msg)
nipype.pipeline.engine.nodes.NodeExecutionError: Exception raised while executing Node petref_pet.

Traceback:
        Traceback (most recent call last):
          File "/opt/conda/envs/petprep/lib/python3.12/site-packages/nipype/interfaces/base/core.py", line 401, in run
            runtime = self._run_interface(runtime)
                      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
          File "/opt/conda/envs/petprep/lib/python3.12/site-packages/petprep/interfaces/resampling.py", line 79, in _run_interface
            resampled = resample_image(
                        ^^^^^^^^^^^^^^^
          File "/opt/conda/envs/petprep/lib/python3.12/site-packages/petprep/interfaces/resampling.py", line 390, in resample_image
            mapped_coordinates = ref2vox.map(coordinates)
                                 ^^^^^^^^^^^^^^^^^^^^^^^^
          File "/opt/conda/envs/petprep/lib/python3.12/site-packages/nitransforms/manip.py", line 155, in map
            x = xfm.map(x, inverse=inverse)
                ^^^^^^^^^^^^^^^^^^^^^^^^^^^
          File "/opt/conda/envs/petprep/lib/python3.12/site-packages/nitransforms/linear.py", line 282, in map
            return affine.dot(coords).T[..., :-1]
                   ^^^^^^^^^^^^^^^^^^
        ValueError: shapes (4,4) and (4619377,3) not aligned: 4 (dim 1) != 4619377 (dim 0)

Here's the command I ran:

# DATA_DIR is the data Martin provided for the sprint
# DATA_DIR_COPY is just a copy of that so that petprep can write to derivatives/
docker run -ti --rm \
    -v $DATA_DIR:/data:ro \
    -v $DATA_DIR_COPY/derivatives/freesurfer:/data_fs \
    -v $OUTPUT_DIR:/out \
    -v $FSLICENSE_DIR:/fslicense \
    ghcr.io/nipreps/petprep:maint-streamline /data /out participant \
    --skip_bids_validation \
    --fs-license-file /fslicense/license.txt \
    --fs-no-resume \
    --fs-subjects-dir /data_fs \
    --pvc-tool petpvc \
    --pvc-method GTM \
    --pvc-psf 5 \
    --ref-mask-name cerebellum \
    --ref-mask-index 7 8 46 47 \
    -w /out/work --stop-on-first-crash --write-graph

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.

2 participants