<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv=Content-Type content="text/html; charset=us-ascii">
<meta name=Generator content="Microsoft Word 12 (filtered medium)">
<style>
<!--
/* Font Definitions */
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0cm;
        margin-bottom:.0001pt;
        font-size:11.0pt;
        font-family:"Calibri","sans-serif";}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:purple;
        text-decoration:underline;}
span.EmailStyle17
        {mso-style-type:personal-compose;
        font-family:"Calibri","sans-serif";
        color:windowtext;}
.MsoChpDefault
        {mso-style-type:export-only;}
@page Section1
        {size:612.0pt 792.0pt;
        margin:72.0pt 72.0pt 72.0pt 72.0pt;}
div.Section1
        {page:Section1;}
-->
</style>
<!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
</head>
<body lang=EN-US link=blue vlink=purple>
<div class=Section1>
<p class=MsoNormal>Dear all,<o:p></o:p></p>
<p class=MsoNormal><o:p> </o:p></p>
<p class=MsoNormal>I’ve been searching through the mailing list. Although
there are several questions about transformations, <br>
I could not really find an answer that really clarifies transformations in VTK.<o:p></o:p></p>
<p class=MsoNormal><o:p> </o:p></p>
<p class=MsoNormal>Currently I have a vtkImageData structure, containing a
pointDataSet with data arrays containing scalars and vectors.<o:p></o:p></p>
<p class=MsoNormal><o:p> </o:p></p>
<p class=MsoNormal>I know that originally the data is flipped on the y and z
axis, and that the whole dataset needs to be rotated.<o:p></o:p></p>
<p class=MsoNormal>I prefer not to resample that data, because this may add
interpolation artefacts early on in my visualization pipeline.<o:p></o:p></p>
<p class=MsoNormal><o:p> </o:p></p>
<p class=MsoNormal>So I’ve found vtkMatrix4x4 to hold my transformation
matrix, and vtkTransform to carry out the transformation.<o:p></o:p></p>
<p class=MsoNormal>However, I think that for the vtkImageData I’d need to
use the vtkTransformFilter. <br>
(am I right? can I apply transformations on the level of image data?)<o:p></o:p></p>
<p class=MsoNormal><o:p> </o:p></p>
<p class=MsoNormal>So an initial attempt looks like this (just with an identity
matrix so far):<o:p></o:p></p>
<p class=MsoNormal><o:p> </o:p></p>
<p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;
font-family:"Courier New"'> <span style='color:black'>vtkMatrix4x4</span>
*<span style='color:black'>mat</span> = <span style='color:black'>vtkMatrix4x4</span>::<span
style='color:black'>New</span>();<o:p></o:p></span></p>
<p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;
font-family:"Courier New"'> <span style='color:black'>mat</span>-><span
style='color:black'>SetElement</span>(0,0, 1.0);<o:p></o:p></span></p>
<p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;
font-family:"Courier New"'> <span style='color:black'>mat</span>-><span
style='color:black'>SetElement</span>(0,1, 0.0);<o:p></o:p></span></p>
<p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;
font-family:"Courier New"'> <span style='color:black'>mat</span>-><span
style='color:black'>SetElement</span>(0,2, 0.0);<o:p></o:p></span></p>
<p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;
font-family:"Courier New"'> <span style='color:black'>mat</span>-><span
style='color:black'>SetElement</span>(0,3, 0.0);<o:p></o:p></span></p>
<p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;
font-family:"Courier New"'> <span style='color:black'>mat</span>-><span
style='color:black'>SetElement</span>(1,0, 0.0);<o:p></o:p></span></p>
<p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;
font-family:"Courier New"'> <span style='color:black'>mat</span>-><span
style='color:black'>SetElement</span>(1,1, 1.0);<o:p></o:p></span></p>
<p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;
font-family:"Courier New"'> <span style='color:black'>mat</span>-><span
style='color:black'>SetElement</span>(1,2, 0.0);<o:p></o:p></span></p>
<p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;
font-family:"Courier New"'> <span style='color:black'>mat</span>-><span
style='color:black'>SetElement</span>(1,3, 0.0);<o:p></o:p></span></p>
<p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;
font-family:"Courier New"'> <span style='color:black'>mat</span>-><span
style='color:black'>SetElement</span>(2,0, 0.0);<o:p></o:p></span></p>
<p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;
font-family:"Courier New"'> <span style='color:black'>mat</span>-><span
style='color:black'>SetElement</span>(2,1, 0.0);<o:p></o:p></span></p>
<p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;
font-family:"Courier New"'> <span style='color:black'>mat</span>-><span
style='color:black'>SetElement</span>(2,2, 1.0);<o:p></o:p></span></p>
<p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;
font-family:"Courier New"'> <span style='color:black'>mat</span>-><span
style='color:black'>SetElement</span>(2,3, 0.0);<o:p></o:p></span></p>
<p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;
font-family:"Courier New"'> <span style='color:black'>mat</span>-><span
style='color:black'>SetElement</span>(3,0, 0.0);<o:p></o:p></span></p>
<p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;
font-family:"Courier New"'> <span style='color:black'>mat</span>-><span
style='color:black'>SetElement</span>(3,1, 0.0);<o:p></o:p></span></p>
<p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;
font-family:"Courier New"'> <span style='color:black'>mat</span>-><span
style='color:black'>SetElement</span>(3,2, 0.0);<o:p></o:p></span></p>
<p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;
font-family:"Courier New"'> <span style='color:black'>mat</span>-><span
style='color:black'>SetElement</span>(3,3, 1.0);<o:p></o:p></span></p>
<p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;
font-family:"Courier New"'><o:p> </o:p></span></p>
<p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;
font-family:"Courier New"'> <span style='color:black'>vtkTransform</span>
*<span style='color:black'>trans</span> = <span style='color:black'>vtkTransform</span>::<span
style='color:black'>New</span>();<o:p></o:p></span></p>
<p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;
font-family:"Courier New"'> <span style='color:black'>trans</span>-><span
style='color:black'>SetMatrix</span>(<span style='color:black'>mat</span>);<o:p></o:p></span></p>
<p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;
font-family:"Courier New"'><o:p> </o:p></span></p>
<p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;
font-family:"Courier New"'> <span style='color:black'>vtkTransformFilter</span>
*<span style='color:black'>filter</span> = <span style='color:black'>vtkTransformFilter</span>::<span
style='color:black'>New</span>();<o:p></o:p></span></p>
<p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;
font-family:"Courier New"'> <span style='color:black'>filter</span>-><span
style='color:black'>SetInput</span>(imageD<span style='color:black'>ata</span>);<o:p></o:p></span></p>
<p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;
font-family:"Courier New"'> <span style='color:black'>filter</span>-><span
style='color:black'>SetTransform</span>(<span style='color:black'>trans</span>);<o:p></o:p></span></p>
<p class=MsoNormal><span style='font-size:10.0pt;font-family:"Courier New"'>
<span style='color:black'>filter</span>-><span style='color:black'>Update</span>();<o:p></o:p></span></p>
<p class=MsoNormal><span style='font-size:10.0pt;font-family:"Courier New"'><o:p> </o:p></span></p>
<p class=MsoNormal>The problem now is the get an output image data that I can
pass on to the next stage of the pipeline.<o:p></o:p></p>
<p class=MsoNormal><o:p> </o:p></p>
<p class=MsoNormal>Can anyone help me to get this right?<o:p></o:p></p>
<p class=MsoNormal><o:p> </o:p></p>
<p class=MsoNormal>Thanks in advance!<o:p></o:p></p>
<p class=MsoNormal><o:p> </o:p></p>
</div>
</body>
</html>