[vtkusers] converting java array to vtkimage data
Sebastien Jourdain
sebastien.jourdain at kitware.com
Mon Apr 26 08:33:35 EDT 2010
Red, not white ???
If so, it is just because you didn't set the proper lookuptable range that
should be linked to your mapper. (You might need to update scalar range on
the mapper too)
On Sun, Apr 25, 2010 at 3:18 PM, nikhil singhania <niksinghania at gmail.com>wrote:
> 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/20100426/e164f9b9/attachment.htm>
More information about the vtkusers
mailing list