# How to map volume data to a slice viewer in a non-linear transformation using custom code?

**URL:** <https://discourse.slicer.org/t/how-to-map-volume-data-to-a-slice-viewer-in-a-non-linear-transformation-using-custom-code/12882>\
**Category:** Development\
**Tags:** transforms, coordinates\
**Created:** [August 7, 2020, 1:17am UTC](https://discourse.slicer.org/t/how-to-map-volume-data-to-a-slice-viewer-in-a-non-linear-transformation-using-custom-code/12882 "2020-08-07T01:17:12Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Tesla2687](https://avatars.discourse-cdn.com/v4/letter/t/c4cdca/32.png) [@Tesla2687](https://discourse.slicer.org/u/Tesla2687)\
**Post date:** [August 7, 2020, 1:17am UTC](https://discourse.slicer.org/t/how-to-map-volume-data-to-a-slice-viewer-in-a-non-linear-transformation-using-custom-code/12882/1 "2020-08-07T01:17:12Z")

</div>

Operating system:Windows 10  
Slicer version: 4.11.0  
Expected behavior: How to map volume data to a slice display viewer in a non-linear transformation using custom code?  
Actual behavior:

I would like to display a curved slice in Red slice view. This should use a non-linear transformation to do that. Is there any suggestion to do this?  
Goal:  
 ![image](https://us1.discourse-cdn.com/flex002/uploads/slicer/original/3X/3/9/39bb32dd4ad59be137055565bfb2be1b7bfe05f2.png)

Display the volume upon in a curved style like the volume below by non-linear transform.

![image](https://us1.discourse-cdn.com/flex002/uploads/slicer/original/3X/2/4/24b53c819cab92a20f0028c33a28457a8bc53b1e.jpeg)

---

<div class="post-metadata">

**Author:** ![lassoan](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/lassoan/32/13_2.png) [@lassoan](https://discourse.slicer.org/u/lassoan)\
**Post date:** [August 7, 2020, 2:57am UTC](https://discourse.slicer.org/t/how-to-map-volume-data-to-a-slice-viewer-in-a-non-linear-transformation-using-custom-code/12882/2 "2020-08-07T02:57:49Z")

</div>

Ultrasound scan conversion can be indeed very efficiently implemented using a grid transform. See for example how it is done in [GE Kretz 3D ultrasound reader in SlicerHeart extension](https://github.com/SlicerHeart/SlicerHeart/tree/master/KretzFileReader).

Note that SlicerHeart extension can import 3D/4D ultrasound data from a wide range of systems. For 2D (and 2D+t) ultrasound scan conversion, you can use [SlicerIGT extension](https://www.slicerigt.org) and [Plus toolkit](https://plustoolkit.github.io/).

We can give more information about features that could be useful for you if you write a bit about your project. What is your end goal?

---

<div class="post-metadata">

**Author:** ![Tesla2687](https://avatars.discourse-cdn.com/v4/letter/t/c4cdca/32.png) [@Tesla2687](https://discourse.slicer.org/u/Tesla2687)\
**Post date:** [August 9, 2020, 12:52am UTC](https://discourse.slicer.org/t/how-to-map-volume-data-to-a-slice-viewer-in-a-non-linear-transformation-using-custom-code/12882/3 "2020-08-09T00:52:47Z")

</div>

Thank you very much lassoan.
