[vtkusers] Getting started with Java in VTK

Jonathan Morra jonmorra at gmail.com
Thu Oct 7 09:57:21 EDT 2010


OK, so maybe my last email wasn't specific enough, so here's a very specific
question.  I have a vtkCanvas onto which I put a vtkImageViewer2.  I wish to
have crosshairs show on the image where the user clicks.  I also wish to get
the point clicked information during the mouse event so that I can display
that to the user in a JLabel.  Any ideas?

Thanks

On Tue, Oct 5, 2010 at 4:30 PM, Jonathan Morra <jonmorra at gmail.com> wrote:

> After some tinkering I was able to get a simple Java program that will
> display the 3 planes that I want in a JFrame.  Now I need to figure out how
> to combine Java's click handling with VTK's click handling.  Again, does
> anyone have an idea of where to start?
>
>
> On Tue, Oct 5, 2010 at 3:50 PM, Jonathan Morra <jonmorra at gmail.com> wrote:
>
>> Thanks for the info, I'll have a look, also I found the following site
>> which is helping a lot
>> http://ij-plugins.sourceforge.net/vtk-examples/index.html
>>
>>
>> On Tue, Oct 5, 2010 at 2:24 PM, Luke Dodd <i.like.bread at gmail.com> wrote:
>>
>>> This is possible. Take a look at the vtk.vtkPanel and vtk.vtkCanvas
>>> classes. They are awt components, you can - with some caveats put them
>>> in a swing GUI like any other swing component.
>>>
>>> There are methods to get the renderer - so you can add things to it,
>>> and to paint so you can see the results. I think vtkPanel is the base
>>> class and vtkCanvas extends this with more functionality. I'd say look
>>> at the source of each and figure out what you need - they implement
>>> certain interaction behaviours and forward certain awt events to vtk
>>> interactors.
>>>
>>> There is not much documentation for this, but the source code is not
>>> too hard to read.
>>>
>>> (Sorry for sending again Jonathan, but I hit reply instead of reply
>>> all - it's good to get this on the list for others to see)
>>>
>>> Best Regards,
>>> Luke Dodd
>>>
>>> On 5 October 2010 21:33, Jonathan Morra <jonmorra at gmail.com> wrote:
>>> > I'm new to VTK and am interested in writing a very simple medical image
>>> > viewer that can view a 3D volume at three orthogonal planes and have
>>> the
>>> > user click around on various planes to navigate through the data.  I
>>> was
>>> > able to get VTK compiling and examples running in Java, however I'm
>>> unsure
>>> > how to get the native VTK windows to interact with Java swing.
>>>  Ideally, I'd
>>> > like there to be no VTK windows, and have everything live inside of
>>> Swing
>>> > components.  Can anyone point me to some example code or good reading
>>> to
>>> > help getting started with this in Java?
>>> > Thanks
>>> > _______________________________________________
>>> > 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
>>> >
>>> >
>>>
>>
>>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20101007/e7ec8513/attachment.htm>


More information about the vtkusers mailing list