<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=utf-8">
<meta name="Generator" content="Microsoft Word 15 (filtered medium)">
<style><!--
/* Font Definitions */
@font-face
        {font-family:"Cambria Math";
        panose-1:2 4 5 3 5 4 6 3 2 4;}
@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:0in;
        margin-bottom:.0001pt;
        font-size:11.0pt;
        font-family:"Calibri",sans-serif;}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:#0563C1;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:#954F72;
        text-decoration:underline;}
p.msonormal0, li.msonormal0, div.msonormal0
        {mso-style-name:msonormal;
        mso-margin-top-alt:auto;
        margin-right:0in;
        mso-margin-bottom-alt:auto;
        margin-left:0in;
        font-size:11.0pt;
        font-family:"Calibri",sans-serif;}
span.EmailStyle18
        {mso-style-type:personal-reply;
        font-family:"Calibri",sans-serif;
        color:windowtext;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-family:"Calibri",sans-serif;}
@page WordSection1
        {size:8.5in 11.0in;
        margin:1.0in 1.0in 1.0in 1.0in;}
div.WordSection1
        {page:WordSection1;}
--></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="#0563C1" vlink="#954F72">
<div class="WordSection1">
<p class="MsoNormal">Would you mind posting your question to <a href="https://na01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fdiscourse.vtk.org&data=02%7C01%7Classo%40queensu.ca%7C5304536c0989415fbbc908d6ac81b86e%7Cd61ecb3b38b142d582c4efb2838b925c%7C1%7C0%7C636886070474774650&sdata=lun%2BrDG1HY0uvG2whuSD8ErGkAwmr0Vl2a7iBriy%2BdQ%3D&reserved=0">
https://discourse.vtk.org</a>? Community support for VTK is transitioning to that forum, and you are more likely to get an answer there.<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">Thanks,<o:p></o:p></p>
<p class="MsoNormal">Andras<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal"><b>From:</b> vtkusers <vtkusers-bounces@vtk.org> <b>On Behalf Of
</b>Esmeralda Ruiz<br>
<b>Sent:</b> Wednesday, March 20, 2019 8:55 AM<br>
<b>To:</b> vtkusers@vtk.org<br>
<b>Subject:</b> [vtkusers] mouse coordinates from a 3d volume with wrong y<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<div>
<div>
<div>
<p class="MsoNormal">Dear all, <o:p></o:p></p>
</div>
<div>
<p class="MsoNormal">I want to get the positions of a volume using the mouse for segmentation.  But the y coordinate is wrong. I only get the x and z fine but the depth (y) is not correct. I use this code to get the position. Is there any way to obtain the
 slice (y position)<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal">thanks<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal">            // Get the location of the click (in window coordinates)<br>
            int* pos = this->GetInteractor()->GetEventPosition();<br>
<br>
            vtkSmartPointer<vtkCellPicker> picker =<br>
                vtkSmartPointer<vtkCellPicker>::New();<br>
            picker->SetTolerance(0.0005);<br>
<br>
<br>
            //this->GetDefaultRenderer()->Clear();<br>
<br>
            // Pick from this location.<br>
            picker->Pick(pos[0], pos[1], 0, global_renderer);<br>
<br>
            double* worldPosition = picker->GetPickPosition();<br>
            std::cout << "Cell id is: " << picker->GetCellId() << std::endl;<br>
<br>
            if (picker->GetCellId() != -1)<br>
            {<br>
<br>
                std::cout << "Pick position is: " << worldPosition[0] << " " << worldPosition[1]<br>
                    << " " << worldPosition[2] << endl;<br>
            }<o:p></o:p></p>
</div>
</div>
</div>
</div>
</body>
</html>