niivue / ipyniivue

A WebGL-powered Jupyter Widget for Niivue based on anywidget
BSD 2-Clause "Simplified" License
25 stars 8 forks source link

Larger NIfTI images cause Jupyter Notebook to crash #74

Open kabilar opened 1 month ago

kabilar commented 1 month ago

Description

Hi Niivue team, thanks for your work on this package.

When using the code below for a ~10 MB NIfTI-GZ file, the image loads successfully. For a larger NIfTI-GZ file (~200 MB), I receive the following error: The extension host terminated unexpectedly. Restarting.... Is there a way to get around this issue? Thank you.

from ipyniivue import AnyNiivue, SliceType, DragMode

volumes = [
  { "path": "~/data.nii.gz", 
    "colormap": "gray", 
    "visible": True, 
    "opacity": 1.0, 
    "isHighResolutionCapable": False 
  },
]

nv = AnyNiivue(
    back_color=(0, 0, 0, 1),
    show_3D_crosshair=True,
    isCornerOrientationText=True,
    clip_plane_color=(1,0,0,1),
    is_colorbar=False,
    slice_type=SliceType.AXIAL,
    dragMode=DragMode.PAN
)

nv.load_volumes(volumes)
nv

Reproducibility

I am running a Jupyter Notebook with a conda environment in VS Code on MacOS. Below are a few of the relevant versions, but happy to provide a full list.

kolibril13 commented 1 month ago

hi @kabilar, thank you for your report!

For a larger NIfTI-GZ file (~200 MB), I receive the following error

Can you provide a link, so that we can download the file that is not loading correctly? Otherwise it will be difficult for us to reproduce your issue.

Can you also try to drag and drop the file into this viewer instance from the original niivue project and see if it works? https://niivue.github.io/niivue/features/draganddrop.html

We can then see if it's a niivue problem, or a problem in ipyniivue

kolibril13 commented 3 weeks ago

hi @kabilar, do you have further information for us? Thanks!