DisGUVery / disguvery

GNU General Public License v3.0
10 stars 3 forks source link

Loading of large tif files fails #1

Open agatawitkowska opened 1 year ago

agatawitkowska commented 1 year ago

When trying to load very large tif files (from tile scan, ~18000 x 18000px, 3 channels) I get the following error that does not persist with smaller, cropped images: Loading file: xxxxxxx.tif Image type cannot be identified. Please choose another type. Exception in Tkinter callback Traceback (most recent call last): File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.10_3.10.2032.0_x64qbz5n2kfra8p0\lib\tkinter\init.py", line 1921, in call__ return self.func(*args) File "...\disguvery\ui_menu.py", line 93, in self.add_command(label = 'Open Image', command = lambda: self.open('single')) File "...\disguvery\ui_menu.py", line 148, in open self.controller.gw_maindisplay.clear_showimage(image_toshow , update_current = True) File "...\disguvery\ui_canvas.py", line 93, in clear_showimage img = img[:,:,current_channel - 1] TypeError: 'NoneType' object is not subscriptable.

Is there a limit on image size? If yes which one, as I did not find it in your documentation. Thank you.

LennyvB commented 1 year ago

@cristina-mt any idea if there is a max file size that we can load?

@agatawitkowska can you please share the file with me? You can send it to l.vanburen@tudelft.nl

cristina-mt commented 1 year ago

Yes, unfortunately there is an image size limit. At the moment this is determined by the default limit set by Pillow, which might be up to 2 Gb depending on type of image data.

@LennyvB Since it's a safety limit, I'm reluctant to put in place a workaround, but an alternative would be to use OpenCV to load the images. In that case, we'll need to update and test again all the functions related to image loading/handling. I'll note it down to implement it on a future release.

agatawitkowska commented 1 year ago

Thanks a lot - this info is helpful! Maybe you could add this information to your manual? My workaround was to split the images into 4 tiles in a preprocessing script in Fiji. This, of course, might lead to loosing some of the GUVs by splitting them into parts. Best is to know in advance that images cannot be too big and acquire them in a way that's suitable for analysis with disguvery.

LennyvB commented 1 year ago

Excellent idea, will do - thanks for posting!