Skip to content

Commit

Permalink
Update CTSkullStripping recipe to use WrapSolidify effect
Browse files Browse the repository at this point in the history
  • Loading branch information
lassoan committed Apr 21, 2020
1 parent 996bef3 commit a459482
Show file tree
Hide file tree
Showing 10 changed files with 16 additions and 28 deletions.
38 changes: 13 additions & 25 deletions CTSkullStripping/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,9 @@ Recommended workflow
--------------------

- Create a new segment that will contain the brain region
- use `Threshold` effect to select the brain region. Soft tissues with similar image intensity as the brain will be selected, too, but they will be removed by the next 3 processing steps.
- Use `Margin` effect with `Shrink` operation to disconnect brain region from similar-intensity soft tissue regions.
- Use `Islands` effect's `Keep selected island` operation to keep only brain region.
- Use `Margin` effect with `Grow` operation to restore brain region original size.
- Use `Mask volume` effect to blank out all non-brain regions in the image.
- Use `Threshold` effect to create a segment that contains the skull bone
- Use `Wrap solidify` effect (provided by `SurfaceWrapSolidify` extension) to extract the brain cavity.
- Use `Mask volume` effect (provided by `SegmentEditorExtraEffects` extension) to blank out all non-brain regions in the image.

Example
-------
Expand All @@ -30,38 +28,28 @@ Example
![Head CT image.](image-001.png)

- Go to `Segment editor` module, click `Add` button to create a new segment
- Select `Threshold` effect and set brain intensity range by clicking on `Local histogram` section title then click-and-dragging in the brain in yellow (sagittal) view. Click Apply to save previewed region.
- Select `Threshold` effect and set intensity range of bone (from approximately 300 to maximum value), click `Apply`

![Segment containint brain and other soft tissues.](image-002.png)
![Segment containing skull bone.](image-002.png)

- Select `Margin` effect, set operation to `Shrink`, margin size to 6mm, and click `Apply` to make sure the brain region is not connected anymore to any other regions. Depending on the data set, slightly smaller margin value could be enough, or larger value may be necessary.
- Remove small speckles of noise using `Islands` effect: choose `Keep largest island` option and click `Apply`

![Soft tissue regions are broken up after shrinking.](image-003.png)
- Select `Wrap solidify effect`, set region to `Largest cavity`
- Enable `Split cavities` and set cavity size slider to approximately 30mm to prevent the segmentation from "leaking" into other soft-tissue regions through small discontinuities in the bone
- Click `Apply`

- Select `Islands` effect, choose `Keep selected island` operation, then click anywhere within the brain region in a slice view to keep only the brain region and remove all other disconnected soft tissue regions.

![Only brain region is kept.](image-004.png)

- Select `Margin` effect, set operation to `Grow`, keep the margin size the same as before, and click `Apply`. This restores the original brain segment size.

![Brain region size is restored to original.](image-005.png)

- Click `Show 3D` button to see the brain shape in 3D view. If non-brain regions appear then either remove them using `Scissors` effect or click `Undo` a few times and shrink the brain segment a bit larger margin size.

![Brain region shown in 3D view.](image-006.png)
![Solid brain cavity segment.](image-003.png)

- Select `Mask volume` effect, set `Fill value` to -1000 (corresponding to air on CT), and click `Apply` to create a new volume where non-brain region is blanked out. To see the resulting masked volume, click the eye icon next to `Output volume`.

![Blanked out volume.](image-007.png)

- Click `Add` button to create a new segment, which will store the part that is separated from the skull
![Blanked out volume.](image-004.png)

- Brain image intensity range is very narrow range compared to whole intensity range of the volume. To see brain contrast better, go to `Data` module, click eye icon of `Segmentation` node to hide it, click on eye icon of `CTBrain masked` node to show it in slice viewers.

- Click "adjust window/level..." toolbar and then hold down `Ctrl` key while click-and-drag in the brain region to set optimal window/level.

![Brain volume after contrast adjustment.](image-008.png)
![Brain volume after contrast adjustment.](image-005.png)

Final result:

![Skull-stripped CT image.](image-009.gif)
![Skull-stripped CT image.](image-006.png)
Binary file modified CTSkullStripping/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 modified CTSkullStripping/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 modified CTSkullStripping/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.
Binary file modified CTSkullStripping/image-005.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 modified CTSkullStripping/image-006.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 removed CTSkullStripping/image-007.png
Binary file not shown.
Binary file removed CTSkullStripping/image-008.png
Binary file not shown.
Binary file removed CTSkullStripping/image-009.gif
Binary file not shown.
6 changes: 3 additions & 3 deletions SkinSurface2/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@ This recipe replaces an [earlier recipe that used `Flood filling` effect](../Ski
Recommended workflow
--------------------

- Use `Wrap solidify` effect (provided by `SegmentEditorExtraEffects` extension) with to segment outside air. Click anywhere in the outside air in slice views to segment the air. If not all areas are hightlighted then click in air regions that are not included and/or increase `Intensity tolerance` parameter. If segment leaks inside the tissue then click `Undo` and increase `Neighborhood size`.
- Use `Logical operators` effect / `Invert` operation to make the segment contain tissue instead of air
- Use `Scissors` effect and `Smoothing` effect to remove artifacts and noise
- Use `Threshold` and effect to create a segment that contains the head (skin and internal structures)
- Use `Islands` effect's `Keep largest island` method to remove noise speckles
- Use `Wrap solidify` effect (provided by `SurfaceWrapSolidify` extension) to fill holes inside the segment.

Example
-------
Expand Down

0 comments on commit a459482

Please sign in to comment.