# Split slice based on connection

**URL:** https://discourse.paraview.org/t/split-slice-based-on-connection/5998
**Category:** ParaView Support
**Created:** [December 7, 2020, 6:15am UTC](https://discourse.paraview.org/t/split-slice-based-on-connection/5998 "2020-12-07T06:15:40Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![BastiL](https://discourse.paraview.org/letter_avatar_proxy/v4/letter/b/df705f/32.png) [@BastiL](https://discourse.paraview.org/u/BastiL)
#### Post date: [December 7, 2020, 6:15am UTC](https://discourse.paraview.org/t/split-slice-based-on-connection/5998/1 "2020-12-07T06:15:40Z")

</div>

Hello all,

I have a slice that consists of several disconnected region. I want to do the following:

1. Calculate the average of some (scalar) variables for each of the disconnected regions individually
2. Draw glyphs on the average

For step 1 I thought about using “ExtractCellsByRegion” filter on each of the disconnected regions and run “IntegrateVarables” afterwards. Howeve, I have several hundreds of disconnected regions which makes running “ExtractCellsByRegion” a real pain. Is there something like “ExtractCellsByConnection”?

Thanks.

---

<div class="post-metadata">

### Author: ![Kenichiro-Yoshimi](https://discourse.paraview.org/letter_avatar_proxy/v4/letter/k/ecc23a/32.png) [@Kenichiro-Yoshimi](https://discourse.paraview.org/u/Kenichiro-Yoshimi)
#### Post date: [December 8, 2020, 12:08am UTC](https://discourse.paraview.org/t/split-slice-based-on-connection/5998/2 "2020-12-08T00:08:20Z")

</div>

Hello,

The **Connectivity** filter can assign a single RegionID to each connected region. Then, each of the connected regions could be extracted based on the RegionID array by using the **Threshold** filter or **Edit \> FindData**. Additionally, there are many disconnected regions, so the tasks should be automatically achieved via a python script as macros.
