Skip to content

Surfa 0.6.3 does not work with numpy 2.x.x #79

Description

@aymenDeemea

Hello, I encountered the following issue when trying to use surfa v0.6.3 with numpy 2.4.6. Could you precise it the issues with numpy>2.x.x are solved in this surfa version or not?

ERROR: [2026-06-17 11:53:02,8080] -- (17906edb) -- --- SynthStrip Error Log ---
TypeError: only 0-dimensional arrays can be converted to Python scalars

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/home/user/app/synthstrip/mri_synthstrip.py", line 306, in <module>
    conformed = frame.conform(
                ^^^^^^^^^^^^^^
  File "/home/user/app/.venv/lib/python3.12/site-packages/surfa/image/framed.py", line 649, in conform
    conformed = conformed.reorient(orientation, copy=False)
                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/user/app/.venv/lib/python3.12/site-packages/surfa/image/framed.py", line 507, in reorient
    world_axes_src[swapped_axis_idx], world_axes_src[i] = world_axes_src[i], world_axes_src[swapped_axis_idx]
                                      ~~~~~~~~~~~~~~^^^
ValueError: setting an array element with a sequence.


ERROR: [2026-06-17 11:53:02,8083] -- (17906edb) -- --- SynthStrip Output Log ---
Configuring model on the CPU
Running SynthStrip model version 1
Excluding CSF from brain boundary
Input image read from: FLAIR.nii.gz
Processing frame (of 1): 1 

ERROR: [2026-06-17 11:53:02,8084] -- Error occurred: SynthStrip failed with exit code 1

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions