VTK POINT PROBLEM WITH BIG VALUES

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

VTK POINT PROBLEM WITH BIG VALUES

messari.omar
This post was updated on .
HELLO,
I'm trying to display my points (data comming from a magneto sensor) the
datas are between -600 and 600 i can't show them and i have a message error
that tells me that the format i'm trying to enter are incorrect.
but when i normalise my values ( -1<value<1) i can see my point on the
windowscontrol so i don't know what is the problem and how i can fix this,
to show the values between -600 and 600.

this is my code:

private void Point()
        {

            // Create the geometry of the points (the coordinate)
            vtkPoints points = vtkPoints.New();
            List<double> X = new List<double>(); // création de la liste
            List<double> Y = new List<double>();
            List<double> Z = new List<double>();

            // Create topology of the points (a vertex per point)
            vtkCellArray vertices = vtkCellArray.New();
           
            double a =  double.Parse(reader.MAGx.Text); // data comming from the sensor
            double b =  double.Parse(reader.MAGy.Text);// data comming from the sensor
            double c = double.Parse(reader.MAGz.Text);// data comming from the sensor
            X.Add(a);
            Y.Add(b);
            Z.Add(c);
            label7.Text = a.ToString();
            int[] ids = new int[X.Count];
            for (i = 0; i < X.Count; i++)
                ids[i] = points.InsertNextPoint(X[i], Y[i], Z[i]);

            int size = Marshal.SizeOf(typeof(int)) * X.Count;
            IntPtr pIds = Marshal.AllocHGlobal(size);
            Marshal.Copy(ids, 0, pIds, X.Count);
            vertices.InsertNextCell(X.Count, pIds);
            Marshal.FreeHGlobal(pIds);

            // Create a polydata object
            vtkPolyData pointPoly = vtkPolyData.New();

            // Set the points and vertices we created as the geometry and topology of the polydata
            pointPoly.SetPoints(points);
            pointPoly.SetVerts(vertices);

            // Visualize
            vtkPolyDataMapper mapper = vtkPolyDataMapper.New();
            mapper.SetInput(pointPoly);
            vtkActor actor = vtkActor.New();
            actor.SetMapper(mapper);
            actor.GetProperty().SetPointSize(2);
            vtkRenderWindow renderWindow = renderWindowControl1.RenderWindow;
            vtkRenderer renderer = renderWindow.GetRenderers().GetFirstRenderer();
            renderer.AddActor(actor);
            renderWindow.Render();
        }

Thanks all.



--
Sent from: http://vtk.1045678.n5.nabble.com/VTK-Dev-f1251487.html
_______________________________________________
Powered by www.kitware.com

Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html

Search the list archives at: http://markmail.org/search/?q=vtk-developers

Follow this link to subscribe/unsubscribe:
https://public.kitware.com/mailman/listinfo/vtk-developers

Reply | Threaded
Open this post in threaded view
|

Re: VTK POINT PROBLEM WITH BIG VALUES

Shawn Waldon-2
Hi,

Can you give the list a bit more information about your data format?  Are you streaming data from the sensor or reading it from a file?  What vtk reader are you using?  What is the exact error message (it probably has a line number and file)?  Would it be possible to share the data (or fake data that has the same issue) so someone can try to reproduce the issue?

On Thu, Jun 14, 2018 at 3:55 AM, messari.omar <[hidden email]> wrote:
HELLO,
I'm trying to display my points (data comming from a magneto sensor) the
datas are between -600 and 600 i can't show them and i have a message error
that tells me that the format i'm trying to enter are incorrect.
but when i normalise my values ( -1<value<1) i can see my point on the
windowscontrol so i don't know what is the problem and how i can fix this,
to show the values between -600 and 600.

Thanks all.



--
Sent from: http://vtk.1045678.n5.nabble.com/VTK-Dev-f1251487.html
_______________________________________________
Powered by www.kitware.com

Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html

Search the list archives at: http://markmail.org/search/?q=vtk-developers

Follow this link to subscribe/unsubscribe:
https://public.kitware.com/mailman/listinfo/vtk-developers



_______________________________________________
Powered by www.kitware.com

Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html

Search the list archives at: http://markmail.org/search/?q=vtk-developers

Follow this link to subscribe/unsubscribe:
https://public.kitware.com/mailman/listinfo/vtk-developers

Reply | Threaded
Open this post in threaded view
|

Re: VTK POINT PROBLEM WITH BIG VALUES

messari.omar
Hi,
thank you for your respond .

The format of my data are double , i'm streaming data from the sensor. the
error message is in the french language and it says that the format of the
input is incorrect, even if it's the same format i used to draw my normlised
data that are between 1 and -1.

you'll find bellow  a file that contain some data of the sensor
tosend.txt <http://vtk.1045678.n5.nabble.com/file/t342386/tosend.txt>  



--
Sent from: http://vtk.1045678.n5.nabble.com/VTK-Dev-f1251487.html
_______________________________________________
Powered by www.kitware.com

Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html

Search the list archives at: http://markmail.org/search/?q=vtk-developers

Follow this link to subscribe/unsubscribe:
https://public.kitware.com/mailman/listinfo/vtk-developers