polygon plot profile

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
11 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

polygon plot profile

Nirbio
Hi There,

I would appreciate if you could help me with the following issue: I am trying to get a plot profile for a polygonal shape. It seems like the software only accept rectangle or line shape for the analysis, resulting in averaging the signal over a range of pixels not occupied by my cells, hence reducing the "true signal". is there a way to get the plot profile for a polygon. This will be extremely helpful.

Thanks in advance,

Nir
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: polygon plot profile

Michael P Ellis
Just use the “Segmented Line Tool” in place of the Ploygon tool, then the Plot Profile will work.

“Segmented Line Tool” is available by meta-clicking on the Line Tool button in the tool bar.

You can also set the profile line thickness that gets used by double clicking on the “Line Tool” in the tool bar.

— Michael Ellis

> On 21 Feb 2017, at 17:54, Nirbio <[hidden email]> wrote:
>
> Hi There,
>
> I would appreciate if you could help me with the following issue: I am
> trying to get a plot profile for a polygonal shape. It seems like the
> software only accept rectangle or line shape for the analysis, resulting in
> averaging the signal over a range of pixels not occupied by my cells, hence
> reducing the "true signal". is there a way to get the plot profile for a
> polygon. This will be extremely helpful.
>
> Thanks in advance,
>
> Nir
>
>
>
> --
> View this message in context: http://imagej.1557.x6.nabble.com/polygon-plot-profile-tp5018156.html
> Sent from the ImageJ mailing list archive at Nabble.com.
>
> --
> ImageJ mailing list: http://imagej.nih.gov/ij/list.html

Michael Ellis (Managing Director)
Digital Scientific UK Ltd.
http://www.dsuk.biz <http://www.dsuk.biz/>
[hidden email]
tel: +44(0)1223 911215

The Commercial Centre
6 Green End
Cambridge
CB23 7DY

=== END OF EMAIL ===


--
ImageJ mailing list: http://imagej.nih.gov/ij/list.html
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: polygon plot profile

Nirbio
Hi Michael,

First, I really appreciate your help. Unfortunately, segmented line will not help in this case as it will not average the pixels within the shape that I create using the segmented line tool, but rather plot the pixel value along the line itself. thickening the line won't allow to cover the polygonal area of interest. Think of my shape as a side view of a funnel, within this funnel I need the average value of the pixels along the y axis. Will appreciate any other ideas you might have.

Thanks,

Nir

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: polygon plot profile

Herbie
Good day Nirbio,

what about clearing the image outside the selection.
Then select the whole image and get the profile.
If you need the original image, then duplicate it at the beginning.

Best

Herbie

:::::::::::::::::::::::::::::::::::
Am 21.02.17 um 17:40 schrieb Nirbio:

> Hi Michael,
>
> First, I really appreciate your help. Unfortunately, segmented line will not
> help in this case as it will not average the pixels within the shape that I
> create using the segmented line tool, but rather plot the pixel value along
> the line itself. thickening the line won't allow to cover the polygonal area
> of interest. Think of my shape as a side view of a funnel, within this
> funnel I need the average value of the pixels along the y axis. Will
> appreciate any other ideas you might have.
>
> Thanks,
>
> Nir
>
>
>
>
>
> --
> View this message in context: http://imagej.1557.x6.nabble.com/polygon-plot-profile-tp5018156p5018158.html
> Sent from the ImageJ mailing list archive at Nabble.com.
>
> --
> ImageJ mailing list: http://imagej.nih.gov/ij/list.html
>

--
ImageJ mailing list: http://imagej.nih.gov/ij/list.html
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: polygon plot profile

Nirbio
Hi Herbie,

I tried that as well. The problem with that approach is that after clearing the image outside my ROI (funnel shape) I sill need to use the rectangle tool, hence selecting pixels from the cleared region as well. The cleared regions is now pixels with the value=0 which dilute my overall average signal.

Thanks!

Nir
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: polygon plot profile

Herbie
Nir,

ok, then I suggest to (temporarily) change the image type to 32bit and
set the "Outside" region to NaN instead of zero.

HTH

Herbie

::::::::::::::::::::::::::::::::::::
Am 21.02.17 um 19:07 schrieb Nirbio:

> Hi Herbie,
>
> I tried that as well. The problem with that approach is that after clearing
> the image outside my ROI (funnel shape) I sill need to use the rectangle
> tool, hence selecting pixels from the cleared region as well. The cleared
> regions is now pixels with the value=0 which dilute my overall average
> signal.
>
> Thanks!
>
> Nir
>
>

> --
> View this message in context: http://imagej.1557.x6.nabble.com/polygon-plot-profile-tp5018156p5018161.html
> Sent from the ImageJ mailing list archive at Nabble.com.
>
> --
> ImageJ mailing list: http://imagej.nih.gov/ij/list.html
>

--
ImageJ mailing list: http://imagej.nih.gov/ij/list.html
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: polygon plot profile

Nirbio
Hi Herbie,

This is a good solution. Is there an easy way to set the clear outside tool to NAN? I can can create NAN from the 0 values (by dividing and multiplying options in image calculator) but I am wondering if there is a more straight forward way.

Thank you so much!

Nir
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: polygon plot profile

Herbie
Well Nir,

a little macro will do...

It depends from where you start.
Let's assume you've made the selection on an 8bit image, then start the
following code:

// begin
requires("1.51j")
origImg = getImageID();
run("Make Inverse");
run("Duplicate...", "title=Temp");
tempImg = getImageID();
run("32-bit");
run("Set...", "value=NaN");
run("Select All");
run("Plot Profile");
selectImage(tempImg);
close();
selectImage(origImg);
run("Make Inverse");
// end

(Paste the code to an empty Macro.txt window (Plugins > New > Macro) and
start it with Command-R or Control-R.)

The Recorder-feature may help you with creating macros. Try it!

Regards

Herbie

::::::::::::::::::::::::::::::::::::
Am 21.02.17 um 19:58 schrieb Nirbio:

> Hi Herbie,
>
> This is a good solution. Is there an easy way to set the clear outside tool
> to NAN? I can can create NAN from the 0 values (by dividing and multiplying
> options in image calculator) but I am wondering if there is a more straight
> forward way.
>
> Thank you so much!
>
> Nir
>
>
>
> --
> View this message in context: http://imagej.1557.x6.nabble.com/polygon-plot-profile-tp5018156p5018163.html
> Sent from the ImageJ mailing list archive at Nabble.com.
>
> --
> ImageJ mailing list: http://imagej.nih.gov/ij/list.html
>

--
ImageJ mailing list: http://imagej.nih.gov/ij/list.html
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: polygon plot profile

Michael Schmid-3
In reply to this post by Nirbio
Hi Nir,

you can use Process>Math>Set to set to NaN.  You might create a macro
with a shortcut for this (it may also do Edit>Selection>Make Inverse;
use the Macro Recorder to get the commands).
As far as I can say, you can't define the background color as
corresponding to NaN.

Michael
________________________________________________________________
On 21/02/2017 19:58, Nirbio wrote:

> Hi Herbie,
>
> This is a good solution. Is there an easy way to set the clear outside tool
> to NAN? I can can create NAN from the 0 values (by dividing and multiplying
> options in image calculator) but I am wondering if there is a more straight
> forward way.
>
> Thank you so much!
>
> Nir
>
>
>
> --
> View this message in context: http://imagej.1557.x6.nabble.com/polygon-plot-profile-tp5018156p5018163.html
> Sent from the ImageJ mailing list archive at Nabble.com.
>
> --
> ImageJ mailing list: http://imagej.nih.gov/ij/list.html
>

--
ImageJ mailing list: http://imagej.nih.gov/ij/list.html
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: polygon plot profile

Nirbio
In reply to this post by Herbie
Thank you Herbie,

Thanks to your help I wrote a macro that do exactly what I need.

Best,

Nir

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: polygon plot profile

Nirbio
In reply to this post by Michael Schmid-3
Thank you so much Michael! problem solved. I wrote a macro that define everything out side my ROI as NaN and that solved it.
Loading...