[vtkusers] Pixel Value on Mouse Over with java

amal jerbi am.jerbi at gmail.com
Fri Nov 15 03:16:15 EST 2013


Hi,

I want to pick the pixel value of an image i found this C++ example on net

http://devsample.org/index.php?option=com_content&task=view&id=48&Itemid=27

but no idea how to write this code with java:

   1. unsigned short* pPix = (unsigned short*)pImageData->GetScalarPointer()
   ;
   2.           unsigned short usPix = pPix[nVolIdx];
   3.           FmtStr(m_strDetails, "Pixel val = [" << usPix << "]   at
   index [" << nVolIdx << "],  coordinates(" << ptMapped[0] << "," <<
   ptMapped[1] << ")");

   Indeed, with vtk wrapped java i dont find the method GetScalarPointer

   Best,
   Amal
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20131115/6101c3c5/attachment.htm>


More information about the vtkusers mailing list