# Basic question about the format of Image2ProbeTransform

**URL:** <https://discourse.slicer.org/t/basic-question-about-the-format-of-image2probetransform/35372>\
**Category:** Support\
**Created:** [April 9, 2024, 12:59am UTC](https://discourse.slicer.org/t/basic-question-about-the-format-of-image2probetransform/35372 "2024-04-09T00:59:08Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![DHK](https://avatars.discourse-cdn.com/v4/letter/d/f475e1/32.png) [@DHK](https://discourse.slicer.org/u/DHK)\
**Post date:** [April 9, 2024, 12:59am UTC](https://discourse.slicer.org/t/basic-question-about-the-format-of-image2probetransform/35372/1 "2024-04-09T00:59:08Z")

</div>

Hello,

I have a question about the Image2ProbeTransform that is used in .mha files. As far as I can tell, all of the matrices have to be 4X4 matrices. Please correct me if I’m wrong.

I have an ultrasound probe with an attached markers, and its position in a reference system (Probe2ReferenceTransform) is known.

The thing is, the image plane itself is 2D, and while ([Plus applications user manual: Definition of commonly used coordinate systems](http://perk-software.cs.queensu.ca/plus/doc/nightly/user/CommonCoordinateSystems.html)) says that the Z-axis is a cross product of the X-axis and Y-axis, I have been having some confusion about how I should define the transformation matrix.

Say that the image coordinates are in (u, v) and I want to transform it to (x,y,z) in the probe coordinates. The two are linked via

[x [a1 a2 [p1  
y = b1 b2 \* [u + p2 z] c1 c2] v] p3]

or [x; y; z] = [a1, a2; b1, b2; c1, c2] \* [u, v] + [p1, p2, p3]. Semicolons denote new rows and commas denote new columns within a row a la MATLAB.

Values are

a1 = 0.3467;

a2 = -0.1316;

b1 = -0.2807;

b2 = -0.0620;

c1 = 0.1460;

c2 = -0.0394;

p1 = -109.1116;

p2 = 154.9904;

p3 = 5.9658;

I am thinking of a 4X4 Image2ProbeTransform

[a1, a2, 1, p1;  
b1, b2, 1, p2;  
c1, c2, 1, p3;  
0, 0, 0 1]

but it seems that while Slicer can track _an_ image via this method when I put it all into a .mha file, the image gets zoomed in, pixelated, and cut up from a 2D image into an odd slice like this:

[![](https://i.imgur.com/UPit8VT.png) ](https://i.imgur.com/UPit8VT.png)

I would greatly appreciate any help!

---

<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:** [April 9, 2024, 3:18am UTC](https://discourse.slicer.org/t/basic-question-about-the-format-of-image2probetransform/35372/2 "2024-04-09T03:18:20Z")

</div>

See detailed specification in the [PLUS toolkit documentation](http://perk-software.cs.queensu.ca/plus/doc/nightly/user/CoordinateSystemDefinitions.html#TransformationMatrix).
