ClearVolume and large images

When trying to open a very large (5000 x 4000 x 3000) image in ClearVolume I get an error (below). Is it possible to open images of this size, perhaps by converting the image before ClearVolume? @fjug?

Specs:
Ubuntu 18.04
ImageJ 1.52n
Latest ClearVolume
NVIDIA TITAN RTX

Everything else seems ok, ClearVolume finds the GPU and OpenCL ok. I don’t currently have CUDA installed, but presumably that’s not necessary?

Thanks!

[ERROR] Module threw exception
java.lang.RuntimeException: Number of elements in ArrayImg too big, use for example CellImg instead: 113125075200 > 2147483647
	at net.imglib2.img.array.ArrayImgFactory.numEntitiesRangeCheck(ArrayImgFactory.java:102)
	at net.imglib2.img.array.ArrayImgFactory.create(ArrayImgFactory.java:90)
	at net.imglib2.img.array.ArrayImgFactory.create(ArrayImgFactory.java:140)
	at de.mpicbg.jug.clearvolume.ImgLib2ClearVolume.makeClearVolumeUnsignedShortTypeCopy(ImgLib2ClearVolume.java:398)
	at de.mpicbg.jug.clearvolume.ImgLib2ClearVolume.makeClearVolumeUnsignedShortTypeCopies(ImgLib2ClearVolume.java:372)
	at de.mpicbg.jug.clearvolume.ImgLib2ClearVolume.initRealImgs(ImgLib2ClearVolume.java:512)
	at de.mpicbg.jug.clearvolume.gui.ClearVolumeManager.run(ClearVolumeManager.java:182)
	at de.mpicbg.jug.clearvolume.gui.GenericClearVolumeGui.launchClearVolumeManager(GenericClearVolumeGui.java:306)
	at de.mpicbg.jug.clearvolume.gui.GenericClearVolumeGui.<init>(GenericClearVolumeGui.java:163)
	at de.mpicbg.jug.plugins.ClearVolumePlugin.run(ClearVolumePlugin.java:90)
	at org.scijava.command.CommandModule.run(CommandModule.java:199)
	at org.scijava.module.ModuleRunner.run(ModuleRunner.java:168)
	at org.scijava.module.ModuleRunner.call(ModuleRunner.java:127)
	at org.scijava.module.ModuleRunner.call(ModuleRunner.java:66)
	at org.scijava.thread.DefaultThreadService$3.call(DefaultThreadService.java:238)
	at java.util.concurrent.FutureTask.run(FutureTask.java:266)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
	at java.lang.Thread.run(Thread.java:748)

Hi @adamltyson and welcome to the forum :slight_smile:

We wrote ClearVolume in a way that it’s required the dataset you want to visualise fits in the GPU memory. With a 5000x4000x3000 occupying at least 60GiB of memory, that is does unfortunately not work.

I have the following suggestions for you, all of them require though that you convert them to BigDataViewer’s format first, see https://imagej.net/BigDataViewer#Exporting_Datasets_for_the_BigDataViewer on how to do this. For visualising your dataset, you can then do one or more of the following:

  • use BigDataViewer directly, in BDV you can browse your dataset by arbitrarily aligned slices
  • @tpietzsch has recently written a volume visualiser named BigVolumeViewer, for which there is an update site at sites.imagej.net/BigVolumeViewer, which you can use
  • as a third option, @kephale and I are currently developing a replacement for the old 3D Viewer in Fiji, supporting VR headsets, customizable scenes, etc., named sciview. sciview is also available via an update site (see New sciview preview release for more details). Thanks to @tpietzsch, we also have preliminary support for BDV datasets in sciview now.

I hope this gets you a bit further. Let us know if you encounter any issues.

cheers!

4 Likes

Thanks @skalarproduktraum ! For some reason I thought images only had to load into RAM for ClearVolume. I’ll try BigVolumeViewer (I’ve had a lot of success with BigDataViewer before).

Thanks again,
Adam

1 Like

So ClearVolume works nicely when I load images that fit into GPU memory. However, if I use FIJI to reduce a large image in size (Image -> Scale), I still get the same error. I’ve tried a few images, and fresh FIJI installs. Do you have any ideas?

Thanks!

Hi again! I have to admit that I had actually misread your original traceback – the issue you’re seeing does not come from the image not fitting in the GPU memory (which of course it still needs to), but actually from the problem that the image needs to fit into a Java array, which CellImg uses as a backing store. This means you’re limited to 2GB. Everything below that should work. Sorry for the confusion.