# Poor segmentation and intersection performance

**URL:** <https://discourse.slicer.org/t/poor-segmentation-and-intersection-performance/31344>\
**Category:** Support\
**Tags:** segmentation, python\
**Created:** [August 24, 2023, 8:25pm UTC](https://discourse.slicer.org/t/poor-segmentation-and-intersection-performance/31344 "2023-08-24T20:25:47Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![d0rnkernsky](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/d0rnkernsky/32/67029_2.png) [@d0rnkernsky](https://discourse.slicer.org/u/d0rnkernsky)\
**Post date:** [August 24, 2023, 8:25pm UTC](https://discourse.slicer.org/t/poor-segmentation-and-intersection-performance/31344/1 "2023-08-24T20:25:47Z")

</div>

Hello everyone!

I have troubles with slicer’s performance while working with segmentation and segments. My goal is to build a heart segmentation that consists of 360 small segments. My workflow has two parts:

Part A: load a myocardium segmentation (a single object in seg.nrrd format) and add 360 wedges around it (like a cylinder)  
Context: Slicer loads it as a binary label map representation, I have to convert it to closed surface otherwise the wedging takes several hours vs. 3 minutes now. I use the AddSegmentFromClosedSurfaceRepresentation function to add the wedges.

Part B: take the intersection between the initial myocardium segmentation and each wedge.  
Context: When Part A completes, a window pops up saying that in order to edit the representation I have to convert it to a binary label map, which I do. The conversion takes 20 seconds. Then taking the intersections takes 50 minutes at best to complete.

I have several questions:

1. Is intersection only available for binary label maps?
2. Is there a way to make taking the intersections faster? For example, doing it in a CLI module without visualizing it.

Please let me know if I am not being clear. I will greatly appreciate your help.
