# sitk.ConnectedComponent

**URL:** https://discourse.itk.org/t/sitk-connectedcomponent/876
**Category:** Algorithms
**Created:** [April 27, 2018, 3:21pm UTC](https://discourse.itk.org/t/sitk-connectedcomponent/876 "2018-04-27T15:21:16Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![Giuseppe\_Amatulli](https://discourse.itk.org/letter_avatar_proxy/v4/letter/g/ed655f/32.png) [@Giuseppe\_Amatulli](https://discourse.itk.org/u/Giuseppe_Amatulli)
#### Post date: [April 27, 2018, 3:21pm UTC](https://discourse.itk.org/t/sitk-connectedcomponent/876/1 "2018-04-27T15:21:18Z")

</div>

Hi ,  
I had a scripting procedure that was using SimpleITK 0.10.0  
marker\_img = sitk.ConnectedComponent(peak, fullyConnected=True) , where peak is an image 0 , 1.  
The sitk.ConnectedComponent was run correctly with no errors.

Now I’m using SimpleITK 1.1.0 and the same command does not work anymore  
TypeError: ConnectedComponent() got an unexpected keyword argument ‘fullyConnected’

I have tried to read the manual but i did not find any useful suggestion.  
Is the command change? and if yes which is the new syntax?

Thank You  
Sincerely  
Giuseppe

---

<div class="post-metadata">

### Author: ![zivy](https://discourse.itk.org/user_avatar/discourse.itk.org/zivy/32/1726_2.png) [@zivy](https://discourse.itk.org/u/zivy)
#### Post date: [April 27, 2018, 3:32pm UTC](https://discourse.itk.org/t/sitk-connectedcomponent/876/2 "2018-04-27T15:32:25Z")

</div>

Hello Giuseppe,

The syntax hasn’t changed, it is a problem/feature of SWIG and needs to be addressed there.

When we overload a function, named arguments don’t work. The [ConnectedComponent](https://itk.org/SimpleITKDoxygen/html/namespaceitk_1_1simple.html#a55cfd9d5f7f425ca8092d63f0d3bdc81) function has two variants now.

The solution in your case is to provide all arguments based on location (use the default values for those you didn’t provided in the past).

```
Ziv
```
