Hi everyone,
I would like to know if anyone can help me with the attached images. The first one it's the original, the second one is what I have been done. I need to know the brightness or intensity of the two strips that you can see in the frame, and the ratio between both (right strip/left strip). There is any way to do this automatically? Know the highest value of each curve in the plot? Right now I'm doing it manually, then subtract the mode value to both and after that I do the ratio (R/L). Do you think I'm doing it ok? What would you do/change? another way to do it? Thank you so much !!!! PD: I try image<adjust<brightness-contrast<auto ; then Process<subtract background and finally analyze<plot profile [cid:image002.jpg@01D303AA.275D35A0] [cid:image003.jpg@01D303A9.E9AEF4F0] -- ImageJ mailing list: http://imagej.nih.gov/ij/list.html image001.jpg (270K) Download Attachment image003.jpg (212K) Download Attachment image002.jpg (30K) Download Attachment |
I think this is what you want to do:
Analyze > Set Measurements... and click the box for Mean Gray Value. Then draw a box around the background between the two stripes. This is the background value. Analyze > Measure. Then draw a box on one of the stripes. Analyze > Measure. Then draw a box on the other stripe. Analyze > Measure. Find the Results window. Subtract the background value from the two stripes values. Then do the ratio. _________________________________________ Michael Cammer, Optical Microscopy Specialist http://ocs.med.nyu.edu/microscopy http://microscopynotes.com/ Cell: (914) 309-3270 ________________________________________ From: ImageJ Interest Group [[hidden email]] on behalf of Mart?n Mat?as P?rez Zan?n [[hidden email]] Sent: Sunday, July 23, 2017 11:52 AM To: [hidden email] Subject: FW: PLOT-RATIO Hi everyone, I would like to know if anyone can help me with the attached images. The first one it's the original, the second one is what I have been done. I need to know the brightness or intensity of the two strips that you can see in the frame, and the ratio between both (right strip/left strip). There is any way to do this automatically? Know the highest value of each curve in the plot? Right now I'm doing it manually, then subtract the mode value to both and after that I do the ratio (R/L). Do you think I'm doing it ok? What would you do/change? another way to do it? Thank you so much !!!! PD: I try image<adjust<brightness-contrast<auto ; then Process<subtract background and finally analyze<plot profile [cid:image002.jpg@01D303AA.275D35A0] [cid:image003.jpg@01D303A9.E9AEF4F0] -- ImageJ mailing list: https://urldefense.proofpoint.com/v2/url?u=http-3A__imagej.nih.gov_ij_list.html&d=DQIFAg&c=j5oPpO0eBH1iio48DtsedbOBGmuw5jHLjgvtN2r4ehE&r=oU_05LztNstAydlbm5L5GDu_vAdjXk3frDLx_CqKkuo&m=kTxrUWtcB9GwFXm64wmx4JOElL7psUDd3r8L_BStNDc&s=yByS06ng-g8pfXlsr-nDlHJnFM49U2ZMmNlCyNvNBIk&e= ------------------------------------------------------------ This email message, including any attachments, is for the sole use of the intended recipient(s) and may contain information that is proprietary, confidential, and exempt from disclosure under applicable law. Any unauthorized review, use, disclosure, or distribution is prohibited. If you have received this email in error please notify the sender by return email and delete the original message. Please note, the recipient should check this email and any attachments for the presence of viruses. The organization accepts no liability for any damage caused by any virus transmitted by this email. ================================= -- ImageJ mailing list: http://imagej.nih.gov/ij/list.html |
Thanks Michael Cammer! I will try that
Vet. Martín Pérez Cel phone: (+1) 917-647-7054 Tel. Cel.: (+549) 249-465-1-465 Skype: martin.perez.zanon > El jul. 23, 2017, a las 17:54, Cammer, Michael <[hidden email]> escribió: > > I think this is what you want to do: > > Analyze > Set Measurements... and click the box for Mean Gray Value. > > Then draw a box around the background between the two stripes. This is the background value. > Analyze > Measure. > Then draw a box on one of the stripes. > Analyze > Measure. > Then draw a box on the other stripe. > Analyze > Measure. > > Find the Results window. > > Subtract the background value from the two stripes values. > > Then do the ratio. > > > > _________________________________________ > Michael Cammer, Optical Microscopy Specialist > http://ocs.med.nyu.edu/microscopy > http://microscopynotes.com/ > Cell: (914) 309-3270 > > ________________________________________ > From: ImageJ Interest Group [[hidden email]] on behalf of Mart?n Mat?as P?rez Zan?n [[hidden email]] > Sent: Sunday, July 23, 2017 11:52 AM > To: [hidden email] > Subject: FW: PLOT-RATIO > > Hi everyone, > I would like to know if anyone can help me with the attached images. The first one it's the original, the second one is what I have been done. > I need to know the brightness or intensity of the two strips that you can see in the frame, and the ratio between both (right strip/left strip). There is any way to do this automatically? Know the highest value of each curve in the plot? > Right now I'm doing it manually, then subtract the mode value to both and after that I do the ratio (R/L). > Do you think I'm doing it ok? What would you do/change? another way to do it? > Thank you so much !!!! > > PD: I try image<adjust<brightness-contrast<auto ; then Process<subtract background and finally analyze<plot profile > [cid:image002.jpg@01D303AA.275D35A0] > [cid:image003.jpg@01D303A9.E9AEF4F0] > > -- > ImageJ mailing list: https://urldefense.proofpoint.com/v2/url?u=http-3A__imagej.nih.gov_ij_list.html&d=DQIFAg&c=j5oPpO0eBH1iio48DtsedbOBGmuw5jHLjgvtN2r4ehE&r=oU_05LztNstAydlbm5L5GDu_vAdjXk3frDLx_CqKkuo&m=kTxrUWtcB9GwFXm64wmx4JOElL7psUDd3r8L_BStNDc&s=yByS06ng-g8pfXlsr-nDlHJnFM49U2ZMmNlCyNvNBIk&e= > > ------------------------------------------------------------ > This email message, including any attachments, is for the sole use of the intended recipient(s) and may contain information that is proprietary, confidential, and exempt from disclosure under applicable law. Any unauthorized review, use, disclosure, or distribution is prohibited. If you have received this email in error please notify the sender by return email and delete the original message. Please note, the recipient should check this email and any attachments for the presence of viruses. The organization accepts no liability for any damage caused by any virus transmitted by this email. > ================================= > > -- > ImageJ mailing list: http://imagej.nih.gov/ij/list.html -- ImageJ mailing list: http://imagej.nih.gov/ij/list.html |
In reply to this post by Martín Matías Pérez Zanón
Good day Martín,
here is an ImageJ-macro that hopefully does what you want: ////macro begin requires("1.51p") border = 25; width = 100; run( "Select All" ); setKeyDown( "alt" ); p = getProfile(); setKeyDown("none"); p = xtrOfDeriv( p, border ); top = p[0]; bottom = p[1]; makeRectangle( 0, top, getWidth(), bottom - top ); p = getProfile(); max = Array.findMaxima( p, 0 ); x1 = max[0]; peak1 = p[x1]; p = zero( p, x1, width ); max = Array.findMaxima( p, 0 ); x2 = max[0]; peak2 = p[x2]; if ( x2 > x1 ) { left = x1 + width; right = x2 - width; } else { left = x2 + width; right = x1 - width; } makeRectangle( left, top, right - left, bottom - top ); run( "Set Measurements...", "mean modal median redirect=None decimal=3" ); List.setMeasurements; med = List.getValue( "Median" ); run( "Select None" ); print( (peak2 - med) / (peak1 - med) ); exit(); ////macro functions =============================================== function zero( a, mx, hw ) { for ( i=mx-hw; i<=mx+hw; i++ ) { a[i] = 0; } return a; } function xtrOfDeriv( a, crop ) { for ( i=1; i<a.length; i++ ) { a[i-1] = a[i] - a[i-1]; } a[a.length-1] = 0; min = Array.findMinima( a, 0 ); a = Array.findMaxima( a, 0 ); a[0] = a[0] + crop; a[1] = min[0] - crop; return a; } ////macro end There are two parameters that I've set according to your example image and if all your images look similar, you may stay with these values: border = 25; is the width in pixels of a strip that is cut off from the top and the bottom of the horizontal band in your image width = 100; is about the width of the strips of interest As a base value (the value that is subtracted) I've used the median of a selection between the strips of interest. You may also consider the mean or the modal value. Paste the macro code to an empty Macro-window and run it. (Plugins >> New >> Macro) HTH Herbie ::::::::::::::::::::::::::::::::::::::::::::::::::::::: Am 23.07.17 um 17:52 schrieb Mart?n Mat?as P?rez Zan?n: > Hi everyone, I would like to know if anyone can help me with the > attached images. The first one it's the original, the second one is > what I have been done. I need to know the brightness or intensity of > the two strips that you can see in the frame, and the ratio between > both (right strip/left strip). There is any way to do this > automatically? Know the highest value of each curve in the plot? > Right now I'm doing it manually, then subtract the mode value to both > and after that I do the ratio (R/L). Do you think I'm doing it ok? > What would you do/change? another way to do it? Thank you so much > !!!! > > PD: I try image<adjust<brightness-contrast<auto ; then > Process<subtract background and finally analyze<plot profile > [cid:image002.jpg@01D303AA.275D35A0] > [cid:image003.jpg@01D303A9.E9AEF4F0] > > -- ImageJ mailing list: http://imagej.nih.gov/ij/list.html -- ImageJ mailing list: http://imagej.nih.gov/ij/list.html |
Greetings All,
Part of the problem with this kind of analysis is that the peaks are not step functions, but are Gaussians of some form. Thus it is not always easy to determine when the peak actually begins.It seems to me that what you want is the area under the peaks, corrected for the background. To my mind, the most accurate method for doing this is to take advantage of the Gel Analysis tools in the Analyze menu. You would have to tell the system that the bands are arranged horizontally, and make sure that the system is defining a peak as brightness. Then, you can draw a box around the whole image and, following the routine, select that box as "lane 1" (control 1), and then plot the curve (control 3). The system then switches to the "line" tool so that you can draw a background line across the peaks. You can then use the wand tool to select the area under each peak. This is pretty well explained in the users guide. The tricky part is to decide where to place the background line. For this case, I drew the line with the central portion of the pattern as my guide. You have to make sure that the line crosses the peaks. As a general principle, you should do the analysis on the least processed image possible. Joel B. Sheffield, Ph.D Department of Biology Temple University Philadelphia, PA 19122 Voice: 215 204 8839 e-mail: [hidden email] URL: *https://bio.cst.temple.edu/~jbs/ <https://bio.cst.temple.edu/~jbs/> <http://tinyurl.com/khbouft>* On Mon, Jul 24, 2017 at 12:44 PM, Herbie <[hidden email]> wrote: > Good day Martín, > > here is an ImageJ-macro that hopefully does what you want: > > ////macro begin > requires("1.51p") > border = 25; > width = 100; > run( "Select All" ); > setKeyDown( "alt" ); > p = getProfile(); > setKeyDown("none"); > p = xtrOfDeriv( p, border ); > top = p[0]; > bottom = p[1]; > makeRectangle( 0, top, getWidth(), bottom - top ); > p = getProfile(); > max = Array.findMaxima( p, 0 ); > x1 = max[0]; > peak1 = p[x1]; > p = zero( p, x1, width ); > max = Array.findMaxima( p, 0 ); > x2 = max[0]; > peak2 = p[x2]; > if ( x2 > x1 ) { > left = x1 + width; > right = x2 - width; > } else { > left = x2 + width; > right = x1 - width; > } > makeRectangle( left, top, right - left, bottom - top ); > run( "Set Measurements...", "mean modal median redirect=None decimal=3" ); > List.setMeasurements; > med = List.getValue( "Median" ); > run( "Select None" ); > print( (peak2 - med) / (peak1 - med) ); > exit(); > ////macro functions =============================================== > function zero( a, mx, hw ) { > for ( i=mx-hw; i<=mx+hw; i++ ) { > a[i] = 0; > } > return a; > } > function xtrOfDeriv( a, crop ) { > for ( i=1; i<a.length; i++ ) { > a[i-1] = a[i] - a[i-1]; > } > a[a.length-1] = 0; > min = Array.findMinima( a, 0 ); > a = Array.findMaxima( a, 0 ); > a[0] = a[0] + crop; > a[1] = min[0] - crop; > return a; > } > ////macro end > > There are two parameters that I've set according to your example image > and if all your images look similar, you may stay with these values: > border = 25; > is the width in pixels of a strip that is cut off from the top and the > bottom of the horizontal band in your image > width = 100; > is about the width of the strips of interest > > As a base value (the value that is subtracted) I've used the median of a > selection between the strips of interest. You may also consider the mean > or the modal value. > > Paste the macro code to an empty Macro-window and run it. > (Plugins >> New >> Macro) > > HTH > > Herbie > > ::::::::::::::::::::::::::::::::::::::::::::::::::::::: > Am 23.07.17 um 17:52 schrieb Mart?n Mat?as P?rez Zan?n: > > Hi everyone, I would like to know if anyone can help me with the >> attached images. The first one it's the original, the second one is >> what I have been done. I need to know the brightness or intensity of >> the two strips that you can see in the frame, and the ratio between >> both (right strip/left strip). There is any way to do this >> automatically? Know the highest value of each curve in the plot? Right >> now I'm doing it manually, then subtract the mode value to both >> and after that I do the ratio (R/L). Do you think I'm doing it ok? >> What would you do/change? another way to do it? Thank you so much >> !!!! >> >> PD: I try image<adjust<brightness-contrast<auto ; then >> Process<subtract background and finally analyze<plot profile >> [cid:image002.jpg@01D303AA.275D35A0] [cid:image003.jpg@01D303A9.E9AEF4F0] >> >> -- ImageJ mailing list: http://imagej.nih.gov/ij/list.html >> > > -- > ImageJ mailing list: http://imagej.nih.gov/ij/list.html > ImageJ mailing list: http://imagej.nih.gov/ij/list.html Screenshot 2017-07-24 14.46.06.png (764K) Download Attachment |
Free forum by Nabble | Edit this page |