[vtkusers] Re : Displaying points on a 2D image

David Doria daviddoria+vtk at gmail.com
Tue Jul 27 07:32:36 EDT 2010


On Tue, Jul 27, 2010 at 4:42 AM, Trystan Louboutin <tanstry at gmail.com> wrote:
>> Hi,
>>
>> Thanks all for replying.
>>
>> In fact, I don't want to manually place points over the image but just
>> displaying some points I obtained by my own contours computation.
>>
>> I think my problem comes from the image displaying: the references between
>> image and contour display are mismatching.
>> (the contours points are not superposing well the image)
>>
>> Image reference origin: upper left
>> ---------------> X
>> |
>> |
>> |
>> |
>> Y
>>
>> Contours points reference origin: lower left
>> Y
>> |
>> |
>> |
>> |--------------> X
>>
>> Is there any parameter to configure to flip my image (vtkImageActor) or my
>> contours (vtkActor2D) so that their references match ?
>>
>> Regards,
>> Trystan
>>
>>
>>
>> 2010/7/23 Prathamesh Kulkarni <prathameshmkulkarni at gmail.com>
>>>
>>> How about using the vtkSeedWidget for placing points?
>>>
>>> Here is an example:
>>> http://www.vtk.org/Wiki/VTK/Examples/Widgets/vtkSeedWidget
>>>
>>>
>>> Prathamesh
>>>
>>> Message: 3
>>> Date: Fri, 23 Jul 2010 04:31:17 -0700 (PDT)
>>> From: Malsoaz James <jmalsoaz at yahoo.fr>
>>> Subject: [vtkusers] Re :  Displaying points on a 2D image
>>> To: vtkusers at vtk.org, Trystan Louboutin <tanstry at gmail.com>
>>> Message-ID: <151153.72822.qm at web28312.mail.ukl.yahoo.com>
>>> Content-Type: text/plain; charset="iso-8859-1"
>>>
>>> Hi,
>>>
>>> I have been facing similar problems few weeks ago.
>>> A solution has been to create a vtkImageData for each set of points I had
>>> (in my case, it was contours). Then, I have used a vtkTexture to paste the
>>> vtkImageData on the image (which was also a texture).
>>> To my mind, this isn't ideal at all, but I didn't find any other
>>> solutions and I'm still looking for something else.
>>>
>>> I hope someone could help us with this issue.
>>>
>>> Best
>>> James
>>>
>>> --- En date de?: Mer 21.7.10, Trystan Louboutin <tanstry at gmail.com> a
>>> ?crit?:
>>>
>>> De: Trystan Louboutin <tanstry at gmail.com>
>>> Objet: [vtkusers] Displaying points on a 2D image
>>> ?: vtkusers at vtk.org
>>> Date: Mercredi 21 juillet 2010, 17h13
>>>
>>> Hi vtk users,
>>>
>>> I want to display some points over a 2D-image, it displays fine but the
>>> problem is that the points and image are not linked together.
>>> In fact, I want the points to be associated with the image so that zoom
>>> in/out will affect the image either the points, which is not the case
>>> actually.
>>>
>>> The image is obtained by re-slicing a vtkData volume as vtkImageData and
>>> displayed in a QVTKWidget.
>>>
>>> For displaying the points, I use :
>>> vtkPoints : defines the points
>>> vtkCellArray : to link points
>>>
>>> vtkPolyData : setPoints( theVtkPoints ) - setVerts( theCellArray )
>>> vtkActor2D
>>> vtkPolyData2DMapperAdd the actor to the renderer (same as image)
>>> The points (ie, representing a contour) are visible over the image but
>>> not superposing it correctly (coordinates are mismatching).
>>>
>>>
>>> I would like to know how to display some points (displayed in different
>>> colors) on a vtkImageActor ?
>>> Is the vtkImageActorPointPlacer suitable for this kind of thing ? I can't
>>> find any satisfactory example on how using it in such a case...
>>>
>>>
>>> Thanks in advance for any help,
>>>
>>> Regards,
>>> Trystan
>>>
>>>
>>>
>>>
>>>
>>> -----La pi?ce jointe associ?e suit-----
>>>
>>> ______________________________
>>> _________________
>>> Powered by www.kitware.com
>>>
>>> Visit other Kitware open-source projects at
>>> http://www.kitware.com/opensource/opensource.html
>>>
>>> Please keep messages on-topic and check the VTK FAQ at:
>>> http://www.vtk.org/Wiki/VTK_FAQ
>>>
>>> Follow this link to subscribe/unsubscribe:
>>> http://www.vtk.org/mailman/listinfo/vtkusers
>>
>

You can probably use vtkCoordinate:
http://www.vtk.org/doc/nightly/html/classvtkCoordinate.html

to do this. Particularly you might look at

virtual void 	SetReferenceCoordinate (vtkCoordinate *)

Here is a general example of vtkCoordinate:

http://www.vtk.org/Wiki/VTK/Examples/Utilities/Coordinate

Thanks,

David



More information about the vtkusers mailing list