[vtkusers] Display Pointcloud in 3d

Alex Malyushytskyy alexmalvtk at gmail.com
Fri Jan 6 18:51:37 EST 2012


Just want to point that the following line supposed not to compile by
any C++ compiler:

 int[][][] Matrix;

if you need multidimensional array when you don't know (number of
dimensions -1 ) size of dimensions at the compile time, you normally
should use a single dimensional array equivalent.

Alex


On Fri, Jan 6, 2012 at 5:23 AM, David E DeMarle
<dave.demarle at kitware.com> wrote:
> You could threshold or contour or use selection by value or volume render to
> see the bins.
>
> Or instead of using a vtkImageData you could create a vtkPolyData for the
> bins (with one vtkVertex cell per vtkPoint) and assign the hit count to a
> scalar array. If you want to convert to vtkImageData afterward you could use
> vtkGaussianSplatter to sample onto the cells.
>
> David E DeMarle
> Kitware, Inc.
> R&D Engineer
> 21 Corporate Drive
> Clifton Park, NY 12065-8662
> Phone: 518-881-4909
>
>
> On Fri, Jan 6, 2012 at 4:55 AM, h0ppel <h0ppel at web.de> wrote:
>>
>> Hi,
>>
>> I do have an example point Cloud and put it into imagedata like this:
>>
>> int i, j, k;
>>
>>            int[][][] Matrix;
>>            var rand = new Random(100);
>>
>>            var x = 100; var y = 200; var z = 35;
>>            var size = x * y * z * sizeof(int);
>>
>>            Matrix = new int[x][][];
>>
>>            for (i = 0; i < x; i++)
>>            {
>>                Matrix[i] = new int[y][];
>>
>>                for (j = 0; j < y; j++)
>>                {
>>                    Matrix[i][j] = new int[z];
>>
>>                    for (k = 0; k < z; k++)
>>                    {
>>                        Matrix[i][j][k] = rand.Next();
>>                    }
>>                }
>>            }
>>
>>            vtkImageData image = new vtkImageData();
>>
>>            image.SetDimensions(100, 200, 35);
>>            image.SetSpacing(1, 1, 1);
>>            image.SetOrigin(0, 0, 0);
>>            image.SetNumberOfScalarComponents(1);
>>            image.SetScalarTypeToFloat();
>>            image.AllocateScalars();
>>
>>            unsafe
>>            {
>>                int* ptr = (int*)(image.GetScalarPointer());
>>
>>                for (i = 0; i < 100; i++)
>>                {
>>                    for (j = 0; j < 200; ++j)
>>                    {
>>                        for (k = 0; k < 35; ++k)
>>                        {
>>                            *ptr++ = Matrix[i][j][k];
>>                        }
>>                    }
>>                }}< /raw>
>>
>> but how can I display this cloud in 3d and not only in the viewer?
>>
>> thanks
>>
>> --
>> View this message in context:
>> http://vtk.1045678.n5.nabble.com/Display-Pointcloud-in-3d-tp5125086p5125086.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
>
>
>
> _______________________________________________
> 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
>



More information about the vtkusers mailing list