[vtkusers] converting java array to vtkimage data

nikhil singhania niksinghania at gmail.com
Sun Apr 25 15:18:29 EDT 2010


Sir,
I am using Vtkimagedata and reading a java array.After rendering it in spite
of viewing data its just viewing red slab of given dimension.
         image = new vtkImageData();
         image.SetExtent(0,499,0, 499,0, 49);
         image.SetSpacing(0.33,0.33,1.0);
         image.SetScalarTypeToChar();
         image.SetNumberOfScalarComponents(0);
         image.AllocateScalars();
         array = image.GetPointData().GetScalars();

         for(int iZ = 0; iZ < 50; iZ++){
             for(int iY= 0; iY < 500; iY++){
                 for(int iX = 0; iX < 500; iX++){
                        array.InsertNextTuple1(arr[iZ][iY][iX]);
                    }
               }
         }

Please help.

With regards,
Nikhil
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20100425/8e474c5f/attachment.htm>


More information about the vtkusers mailing list