<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style type="text/css" style="display:none;"><!-- P {margin-top:0;margin-bottom:0;} --></style>
</head>
<body dir="ltr">
<div id="divtagdefaultwrapper" style="font-size:12pt;color:#000000;font-family:'Times New Roman', Times, serif;" dir="ltr">
<p><br>
</p>
<div style="color: rgb(0, 0, 0);">
<div>
<div id="divtagdefaultwrapper" dir="ltr" style="font-size:12pt; color:#000000; font-family:'Times New Roman',Times,serif">
<p style="margin-right:0px; margin-bottom:1em; margin-left:0px; padding:0px; border:0px; font-size:15px; clear:both; color:rgb(36,39,41); font-family:Arial,"Helvetica Neue",Helvetica,sans-serif">
<span style="font-family:"Times New Roman",Times,serif"></p>
<p style="margin-right: 0px; margin-bottom: 1em; margin-left: 0px; padding: 0px; border: 0px; font-size: 15px; clear: both; color: rgb(36, 39, 41); font-family: Arial, "Helvetica Neue", Helvetica, sans-serif;">
<span style="font-family: "Times New Roman", Times, serif;">Dear VTK users</span><span style="font-family: "Times New Roman", Times, serif;">,</span></p>
<p style="margin-right: 0px; margin-bottom: 1em; margin-left: 0px; padding: 0px; border: 0px; font-size: 15px; clear: both; color: rgb(36, 39, 41); font-family: Arial, "Helvetica Neue", Helvetica, sans-serif;">
<br>
<br>
<span style="font-family: "Times New Roman", Times, serif;">I am using QT and VTK. I created a mouse release method to use it inside a QVTKWidget :</span></p>
<pre class="x_lang-cpp x_prettyprint x_prettyprinted" style="margin-top: 0px; margin-bottom: 1em; padding: 5px; border: 0px; font-size: 13px; width: auto; max-height: 600px; overflow: auto; font-family: Consolas, Menlo, Monaco, "Lucida Console", "Liberation Mono", "DejaVu Sans Mono", "Bitstream Vera Sans Mono", "Courier New", monospace, sans-serif; background-color: rgb(239, 240, 241); color: rgb(57, 51, 24); word-wrap: normal;"><code style="margin: 0px; padding: 0px; border: 0px; font-family: Consolas, Menlo, Monaco, "Lucida Console", "Liberation Mono", "DejaVu Sans Mono", "Bitstream Vera Sans Mono", "Courier New", monospace, sans-serif; white-space: inherit;"><span class="x_kwd" style="margin: 0px; padding: 0px; border: 0px; color: rgb(16, 16, 148);">void</span><span class="x_pln" style="margin: 0px; padding: 0px; border: 0px; color: rgb(48, 51, 54);"> </span><span class="x_typ" style="margin: 0px; padding: 0px; border: 0px; color: rgb(43, 145, 175);">MyQVTKWidget</span><span class="x_pun" style="margin: 0px; padding: 0px; border: 0px; color: rgb(48, 51, 54);">::</span><span class="x_pln" style="margin: 0px; padding: 0px; border: 0px; color: rgb(48, 51, 54);">mouseReleaseEvent</span><span class="x_pun" style="margin: 0px; padding: 0px; border: 0px; color: rgb(48, 51, 54);">(</span><span class="x_typ" style="margin: 0px; padding: 0px; border: 0px; color: rgb(43, 145, 175);">QMouseEvent</span><span class="x_pun" style="margin: 0px; padding: 0px; border: 0px; color: rgb(48, 51, 54);">*</span><span class="x_pln" style="margin: 0px; padding: 0px; border: 0px; color: rgb(48, 51, 54);"> event</span><span class="x_pun" style="margin: 0px; padding: 0px; border: 0px; color: rgb(48, 51, 54);">)</span></code></pre>
<p style="margin-right: 0px; margin-bottom: 1em; margin-left: 0px; padding: 0px; border: 0px; font-size: 15px; clear: both; color: rgb(36, 39, 41); font-family: Arial, "Helvetica Neue", Helvetica, sans-serif;">
{</p>
<pre class="x_lang-cpp x_prettyprint x_prettyprinted" style="margin-top: 0px; margin-bottom: 1em; padding: 5px; border: 0px; font-size: 13px; width: auto; max-height: 600px; overflow: auto; font-family: Consolas, Menlo, Monaco, "Lucida Console", "Liberation Mono", "DejaVu Sans Mono", "Bitstream Vera Sans Mono", "Courier New", monospace, sans-serif; background-color: rgb(239, 240, 241); color: rgb(57, 51, 24); word-wrap: normal;"><code style="margin: 0px; padding: 0px; border: 0px; font-family: Consolas, Menlo, Monaco, "Lucida Console", "Liberation Mono", "DejaVu Sans Mono", "Bitstream Vera Sans Mono", "Courier New", monospace, sans-serif; white-space: inherit;"><span class="x_kwd" style="margin: 0px; padding: 0px; border: 0px; color: rgb(16, 16, 148);">if</span><span class="x_pln" style="margin: 0px; padding: 0px; border: 0px; color: rgb(48, 51, 54);"> </span><span class="x_pun" style="margin: 0px; padding: 0px; border: 0px; color: rgb(48, 51, 54);">(</span><span class="x_pln" style="margin: 0px; padding: 0px; border: 0px; color: rgb(48, 51, 54);">pMainWindow</span><span class="x_pun" style="margin: 0px; padding: 0px; border: 0px; color: rgb(48, 51, 54);">)</span><span class="x_pln" style="margin: 0px; padding: 0px; border: 0px; color: rgb(48, 51, 54);">
</span><span class="x_pun" style="margin: 0px; padding: 0px; border: 0px; color: rgb(48, 51, 54);">{</span><span class="x_pln" style="margin: 0px; padding: 0px; border: 0px; color: rgb(48, 51, 54);">
</span><span class="x_pun" style="margin: 0px; padding: 0px; border: 0px; color: rgb(48, 51, 54);">((</span><span class="x_typ" style="margin: 0px; padding: 0px; border: 0px; color: rgb(43, 145, 175);">MainWindow</span><span class="x_pln" style="margin: 0px; padding: 0px; border: 0px; color: rgb(48, 51, 54);"> </span><span class="x_pun" style="margin: 0px; padding: 0px; border: 0px; color: rgb(48, 51, 54);">*)</span><span class="x_pln" style="margin: 0px; padding: 0px; border: 0px; color: rgb(48, 51, 54);">pMainWindow</span><span class="x_pun" style="margin: 0px; padding: 0px; border: 0px; color: rgb(48, 51, 54);">)-></span><span class="x_pln" style="margin: 0px; padding: 0px; border: 0px; color: rgb(48, 51, 54);">myMouseReleaseEvent</span><span class="x_pun" style="margin: 0px; padding: 0px; border: 0px; color: rgb(48, 51, 54);">(</span><span class="x_pln" style="margin: 0px; padding: 0px; border: 0px; color: rgb(48, 51, 54);">event</span><span class="x_pun" style="margin: 0px; padding: 0px; border: 0px; color: rgb(48, 51, 54);">);</span><span class="x_pln" style="margin: 0px; padding: 0px; border: 0px; color: rgb(48, 51, 54);">
</span><span class="x_pun" style="margin: 0px; padding: 0px; border: 0px; color: rgb(48, 51, 54);">}</span><span class="x_pln" style="margin: 0px; padding: 0px; border: 0px; color: rgb(48, 51, 54);">
</span><span class="x_com" style="margin: 0px; padding: 0px; border: 0px; color: rgb(133, 140, 147);">// call the super class to avoid troubles</span><span class="x_pln" style="margin: 0px; padding: 0px; border: 0px; color: rgb(48, 51, 54);">
</span><span class="x_typ" style="margin: 0px; padding: 0px; border: 0px; color: rgb(43, 145, 175);">QVTKWidget</span><span class="x_pun" style="margin: 0px; padding: 0px; border: 0px; color: rgb(48, 51, 54);">::</span><span class="x_pln" style="margin: 0px; padding: 0px; border: 0px; color: rgb(48, 51, 54);">mouseReleaseEvent</span><span class="x_pun" style="margin: 0px; padding: 0px; border: 0px; color: rgb(48, 51, 54);">(</span><span class="x_pln" style="margin: 0px; padding: 0px; border: 0px; color: rgb(48, 51, 54);">event</span><span class="x_pun" style="margin: 0px; padding: 0px; border: 0px; color: rgb(48, 51, 54);">);</span></code></pre>
<p style="margin-right: 0px; margin-bottom: 1em; margin-left: 0px; padding: 0px; border: 0px; font-size: 15px; clear: both; color: rgb(36, 39, 41); font-family: Arial, "Helvetica Neue", Helvetica, sans-serif;">
}</p>
<p style="margin-right: 0px; margin-bottom: 1em; margin-left: 0px; padding: 0px; border: 0px; font-size: 15px; clear: both; color: rgb(36, 39, 41); font-family: Arial, "Helvetica Neue", Helvetica, sans-serif;">
<span style="font-family: "Times New Roman", Times, serif;">Now, I would like to map (x,y) to slice (i,j). Generally, mouse position should be mapped into ( i, j) of current slice. I</span><span style="font-family: "Times New Roman", Times, serif;">t depends
on the zoom factor, </span><span style="font-family: "Times New Roman", Times, serif;">aspect ratio of the slice </span><span style="font-family: "Times New Roman", Times, serif;">and the window size.</span><span style="font-family: "Times New Roman", Times, serif;"><br>
</span><span style="font-family: "Times New Roman", Times, serif;"> </span></p>
<p style="margin-right: 0px; margin-bottom: 1em; margin-left: 0px; padding: 0px; border: 0px; font-size: 15px; clear: both; color: rgb(36, 39, 41); font-family: Arial, "Helvetica Neue", Helvetica, sans-serif;">
<span style="font-family: "Times New Roman", Times, serif;">But, I am wondering about how can I solve this issue. </span></p>
<p style="margin-right: 0px; margin-bottom: 1em; margin-left: 0px; padding: 0px; border: 0px; font-size: 15px; clear: both; color: rgb(36, 39, 41); font-family: Arial, "Helvetica Neue", Helvetica, sans-serif;">
<span style="color: rgb(33, 33, 33); font-family: "Times New Roman", Times, serif;"><br>
</span></p>
<p style="margin-right: 0px; margin-bottom: 1em; margin-left: 0px; padding: 0px; border: 0px; font-size: 15px; clear: both; color: rgb(36, 39, 41); font-family: Arial, "Helvetica Neue", Helvetica, sans-serif;">
<span style="color: rgb(33, 33, 33); font-family: "Times New Roman", Times, serif;"><br>
</span></p>
<p style="margin-right: 0px; margin-bottom: 1em; margin-left: 0px; padding: 0px; border: 0px; font-size: 15px; clear: both; color: rgb(36, 39, 41); font-family: Arial, "Helvetica Neue", Helvetica, sans-serif;">
<span style="font-family: "Times New Roman", Times, serif;"></span><span style="color: rgb(33, 33, 33); font-family: "Times New Roman", Times, serif;">Thanks in advance!</span></p>
<span style="font-family: "Times New Roman", Times, serif; font-size: 16px;">Best regards,</span><span style="font-family: "Times New Roman", Times, serif; font-size: 16px;"></span>
<p style="font-family: "Times New Roman", Times, serif; font-size: 16px;"></p>
<p style="font-family: "Times New Roman", Times, serif; font-size: 16px;"><br>
</p>
<div id="x_Signature" style="font-family: "Times New Roman", Times, serif; font-size: 16px;">
<font size="3" face="Garamond">Abdelkhalek Bakkari</font>
<div><span style="line-height: 14px;"><font size="3" face="Garamond">Ph.D candidate in Computer Science</font></span></div>
<div><span style="line-height: 20.8267px;"><font face="Garamond" size="3">Institute of Applied Computer Science</font></span></div>
<div><span style="line-height: 18.4px;"><font face="Garamond" size="3">Lodz University of Technology, Poland</font></span></div>
</div>
</span>
<p></p>
<div id="Signature">
<div><span style="line-height:18.399999618530273px"><font face="Garamond" size="3"></font></span></div>
<div><span style="line-height:18.399999618530273px"><font face="Garamond" size="3"><br>
</font></span></div>
<div><br>
</div>
</div>
</div>
</div>
</div>
</div>
</body>
</html>