# How to add some holes by script?

**URL:** <https://discourse.slicer.org/t/how-to-add-some-holes-by-script/33183>\
**Category:** Development\
**Tags:** segmentation\
**Created:** [December 3, 2023, 1:23am UTC](https://discourse.slicer.org/t/how-to-add-some-holes-by-script/33183 "2023-12-03T01:23:00Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![slicer365](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/slicer365/32/67549_2.png) [@slicer365](https://discourse.slicer.org/u/slicer365)\
**Post date:** [December 3, 2023, 1:23am UTC](https://discourse.slicer.org/t/how-to-add-some-holes-by-script/33183/1 "2023-12-03T01:23:00Z")

</div>

When I am splitting the skin, I want to add some holes on the surface of the skin model. This can be achieved using the eraser tool. Currently, I have placed some points on the surface of the skin model, and I want to write a script that obtains the RAS coordinates of each point and then iteratively creates holes using the eraser tool. How can I accomplish this? I am able to obtain the current segmentation node and markups node."

 ![44](https://us1.discourse-cdn.com/flex002/uploads/slicer/original/3X/1/7/17480983da5249b642bc81d59a03c2dd7724fa2b.png)

---

<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 3, 2023, 2:02am UTC](https://discourse.slicer.org/t/how-to-add-some-holes-by-script/33183/2 "2023-12-03T02:02:29Z")

</div>

You can add a small sphere-shaped segment at each point as shown in [this example](https://slicer.readthedocs.io/en/latest/developer_guide/script_repository.html#get-histogram-of-a-segmented-region). You can then use Logical operators effect to subtract these sphere segments from the skull cap segment.
