<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: Spatial transformations: Three-dimensional rotation</title>
	<atom:link href="http://blogs.mathworks.com/steve/2006/08/17/spatial-transformations-three-dimensional-rotation/feed/" rel="self" type="application/rss+xml" />
	<link>http://blogs.mathworks.com/steve/2006/08/17/spatial-transformations-three-dimensional-rotation/</link>
	<description>Steve Eddins manages the Image &#38; Geospatial development team at The MathWorks and coauthored Digital Image Processing Using MATLAB. He writes here about image processing concepts, algorithm implementations, and MATLAB.</description>
	<lastBuildDate>Sat, 11 Feb 2012 18:27:50 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
	<item>
		<title>By: Miguel Sotaquira</title>
		<link>http://blogs.mathworks.com/steve/2006/08/17/spatial-transformations-three-dimensional-rotation/#comment-24776</link>
		<dc:creator>Miguel Sotaquira</dc:creator>
		<pubDate>Tue, 03 Jan 2012 13:32:17 +0000</pubDate>
		<guid isPermaLink="false">http://blogs.mathworks.com/steve/?p=79#comment-24776</guid>
		<description>Hi Steve!

I&#039;m trying to use the approach described in this blog to rotate a 3-D volume. The volume&#039;s main axis is oriented along a z&#039; direction, which differs from the z direction on the cartesian coordinate system.

In fact up to this point what I have is the volume and the set of unit vectors defining the local coordinate system:
x&#039; = [0.7071 0.7071 0];
y&#039; = [-0.6802 0.6802 0.2735];
z&#039; = [0.1934 -0.1934 0.9619];

What I want is to rotate this volume so as to obtain a new one with its main axis parallel to z-axis ([0 0 1]). In order to do so I&#039;m using the sequence of affine transformations: 
- Translation to the origin (T1 matrix)
- Rotation (T2 matrix)
- Translation back to the starting location (T3 matrix)

I&#039;m having problems defining the angle (theta) of the rotation matrix T2, since at this point what I have are the unit vector of my local coordinate system.

What would be the approach in this case?
Thanks!</description>
		<content:encoded><![CDATA[<p>Hi Steve!</p>
<p>I&#8217;m trying to use the approach described in this blog to rotate a 3-D volume. The volume&#8217;s main axis is oriented along a z&#8217; direction, which differs from the z direction on the cartesian coordinate system.</p>
<p>In fact up to this point what I have is the volume and the set of unit vectors defining the local coordinate system:<br />
x&#8217; = [0.7071 0.7071 0];<br />
y&#8217; = [-0.6802 0.6802 0.2735];<br />
z&#8217; = [0.1934 -0.1934 0.9619];</p>
<p>What I want is to rotate this volume so as to obtain a new one with its main axis parallel to z-axis ([0 0 1]). In order to do so I&#8217;m using the sequence of affine transformations:<br />
- Translation to the origin (T1 matrix)<br />
- Rotation (T2 matrix)<br />
- Translation back to the starting location (T3 matrix)</p>
<p>I&#8217;m having problems defining the angle (theta) of the rotation matrix T2, since at this point what I have are the unit vector of my local coordinate system.</p>
<p>What would be the approach in this case?<br />
Thanks!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Steve Eddins</title>
		<link>http://blogs.mathworks.com/steve/2006/08/17/spatial-transformations-three-dimensional-rotation/#comment-24742</link>
		<dc:creator>Steve Eddins</dc:creator>
		<pubDate>Wed, 14 Dec 2011 15:42:20 +0000</pubDate>
		<guid isPermaLink="false">http://blogs.mathworks.com/steve/?p=79#comment-24742</guid>
		<description>Ibrahim&#8212;See the posts on my &lt;a href=&quot;http://blogs.mathworks.com/steve/category/spatial-transforms/&quot; rel=&quot;nofollow&quot;&gt;spatial transforms&lt;/a&gt; series about controlling the input and output grids.</description>
		<content:encoded><![CDATA[<p>Ibrahim&mdash;See the posts on my <a href="http://blogs.mathworks.com/steve/category/spatial-transforms/" rel="nofollow">spatial transforms</a> series about controlling the input and output grids.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Ibrahim</title>
		<link>http://blogs.mathworks.com/steve/2006/08/17/spatial-transformations-three-dimensional-rotation/#comment-24741</link>
		<dc:creator>Ibrahim</dc:creator>
		<pubDate>Wed, 14 Dec 2011 15:31:47 +0000</pubDate>
		<guid isPermaLink="false">http://blogs.mathworks.com/steve/?p=79#comment-24741</guid>
		<description>Hi Steve, 

I worked on your example code, but I could not get what I really wanted.

I want to rotate a 3D image, but when I rotate it, rotated image is cropped. 

I need help, could you please help me?</description>
		<content:encoded><![CDATA[<p>Hi Steve, </p>
<p>I worked on your example code, but I could not get what I really wanted.</p>
<p>I want to rotate a 3D image, but when I rotate it, rotated image is cropped. </p>
<p>I need help, could you please help me?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Steve</title>
		<link>http://blogs.mathworks.com/steve/2006/08/17/spatial-transformations-three-dimensional-rotation/#comment-24417</link>
		<dc:creator>Steve</dc:creator>
		<pubDate>Wed, 17 Aug 2011 02:14:17 +0000</pubDate>
		<guid isPermaLink="false">http://blogs.mathworks.com/steve/?p=79#comment-24417</guid>
		<description>Haque&#8212;If I understand your description correctly, you could just use tformarray for the whole operation. But if you want to implement the pieces yourself as you describe, then it sounds like you could use interp3 for your missing piece.</description>
		<content:encoded><![CDATA[<p>Haque&mdash;If I understand your description correctly, you could just use tformarray for the whole operation. But if you want to implement the pieces yourself as you describe, then it sounds like you could use interp3 for your missing piece.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Haque</title>
		<link>http://blogs.mathworks.com/steve/2006/08/17/spatial-transformations-three-dimensional-rotation/#comment-24406</link>
		<dc:creator>Haque</dc:creator>
		<pubDate>Sun, 14 Aug 2011 07:15:31 +0000</pubDate>
		<guid isPermaLink="false">http://blogs.mathworks.com/steve/?p=79#comment-24406</guid>
		<description>Hi Steve,
I have a 3D coordinate of a Volume like, 
Index=find(V);
[x,y,z]=ind2sub(size(V),Index);
Now after applying few transformations the new coordinate becomes Xn,Yn,Zn those are noninteger values. Though, the number of grid points is same for both of them but the new coordinate&#039;s maximum dimension is bigger than the old one. Like, for the old coordinate the maximum value was 128 and now it’s becoming 300. Now I want to interpolate V into the Xn,Yn,Zn and refill the empty grids with the values based on interpolation methods. Would you please help me out by giving some suggestion based on how could I do that?
Thanks in advance.</description>
		<content:encoded><![CDATA[<p>Hi Steve,<br />
I have a 3D coordinate of a Volume like,<br />
Index=find(V);<br />
[x,y,z]=ind2sub(size(V),Index);<br />
Now after applying few transformations the new coordinate becomes Xn,Yn,Zn those are noninteger values. Though, the number of grid points is same for both of them but the new coordinate&#8217;s maximum dimension is bigger than the old one. Like, for the old coordinate the maximum value was 128 and now it’s becoming 300. Now I want to interpolate V into the Xn,Yn,Zn and refill the empty grids with the values based on interpolation methods. Would you please help me out by giving some suggestion based on how could I do that?<br />
Thanks in advance.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Steve</title>
		<link>http://blogs.mathworks.com/steve/2006/08/17/spatial-transformations-three-dimensional-rotation/#comment-24200</link>
		<dc:creator>Steve</dc:creator>
		<pubDate>Fri, 13 May 2011 13:53:41 +0000</pubDate>
		<guid isPermaLink="false">http://blogs.mathworks.com/steve/?p=79#comment-24200</guid>
		<description>Kim (comment 56)&#8212;You&#039;ll need some understanding of input-space and output-space coordinate systems when you are transform images. I have written about this a few times. See, for example:

&lt;ul&gt;
&lt;li&gt;&lt;a href=&quot;http://blogs.mathworks.com/steve/2006/01/31/spatial-transformations-terminology-and-notation/&quot; rel=&quot;nofollow&quot;&gt;Spatial transformations: Terminology and notation&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://blogs.mathworks.com/steve/2006/02/28/spatial-transformations-where-is-the-input-image/&quot; rel=&quot;nofollow&quot;&gt;Spatial transformations: Where is the input image?&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://blogs.mathworks.com/steve/2006/05/12/spatial-transformations-where-is-the-output-image/&quot; rel=&quot;nofollow&quot;&gt;Spatial transformations: Where is the output image?&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://blogs.mathworks.com/steve/2006/08/01/spatial-transformations-controlling-the-input-and-output-grids-with-imtransform/&quot; rel=&quot;nofollow&quot;&gt;Spatial transformations: Controlling the input and output grids with imtransform&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;</description>
		<content:encoded><![CDATA[<p>Kim (comment 56)&mdash;You&#8217;ll need some understanding of input-space and output-space coordinate systems when you are transform images. I have written about this a few times. See, for example:</p>
<ul>
<li><a href="http://blogs.mathworks.com/steve/2006/01/31/spatial-transformations-terminology-and-notation/" rel="nofollow">Spatial transformations: Terminology and notation</a></li>
<li><a href="http://blogs.mathworks.com/steve/2006/02/28/spatial-transformations-where-is-the-input-image/" rel="nofollow">Spatial transformations: Where is the input image?</a></li>
<li><a href="http://blogs.mathworks.com/steve/2006/05/12/spatial-transformations-where-is-the-output-image/" rel="nofollow">Spatial transformations: Where is the output image?</a></li>
<li><a href="http://blogs.mathworks.com/steve/2006/08/01/spatial-transformations-controlling-the-input-and-output-grids-with-imtransform/" rel="nofollow">Spatial transformations: Controlling the input and output grids with imtransform</a></li>
</ul>
]]></content:encoded>
	</item>
	<item>
		<title>By: Steve</title>
		<link>http://blogs.mathworks.com/steve/2006/08/17/spatial-transformations-three-dimensional-rotation/#comment-24198</link>
		<dc:creator>Steve</dc:creator>
		<pubDate>Fri, 13 May 2011 13:44:12 +0000</pubDate>
		<guid isPermaLink="false">http://blogs.mathworks.com/steve/?p=79#comment-24198</guid>
		<description>Sohaib (comment 46)&#8212;My mistake, sorry.</description>
		<content:encoded><![CDATA[<p>Sohaib (comment 46)&mdash;My mistake, sorry.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Steve</title>
		<link>http://blogs.mathworks.com/steve/2006/08/17/spatial-transformations-three-dimensional-rotation/#comment-24130</link>
		<dc:creator>Steve</dc:creator>
		<pubDate>Tue, 26 Apr 2011 12:34:01 +0000</pubDate>
		<guid isPermaLink="false">http://blogs.mathworks.com/steve/?p=79#comment-24130</guid>
		<description>Sundar&#8212;When using tformarray, you should be aware that it maps dimensions differently than imtransform. With tformarray, the first dimension of the mathematical warping function corresponds to the first subscript dimension of the array. The second dimension of the mathematical warping function corresponds to the second subscript dimension of the array, and so on. For the first two dimensions, this order is the opposite of the X-Y convention used by imtransform. This might be the reason your rotation is working in a different direction than you expect.</description>
		<content:encoded><![CDATA[<p>Sundar&mdash;When using tformarray, you should be aware that it maps dimensions differently than imtransform. With tformarray, the first dimension of the mathematical warping function corresponds to the first subscript dimension of the array. The second dimension of the mathematical warping function corresponds to the second subscript dimension of the array, and so on. For the first two dimensions, this order is the opposite of the X-Y convention used by imtransform. This might be the reason your rotation is working in a different direction than you expect.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: alexandra</title>
		<link>http://blogs.mathworks.com/steve/2006/08/17/spatial-transformations-three-dimensional-rotation/#comment-24123</link>
		<dc:creator>alexandra</dc:creator>
		<pubDate>Sun, 24 Apr 2011 17:01:12 +0000</pubDate>
		<guid isPermaLink="false">http://blogs.mathworks.com/steve/?p=79#comment-24123</guid>
		<description>Hi Steve,

I was reading your answer at number 25:

&quot;Any coordinate system scaling or translating that you might need, for example to shift the image over in order to capture all of it, have to be incorporated into the spatial transformation function itself.&quot;

I don&#039;t understand how to incorporate the changes in the coordinates into the spatial transformation function.. can you give me a few more details? I am doing an affine transformation for a volume. 

Also, where can I get more info about the internal structure of a TFORM struct? I couldn&#039;t seem to find it online. 

Thanks, your example was very helpful.</description>
		<content:encoded><![CDATA[<p>Hi Steve,</p>
<p>I was reading your answer at number 25:</p>
<p>&#8220;Any coordinate system scaling or translating that you might need, for example to shift the image over in order to capture all of it, have to be incorporated into the spatial transformation function itself.&#8221;</p>
<p>I don&#8217;t understand how to incorporate the changes in the coordinates into the spatial transformation function.. can you give me a few more details? I am doing an affine transformation for a volume. </p>
<p>Also, where can I get more info about the internal structure of a TFORM struct? I couldn&#8217;t seem to find it online. </p>
<p>Thanks, your example was very helpful.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Steve</title>
		<link>http://blogs.mathworks.com/steve/2006/08/17/spatial-transformations-three-dimensional-rotation/#comment-24120</link>
		<dc:creator>Steve</dc:creator>
		<pubDate>Sat, 23 Apr 2011 19:27:02 +0000</pubDate>
		<guid isPermaLink="false">http://blogs.mathworks.com/steve/?p=79#comment-24120</guid>
		<description>Aaron&#8212;That looks like the basic idea.</description>
		<content:encoded><![CDATA[<p>Aaron&mdash;That looks like the basic idea.</p>
]]></content:encoded>
	</item>
</channel>
</rss>

