ITKElastix
ITKElastix copied to clipboard
Problem when opening a big TIF file
Hello,
I am doing mouse brains alignement to the Allen Brain Atlas. Samples are optically cleared and images are obtained on a light sheet microscope.
It works nicely on small files (25x25x25 um voxel : 100 Mo in size).
However, when I am trying to apply the transformation to a high resolution data set of 70 Go, I have a problem: I cannot open the file at all:
- when using the view module from ITKWIDGETS, the big image looks empty.
- when trying to change the voxel spacing, it works on small size file but not on the big one.
If I crop the big one, it is opened correctly... That makes me think that the data type is good, but that it is some sort of memory problem.
I am working on Windows 10, with 512 Go Ram.
Thank you very much for your help!!
Best,
Jérémie
Hi @Jeremie-BIC
Thank you for reporting this issue. Marius Staring (@mstaring) and I just looked at it, and it seems to us that it isn't a specific elastix/ITKElastix issue, but rather an ITK issue, or an itkwidgets issue. In that case, maybe you'd better report this to ITK (https://discourse.itk.org or https://github.com/InsightSoftwareConsortium/ITK/issues) or itkwidgets: https://github.com/InsightSoftwareConsortium/itkwidgets
Kind regards, Niels
Dear Niels,
Thank you for taking the time. I will report this to ITK.
Best regards,
Jérémie
This is most likely a limitation of the graphics subsystem (GPU does not have enough memory to fit the entire image in it) or VTK, the visualization library https://github.com/InsightSoftwareConsortium/itkwidgets uses. @floryst or @thewtex might have a better idea of where the problem comes from.
For itkwidgets, browser tabs usually have a ceiling on the memory allocation, though that usually results in a browser tab crash and not a blank image. If it's a TIF image, my guess would be that the underlying itk-wasm WebWorker is failing or crashing silently (possibly due to out-of-memory), leading to the display of a blank image...
Hi,
Thank you for help!
I understand that such a big file might be impossible to display in the Jupyter Notebook through the Itk Widget viewer.
However when I try to do a simpler operation, such as change the pixel spacing, I get an error. I think that the problem is happening when I open my image (using itk.imread).
I guess that, like Niels suggested, it is an ITK problem...
In case, I am putting the error I get. Any suggestion would be super appreciated. Error is:
TypeError Traceback (most recent call last)
TypeError: Expecting an itkVectorD2, an int, a float, a sequence of int or a sequence of float. Additional information: Wrong number or type of arguments for overloaded function 'itkImageBase2_SetSpacing'. Possible C/C++ prototypes are: itkImageBase2::SetSpacing(itkVectorD2 const &) itkImageBase2::SetSpacing(double const *) itkImageBase2::SetSpacing(float const *)
Thank you very much.
Best,
Jérémie
You might need something like:
spacing = itk.spacing((2,2,4)) # like this?
spacing = itk.spacing([2,2,4]) # or maybe like this?
upscale_image.SetSpacing(spacing)
Large scale registration support coming via https://github.com/InsightSoftwareConsortium/itk-dreg.
itk-widgets has support for large-scale images via NGFF. See: https://github.com/InsightSoftwareConsortium/itkwidgets/blob/main/examples/integrations/zarr/OME-NGFF-Brainstem-MRI.ipynb