# How to do the segmentation of ribcage including the Costal cartilage? 

**URL:** <https://discourse.slicer.org/t/how-to-do-the-segmentation-of-ribcage-including-the-costal-cartilage/23903>\
**Category:** Support\
**Tags:** segmentation, extensions-manager\
**Created:** [June 16, 2022, 1:28pm UTC](https://discourse.slicer.org/t/how-to-do-the-segmentation-of-ribcage-including-the-costal-cartilage/23903 "2022-06-16T13:28:56Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![Monkeyking123](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/monkeyking123/32/15663_2.png) [@Monkeyking123](https://discourse.slicer.org/u/Monkeyking123)\
**Post date:** [June 16, 2022, 1:28pm UTC](https://discourse.slicer.org/t/how-to-do-the-segmentation-of-ribcage-including-the-costal-cartilage/23903/1 "2022-06-16T13:28:57Z")

</div>

Hi everyone  
It is my first time using 3D slicer along with its tools, mainly for learning the segmentations of ribcages, and heart structures with the aforementioned tools and those in the extensive section(i.e Nvidia AIAA, wrap solidify and logical operator)

Our teacher told us 2 ways:

1. Crop volume - Threshold - Segment editor (Scissors, Island, smoothing etc) then export files

2. Go to logical operators first and invert and apply. (Cancel bypass marking)  
Go to “Wrap solidify” - "Largest cavities, split cavities to about 10 mm) and create a new segment  
Go back to logical operators to invert back  
Go to Nvidia AIAA to find and delete the livers, spleen, tumors etc from the ribcage  
Do the rest of the segmenting as the 1st method

I have tried both methods but got stuck since the requested ribcage is a perfect model

 ![image](https://us1.discourse-cdn.com/flex002/uploads/slicer/original/3X/5/b/5bb134c826f705f5487aca31e0534b8d79fa6364.jpeg)

But, the ribcage that I segmented lacks the cartilage and the “Island” section seems to become

 ![image](https://us1.discourse-cdn.com/flex002/uploads/slicer/original/3X/e/1/e1c014386ee698ba6f004bd1cccaec292b8534e0.png)

 ![image](https://us1.discourse-cdn.com/flex002/uploads/slicer/original/3X/c/7/c7c3c4caa43c4867017bb72f83eb298b0af34e2f.jpeg)

Question:

1. What is the best way to do a model of the ribcage and are there places to be aware of
2. Is there an automatic ribcage segmentation tool or is that the 2 method that was mentioned above e
3. What steps might be missing in the ribcaged that was tried?

Thank you for the help and tips!

---

<div class="post-metadata">

**Author:** ![mau\_igna\_06](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/mau_igna_06/32/9056_2.png) [@mau\_igna\_06](https://discourse.slicer.org/u/mau_igna_06)\
**Post date:** [June 16, 2022, 1:46pm UTC](https://discourse.slicer.org/t/how-to-do-the-segmentation-of-ribcage-including-the-costal-cartilage/23903/2 "2022-06-16T13:46:59Z")

</div>

Did you try localThreshold on segmentEditor extra effects? And the some scissors maybe?

---

<div class="post-metadata">

**Author:** ![Monkeyking123](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/monkeyking123/32/15663_2.png) [@Monkeyking123](https://discourse.slicer.org/u/Monkeyking123)\
**Post date:** [June 16, 2022, 3:55pm UTC](https://discourse.slicer.org/t/how-to-do-the-segmentation-of-ribcage-including-the-costal-cartilage/23903/3 "2022-06-16T15:55:25Z")

</div>

What’s the difference between the Normal Threshold and localThreshold?

---

<div class="post-metadata">

**Author:** ![mau\_igna\_06](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/mau_igna_06/32/9056_2.png) [@mau\_igna\_06](https://discourse.slicer.org/u/mau_igna_06)\
**Post date:** [June 16, 2022, 4:02pm UTC](https://discourse.slicer.org/t/how-to-do-the-segmentation-of-ribcage-including-the-costal-cartilage/23903/4 "2022-06-16T16:02:38Z")

</div>

LocalThreshold uses a combination of threshold and region growing

---

<div class="post-metadata">

**Author:** ![Monkeyking123](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/monkeyking123/32/15663_2.png) [@Monkeyking123](https://discourse.slicer.org/u/Monkeyking123)\
**Post date:** [June 16, 2022, 7:40pm UTC](https://discourse.slicer.org/t/how-to-do-the-segmentation-of-ribcage-including-the-costal-cartilage/23903/5 "2022-06-16T19:40:55Z")

</div>

Hi!  
I have a question on the process of Ribcage segmentation.  
Given the picture below(haven’t completed yet), there are some gaps in the ribs (Left side) as seen which are attached to the sternum

 ![image](https://us1.discourse-cdn.com/flex002/uploads/slicer/original/3X/f/5/f50a184134d181a6e52a3219a54f5abfe9c3f155.png)

![image](https://us1.discourse-cdn.com/flex002/uploads/slicer/original/3X/b/2/b2e4cd62e49784795154959701193c7e1fc09947.jpeg)

Question:

1. Are there tools that can be used to fill in the gaps of the ribs (Extensions etc) and how should I do it
2. I was trying to see if Nvidia AIAA can work to segment out the liver and tumors but it shows an error message so I want to ask if there is a way to finetune the ribcage to this

![image](https://us1.discourse-cdn.com/flex002/uploads/slicer/original/3X/0/a/0a6049fd9b026375ae8dcd7460e1547cb8de54ef.png)

Thanks very much!

---

<div class="post-metadata">

**Author:** ![lassoan](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/lassoan/32/13_2.png) [@lassoan](https://discourse.slicer.org/u/lassoan)\
**Post date:** [June 17, 2022, 6:44pm UTC](https://discourse.slicer.org/t/how-to-do-the-segmentation-of-ribcage-including-the-costal-cartilage/23903/6 "2022-06-17T18:44:42Z")

</div>

Segmentation of ribs is usually an easy task, so even simple thresholding may suffice, but depending on what you need exactly, you may need to use additional tools.

What is your end goal? Visualization, quantification (what do you want to measure?), 3D printing (is it OK if the cancellous region inside the bones are hollow)? Do you need separate the ribs from each other or from vertebrae? Are there contrasted vessels in your CT images?

---

<div class="post-metadata">

**Author:** ![Monkeyking123](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/monkeyking123/32/15663_2.png) [@Monkeyking123](https://discourse.slicer.org/u/Monkeyking123)\
**Post date:** [June 17, 2022, 7:09pm UTC](https://discourse.slicer.org/t/how-to-do-the-segmentation-of-ribcage-including-the-costal-cartilage/23903/7 "2022-06-17T19:09:38Z")

</div>

Using the aforementioned models for 3D printing  
We need to keep the ribcage structure as following

 ![image](https://us1.discourse-cdn.com/flex002/uploads/slicer/original/3X/d/7/d7ad1f9567843d5d1e55fbe0d66324e62b285db3.jpeg)

 ![image](https://us1.discourse-cdn.com/flex002/uploads/slicer/original/3X/5/b/5bb134c826f705f5487aca31e0534b8d79fa6364.jpeg)

\*I was trying to use

1. Logical Operators first to invert(Cancel bypass marking)
2. Warp Solidify and create a new segment by largest cavity
3. Allow bypass marking in Logical Operators and inverting back
4. NVidia AIAA to cancel out the liver, spleen, tumors etc
5. Then the Islands, smoothing etc

But there are a few problems to solve:

(a) Accidentally cutting parts of the ribcage but the redo button can’t be pressed(can’t redo after a certain number)  
(b) Too much other elements other than the ribcage and using the “Island” function sometimes deletes the entire Ribcage  
(c) Slicer automatically shuts off when using Nvidia and gives this message when reopening:

 ![image](https://us1.discourse-cdn.com/flex002/uploads/slicer/original/3X/1/3/13374d6081382dad4535c2639e634983ffc8b153.png)

Thanks!

---

<div class="post-metadata">

**Author:** ![lassoan](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/lassoan/32/13_2.png) [@lassoan](https://discourse.slicer.org/u/lassoan)\
**Post date:** [June 17, 2022, 7:30pm UTC](https://discourse.slicer.org/t/how-to-do-the-segmentation-of-ribcage-including-the-costal-cartilage/23903/8 "2022-06-17T19:30:08Z")

</div>

> [@Monkeyking123](#):
>
> NVidia AIAA to cancel out the liver, spleen, tumors etc

Do you need to segment any other structures than ribs, cartilage, and sternum? Do you need to separate the ribs from vertebrae?

How many segmentations do you need to do? Are there any time limits on the maximum segmentation time? Does the method have to be fully automatic? Are all the images acquired using the same imaging protocol?

What is the goal with 3D printing? Would like to create a phantom? 3D printing an entire ribcage requires special printer and/or splitting the model into several pieces. tThis is both time-consuming and expensive. It is much easier and cheaper to buy a ready-made phantom (e.g., from [sawbones](https://www.sawbones.com/)) and get a CT scan of it.

---

<div class="post-metadata">

**Author:** ![rbumm](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/rbumm/32/9404_2.png) [@rbumm](https://discourse.slicer.org/u/rbumm)\
**Post date:** [June 17, 2022, 8:54pm UTC](https://discourse.slicer.org/t/how-to-do-the-segmentation-of-ribcage-including-the-costal-cartilage/23903/9 "2022-06-17T20:54:36Z")

</div>

> [@Monkeyking123](#):
>
> NVidia AIAA to cancel out the liver, spleen, tumors etc

Please note that developers of NVIDIA-AIAA have changed their focus on working on MONAILabel so you can not expect to find ready to use solution for your task in NVIDIA-AIAA. It would probably make more sense from a mid-term perspective to use MONAILabel for that specific task.
