# How do i implement a feature such as (mask=segmentaion==c python language) with c++ itk

**URL:** https://discourse.itk.org/t/how-do-i-implement-a-feature-such-as-mask-segmentaion-c-python-language-with-c-itk/4985
**Category:** Beginner Questions
**Created:** [May 13, 2022, 9:46am UTC](https://discourse.itk.org/t/how-do-i-implement-a-feature-such-as-mask-segmentaion-c-python-language-with-c-itk/4985 "2022-05-13T09:46:48Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![Bugmaker](https://discourse.itk.org/user_avatar/discourse.itk.org/bugmaker/32/2500_2.png) [@Bugmaker](https://discourse.itk.org/u/Bugmaker)
#### Post date: [May 13, 2022, 9:46am UTC](https://discourse.itk.org/t/how-do-i-implement-a-feature-such-as-mask-segmentaion-c-python-language-with-c-itk/4985/1 "2022-05-13T09:46:48Z")

</div>

I want to transform the following code into ITK(c++ version), But I do not know which functions could do it. HELP!

```auto
for c in labels: # labels is list that stores the labelmap's unique value
      mask = segmentation==c #segmentation is LabelMap
      reshape_multihot = resize(mask,shape.....) # resize import from skimage.transform
      reshape[reshape_multihot>=0.5]=c

```

---

<div class="post-metadata">

### Author: ![matt.mccormick](https://discourse.itk.org/user_avatar/discourse.itk.org/matt.mccormick/32/7_2.png) [@matt.mccormick](https://discourse.itk.org/u/matt.mccormick)
#### Post date: [May 13, 2022, 9:54am UTC](https://discourse.itk.org/t/how-do-i-implement-a-feature-such-as-mask-segmentaion-c-python-language-with-c-itk/4985/2 "2022-05-13T09:54:14Z")

</div>

Hi,

The following may be useful:

- [itk::MaskImageFilter](https://itk.org/Doxygen/html/classitk_1_1MaskImageFilter.html)
- [itk::ResampleImageFilter](https://itk.org/Doxygen/html/classitk_1_1ResampleImageFilter.html)
- [itk::BinaryThresholdImageFilter](https://itk.org/Doxygen/html/classitk_1_1BinaryThresholdImageFilter.html)

---

<div class="post-metadata">

### Author: ![Bugmaker](https://discourse.itk.org/user_avatar/discourse.itk.org/bugmaker/32/2500_2.png) [@Bugmaker](https://discourse.itk.org/u/Bugmaker)
#### Post date: [May 16, 2022, 12:58am UTC](https://discourse.itk.org/t/how-do-i-implement-a-feature-such-as-mask-segmentaion-c-python-language-with-c-itk/4985/3 "2022-05-16T00:58:24Z")

</div>

Thanks, i will check those files.
