Hello Friends,
I'm writing a macro in which I want to read my program the pixel level gray scale values.I run the program to open the text file.But I can't figure out how to read each single pixel value. Basically I'm asking if there is a command in ImageJ that reads those value automatically. Could anyone please help? Thanks, Sasmita |
Hi Sasmita!
this is a bit confusing! Dou you want to read pixel values from a regular binary image file (.TIF or whatever) or from a *TEXT* file that specifies pixel by pixel? In can of an image loaded into ImageJ, you can use >getPixel(x, y) >Returns the value of the pixel at (x,y). Note that pixels in RGB images contain red, green and blue components that need to be >extracted using shifting and masking. See the Color Picker Tool macro for an example that shows how to do this. in a loop inside a macro. Please lookup the documentation http://rsb.info.nih.gov/ij/docs/ImageJMacroLanguage.pdf Cheers Joachim Leica Microsystems CMS GmbH | GmbH mit Sitz in Wetzlar | Amtsgericht Wetzlar HRB 2432 Geschäftsführer: Dr. Stefan Traeger | Dr. Wolf-Otto Reuter | Dr. David Roy Martyr | Colin Davis ImageJ Interest Group <[hidden email]> schrieb am 03.06.2008 23:07:55: > Hello Friends, > I'm writing a macro in which I want to read my program the pixel > level gray scale values.I run the program to open the text file.But > I can't figure out how to read each single pixel > > value. Basically I'm asking if there is a command in ImageJ that > reads those value automatically. > > Could anyone please help? > > Thanks, > Sasmita ______________________________________________________________________ This email has been scanned by the MessageLabs Email Security System. For more information please visit http://www.messagelabs.com/email ______________________________________________________________________ |
Hi Joachim,
Yes I got it.Many thanks. Sasmita ----- Original Message ----- From: "Joachim Wesner" <[hidden email]> To: [hidden email] Sent: Wednesday, June 4, 2008 1:47:20 AM GMT -06:00 US/Canada Central Subject: Antwort: gray scale value? Hi Sasmita! this is a bit confusing! Dou you want to read pixel values from a regular binary image file (.TIF or whatever) or from a *TEXT* file that specifies pixel by pixel? In can of an image loaded into ImageJ, you can use >getPixel(x, y) >Returns the value of the pixel at (x,y). Note that pixels in RGB images contain red, green and blue components that need to be >extracted using shifting and masking. See the Color Picker Tool macro for an example that shows how to do this. in a loop inside a macro. Please lookup the documentation http://rsb.info.nih.gov/ij/docs/ImageJMacroLanguage.pdf Cheers Joachim Leica Microsystems CMS GmbH | GmbH mit Sitz in Wetzlar | Amtsgericht Wetzlar HRB 2432 Geschäftsführer: Dr. Stefan Traeger | Dr. Wolf-Otto Reuter | Dr. David Roy Martyr | Colin Davis ImageJ Interest Group <[hidden email]> schrieb am 03.06.2008 23:07:55: > Hello Friends, > I'm writing a macro in which I want to read my program the pixel > level gray scale values.I run the program to open the text file.But > I can't figure out how to read each single pixel > > value. Basically I'm asking if there is a command in ImageJ that > reads those value automatically. > > Could anyone please help? > > Thanks, > Sasmita ______________________________________________________________________ This email has been scanned by the MessageLabs Email Security System. For more information please visit http://www.messagelabs.com/email ______________________________________________________________________ |
In reply to this post by Joachim Wesner
Hi Joachim,
I am getting difficulty in finding the gray scale value of an image. My problem is when I get the pixel value for (0,0) coordinate using macrofunction getPixel(0,0)from .tif file I get value1(say). But when I open the .dat file for the same image with "TextFile..." command I get a different value for (0,0) coordinate value2(say). I believe both the values should return the same value because they both are the same pixel of the same image. Please correct me if I'm doing something wrong. waiting for your reply. Thanks, Sasmita ----- Original Message ----- From: "Joachim Wesner" <[hidden email]> To: [hidden email] Sent: Wednesday, June 4, 2008 1:47:20 AM GMT -06:00 US/Canada Central Subject: Antwort: gray scale value? Hi Sasmita! this is a bit confusing! Dou you want to read pixel values from a regular binary image file (.TIF or whatever) or from a *TEXT* file that specifies pixel by pixel? In can of an image loaded into ImageJ, you can use >getPixel(x, y) >Returns the value of the pixel at (x,y). Note that pixels in RGB images contain red, green and blue components that need to be >extracted using shifting and masking. See the Color Picker Tool macro for an example that shows how to do this. in a loop inside a macro. Please lookup the documentation http://rsb.info.nih.gov/ij/docs/ImageJMacroLanguage.pdf Cheers Joachim Leica Microsystems CMS GmbH | GmbH mit Sitz in Wetzlar | Amtsgericht Wetzlar HRB 2432 Geschäftsführer: Dr. Stefan Traeger | Dr. Wolf-Otto Reuter | Dr. David Roy Martyr | Colin Davis ImageJ Interest Group <[hidden email]> schrieb am 03.06.2008 23:07:55: > Hello Friends, > I'm writing a macro in which I want to read my program the pixel > level gray scale values.I run the program to open the text file.But > I can't figure out how to read each single pixel > > value. Basically I'm asking if there is a command in ImageJ that > reads those value automatically. > > Could anyone please help? > > Thanks, > Sasmita ______________________________________________________________________ This email has been scanned by the MessageLabs Email Security System. For more information please visit http://www.messagelabs.com/email ______________________________________________________________________ |
Free forum by Nabble | Edit this page |