# How Segment the board in the red line of the picture?

**URL:** https://discourse.itk.org/t/how-segment-the-board-in-the-red-line-of-the-picture/2973
**Category:** Uncategorized
**Created:** [April 19, 2020, 8:38am UTC](https://discourse.itk.org/t/how-segment-the-board-in-the-red-line-of-the-picture/2973 "2020-04-19T08:38:27Z")
**Posts on this page:** 8
**Page:** 1

<div class="post-metadata">

### Author: ![wulicheng](https://discourse.itk.org/user_avatar/discourse.itk.org/wulicheng/32/1390_2.png) [@wulicheng](https://discourse.itk.org/u/wulicheng)
#### Post date: [April 19, 2020, 8:38am UTC](https://discourse.itk.org/t/how-segment-the-board-in-the-red-line-of-the-picture/2973/1 "2020-04-19T08:38:27Z")

</div>

image 1  
 ![无标题](https://discourse.itk.org/uploads/default/original/2X/2/201a2736ea499e2cb3deb1c41567110310e184b2.png)  
This 3D image was constructed by a series of dicom file. Now I want to segment the content in the red closed line. how to DO!!!

image 2

 ![无标题](https://discourse.itk.org/uploads/default/original/2X/a/a6bbc6ab81c39cc51b7913e2d0f4b219d2498e24.png)  
This is one of the series study of the dicom files.

---

<div class="post-metadata">

### Author: ![dzenanz](https://discourse.itk.org/user_avatar/discourse.itk.org/dzenanz/32/1093_2.png) [@dzenanz](https://discourse.itk.org/u/dzenanz)
#### Post date: [April 20, 2020, 3:04pm UTC](https://discourse.itk.org/t/how-segment-the-board-in-the-red-line-of-the-picture/2973/2 "2020-04-20T15:04:25Z")

</div>

For segmenting the second case, using [Objectness filter](https://itk.org/Doxygen/html/classitk_1_1HessianToObjectnessMeasureImageFilter.html) with emphasis on plate-like structures should help, perhaps even make it easy.

It is hard to infer 3D structure in image 1, so I can’t help with that.

---

<div class="post-metadata">

### Author: ![dchen](https://discourse.itk.org/user_avatar/discourse.itk.org/dchen/32/34_2.png) [@dchen](https://discourse.itk.org/u/dchen)
#### Post date: [April 20, 2020, 3:19pm UTC](https://discourse.itk.org/t/how-segment-the-board-in-the-red-line-of-the-picture/2973/3 "2020-04-20T15:19:14Z")

</div>

Maybe you could use the red line to generate a distance function. That would tell you want was inside vs outside.

---

<div class="post-metadata">

### Author: ![wulicheng](https://discourse.itk.org/user_avatar/discourse.itk.org/wulicheng/32/1390_2.png) [@wulicheng](https://discourse.itk.org/u/wulicheng)
#### Post date: [April 21, 2020, 1:24am UTC](https://discourse.itk.org/t/how-segment-the-board-in-the-red-line-of-the-picture/2973/4 "2020-04-21T01:24:51Z")

</div>

thanks

---

<div class="post-metadata">

### Author: ![wulicheng](https://discourse.itk.org/user_avatar/discourse.itk.org/wulicheng/32/1390_2.png) [@wulicheng](https://discourse.itk.org/u/wulicheng)
#### Post date: [April 21, 2020, 1:37pm UTC](https://discourse.itk.org/t/how-segment-the-board-in-the-red-line-of-the-picture/2973/5 "2020-04-21T13:37:39Z")

</div>

Sorry,the red line was drawn by me, I mean how to segment the withe line closed by the red line.

---

<div class="post-metadata">

### Author: ![wulicheng](https://discourse.itk.org/user_avatar/discourse.itk.org/wulicheng/32/1390_2.png) [@wulicheng](https://discourse.itk.org/u/wulicheng)
#### Post date: [April 21, 2020, 1:44pm UTC](https://discourse.itk.org/t/how-segment-the-board-in-the-red-line-of-the-picture/2973/6 "2020-04-21T13:44:14Z")

</div>

Sorry,I can not use the " Objectness filter", can you give me an example!, and the red line was drawn by me, I mean how to segment the withe line closed by the red line.

---

<div class="post-metadata">

### Author: ![dzenanz](https://discourse.itk.org/user_avatar/discourse.itk.org/dzenanz/32/1093_2.png) [@dzenanz](https://discourse.itk.org/u/dzenanz)
#### Post date: [April 21, 2020, 2:25pm UTC](https://discourse.itk.org/t/how-segment-the-board-in-the-red-line-of-the-picture/2973/7 "2020-04-21T14:25:04Z")

</div>

You can find some examples in the [IJ article](https://hdl.handle.net/1926/576). Direct [download](https://www.insight-journal.org/download/fulldownload/zip/175/8).

This [example](https://itk.org/Doxygen/html/SphinxExamples_2src_2Nonunit_2Review_2SegmentBloodVesselsWithMultiScaleHessianBasedMeasure_2Code_8cxx-example.html#_a4) focuses on vesselness, but by changing parameters of `objectnessFilter` you can get sheetness enhancement.

---

<div class="post-metadata">

### Author: ![lassoan](https://discourse.itk.org/user_avatar/discourse.itk.org/lassoan/32/27_2.png) [@lassoan](https://discourse.itk.org/u/lassoan)
#### Post date: [April 22, 2020, 1:01pm UTC](https://discourse.itk.org/t/how-segment-the-board-in-the-red-line-of-the-picture/2973/8 "2020-04-22T13:01:07Z")

</div>

If there is a threshold value that separates the scanned object from the table then the operation is trivial:

1. Threshold to create segmentation
2. Keep largest island in the segmentation (this discards the table, which is thin, so its volume is smaller than the scanned object) - you might need to use more sophisticated property to find the island corresponding to the object of interest (such as objectness filter that @dzenanz recommended above), but in most cases keeping the island with the largest volume should be enough
3. Solidify the segment
4. Mask volume using the segment (blank out voxels outside the segment)

These steps can all be performed in 3D Slicer’s Segment Editor (using ITK and VTK internally) but can be also automated very easily. See a complete, fully automatic implementation in Python (need to be run in 3D Slicer’s Python interpreter) [here](https://gist.github.com/lassoan/84d1f9a093dbb6a46c0fcc89279d8088).

Original image:

 ![image](https://discourse.itk.org/uploads/default/original/2X/a/a45fc3620f800f0567dc6504911d540c59dc3456.jpeg)

After automatic table removal:

 ![image](https://discourse.itk.org/uploads/default/original/2X/b/bae0e2739a637ff01661ab3776b4a73dc9831921.jpeg)
