<div dir="ltr"><pre style="white-space:pre-wrap;margin-top:0px;margin-bottom:0px"><span style="color:rgb(0,0,0)">I set the fourth component of the fourth column to 1:</span></pre><pre style="white-space:pre-wrap;margin-top:0px;margin-bottom:0px"><span style="color:rgb(0,0,0)"><br></span></pre><pre style="white-space:pre-wrap;margin-top:0px;margin-bottom:0px"><span style="color:rgb(0,0,0)">matriz</span><span style="color:rgb(0,0,0)">-></span><span style="color:rgb(0,0,0)">SetElement</span><span style="color:rgb(0,0,0)">(</span><span style="color:rgb(0,0,128)">3</span><span style="color:rgb(0,0,0)">,</span><span style="color:rgb(0,0,128)">3</span><span style="color:rgb(0,0,0)">,</span><font color="#000080">1</font><span style="color:rgb(0,0,0)">);</span></pre><pre style="white-space:pre-wrap;margin-top:0px;margin-bottom:0px"><span style="color:rgb(0,0,0)"><br></span></pre><pre style="white-space:pre-wrap;margin-top:0px;margin-bottom:0px"><span style="color:rgb(0,0,0)">ant the rotation is the same as with 3x3. Even with multiframe images, all frames are upside down (good) but not centered.</span></pre><pre style="white-space:pre-wrap;margin-top:0px;margin-bottom:0px"><span style="color:rgb(0,0,0)"><br></span></pre><pre style="white-space:pre-wrap;margin-top:0px;margin-bottom:0px"><span style="color:rgb(0,0,0)">The problem is locating the center of the image, even with multiframe.</span></pre><pre style="white-space:pre-wrap;margin-top:0px;margin-bottom:0px"><span style="color:rgb(0,0,0)"><br></span></pre><pre style="white-space:pre-wrap;margin-top:0px;margin-bottom:0px"><span style="color:rgb(0,0,0)">Any ideas? Thanks.</span></pre></div><div class="gmail_extra"><br><div class="gmail_quote">2015-09-14 20:36 GMT+02:00 Marcos <span dir="ltr"><<a href="mailto:fotosentido@gmail.com" target="_blank">fotosentido@gmail.com</a>></span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Well, I tried with an 3x3 matrix, and, as you said it flipped around the origin I guess.<div><br></div><div>So I guess I have to locate the center or use 4x4 matrix.</div><div><br></div><div>I was trying to use 4x4 matrix, creating a vtkMatrix4x4, but I don't know what values to insert.</div><div>I checked the ImageSlicing example but not sure what I have to do.</div><div><br></div><div>Reviewing related topics I found an answer of yours:</div><div><br></div><div>"<span style="font-size:16px">The first three columns are the the direction cosine vectors (for these, the 4th component should be zero). The three direction cosine vectors should be perpendicular to each other.</span></div><div style="font-size:16px"><br></div><div style="font-size:16px">The fourth column (whose 4th component must be 1.0) gives a translation, defined with respect to the coordinate system of the input of <span>vtkImageReslice</span>."</div><div class="gmail_extra"><br></div><div class="gmail_extra"><br></div><div class="gmail_extra">So I tried this code:</div><div class="gmail_extra"><br></div><div class="gmail_extra"><pre style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(0,128,0)">//flipperX->SetResliceAxesDirectionCosines(1,0,0,</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">0,-1,0,</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">0,0,1);</span></pre>
<pre style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(128,0,128)">vtkSmartPointer</span><span style="color:rgb(0,0,0)"><</span><span style="color:rgb(128,0,128)">vtkMatrix4x4</span><span style="color:rgb(0,0,0)">></span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,0,0)">matriz</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,0,0)">=</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(128,0,128)">vtkSmartPointer</span><span style="color:rgb(0,0,0)"><</span><span style="color:rgb(128,0,128)">vtkMatrix4x4</span><span style="color:rgb(0,0,0)">>::</span><span style="color:rgb(0,0,0)">New</span><span style="color:rgb(0,0,0)">();</span></pre>
<pre style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,0,0)">matriz</span><span style="color:rgb(0,0,0)">-></span><span style="color:rgb(0,0,0)">SetElement</span><span style="color:rgb(0,0,0)">(</span><span style="color:rgb(0,0,128)">0</span><span style="color:rgb(0,0,0)">,</span><span style="color:rgb(0,0,128)">0</span><span style="color:rgb(0,0,0)">,</span><span style="color:rgb(0,0,128)">1</span><span style="color:rgb(0,0,0)">);</span></pre>
<pre style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,0,0)">matriz</span><span style="color:rgb(0,0,0)">-></span><span style="color:rgb(0,0,0)">SetElement</span><span style="color:rgb(0,0,0)">(</span><span style="color:rgb(0,0,128)">0</span><span style="color:rgb(0,0,0)">,</span><span style="color:rgb(0,0,128)">1</span><span style="color:rgb(0,0,0)">,</span><span style="color:rgb(0,0,128)">0</span><span style="color:rgb(0,0,0)">);</span></pre>
<pre style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,0,0)">matriz</span><span style="color:rgb(0,0,0)">-></span><span style="color:rgb(0,0,0)">SetElement</span><span style="color:rgb(0,0,0)">(</span><span style="color:rgb(0,0,128)">0</span><span style="color:rgb(0,0,0)">,</span><span style="color:rgb(0,0,128)">2</span><span style="color:rgb(0,0,0)">,</span><span style="color:rgb(0,0,128)">0</span><span style="color:rgb(0,0,0)">);</span></pre>
<pre style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,0,0)">matriz</span><span style="color:rgb(0,0,0)">-></span><span style="color:rgb(0,0,0)">SetElement</span><span style="color:rgb(0,0,0)">(</span><span style="color:rgb(0,0,128)">0</span><span style="color:rgb(0,0,0)">,</span><span style="color:rgb(0,0,128)">3</span><span style="color:rgb(0,0,0)">,</span><span style="color:rgb(0,0,128)">0</span><span style="color:rgb(0,0,0)">);</span></pre>
<pre style="margin-top:0px;margin-bottom:0px"><br></pre>
<pre style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,0,0)">matriz</span><span style="color:rgb(0,0,0)">-></span><span style="color:rgb(0,0,0)">SetElement</span><span style="color:rgb(0,0,0)">(</span><span style="color:rgb(0,0,128)">1</span><span style="color:rgb(0,0,0)">,</span><span style="color:rgb(0,0,128)">0</span><span style="color:rgb(0,0,0)">,</span><span style="color:rgb(0,0,128)">0</span><span style="color:rgb(0,0,0)">);</span></pre>
<pre style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,0,0)">matriz</span><span style="color:rgb(0,0,0)">-></span><span style="color:rgb(0,0,0)">SetElement</span><span style="color:rgb(0,0,0)">(</span><span style="color:rgb(0,0,128)">1</span><span style="color:rgb(0,0,0)">,</span><span style="color:rgb(0,0,128)">1</span><span style="color:rgb(0,0,0)">,-</span><span style="color:rgb(0,0,128)">1</span><span style="color:rgb(0,0,0)">);</span></pre>
<pre style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,0,0)">matriz</span><span style="color:rgb(0,0,0)">-></span><span style="color:rgb(0,0,0)">SetElement</span><span style="color:rgb(0,0,0)">(</span><span style="color:rgb(0,0,128)">1</span><span style="color:rgb(0,0,0)">,</span><span style="color:rgb(0,0,128)">2</span><span style="color:rgb(0,0,0)">,</span><span style="color:rgb(0,0,128)">0</span><span style="color:rgb(0,0,0)">);</span></pre>
<pre style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,0,0)">matriz</span><span style="color:rgb(0,0,0)">-></span><span style="color:rgb(0,0,0)">SetElement</span><span style="color:rgb(0,0,0)">(</span><span style="color:rgb(0,0,128)">1</span><span style="color:rgb(0,0,0)">,</span><span style="color:rgb(0,0,128)">3</span><span style="color:rgb(0,0,0)">,</span><span style="color:rgb(0,0,128)">0</span><span style="color:rgb(0,0,0)">);</span></pre>
<pre style="margin-top:0px;margin-bottom:0px"><br></pre>
<pre style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,0,0)">matriz</span><span style="color:rgb(0,0,0)">-></span><span style="color:rgb(0,0,0)">SetElement</span><span style="color:rgb(0,0,0)">(</span><span style="color:rgb(0,0,128)">2</span><span style="color:rgb(0,0,0)">,</span><span style="color:rgb(0,0,128)">0</span><span style="color:rgb(0,0,0)">,</span><span style="color:rgb(0,0,128)">0</span><span style="color:rgb(0,0,0)">);</span></pre>
<pre style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,0,0)">matriz</span><span style="color:rgb(0,0,0)">-></span><span style="color:rgb(0,0,0)">SetElement</span><span style="color:rgb(0,0,0)">(</span><span style="color:rgb(0,0,128)">2</span><span style="color:rgb(0,0,0)">,</span><span style="color:rgb(0,0,128)">1</span><span style="color:rgb(0,0,0)">,</span><span style="color:rgb(0,0,128)">0</span><span style="color:rgb(0,0,0)">);</span></pre>
<pre style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,0,0)">matriz</span><span style="color:rgb(0,0,0)">-></span><span style="color:rgb(0,0,0)">SetElement</span><span style="color:rgb(0,0,0)">(</span><span style="color:rgb(0,0,128)">2</span><span style="color:rgb(0,0,0)">,</span><span style="color:rgb(0,0,128)">2</span><span style="color:rgb(0,0,0)">,</span><span style="color:rgb(0,0,128)">1</span><span style="color:rgb(0,0,0)">);</span></pre>
<pre style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,0,0)">matriz</span><span style="color:rgb(0,0,0)">-></span><span style="color:rgb(0,0,0)">SetElement</span><span style="color:rgb(0,0,0)">(</span><span style="color:rgb(0,0,128)">2</span><span style="color:rgb(0,0,0)">,</span><span style="color:rgb(0,0,128)">3</span><span style="color:rgb(0,0,0)">,</span><span style="color:rgb(0,0,128)">0</span><span style="color:rgb(0,0,0)">);</span></pre>
<pre style="margin-top:0px;margin-bottom:0px"><br></pre>
<pre style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,0,0)">matriz</span><span style="color:rgb(0,0,0)">-></span><span style="color:rgb(0,0,0)">SetElement</span><span style="color:rgb(0,0,0)">(</span><span style="color:rgb(0,0,128)">3</span><span style="color:rgb(0,0,0)">,</span><span style="color:rgb(0,0,128)">0</span><span style="color:rgb(0,0,0)">,</span><span style="color:rgb(0,0,128)">0</span><span style="color:rgb(0,0,0)">);</span></pre>
<pre style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,0,0)">matriz</span><span style="color:rgb(0,0,0)">-></span><span style="color:rgb(0,0,0)">SetElement</span><span style="color:rgb(0,0,0)">(</span><span style="color:rgb(0,0,128)">3</span><span style="color:rgb(0,0,0)">,</span><span style="color:rgb(0,0,128)">1</span><span style="color:rgb(0,0,0)">,</span><span style="color:rgb(0,0,128)">0</span><span style="color:rgb(0,0,0)">);</span></pre>
<pre style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,0,0)">matriz</span><span style="color:rgb(0,0,0)">-></span><span style="color:rgb(0,0,0)">SetElement</span><span style="color:rgb(0,0,0)">(</span><span style="color:rgb(0,0,128)">3</span><span style="color:rgb(0,0,0)">,</span><span style="color:rgb(0,0,128)">2</span><span style="color:rgb(0,0,0)">,</span><span style="color:rgb(0,0,128)">0</span><span style="color:rgb(0,0,0)">);</span></pre>
<pre style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,0,0)">matriz</span><span style="color:rgb(0,0,0)">-></span><span style="color:rgb(0,0,0)">SetElement</span><span style="color:rgb(0,0,0)">(</span><span style="color:rgb(0,0,128)">3</span><span style="color:rgb(0,0,0)">,</span><span style="color:rgb(0,0,128)">3</span><span style="color:rgb(0,0,0)">,</span><span style="color:rgb(0,0,128)">0</span><span style="color:rgb(0,0,0)">);</span></pre>
<pre style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(128,0,0)">flipperX</span><span style="color:rgb(0,0,0)">-></span><span style="font-style:italic;color:rgb(0,0,0)">SetResliceAxes</span><span style="color:rgb(0,0,0)">(</span><span style="color:rgb(0,0,0)">matriz</span><span style="color:rgb(0,0,0)">);</span></pre>
<pre style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(128,0,0)">flipperX</span><span style="color:rgb(0,0,0)">-></span><span style="font-style:italic;color:rgb(0,0,0)">Update</span><span style="color:rgb(0,0,0)">();</span></pre><pre style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(0,0,0)"><br></span></pre><pre style="margin-top:0px;margin-bottom:0px"><span style="font-family:arial,sans-serif;white-space:normal">The image disappeared :(</span><span style="color:rgb(0,0,0)"><br></span></pre><pre style="margin-top:0px;margin-bottom:0px"><span style="font-family:arial,sans-serif;white-space:normal"><br></span></pre><pre style="margin-top:0px;margin-bottom:0px"><span style="font-family:arial,sans-serif;white-space:normal">Not sure if I'm doing well.</span></pre><pre style="margin-top:0px;margin-bottom:0px"><span style="font-family:arial,sans-serif;white-space:normal"><br></span></pre><pre style="margin-top:0px;margin-bottom:0px"><span style="font-family:arial,sans-serif;white-space:normal"><br></span></pre></div><div><div class="h5"><div class="gmail_extra"><br><div class="gmail_quote">2015-09-14 19:19 GMT+02:00 David Gobbi <span dir="ltr"><<a href="mailto:david.gobbi@gmail.com" target="_blank">david.gobbi@gmail.com</a>></span>:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div dir="ltr"><div>Hi Marcos,</div><div><br></div><div>It might be more convenient to use vtkImageReslice to flip the images. It can take a 3x3 or 4x4 matrix that describes the transformation.</div><div><br></div><div>For a 3x3 matrix that flips the Y axis, you would use this:</div><div><br></div><div>reslice->SetResliceAxesDirectionCosines(</div><div> 1, 0, 0,</div><div> 0, -1, 0,</div><div> 0, 0, 1);</div><div><br></div><div>Be careful, though, because this flips the image around the origin, rather than flipping it around its center.</div><div><br></div><div>For a 4x4 matrix, use reslice->SetResliceAxes(vtkMatrix4x4 *). By using a 4x4 matrix, you can make sure that the correct center-of-rotation is applied.</div><span><font color="#888888"><div><br></div><div> - David</div></font></span><div><div><br><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Sep 14, 2015 at 11:03 AM, Marcos <span dir="ltr"><<a href="mailto:fotosentido@gmail.com" target="_blank">fotosentido@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div dir="ltr">Hi,<div><br></div><div>I attached a vtkImageFlip filter to my pipeline, but I can't find the way to "switch off" this filter or revert its effects.</div><div><br></div><div>I just want to flip my image when I press a button.</div><div><br></div><div>Any suggestions?</div><div>Thank you.</div></div></blockquote></div><br></div></div></div></div>
</blockquote></div><br></div></div></div></div>
</blockquote></div><br></div>