Skip to content

Commit

Permalink
Add MergeSegments recipe
Browse files Browse the repository at this point in the history
  • Loading branch information
lassoan committed Aug 11, 2021
1 parent c8ead02 commit e1daa68
Show file tree
Hide file tree
Showing 6 changed files with 57 additions and 0 deletions.
56 changes: 56 additions & 0 deletions MergeSegments/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
Overview
--------

- Task: Merge selected segments into one segment.
- Imaging modality: any

Prerequisites
-------------

- Have a segmentation with multiple segments.

Recommended workflow
--------------------

Merge two segments:

- Select the first segment to be merged.
- Click `Logical operators` effect.
- Set `Operation` to `Add`.
- Select the second segment to be merged in the `Add segment` list.
- Click `Apply`.

Merge multiple segments:

- Select the segment that will contain the merged segments.
- Make visible the selected segment and all the segments that you want to merge and hide all other segments.
- Click `Logical operators` effect.
- In `Masking` section (near the bottom), set `Editable area` to `Inside all visible segments`.
- In logical operators effect options: uncheck `Bypass masking` and set `Operation` to `Fill`.
- Click `Apply`.

Example
-------

Merge Segment_1, Segment_2, Segment_3 into one segment (Segment_1), while leaving Segment_4 as a separate segment.

- Download `MRHead` sample data set
- Go to `Segment editor` module, click `Add` button 4x to create 4 new segments.
- Select `Paint` effect and paint a few strokes into each segment.

![Example segments created.](image-001.png)

- Hide Segment_4 to exclude it from merging.
- Select Segment_1 to designate it as the segment that will store the merging result.

![Segments are designated for merging input and output.](image-002.png)

- Click `Logical operators` effect. In `Masking` section (near the bottom), set `Editable area` to `Inside all visible segments`, uncheck `Bypass masking`, set `Operation` to `Fill`.

![Example segments created.](image-003.png)

- Click `Apply` to merge the segments.
- Segment_2 and Segment_3 can now be deleted (they are overwritten by Segment_1 anyway because in `Masking` section `Modify ether segments` was set to `Overwrite all`)
- Segment_4 can be shown again.

![Final result.](image-004.png)
Binary file added MergeSegments/image-001.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added MergeSegments/image-002.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added MergeSegments/image-003.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added MergeSegments/image-004.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
Recipes for solving common image segmentation tasks using [3D Slicer](https://www.slicer.org).
- [Skin surface extraction](SkinSurface2/README.md)
- [Craniotomy (splitting segments)](Craniotomy/README.md)
- [Merge segments](MergeSegments/README.md)
- [Aorta segmentation (fast, using Fast marching)](AortaFastMarching/README.md)
- [Aorta segmentation (high-accuracy, using Grow from seeds)](AortaMaskedGrowFromSeeds/README.md)
- [Cerebral vessel segmentation by subtraction](VesselSegmentationBySubtraction/README.md)
Expand Down

0 comments on commit e1daa68

Please sign in to comment.