[vtkusers] Getting the pixel value and coords of a 2D image
Luis Roberto P. Paula
luisrpp at gmail.com
Mon Nov 10 12:38:32 EST 2008
Thanks Mark - that's exactly what I was looking for.
On Mon, Nov 10, 2008 at 3:10 PM, Mark Wyszomierski <markww at gmail.com> wrote:
> Luis, not sure if it'll be helpful but I did something similar here:
>
> http://devsample.org/index.php?option=com_content&task=view&id=48&Itemid=27
>
> Mark
>
> On Mon, Nov 10, 2008 at 12:05 PM, <clinton at elemtech.com> wrote:
>
>> On Monday 10 November 2008 10:00:31 am Luis Roberto P. Paula wrote:
>> > Hi All,
>> >
>> > How can I get the pixel value and the coords of an image being displayed
>> in
>> > a QVTKWidget using the mouse move event? It is a 2D image.
>> >
>> > I'm trying to use the vtkPointPicker, as presented below, but I'm
>> getting a
>> > segmentation fault and I don't know why.
>> >
>> > ...
>> > connections = vtkEventQtSlotConnect::New();
>> > connections->Connect(vtkWidget->GetRenderWindow()->GetInteractor(),
>> > vtkCommand::MouseMoveEvent,
>> > this,
>> > SLOT(updateCoords(vtkObject*)));
>> > }
>> >
>> > void MyClass::updateCoords(vtkObject* obj)
>> > {
>> > vtkRenderWindowInteractor* iren =
>> > vtkRenderWindowInteractor::SafeDownCast(obj);
>> >
>> > vtkPointPicker* pointPicker =
>> > vtkPointPicker::SafeDownCast(iren->GetPicker());
>> > pointPicker->PrintSelf(cerr,vtkIndent()); // seg. fault here!!
>> > }
>> >
>>
>> Are you sure its a vtkPointPicker? VTK creats a vtkPropPicker by default.
>> Did you set up your own vtkPointPicker?
>>
>> Clint
>> _______________________________________________
>> This is the private VTK discussion list.
>> Please keep messages on-topic. Check the FAQ at:
>> http://www.vtk.org/Wiki/VTK_FAQ
>> Follow this link to subscribe/unsubscribe:
>> http://www.vtk.org/mailman/listinfo/vtkusers
>>
>
>
> _______________________________________________
> This is the private VTK discussion list.
> Please keep messages on-topic. Check the FAQ at:
> http://www.vtk.org/Wiki/VTK_FAQ
> Follow this link to subscribe/unsubscribe:
> http://www.vtk.org/mailman/listinfo/vtkusers
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20081110/55554362/attachment.htm>
More information about the vtkusers
mailing list