Re: intensity at each pixel in CSV format to open as greyscale image in imageJ
Posted by Stein Rørvik on Nov 09, 2019; 9:51am URL: http://imagej.273.s1.nabble.com/intensity-at-each-pixel-in-CSV-format-to-open-as-greyscale-image-in-imageJ-tp5022632p5022636.html
I would do the same as Philippe describes below, but create a 32-bit image since your input data appears to be floating point values. Then you will loose nothing; your image will be exactly the same as your data.
There is also an Import -> Text Image... command that takes a text based array from a file and creates an image from it. It expects the pixel values to be separated with tabs or spaces, and laid out in rows separated by linefeeds. Try that first. It also creates a 32-bit image for you if the numbers are floating point. If this works, you do not need a macro and will also get an image which is an exact match to your data.
Stein
-----Original Message-----
From: ImageJ Interest Group <[hidden email]> On Behalf Of CARL Philippe (LBP)
Sent: 8. november 2019 23:14
To: [hidden email] Subject: Re: intensity at each pixel in CSV format to open as greyscale image in imageJ
Dear Kumar,
What you are looking for can easily be done by means of a small macro.
I would create a 309 x 826 pixels 8 bit picture setting by means of the setPixel method the lowest of your value to 0 and the highest to 255.
And to open the .csv file use File.openAsString on which result you apply the split method to extract the data for each pixel.
My best regards,
Philippe
Philippe CARL
Laboratoire de Bioimagerie et Pathologies UMR 7021 CNRS - Université de Strasbourg Faculté de Pharmacie
74 route du Rhin
67401 ILLKIRCH
Tel : +33(0)3 68 85 41 84
----- Mail original -----
De: "kumard" <[hidden email]>
À: "imagej" <[hidden email]>
Envoyé: Vendredi 8 Novembre 2019 22:25:05
Objet: intensity at each pixel in CSV format to open as greyscale image in imageJ
I have Optical coherence tomography (OCT) scan data in the form of intensity value for each pixel in an array of 309 x 826. I want to convert that data in the form of a greyscale image (min intensity: -22.3516 and Max intensity:
52.6367), say <0 dark grey but 0-10, 10-20,30-40 and >40 in the order of lighter grey to white and quantify each increase in the form of % and pixels. Thanks in advance for answering and helping out.