[vtkusers] converting java array to vtkimage data

nikhil singhania niksinghania at gmail.com
Fri Apr 23 14:57:01 EDT 2010


Sir,
I am writing a code to convert java array to image data..but getting an error:

"Exception in thread "main" java.lang.UnsatisfiedLinkError:
vtk.vtkImageData.VTKInit()J
        at vtk.vtkImageData.VTKInit(Native Method)
        at vtk.vtkObject.<init>(vtkObject.java:96)
        at vtk.vtkDataObject.<init>(vtkDataObject.java:1206)
        at vtk.vtkDataSet.<init>(vtkDataSet.java:225)
        at vtk.vtkImageData.<init>(vtkImageData.java:347)
        at javaapplication2.fileread.main(fileread.java:49)"

here is some part of code...

  vtkImageData image = new vtkImageData();
  image.SetDimensions(500, 500, 50);
  image.SetOrigin(0.0, 0.0, 0.0);
  image.SetSpacing(0.33,0.33,0.33);
  image.SetScalarTypeToChar();
  image.AllocateScalars();
  vtkDataArray 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.

Thank You.
-- 
Nikhil Kumar
rit2007033
b.tech IT 6th sem
IIIT Allahabad
contact at 9793905858
email: rit2007033 at iiita.ac.in
          niksinghania at gmail.com
http://profile.iiita.ac.in/RIT2007033/



More information about the vtkusers mailing list