# Set Image Direction from numpy array

**URL:** <https://discourse.itk.org/t/set-image-direction-from-numpy-array/844>\
**Category:** Beginner Questions\
**Tags:** python\
**Created:** [April 18, 2018, 9:47am UTC](https://discourse.itk.org/t/set-image-direction-from-numpy-array/844 "2018-04-18T09:47:06Z")\
**Posts on this page:** 6\
**Page:** 2

<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:** [July 31, 2019, 3:34pm UTC](https://discourse.itk.org/t/set-image-direction-from-numpy-array/844/21 "2019-07-31T15:34:06Z")

</div>

It is worth noting that ITK 5.0 already includes a much cleaner approach here that avoids interacting with `vnl_matrix`:

```auto
new_direction = np.eye(2)
image.SetDirection(itk.matrix_from_array(new_direction))

```

---

<div class="post-metadata">

**Author:** ![constantine](https://discourse.itk.org/user_avatar/discourse.itk.org/constantine/32/3915_2.png) [@constantine](https://discourse.itk.org/u/constantine)\
**Post date:** [February 19, 2024, 1:35am UTC](https://discourse.itk.org/t/set-image-direction-from-numpy-array/844/23 "2024-02-19T01:35:46Z")

</div>

@matt.mccormick — this is very nice indeed. I’m wondering, where can I have a look at the rest of Python API (list of what’s what) for my general education on the matter of Python ITK for functionality discovery?

I’m aware there’s always python online help such as `dir(itk)` and `itk.*matrix*?` and friends, along with [https://docs.itk.org/en/latest/learn/python\_quick\_start.html](https://https://docs.itk.org/en/latest/learn/python_quick_start.html), but I can’t seem to be able an equivalent to [https://itk.org/Doxygen/html/index.html](https://itk.org/Doxygen/html/index.html), which facilitates functionality discovery very much.

---

<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:** [February 19, 2024, 2:27pm UTC](https://discourse.itk.org/t/set-image-direction-from-numpy-array/844/24 "2024-02-19T14:27:20Z")

</div>

@constantine yes, the [quick start](https://docs.itk.org/en/latest/learn/python_quick_start.html) is helpful, and the embedded docs, accessed with the Python built-ins, `dir()` or `help()` are informative, albeit verbose. One motivation for [ITK-Wasm](https://wasm.itk.org) is that it enables Pythonic interfaces along with Markdown/Sphinx documentation, linkable via InterSphinx – [example](https://py.docs.elastix.wasm.itk.eth.limo/apidocs/index.html).

---

<div class="post-metadata">

**Author:** ![constantine](https://discourse.itk.org/user_avatar/discourse.itk.org/constantine/32/3915_2.png) [@constantine](https://discourse.itk.org/u/constantine)\
**Post date:** [February 19, 2024, 11:11pm UTC](https://discourse.itk.org/t/set-image-direction-from-numpy-array/844/25 "2024-02-19T23:11:27Z")

</div>

Yes! I see ITK-Wasm (Python) API reference — it’s great.

Is there ITK Python API reference like that?

---

<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:** [February 20, 2024, 3:24am UTC](https://discourse.itk.org/t/set-image-direction-from-numpy-array/844/26 "2024-02-20T03:24:10Z")

</div>

Not yet – it would come with ITK 6.

---

<div class="post-metadata">

**Author:** ![constantine](https://discourse.itk.org/user_avatar/discourse.itk.org/constantine/32/3915_2.png) [@constantine](https://discourse.itk.org/u/constantine)\
**Post date:** [February 22, 2024, 1:18am UTC](https://discourse.itk.org/t/set-image-direction-from-numpy-array/844/27 "2024-02-22T01:18:35Z")

</div>

ITK 6 — this is exciting!

[Previous page](https://discourse.itk.org/t/set-image-direction-from-numpy-array/844.md?page=1)
