<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 style="margin-top:0;margin-bottom:0">Dear All,</p>
<p style="margin-top:0;margin-bottom:0"><br>
</p>
<p style="margin-top:0;margin-bottom:0">I am trying to mark on the image using  a mouse release event. But the mark appears in different coordinates than which I indicate.</p>
<p style="margin-top:0;margin-bottom:0">Below is my code:</p>
<p style="margin-top:0;margin-bottom:0"><br>
</p>
<p style="margin-top:0;margin-bottom:0"></p>
<div>if (event->button() == Qt::LeftButton )</div>
<div><span style="white-space:pre"></span>{   </div>
<div><span style="white-space:pre"></span></div>
<div><span style="white-space:pre"></span></div>
<div><br>
</div>
<div><span style="white-space:pre"></span>// Seed points visualization</div>
<div><span style="white-space:pre"></span>vtkSmartPointer<vtkSphereSource> sphereSource = vtkSmartPointer<vtkSphereSource>::New();</div>
<div><br>
</div>
<div><span style="white-space:pre"></span>double center[3] = {event->pos().x(), event->pos().y(), currentSlice};</div>
<div><span style="white-space:pre"></span>qDebug() << "center: " << center[0] << "  "<< center[1] << "  " << center[2];</div>
<div><span style="white-space:pre"></span></div>
<div><br>
</div>
<div><br>
</div>
<div><span style="white-space:pre"></span>sphereSource->SetCenter(0.0, 0.0, 0.0);</div>
<div><span style="white-space:pre"></span>sphereSource->SetRadius(10.0);</div>
<div><br>
</div>
<div><span style="white-space:pre"></span>sphereSource->Update();</div>
<div><br>
</div>
<div><span style="white-space:pre"></span>vtkSmartPointer<vtkPolyDataMapper> sphereMapper = vtkSmartPointer<vtkPolyDataMapper>::New();</div>
<div><span style="white-space:pre"></span>sphereMapper->SetInputConnection(sphereSource->GetOutputPort());</div>
<div><span style="white-space:pre"></span>sphereMapper->Update();</div>
<div><br>
</div>
<div><span style="white-space:pre"></span>vtkSmartPointer<vtkActor> sphereActor = vtkSmartPointer<vtkActor>::New();</div>
<div><span style="white-space:pre"></span>sphereActor->SetMapper(sphereMapper);</div>
<div><span style="white-space:pre"></span>sphereActor->GetProperty()->SetColor(1.0, 0.0, 0.0);</div>
<div><span style="white-space:pre"></span>sphereActor->GetProperty()->SetPointSize(5);</div>
<div><span style="white-space:pre"></span>sphereActor->SetPosition(center);</div>
<div><span style="white-space:pre"></span></div>
<div><br>
</div>
<div><span style="white-space:pre"></span>m_renderer->DisplayToWorld();</div>
<div><span style="white-space:pre"></span>m_renderer->AddActor(sphereActor);</div>
<div><span style="white-space:pre"></span></div>
<div><span style="white-space:pre"></span>}</div>
<div><span style="white-space:pre"></span></div>
<div><span style="white-space:pre"></span>ui->qVTK1->update();</div>
-----
<p></p>
<p style="margin-top:0;margin-bottom:0">Thank you in advance</p>
<p style="margin-top:0;margin-bottom:0"><br>
</p>
</div>
</body>
</html>