# Shrink-wrap style margin?

**URL:** <https://discourse.slicer.org/t/shrink-wrap-style-margin/1645>\
**Category:** Support\
**Created:** [December 12, 2017, 12:32pm UTC](https://discourse.slicer.org/t/shrink-wrap-style-margin/1645 "2017-12-12T12:32:22Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![hherhold](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/hherhold/32/12199_2.png) [@hherhold](https://discourse.slicer.org/u/hherhold)\
**Post date:** [December 12, 2017, 12:32pm UTC](https://discourse.slicer.org/t/shrink-wrap-style-margin/1645/1 "2017-12-12T12:32:22Z")

</div>

Greetings slicers,

I have a micro-CT scan of an insect. The exoskeleton and associated dense internal cuticular structures are in a segment. What I would like to do is use the margin tool to erode away just the external exoskeleton part of the segmentation, but not act on the internal structure segmentation - kind of like a “shrink wrap” followed by margin, if that makes sense, to remove just the exoskeleton but keep the internal structures segmentation intact. Is there a way to do this? (Automated or semi-automated, that is - I can always do it by hand, but I was looking for a way to speed up the process.)

Many thanks in advance for any ideas anyone has!

-Hollister

---

<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:** [December 12, 2017, 1:52pm UTC](https://discourse.slicer.org/t/shrink-wrap-style-margin/1645/2 "2017-12-12T13:52:07Z")

</div>

For this, I would create an “air” segment by Thresholding (if there air inside then you can remove it by applying Smoothing \> Opening and Islands \> Keep largest) or Flood filling (in SegmentEditorExtraEffects extension). Then, expand this “air” segment using Margin \> Grow effect.

For more sophisticated stripping (variable shell thickness), you can try [SwissSkullStripper extension](https://www.slicer.org/wiki/Documentation/Nightly/Modules/SwissSkullStripper) - it is developed for stripping the skull, but it can be used for other shells, too. You have to provide one example image (Atlas volume) and a mask (Atlas mask volume; a labelmap that only covers the region that you want to keep).
