Posted by
Divakar Ramachandran-2 on
Mar 29, 2015; 6:26pm
URL: http://imagej.273.s1.nabble.com/Macro-command-setPixel-x-y-p-tp5012242.html
Greetings to all,
I have an output from a program in the form of 256x256 floating point
numbers approximately in the range 10^-5 to 10^-3 which I need to
display as an image. To process some header stuff, reading the 256x256
values and write out a TIFF file, I have written a macro script in
ImageJ. In this connection I have a question about setPixel:
I have created a new image stack using
"newImage(imiFile,"16-bit",nX,nY,datFiles.length);". The individual row
data are obtained using "rowData = split(lineData[8+j]," ");" based on
the format in which the data is output by the programme. Subsequently,
the pixel data is set using "pxy = parseFloat(rowData[k]); // print(j,
k, pxy); setPixel(j, k, pxy);". The (now) commented out print command
verified that the correct floating point values are being detected by
parseFloat. However, the saved TIFF shows all pixel values as zero.
My question is, in writing a 16-bit TIFF, should I be scaling the
floating point data to int between 0 and 2^16? Or between 0 and 2^8 if I
change this to 8-bit? Is there a way to preserve the numerical values of
the simulation, and yet visualise as an image with contrast stretched to
16-bit or 8-bit precision?
Thanks,
Div.
--
*Dr. Divakar R.*
_Anupuram, TN 603127, INDIA._
--
ImageJ mailing list:
http://imagej.nih.gov/ij/list.html