[vtkusers] Coordinates related to a volume

Matias Montroull matimontg at gmail.com
Mon Apr 7 13:24:00 EDT 2014


I imagine you're running vtkMarchingCubes or ContourFilter to create the
mesh?

you could then use vtkPoints to get all points from your filter output

Then something like this:

(This is in C# though)
            vtkPoints mypoints = new vtkPoints();
            mypoints= myfilter.GetOutput().GetPoints(); //Where myfilter
could be the output of the marchingcubes algorithm or other filter you
apply afterwards

            for (int i = 0; i < mypoints.GetNumberOfPoints(); i++)
            {
                double[] p = new double[3];
                p = mypoints.GetPoint(i);
            }
In each iteration you would obtain every single point in the mesh, then you
can easily add that to a list..

hope it makes some sense.


On Mon, Apr 7, 2014 at 1:58 PM, Voisin <adrien.voisin.be at gmail.com> wrote:

>  Hi Matias,
>
>
>
> I use vtk in Qt thanks to the QVTKWidget.
>
>
>
> I want to rightclick on my vtk window and display (on a Qt tooltip) if I
> click or not on the 3D image.
>
>
>
> For now, when I click anywhere, the tooltip appear with a testing message.
> But I want to check (I don't know where) if
>
> the coordinate of the vtk event click (x,y) correspond to points of my
> mesh or not
>
>
>
> The idea is to proceed an action when clicking on the mesh but not if we
> click on an empty part of the vtk window.
>
>
>
> I hope it's clearer now
>
>
>
> Thanks,
>
>
>
> Adrien
>
>
>
> *De :* Matias Montroull [mailto:matimontg at gmail.com]
> *Envoyé :* lundi 7 avril 2014 13:49
> *À :* AdrienV
> *Cc :* vtkusers at vtk.org
> *Objet :* Re: [vtkusers] Coordinates related to a volume
>
>
>
> Hi Adrien,
>
>
>
> What are you trying to achieve? can you provide more information?
>
>
>
> Thanks,
>
>
>
> On Mon, Apr 7, 2014 at 10:33 AM, AdrienV <adrien.voisin.be at gmail.com>
> wrote:
>
> Hi,
>
> I develop a basic application for medical data visualization.
>
> I want to know if it's possible to get all coordinates (axis or world
> coordinates) of a volume in a list (for example).
>
> In fact, when I click on my vtk window, a slot function return the cursor
> position (x,y). I want to put these information in a kind of lookup table,
> which return true if there is a volume in this position or false otherwise.
>
> For example : bool isVolumeAt(int x,int y)
>
> Thanks for your help,
>
> Adrien
>
>
>
>
> --
> View this message in context:
> http://vtk.1045678.n5.nabble.com/Coordinates-related-to-a-volume-tp5726665.html
> Sent from the VTK - Users mailing list archive at Nabble.com.
> _______________________________________________
> 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
>
>
>
>
> ------------------------------
>    <http://www.avast.com/>
>
> Ce courrier électronique ne contient aucun virus ou logiciel malveillant
> parce que la protection Antivirus avast! <http://www.avast.com/> est
> active.
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20140407/efd785d0/attachment.html>


More information about the vtkusers mailing list