# Simple ITK TransformVector Returning Error

**URL:** https://discourse.itk.org/t/simple-itk-transformvector-returning-error/5306
**Category:** Algorithms
**Tags:** python, simpleitk
**Created:** [August 29, 2022, 4:20pm UTC](https://discourse.itk.org/t/simple-itk-transformvector-returning-error/5306 "2022-08-29T16:20:33Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![natwille1](https://discourse.itk.org/user_avatar/discourse.itk.org/natwille1/32/2911_2.png) [@natwille1](https://discourse.itk.org/u/natwille1)
#### Post date: [August 29, 2022, 4:20pm UTC](https://discourse.itk.org/t/simple-itk-transformvector-returning-error/5306/1 "2022-08-29T16:20:33Z")

</div>

Hi, I am trying to apply a 3D euler transform to a vector at a particular point:

```auto
basis = np.array([[1.0, 0.0, 0.0], [0.0, 1.0, 0.0], [0.0, 0.0, 1.0]])
origin = np.array([0.0, 0.0, 0.0]).reshape(-1, 3)
out = transform.TransformVector(basis, origin)

```

which returns the following error:  
`TypeError: in method 'Transform_TransformVector', argument 2 of type 'std::vector< double,std::allocator< double > > const &'`

Clearly I am specifying the inputs wrongly but I haven’t found any example of apply this function in the documentation or forum. Please help!

---

<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: [August 29, 2022, 5:08pm UTC](https://discourse.itk.org/t/simple-itk-transformvector-returning-error/5306/2 "2022-08-29T17:08:24Z")

</div>

Hello @natwille1,

Per the [function documentation](https://simpleitk.org/doxygen/latest/html/classitk_1_1simple_1_1Transform.html#a5ef512acb7c836d70dcc3aa40323c436), for linear transforms such as Euler3D the point does not matter, so any arbitrary setting is fine:

```auto
import SimpleITK as sitk
import numpy as np

transform = sitk.Euler3DTransform()
transform.SetTranslation([10, 20, 30])
transform.SetRotation(0, 0, np.pi/2.0) #90 degree rotation around z, x axis should become y

v = [1, 0, 0] # x axis
arbitrary_p = [0, 0, 0]

print(transform.TransformVector(v, arbitrary_p))
                               

```

---

<div class="post-metadata">

### Author: ![natwille1](https://discourse.itk.org/user_avatar/discourse.itk.org/natwille1/32/2911_2.png) [@natwille1](https://discourse.itk.org/u/natwille1)
#### Post date: [August 29, 2022, 7:35pm UTC](https://discourse.itk.org/t/simple-itk-transformvector-returning-error/5306/3 "2022-08-29T19:35:38Z")

</div>

Thanks, that simplified it!
