# Support for 2D transforms?

**URL:** https://discourse.slicer.org/t/support-for-2d-transforms/34701
**Category:** Feature requests
**Created:** [March 4, 2024, 5:49pm UTC](https://discourse.slicer.org/t/support-for-2d-transforms/34701 "2024-03-04T17:49:01Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![dzenanz](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/dzenanz/32/1992_2.png) [@dzenanz](https://discourse.slicer.org/u/dzenanz)
#### Post date: [March 4, 2024, 5:49pm UTC](https://discourse.slicer.org/t/support-for-2d-transforms/34701/1 "2024-03-04T17:49:01Z")

</div>

sample2D.tfm

```txt
#Insight Transform File V1.0
#Transform 0
Transform: AffineTransform_float_2_2
Parameters: 0.99985015 0.017311562 -0.017311562 0.99985015 -0.64851546 -0.7623114
FixedParameters: 0 0

```

when opened in Slicer, produces this non-sense:

 ![Screenshot 2024-03-04 12.46.01](https://us1.discourse-cdn.com/flex002/uploads/slicer/original/3X/f/6/f660594e90436af3c2f39b28fe86d24f19298721.png)

Is this a known issue? Are there any plans to address it?

---

<div class="post-metadata">

### Author: ![pieper](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/pieper/32/8_2.png) [@pieper](https://discourse.slicer.org/u/pieper)
#### Post date: [March 4, 2024, 6:32pm UTC](https://discourse.slicer.org/t/support-for-2d-transforms/34701/2 "2024-03-04T18:32:25Z")

</div>

I suppose that converting these into a 3D affine might be useful in some cases. Otherwise just refusing to read them seems like an easy option.

Looks like this is being done implicitly in [this code](https://github.com/Slicer/Slicer/blob/5e831bcfad3e501c79b03d32f053d5c2d9effc93/Libs/MRML/Core/vtkMRMLTransformStorageNode.cxx#L303-L511) somewhere.

@dzenanz what happens in ITK if you try to read this 2D transform with a 3D transform reader?

---

<div class="post-metadata">

### Author: ![dzenanz](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/dzenanz/32/1992_2.png) [@dzenanz](https://discourse.slicer.org/u/dzenanz)
#### Post date: [March 4, 2024, 6:37pm UTC](https://discourse.slicer.org/t/support-for-2d-transforms/34701/3 "2024-03-04T18:37:03Z")

</div>

Converting 2D transforms into 3D transforms would be quite useful (transformations in the 3rd dimension all identity/zero). And ideally, not just for affines but for displacement fields too.

> try to read this 2D transform with a 3D transform reader

I assume it would crash as there are not enough parameters, or maybe because the transform name does not match the expectation.

---

<div class="post-metadata">

### Author: ![dzenanz](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/dzenanz/32/1992_2.png) [@dzenanz](https://discourse.slicer.org/u/dzenanz)
#### Post date: [November 10, 2025, 4:20pm UTC](https://discourse.slicer.org/t/support-for-2d-transforms/34701/4 "2025-11-10T16:20:48Z")

</div>

For posterity: I created an [issue with more detail](https://github.com/Slicer/Slicer/issues/7633).
