I am working with the segment-editor module in Slicer 4.10.1 for Linux on a Dell Precision T7400, Intel Xeon E5440 2.83GH, 32Gb RAM
I am sharing the seg.nrrd. file back and forth over Dropbox with a collaborator who segments on laptop that uses Windows 10 Pro, Intel Core i7-8550U 1.8 GHz, 16Gb RAM.
The process started well, but the segmentation file has grown to 12.2 Mb and processes very slowly. For example, from the moment when I press the enter key after drawing a segment to the moment the segment fills in takes from 30 to 90 seconds. Other processes such as scrolling through the slices are also slowed down. Using the paint tool is less slow but still dramatically slower than before. Saving the segmentation file takes several minutes and occasionally crashes my computer.
Starting a new segmentation file with the same image moves much more quickly.
My collaborator’s laptop has no issues with the same file, and only experiences a ~4 second delay between pressing enter and the segmentation filling in.
I have tried 4.10.1 on several other computers including an iMac and a Surface Pro. I have also tried the most recent nightly build, but all have similar speeds.
Is the issue with my segmentation file, and is there a way I can clean it up to run faster?
Is it possible that Grow from seeds or Watershed segmentation is still active (have not clicked Apply or Cancel)? Have you enabled “Show 3D”? Have you disabled surface smoothing? Is the performance OK if you do not load the entire scene just load the segmentation (.seg.nrrd) file and master volume (.nrrd) file? Can you share the file that causes performance problems?
I have not initialized Grow for seeds or Watershed segmentation, neither are active. I have tried with Show 3D on and off. Surface smoothing is off. The performance is the same regardless of whether the files are loaded with the scene or individually. What is the best way for me to share the segmentation file with you?
I tried it on Windows and editing seemed to work fine. There is around 5 seconds delay with the Draw tool, but not 30-90 as you reported, and slice changes and 3D view are responsive.
For me memory usage didn’t go above 2GB, but when I saved the segmentation to file, it went up to 10+GB and it was indeed slow.
Your image seems quite large resolution (0.211 x 0.05 x 0.05mm) but hard to tell without the master volume. Try subsampling them like this:
Also the segment ‘Pontine Nuclei - Right’ is very fragmented, maybe it causes slowdown with
operations like surface conversion. Smoothing won’t help this one but you can make it solid.
The segmentation is editable on my computer (3-year-old Windows PC, 16GB RAM) with about the same speed as @cpinter reported above.
The performance is probably not great due to the somewhat large number of segments and large extent.
Your segmentation resolution is highly anisotropic (voxels are stick-shaped - 4x longer than wide), which is wasting a lot of resources. If you follow @cpinter’s suggestion above (set spacing to isotropic, oversampling to 0.25-0.5) and then apply smoothing (Smoothing effect, Joint smoothing).
To reduce number of segments that are concurrently updated and reduce extent, you can create additional segmentation node(s) and move segments there that you are not currently editing and/or expensive to update (such as Pontine Nuclei). It may also make sense to move segments out to another segmentation that are far away from the others (such as CNVSP and CNXII).
To prevent any crashes, set virtual memory (swap) size to 10x larger than the data set that you work with 279x848x596 x 46 segments x 10 = about 65 GB.