Hi Nikhil,<br><br>You forgot to load the system library.<br><br>You have to add the following line in your code as well as having depending on your system the directory that content the vtk library inside the environment vairiable PATH/LD_LIBRARY_PATH/DYLD_LIBRARY_PATH (win/unix/mac).<br>
<br><pre><span class="java-keyword">static</span> { <br> <span class="java-object">System</span>.loadLibrary(<span class="java-quote">"vtkCommonJava"</span>); <br> <span class="java-object">System</span>.loadLibrary(<span class="java-quote">"vtkFilteringJava"</span>); <br>
<span class="java-object">System</span>.loadLibrary(<span class="java-quote">"vtkIOJava"</span>); <br> <span class="java-object">System</span>.loadLibrary(<span class="java-quote">"vtkImagingJava"</span>); <br>
<span class="java-object">System</span>.loadLibrary(<span class="java-quote">"vtkGraphicsJava"</span>); <br> <span class="java-object">System</span>.loadLibrary(<span class="java-quote">"vtkRenderingJava"</span>); <br>
<span class="java-keyword">try</span> {<br> <span class="java-object">System</span>.loadLibrary(<span class="java-quote">"vtkHybridJava"</span>);<br> } <span class="java-keyword">catch</span> (Throwable e) {<br>
<span class="java-object">System</span>.out.println(<span class="java-quote">"cannot load vtkHybrid, skipping..."</span>);<br> }<br> <span class="java-keyword">try</span> {<br> <span class="java-object">System</span>.loadLibrary(<span class="java-quote">"vtkVolumeRenderingJava"</span>);<br>
} <span class="java-keyword">catch</span> (Throwable e) {<br> <span class="java-object">System</span>.out.println(<span class="java-quote">"cannot load vtkVolumeRendering, skipping..."</span>);<br> }<br>
}</pre>Seb<br><br><div class="gmail_quote">On Fri, Apr 23, 2010 at 2:57 PM, nikhil singhania <span dir="ltr"><<a href="mailto:niksinghania@gmail.com">niksinghania@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Sir,<br>
I am writing a code to convert java array to image data..but getting an error:<br>
<br>
"Exception in thread "main" java.lang.UnsatisfiedLinkError:<br>
vtk.vtkImageData.VTKInit()J<br>
at vtk.vtkImageData.VTKInit(Native Method)<br>
at vtk.vtkObject.<init>(vtkObject.java:96)<br>
at vtk.vtkDataObject.<init>(vtkDataObject.java:1206)<br>
at vtk.vtkDataSet.<init>(vtkDataSet.java:225)<br>
at vtk.vtkImageData.<init>(vtkImageData.java:347)<br>
at javaapplication2.fileread.main(fileread.java:49)"<br>
<br>
here is some part of code...<br>
<br>
vtkImageData image = new vtkImageData();<br>
image.SetDimensions(500, 500, 50);<br>
image.SetOrigin(0.0, 0.0, 0.0);<br>
image.SetSpacing(0.33,0.33,0.33);<br>
image.SetScalarTypeToChar();<br>
image.AllocateScalars();<br>
vtkDataArray array = image.GetPointData().GetScalars();<br>
<br>
for(int iZ = 0; iZ < 50; iZ++){<br>
for(int iY= 0; iY < 500; iY++){<br>
for(int iX = 0; iX < 500; iX++){<br>
array.InsertNextTuple1(arr[iZ][iY][iX]);<br>
}<br>
}<br>
}<br>
<br>
Please help.<br>
<br>
Thank You.<br>
--<br>
Nikhil Kumar<br>
rit2007033<br>
b.tech IT 6th sem<br>
IIIT Allahabad<br>
contact@9793905858<br>
email: <a href="mailto:rit2007033@iiita.ac.in">rit2007033@iiita.ac.in</a><br>
<a href="mailto:niksinghania@gmail.com">niksinghania@gmail.com</a><br>
<a href="http://profile.iiita.ac.in/RIT2007033/" target="_blank">http://profile.iiita.ac.in/RIT2007033/</a><br>
_______________________________________________<br>
Powered by <a href="http://www.kitware.com" target="_blank">www.kitware.com</a><br>
<br>
Visit other Kitware open-source projects at <a href="http://www.kitware.com/opensource/opensource.html" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br>
<br>
Please keep messages on-topic and check the VTK FAQ at: <a href="http://www.vtk.org/Wiki/VTK_FAQ" target="_blank">http://www.vtk.org/Wiki/VTK_FAQ</a><br>
<br>
Follow this link to subscribe/unsubscribe:<br>
<a href="http://www.vtk.org/mailman/listinfo/vtkusers" target="_blank">http://www.vtk.org/mailman/listinfo/vtkusers</a><br>
</blockquote></div><br>