I am trying to calibrate pixel colors 1-255 of a LUT to a known function: pixel=((log x+2))/0.15. How do I do this in image J?
Thanks very much for you insight, Anne |
Hi Anne,
An ImageJ LUT can be defined simply as a text file, 257 rows by 4 columns. The 1st row contains text. Each following row has 4 integers from 0 to 255, separated by tabs: index, red, green, and blue values. Index is incremented from 0 to 255. Then for each index give the values wanted for red, green and blue. If you want grey values, red, green and blue are set equal to each other. I created something similar using Excel to calculate the LUT numbers. Rename the file with the extension, ".lut", and place it in a folder named "LUTs" in the ImageJ folder. -- Harry Parker Senior Systems Engineer Digital Imaging Systems, Inc. ----- Original Message ---- From: Anne Salomon <[hidden email]> To: [hidden email] Sent: Saturday, August 18, 2007 3:44:43 PM Subject: calibrat to known function I am trying to calibrate pixel colors 1-255 of a LUT to a known function: pixel=((log x+2))/0.15. How do I do this in image J? Thanks very much for you insight, Anne ____________________________________________________________________________________ Be a better Heartthrob. Get better relationship answers from someone who knows. Yahoo! Answers - Check it out. http://answers.yahoo.com/dir/?link=list&sid=396545433 |
Thanks for your detailed and speedy reply Harry! Unfortunately, my problem
is still not solved. Here's why... I have made a .lut file just as you said BUT when I use it in ImageJ, the 1-255 pixels, although defined in color, are not defined in the value of the chlorophyll a they should represent i.e. pixel =(log10 (chla)+2)/0.015.So, when I make my image the colors are not calibrated to the function above. So, how do I assign each pixel (that now has the correct color based on my .lut file) a value of chl a given the above equation? Thanks again for your help, Anne ----- Original Message ----- From: "Harry Parker" <[hidden email]> To: <[hidden email]> Sent: Saturday, August 18, 2007 2:05 PM Subject: Re: calibrat to known function > Hi Anne, > > An ImageJ LUT can be defined simply as a text file, 257 rows by 4 columns. > The 1st row contains text. Each following row has 4 integers from 0 to > 255, separated by tabs: index, red, green, and blue values. Index is > incremented from 0 to 255. Then for each index give the values wanted for > red, green and blue. If you want grey values, red, green and blue are set > equal to each other. > > I created something similar using Excel to calculate the LUT numbers. > > Rename the file with the extension, ".lut", and place it in a folder named > "LUTs" in the ImageJ folder. > > -- > Harry Parker > Senior Systems Engineer > Digital Imaging Systems, Inc. > > ----- Original Message ---- > From: Anne Salomon <[hidden email]> > To: [hidden email] > Sent: Saturday, August 18, 2007 3:44:43 PM > Subject: calibrat to known function > > I am trying to calibrate pixel colors 1-255 of a LUT to a known function: > pixel=((log x+2))/0.15. How do I do this in image J? > > Thanks very much for you insight, > Anne > > > > > > > ____________________________________________________________________________________ > Be a better Heartthrob. Get better relationship answers from someone who > knows. Yahoo! Answers - Check it out. > http://answers.yahoo.com/dir/?link=list&sid=396545433 > |
In reply to this post by Anne Salomon
Hi Anne,
Since you really want real numbers and not just integer values from 0 to 255, LUT's won't work. You could use Ulf Dittmer's "Expression" plugin to modify an image with any mathematical expression. It's at http://www.ulfdittmer.com/imagej/expression.html Its a little tricky to learn, but try studying the documentation, then play with it and the example expressions that come with it. Once you've added your custom expression, you can save it and then write a simple macro that calls the plugin with your saved expression. -- Harry Parker Senior Systems Engineer Digital Imaging Systems, Inc. ----- Original Message ---- From: Anne Salomon <[hidden email]> To: [hidden email] Sent: Saturday, August 18, 2007 7:20:08 PM Subject: Re: calibrat to known function Thanks for your detailed and speedy reply Harry! Unfortunately, my problem is still not solved. Here's why... I have made a .lut file just as you said BUT when I use it in ImageJ, the 1-255 pixels, although defined in color, are not defined in the value of the chlorophyll a they should represent i.e. pixel =(log10 (chla)+2)/0.015.So, when I make my image the colors are not calibrated to the function above. So, how do I assign each pixel (that now has the correct color based on my .lut file) a value of chl a given the above equation? Thanks again for your help, Anne ----- Original Message ----- From: "Harry Parker" <[hidden email]> To: <[hidden email]> Sent: Saturday, August 18, 2007 2:05 PM Subject: Re: calibrat to known function > Hi Anne, > > An ImageJ LUT can be defined simply as a text file, 257 rows by 4 columns. > The 1st row contains text. Each following row has 4 integers from 0 to > 255, separated by tabs: index, red, green, and blue values. Index is > incremented from 0 to 255. Then for each index give the values wanted for > red, green and blue. If you want grey values, red, green and blue are set > equal to each other. > > I created something similar using Excel to calculate the LUT numbers. > > Rename the file with the extension, ".lut", and place it in a folder named > "LUTs" in the ImageJ folder. > > -- > Harry Parker > Senior Systems Engineer > Digital Imaging Systems, Inc. > > ----- Original Message ---- > From: Anne Salomon <[hidden email]> > To: [hidden email] > Sent: Saturday, August 18, 2007 3:44:43 PM > Subject: calibrat to known function > > I am trying to calibrate pixel colors 1-255 of a LUT to a known function: > pixel=((log x+2))/0.15. How do I do this in image J? > > Thanks very much for you insight, > Anne > > > > > > > ____________________________________________________________________________________ > Be a better Heartthrob. Get better relationship answers from someone who > knows. Yahoo! Answers - Check it out. > http://answers.yahoo.com/dir/?link=list&sid=396545433 > ____________________________________________________________________________________ Fussy? Opinionated? Impossible to please? Perfect. Join Yahoo!'s user panel and lay it on us. http://surveylink.yahoo.com/gmrs/yahoo_panel_invite.asp?a=7 |
In reply to this post by Anne Salomon
I think I see what you mean.
You could try this macro (a plugin would probably do the processing faster, but I've only used them a little). height = getHeight(); width = getWidth(); chl = newArray(width*height); for ( i = 0 ; i < width ; i++) { for ( j = 0 ; j < height ; j++ ) { chl[i+j*width] = ( pow( 10,getPixel( i,j )*0.015 ) - 2); // I solved for chl a from the equation you provided. You might want to check my math.; } } newImage("[Chl]", "32-bit", width, height, 1); selectWindow("[Chl]"); for ( i = 0 ; i < width ; i++ ) { for ( j = 0 ; j < height ; j++ ) { setPixel( i,j,chl[i+j*width] ); } } This should work if the image is 8 bit, 16 bit or 32 bit. The result is a new 32-bit image (you can change it if you don't need 32 bits). It will probably all be black unless you adjust the contrast. How do you get images that represent chlorophyll concentration? Justin On 8/18/07, Anne Salomon <[hidden email]> wrote: > Thanks for your detailed and speedy reply Harry! Unfortunately, my problem > is still not solved. Here's why... > > I have made a .lut file just as you said BUT when I use it in ImageJ, the > 1-255 pixels, although defined in color, are not defined in the value of the > chlorophyll a they should represent i.e. pixel =(log10 (chla)+2)/0.015.So, > when I make my image the colors are not calibrated to the function above. > So, how do I assign each pixel (that now has the correct color based on my > .lut file) a value of chl a given the above equation? > > Thanks again for your help, > Anne > > ----- Original Message ----- > From: "Harry Parker" <[hidden email]> > To: <[hidden email]> > Sent: Saturday, August 18, 2007 2:05 PM > Subject: Re: calibrat to known function > > > > Hi Anne, > > > > An ImageJ LUT can be defined simply as a text file, 257 rows by 4 columns. > > The 1st row contains text. Each following row has 4 integers from 0 to > > 255, separated by tabs: index, red, green, and blue values. Index is > > incremented from 0 to 255. Then for each index give the values wanted for > > red, green and blue. If you want grey values, red, green and blue are set > > equal to each other. > > > > I created something similar using Excel to calculate the LUT numbers. > > > > Rename the file with the extension, ".lut", and place it in a folder named > > "LUTs" in the ImageJ folder. > > > > -- > > Harry Parker > > Senior Systems Engineer > > Digital Imaging Systems, Inc. > > > > ----- Original Message ---- > > From: Anne Salomon <[hidden email]> > > To: [hidden email] > > Sent: Saturday, August 18, 2007 3:44:43 PM > > Subject: calibrat to known function > > > > I am trying to calibrate pixel colors 1-255 of a LUT to a known function: > > pixel=((log x+2))/0.15. How do I do this in image J? > > > > Thanks very much for you insight, > > Anne > > > > > > > > > > > > > > ____________________________________________________________________________________ > > Be a better Heartthrob. Get better relationship answers from someone who > > knows. Yahoo! Answers - Check it out. > > http://answers.yahoo.com/dir/?link=list&sid=396545433 > > > |
Thanks Justin and Harry,
I'll try your suggestions and script. I got the chl a images from NASA's Ocean Color website. It provides high resolution satellite images of global ocean chl a data. You need permission to get access to their 1.1 km resolution data. Permission requires a brief request letter. Thanks again, Anne ----- Original Message ----- From: "Justin McGrath" <[hidden email]> To: <[hidden email]> Sent: Sunday, August 19, 2007 8:06 AM Subject: Re: calibrat to known function >I think I see what you mean. > > You could try this macro (a plugin would probably do the processing > faster, but I've only used them a little). > > height = getHeight(); > width = getWidth(); > chl = newArray(width*height); > for ( i = 0 ; i < width ; i++) { > for ( j = 0 ; j < height ; j++ ) { > chl[i+j*width] = ( pow( 10,getPixel( i,j )*0.015 ) - 2); // > I solved for chl a from the equation you provided. You might want to > check my math.; > } > } > > newImage("[Chl]", "32-bit", width, height, 1); > selectWindow("[Chl]"); > for ( i = 0 ; i < width ; i++ ) { > for ( j = 0 ; j < height ; j++ ) { > setPixel( i,j,chl[i+j*width] ); > } > } > > > This should work if the image is 8 bit, 16 bit or 32 bit. The result > is a new 32-bit image (you can change it if you don't need 32 bits). > It will probably all be black unless you adjust the contrast. > > How do you get images that represent chlorophyll concentration? > > Justin > > > > > On 8/18/07, Anne Salomon <[hidden email]> wrote: >> Thanks for your detailed and speedy reply Harry! Unfortunately, my >> problem >> is still not solved. Here's why... >> >> I have made a .lut file just as you said BUT when I use it in ImageJ, the >> 1-255 pixels, although defined in color, are not defined in the value of >> the >> chlorophyll a they should represent i.e. pixel =(log10 >> (chla)+2)/0.015.So, >> when I make my image the colors are not calibrated to the function above. >> So, how do I assign each pixel (that now has the correct color based on >> my >> .lut file) a value of chl a given the above equation? >> >> Thanks again for your help, >> Anne >> >> ----- Original Message ----- >> From: "Harry Parker" <[hidden email]> >> To: <[hidden email]> >> Sent: Saturday, August 18, 2007 2:05 PM >> Subject: Re: calibrat to known function >> >> >> > Hi Anne, >> > >> > An ImageJ LUT can be defined simply as a text file, 257 rows by 4 >> > columns. >> > The 1st row contains text. Each following row has 4 integers from 0 to >> > 255, separated by tabs: index, red, green, and blue values. Index is >> > incremented from 0 to 255. Then for each index give the values wanted >> > for >> > red, green and blue. If you want grey values, red, green and blue are >> > set >> > equal to each other. >> > >> > I created something similar using Excel to calculate the LUT numbers. >> > >> > Rename the file with the extension, ".lut", and place it in a folder >> > named >> > "LUTs" in the ImageJ folder. >> > >> > -- >> > Harry Parker >> > Senior Systems Engineer >> > Digital Imaging Systems, Inc. >> > >> > ----- Original Message ---- >> > From: Anne Salomon <[hidden email]> >> > To: [hidden email] >> > Sent: Saturday, August 18, 2007 3:44:43 PM >> > Subject: calibrat to known function >> > >> > I am trying to calibrate pixel colors 1-255 of a LUT to a known >> > function: >> > pixel=((log x+2))/0.15. How do I do this in image J? >> > >> > Thanks very much for you insight, >> > Anne >> > >> > >> > >> > >> > >> > >> > ____________________________________________________________________________________ >> > Be a better Heartthrob. Get better relationship answers from someone >> > who >> > knows. Yahoo! Answers - Check it out. >> > http://answers.yahoo.com/dir/?link=list&sid=396545433 >> > >> > |
Free forum by Nabble | Edit this page |