<div dir="ltr"><div><br></div><div>I got it. I was checking <span style="color:rgb(128,0,128)">vtkImageChangeInformation </span>but it's not necessary.<br></div><div><br></div><div><br></div><div>I would explain it, hoping it will be useful for others. I had to look in several pages.</div><div><br></div><div><pre style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(128,0,0)">flipperX</span><span style="color:rgb(0,0,0)">-></span><span style="color:rgb(0,0,0)">SetResliceAxesDirectionCosines</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><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,0,128)">0</span><span style="color:rgb(0,0,0)">,</span><span style="color:rgb(0,0,0)">change</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(192,192,192)"> </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></div><div><br></div><div>where change is a -1 or a 1, switching the flip effect.</div><div><pre style="margin-top:0px;margin-bottom:0px"><br></pre></div><div><br></div><div>But this flips is around the origin, which is not the center of the image. How to calculate the center:</div><div><br></div><div><pre style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(128,128,0)">double</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,0,0)">origin</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></pre>
<pre style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(192,192,192)"> </span><font color="#800000">imageData</font><span style="color:rgb(0,0,0)">-></span><span style="font-style:italic;color:rgb(0,0,0)">GetOrigin</span><span style="color:rgb(0,0,0)">(</span><span style="color:rgb(0,0,0)">origin</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(128,128,0)">double</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,0,0)">spacing</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></pre>
<pre style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(192,192,192)"> </span><font color="#800000">imageData</font><span style="color:rgb(0,0,0)">-></span><span style="font-style:italic;color:rgb(0,0,0)">GetSpacing</span><span style="color:rgb(0,0,0)">(</span><span style="color:rgb(0,0,0)">spacing</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(128,128,0)">int</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,0,0)">dim</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></pre>
<pre style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(192,192,192)"> </span><font color="#800000">imageData</font><span style="color:rgb(0,0,0)">-></span><span style="font-style:italic;color:rgb(0,0,0)">GetDimensions</span><span style="color:rgb(0,0,0)">(</span><span style="color:rgb(0,0,0)">dim</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(128,128,0)">double</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,0,0)">center</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></pre>
<pre style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(128,128,0)">for</span><span style="color:rgb(0,0,0)">(</span><span style="color:rgb(128,128,0)">int</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,0,0)">i</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(0,0,128)">0</span><span style="color:rgb(0,0,0)">;</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,0,0)">i</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(0,0,128)">3</span><span style="color:rgb(0,0,0)">;</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,0,0)">i</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)">{</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)">center</span><span style="color:rgb(0,0,0)">[</span><span style="color:rgb(0,0,0)">i</span><span style="color:rgb(0,0,0)">]</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(0,0,0)">origin</span><span style="color:rgb(0,0,0)">[</span><span style="color:rgb(0,0,0)">i</span><span style="color:rgb(0,0,0)">]</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(0,0,0)">((</span><span style="color:rgb(0,0,0)">dim</span><span style="color:rgb(0,0,0)">[</span><span style="color:rgb(0,0,0)">i</span><span style="color:rgb(0,0,0)">]</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(0,0,128)">1</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(0,0,0)">*</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,0,0)">spacing</span><span style="color:rgb(0,0,0)">[</span><span style="color:rgb(0,0,0)">i</span><span style="color:rgb(0,0,0)">])</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(0,0,128)">2</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)">}</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"><div style="font-family:arial,sans-serif;white-space:normal">Now that we have the center, we set it as the origin:</div><div style="font-family:arial,sans-serif;white-space:normal"><br></div><div style="font-family:arial,sans-serif;white-space:normal"><pre style="margin-top:0px;margin-bottom:0px"><font color="#800000">imageData</font><span style="color:rgb(0,0,0)">-></span><span style="font-style:italic;color:rgb(0,0,0)">SetOrigin</span><span style="color:rgb(0,0,0)">(</span><span style="color:rgb(0,0,0)">center</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"><div style="font-family:arial,sans-serif;white-space:normal"><br></div><div style="font-family:arial,sans-serif;white-space:normal">And we connect the imageData to our filter in the pipeline.</div><div style="font-family:arial,sans-serif;white-space:normal"><br></div><div style="font-family:arial,sans-serif;white-space:normal"><pre style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(128,0,0)">flipperX</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)">vtkImageReslice</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(128,0,0)">flipperX</span><span style="color:rgb(0,0,0)">-></span><span style="color:rgb(0,0,0)">SetInputData</span><span style="color:rgb(0,0,0)">(</span><font color="#800000">imageData</font><span style="color:rgb(0,0,0)">);</span></pre><pre style="margin-top:0px;margin-bottom:0px"><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></div></pre></div></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">After that, every time we want a flip, we just have invoke the first command of this post with the desired change value. And update().</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"><font face="arial, sans-serif"><span style="white-space:normal">For many people these things are not so obvious, it would be great to have more examples about applying filters like this. Flipping images is a common thing.</span></font></pre><pre style="margin-top:0px;margin-bottom:0px"><font face="arial, sans-serif"><span style="white-space:normal"><br></span></font></pre><pre style="margin-top:0px;margin-bottom:0px"><font face="arial, sans-serif"><span style="white-space:normal">Thank you for your help, David.</span></font></pre><pre style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(0,0,0)"><br></span></pre></div></div><div class="gmail_extra"><br><div class="gmail_quote">2015-09-14 20:55 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"><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="HOEnZb"><div class="h5"><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><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>
</div></div></blockquote></div><br></div>