brainglobe / brainrender

a python based software for visualization of neuroanatomical and morphological data.
https://brainglobe.info/documentation/brainrender/index.html
BSD 3-Clause "New" or "Revised" License
547 stars 77 forks source link

[BUG] Memory issue with loading .tif files into BrainRender #379

Closed c3rry closed 1 month ago

c3rry commented 2 months ago

Describe the bug We are receiving the error: ERROR: MemoryError: Unable to allocate 262. GiB for an array with shape (35109336405,) and data type float64 when trying to plot a tiff file against the Allen Mouse Brain Atlas using Spyder It also does not seem to be using virtual memory

To Reproduce Implement the user_volumetric_data.py file with a .tif file, our .tif file contained 1827 frames and was of size 130 GB

Expected behaviour Our data volume should have been plotted against the Allen Mouse Brain Atlas.

Log file Please attach the l brainrender(8_26_24).txt

Computer used (please complete the following information):

adamltyson commented 2 months ago

Hi @c3rry,

I assume this is happening because the example creates a copy of your data to reorient your data to the atlas, and that requires more memory than you have.

What are you trying to achieve with brainrender? The normal use case is to visualise data that has been aligned to an anatomical atlas, typically processed features (cell coordinates etc.). The method to visualise volumetric data is normally used for e.g. gene expression data.

If your data is 130GB, I assume it's raw data that hasn't been aligned to an atlas?

If you want to visualise raw volumetric data, I would recommend napari, perhaps alongside the napari brainrender plugin.

adamltyson commented 1 month ago

Hi @c3rry I'm going to close this now. Let us know if you have any further questions.