Is there a way to reduce the CPU usage and reduce the amount of RAM used?

Operating system: MacOZ 10.13.4
Slicer version: 4.9.0-2018-05-30
Expected behavior:
Actual behavior:

When I first opened the stack of 547 registered serial section images, the computer was using between 5 and 6 GB RAM. I went through and segmented the whole animal to get an exterior volume . I selegted every 2nd or 4th slice, sometimes every 6th and I then operated “fill between slices”. That didn’t take too long but now of course I want to edit that fill where it wasn’t quite right. the attached image is what happened to the CPU after I did the smallest painting to extend the margin on one part. That was about 10 minutes ago and the CPU is still blown out. We are also now at 43.6GB RAM and that’s only the whole body segment. I still need to do the eyes, gut and maybe nervous system as well as the eggs.

My questions:
How can I edit the segments that were filled between slices without it looking like I’ve doubled the thickness or not responding to the eraser?

How can I more efficiently use the CPU? I have 4.2 GHz Intel Core i7

How can I reduce the RAM usage so that I can do more segmenations?

How can I reduce the size of the segments? It seems like they should be quite small if they are just a shape. Is this because they are not vectors?

What is the best way to downsize my data when I have already started segmentation?

I would really appreciate the help.

Thank you!

Freya

image

1 Like

Most probably you’ve run out of physical memory and so disk swapping is used. In general, I would recommend to have 10x more physical RAM as the size of your data set. If that’s not feasible then you can use Crop volume module to crop and resample your volume. Obviously, also crop any regions in your volume that you don’t need.

For 3D processing, you can rarely benefit from having high in-plane resolution if distance between planes is large. For example, a volume of 2500x2500x500 (with spacing of 0.1x0.1x0.5) will give you approximately same quality 3D reconstructions as a volume of 500x500x500 (with spacing of 0.5x0.5x0.5). So, in Crop volume module, enable isotropic spacing and set spacing scale to a large enough number so that you end up with a volume of approximately 500x500x500 voxels (you can see in Volume information section what the cropped volume’s dimension will be).

Use the cropped and resampled volume as master volume for your segmentation. During segmentation, you can choose the original, full-resolution volume as background, so when you paint you may see small details, but the 3D segmentation will take up much less memory and everything will be much faster.

@cpinter is working on a new feature that will simplify setting the 3D segmentation’s resolution higher or lower than the master volume. It is expected to be ready next week. So, if you have trouble setting up the cropped, isotropic master volume node, then you may wait for this new feature (you can monitor this issue to get status updates).

It would be also useful to know the dimensions, spacing, number of scalars, and scalar type of your data set (see in Volumes module / Volume information section), and the amount of physical RAM in your computer.

1 Like

Thank you. I will try that. I honestly haven’t wrapped my brain completely around what spacing means in this program. I’m coming from Fiji and Amira where I had serially sectioned epoxy embedded animals at 1um thick sections, photographed each section and registered them in a stack. So spacing to me means the distance between slices (1um in my case) and to have the 3D slicer “spacing” in three dimensions makes me think I’m not understanding this.

Here is my hardware:
|Model Name:|iMac|
| Model Identifier:|iMac18,3|
| Processor Name:|Intel Core i7|
| Processor Speed:|4.2 GHz|
| Number of Processors:|1|
| Total Number of Cores:|4|
| L2 Cache (per Core):|256 KB|
| L3 Cache:|8 MB|
| Memory:|64 GB|

Another question: would it help to just outline the different segments instead of coloring in the whole organ?

Spacing is distance between neighboring voxels, which is the same as size of a voxel. This is also referred to as resolution of the image.

It would not make a difference.

It would be useful to know the dimensions, spacing, number of scalars, and scalar type of your data set (shown in Volumes module / Volume information section).

What would you like to do with the images in Slicer? View the shape of segmented structures? Or compute their volume or surface…?

Thank you for that information.
Here is what I ended up doing and it seems to be a bit faster, using less RAM.

image

I want to make a 3D rendering of the whole animal like this:
image
or this:
image

You may delete the original volume to reduce memory need and potentially speed up things. You can also try further increasing spacing value and crop away all regions that you don’t need to segment.

You may try Volume Rendering module for visualization of the complete body. For that you may need to further increase slice spacing.

Okay, thank you. I will try those things tomorrow. I really appreciate your quick responses.