How can I save whole heart without empty spaces?

I am facing this problem while saving/exporting the segmentation into a binary label map. The problem is with HEART only. The heart contains multiple substructures. When I am saving the whole Heart and multiple substructures, the whole heart is showing some empty spaces. The empty spaces mainly contain the substructures.
I am getting below image of whole heart:
Screen Shot 2022-05-25 at 2.34.23 PM

When I select all the substructures of heart then I am getting the below result:
Screen Shot 2022-05-25 at 2.35.54 PM
Screen Shot 2022-05-25 at 2.36.01 PM

I want whole heart should look like the below image without detailed information of substructures. Ignore the texts in it.
Screen Shot 2022-05-25 at 2.37.42 PM

Thanks in advance.

To create a segment that is the union of all other segments, you can use Logical operators effect’s Fill option, with setting Editable region → Inside all segments.

@lassoan Thanks for your suggestion. I tried “Hollow” option. It is giving me the result but other structures are also impacting. Most probably I am not selecting correct parameter. Could you please suggest correct parameter settings?

“Hollow” effect changes a solid structure into a hollow structure. Based on what you described, this is not what you need.

Have you tried to use the “Logical operators” effect as I described above? If you want to keep other segments unchanged then set “Allow overlap” in Masking section.

Yes, I tried and attached is the screenshot of the parameter selection. I am not getting expected result. Am I doing anything wrong here?

Uncheck “Bypass masking” to make the filling operation respect masking settings.

I have attached before and after effects based on your suggestion. Whole segment is filling instead of only Heart.
Before


After

It works well for me. Use the latest Slicer Stable Release (Slicer-5.0.x) and follow these steps:

Thanks for sharing the video. My Slicer package is stable version and up to date. I tried in Mac and Linux but there is no change in result. Here is the latest outcome.

a

What is your exact Slicer version?

Could you try it on a sample data set, creating the segmentation from scratch, to see if there is something special about your segmentation? Or save your scene as a .mrb file, upload it somewhere, and post the link here, so that I can try to reproduce the behavior on my computer?

1 Like

I am using Slicer version 5.1.0 and 5.0.2. I tried both versions.

This is the answer of your next question: Sure, I will share the details soon.

I’ve uploaded the sample data and corresponding segmentation file. Please use this link https://easyupload.io/0klfow to download those files. The problem is with only “Whole Heart”. I have attached few screenshots for your reference. The problem is arising when I am saving the segmentation into labelmap.

1
2
3
4
6

Thank you, by loading the linked file I was able to reproduce the unexpected behavior. There was a bug in Logical operator effect and so the mask was only applied if you performed some editing operation (e.g., use the Paint effect) before.

I’ve submitted a fix, so tomorrow’s Slicer Preview Release will not have this issue. As a workaround, use Paint effect to draw a small scribble somewhere (you can undo it or erase it right after it) and then use the Logical operators effect.

Note: Do not save segmentations in Nifti files. They are intended for brain images only and have many issues and limitations. For example they cannot store overlapping segments.

1 Like

Thanks for the update! I will try tomorrow’s Slicer Preview Release and update here.

Hi,
Update on the issue: I tried with recent release (version 5.1.0 revision 30976 built 2022-05-30) but I didn’t find any changes in the result.

Slicer 5.1.0-2022-05-29 r30976 version works well. See this video successfully testing it on your data:

Thanks so much! This version has partially solved my issue. I want the effect will only be applied to the “whole heart”, not to other organs. For example, I am unable to detach esophagus from whole heart.

Not the RED circle portion
2022_05_31_0jy_Kleki

You can hide the segments that you are not interested in and choose editable region → inside visible segments.

Thanks so much! I tried that option too and there is no improvements on the issue.
Here, I attached the screenshot. I created segment 9 for applying logical operation. You can see all other segments are not visible. segment 9 contains all the organs. I just want heart will display here.

My goal is to FILL the empty regions inside the heart. For example, I am showing the empty regions of heart.