3D Manager memory challenge

Dear folks (@ThomasBoudier),

I am running into memory issues with 3D Manager (Plugins > 3D > 3D Manager). I attempted analysis using a PC with 64 GB RAM available on it - the memory gets fully filled at some stage (it coped after ~2 hours with ‘3D Segmentation’, but not ‘Add Image’). The plugins seems to want to use more memory than it gets allocated by ImageJ (I increased the memory at Edit > Options > Memory & Threads to 65536 MB).

The dataset I have is 3728 x 3728 pixels x 48 slices (8-bit, 636 MB - this data was pre-processed and binarized). When downsized by half (1864 x 1864 x 24, 80 MB) 3D Manager copes fine; both ‘3D Segmentation’ and ‘Add Image’ complete within several seconds.

Has anyone ran into this memory challenge?

Dividing the original data stack into smaller stacks presents different issues with how to treat objects at the then newly created image edges. Ideally I will not do this. I am interested in the 3D orientation of objects in the image stack, I hoped to use the bounding box coordinates for determining this.

Possibly I should think about using Python or Matlab/Octave? Any possible recommendation here for 3D image processing?

Many thanks for any advice :slight_smile:

Could you share a sample file, via a file-sharing service of your choice?

I don’t think this is a question of which programming language/framework to use, but rather a question of the choice of tools.

There are perfectly suitable tools in the Java/ImageJ ecosystem that likely have a better memory management than the 3D Manager plugin. The ImgLib2 library (included in Fiji/ImageJ2 as well as in KNIME) provides a roi/labeling model that can be used with any number of dimensions, and provides tools to handle image data that’s too large to fit into memory.

From with Fiji/ImageJ, most of these require some scripting to fully take advantage of their functionality. KNIME provides a way to access these without any scripting knowledge, but requires getting used to a different way of (graphically) programming workflows.

To get started, you can have a look at their 3D Segmentation example workflow:

If you need to loop over tiles of a larger image, there are some nodes available to make this easier:

Hi Jan,

Many thanks for your response and suggestions.

I have uploaded the stack that I have tried to analyze here: https://gofile.io/?c=kJmUhV

I think KNIME is possibly a good tool to explore for me, I have not looked at this before at all. I have limited scripting / programming skills at present.

Hi @Danielle_Z,

Thanks for challenging 3DManager. Actually there is no problem at all with this image, and I analyzed quite bigger images. The problem was that your image is using inverting-lut so the objects are displayed in white but their value is 0, so it means objects are considered as background.

You just need to invert your image and use a normal gray LUT and it is working fine, the segmentation took a couple of sec and same to add the 2,000 objects in the 3DManager.

Hope this helps


This helps huuuuuuge :sunglasses: (feel a bit silly I did not try this, it is not my first time that I have an adventure with image data that I should invert, cough)

Thanks for taking the time to have a look at this for me. Most likely I will produce data larger than this at some point, but it looks like it will cope fine with this analysis.

Happy Monday