# ITK not working in Python

**URL:** https://discourse.itk.org/t/itk-not-working-in-python/4733
**Category:** Beginner Questions
**Created:** [January 16, 2022, 2:37am UTC](https://discourse.itk.org/t/itk-not-working-in-python/4733 "2022-01-16T02:37:14Z")
**Posts on this page:** 3
**Page:** 2

<div class="post-metadata">

### Author: ![edgar](https://discourse.itk.org/letter_avatar_proxy/v4/letter/e/b487fb/32.png) [@edgar](https://discourse.itk.org/u/edgar)
#### Post date: [February 3, 2022, 12:42am UTC](https://discourse.itk.org/t/itk-not-working-in-python/4733/21 "2022-02-03T00:42:24Z")

</div>

Hi. As a new user of the Python interface of ITK, I would say that you may want to try GNU/Linux on a virtual machine just to test if your code is correct. You can also try a live medium (live USB or live DVD). In my short experience, I have learnt that a GNU/Linux machine or working environment is much better if I am doing any sort of development. Another recommendation is to ask your software provider if they can help you. Good luck.

---

<div class="post-metadata">

### Author: ![lassoan](https://discourse.itk.org/user_avatar/discourse.itk.org/lassoan/32/27_2.png) [@lassoan](https://discourse.itk.org/u/lassoan)
#### Post date: [April 13, 2022, 4:33am UTC](https://discourse.itk.org/t/itk-not-working-in-python/4733/22 "2022-04-13T04:33:52Z")

</div>

> [@edgar](#):
>
> I would say that you may want to try GNU/Linux on a virtual machine just to test if your code is correct.

I would recommend to keep using the operating system that you are the most comfortable with. Everything should work on Windows, Linux, and macOS.

> [@matt.mccormick](#):
>
> `reader = itk.ImageFileReader[inputImageType].New()`

Is there a way to just read the input image without specifying the image type in advance? (normally you don’t know the image type until you read the file)

---

<div class="post-metadata">

### Author: ![dzenanz](https://discourse.itk.org/user_avatar/discourse.itk.org/dzenanz/32/1093_2.png) [@dzenanz](https://discourse.itk.org/u/dzenanz)
#### Post date: [April 13, 2022, 1:42pm UTC](https://discourse.itk.org/t/itk-not-working-in-python/4733/23 "2022-04-13T13:42:06Z")

</div>

> read the input image without specifying the image type

Yes. The [basic example](https://itkpythonpackage.readthedocs.io/en/master/Quick_start_guide.html#basic-example) demonstrates that:

```py
image = itk.imread(input_filename)
median = itk.median_image_filter(image, radius=2)
itk.imwrite(median, output_filename)

```

This should work all image types ITK was built with wrapping support for. For example both 2D uchar images and 3D short images.

[Previous page](https://discourse.itk.org/t/itk-not-working-in-python/4733.md?page=1)
