Suggestion for Plot Profile

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
12 messages Options
Reply | Threaded
Open this post in threaded view
|

Suggestion for Plot Profile

Gabriel Landini
Hello,
I have a suggestion:
Would it be useful if the plot profile graph has some indication of whether
the plot is showing the average of the columns or the rows in an selection?
(whether one called the profiler using ctrl-K or alt-K or if the vertical
profile option has been selected)

Cheers,

Gabriel

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

Re: Suggestion for Plot Profile

Michael Schmid
Hi Gabriel,

yes, I agree that this can be usueful.

To keep compatibility with existing macros, I think that we should not
change the name "Plot of <imageNameWithoutExtension>".

What I could imagine is having the Profiler add an image property
'Label' to the plot if there is a rectangular roi.
This would be shown similar to a slice label of a stack, and it would
also survive saving as .tiff (or zip) and re-opening.


Michael
________________________________________________________________
On 10.03.21 15:31, Gabriel Landini wrote:

> Hello,
> I have a suggestion:
> Would it be useful if the plot profile graph has some indication of whether
> the plot is showing the average of the columns or the rows in an selection?
> (whether one called the profiler using ctrl-K or alt-K or if the vertical
> profile option has been selected)
>
> Cheers,
>
> Gabriel
>
> --
> 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
|

Re: Suggestion for Plot Profile

Wayne Rasband-2
In reply to this post by Gabriel Landini
> On Mar 10, 2021, at 9:31 AM, Gabriel Landini <[hidden email]> wrote:
>
> Hello,
> I have a suggestion:
> Would it be useful if the plot profile graph has some indication of whether
> the plot is showing the average of the columns or the rows in an selection?
> (whether one called the profiler using ctrl-K or alt-K or if the vertical
> profile option has been selected)

Thanks to Michael Schmid, ImageJ displays “horizontal” in the image info line for column average plots and “vertical” for row average plots.

-wayne

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

Re: Suggestion for Plot Profile

Gabriel Landini
On Thursday, 11 March 2021 13:00:33 GMT [hidden email] wrote:
> > On Mar 10, 2021, at 9:31 AM, Gabriel Landini <[hidden email]> wrote:
> > I have a suggestion:

> Thanks to Michael Schmid, ImageJ displays “horizontal” in the image info
> line for column average plots and “vertical” for row average plots.

Thank you!! For some reason I think there might be a refresh of the plot
missing?

newImage("Untitled", "RGB ramp", 256, 256, 1);
run("Select All");
run("Plot Profile");
//selectWindow("Untitled");
//setKeyDown("alt"); run("Plot Profile");

does not always show the string. If I maximise/resize the plot then the string
appears.

Best wishes,

Gabriel

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

Re: Suggestion for Plot Profile

Michael Schmid
Hi Gabriel,

sorry, I can't reproduce the problem. The label "horizontal" remains
visible when resizing or maximizing the plot, even with
Image>Adjust>Size. It also remains in Live Mode.
Even "Duplicate" copies it (but it loses the information that this is a
plot).

Is the remaining text of the subtitle line (image size, 8-bit, memory)
still there? If not, it could be either a problem of the graphics driver
or the interaction of Java with the Window Manager of the operating system.

When the label has disappeared, with the plot being the active window,
could you please try this JavaScript?

   imp=IJ.getImage();
   IJ.log(imp.getProperty("Label"));

It should print the label "horizontal" to the log.


Michael
________________________________________________________________
On 11.03.21 20:29, Gabriel Landini wrote:

> On Thursday, 11 March 2021 13:00:33 GMT [hidden email] wrote:
>>> On Mar 10, 2021, at 9:31 AM, Gabriel Landini <[hidden email]> wrote:
>>> I have a suggestion:
>
>> Thanks to Michael Schmid, ImageJ displays “horizontal” in the image info
>> line for column average plots and “vertical” for row average plots.
>
> Thank you!! For some reason I think there might be a refresh of the plot
> missing?
>
> newImage("Untitled", "RGB ramp", 256, 256, 1);
> run("Select All");
> run("Plot Profile");
> //selectWindow("Untitled");
> //setKeyDown("alt"); run("Plot Profile");
>
> does not always show the string. If I maximise/resize the plot then the string
> appears.
>
> Best wishes,
>
> Gabriel
>
> --
> 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
|

Re: Suggestion for Plot Profile

Fred Damen
Greetings Michael,

If I read Gabriel's issue correctly, the problem is not that the label
disappears, the problem is that sometimes the label does not initially
appear in the GUI, albeit when the plotwindow is convinced to redisplay
the label shows in the GUI.  This sounds similar to problems that I have
had in the past, (subject: plot window bug), where the plot window was
displayed with a size other that what I had requested and upon causing a
redisplay the window would adjust to the requested size.  I was able to
force a redisplay programmatically in Java by calling calling
windowActivated(null) and then drawPlot again.  The problem on my Linux
machine tended to happen more often the more it was overloaded, thus my
suspension of a race condition between Java proper and ImageJ in regards
to the GUI.

Fred

PS: Wayne has already fixed this specific problem.

On Thu, March 11, 2021 3:13 pm, Michael Schmid wrote:

> Hi Gabriel,
>
> sorry, I can't reproduce the problem. The label "horizontal" remains
> visible when resizing or maximizing the plot, even with
> Image>Adjust>Size. It also remains in Live Mode.
> Even "Duplicate" copies it (but it loses the information that this is a
> plot).
>
> Is the remaining text of the subtitle line (image size, 8-bit, memory)
> still there? If not, it could be either a problem of the graphics driver
> or the interaction of Java with the Window Manager of the operating
> system.
>
> When the label has disappeared, with the plot being the active window,
> could you please try this JavaScript?
>
>    imp=IJ.getImage();
>    IJ.log(imp.getProperty("Label"));
>
> It should print the label "horizontal" to the log.
>
>
> Michael
> ________________________________________________________________
> On 11.03.21 20:29, Gabriel Landini wrote:
>> On Thursday, 11 March 2021 13:00:33 GMT [hidden email] wrote:
>>>> On Mar 10, 2021, at 9:31 AM, Gabriel Landini <[hidden email]>
>>>> wrote:
>>>> I have a suggestion:
>>
>>> Thanks to Michael Schmid, ImageJ displays “horizontal” in the image
>>> info
>>> line for column average plots and “vertical” for row average plots.
>>
>> Thank you!! For some reason I think there might be a refresh of the plot
>> missing?
>>
>> newImage("Untitled", "RGB ramp", 256, 256, 1);
>> run("Select All");
>> run("Plot Profile");
>> //selectWindow("Untitled");
>> //setKeyDown("alt"); run("Plot Profile");
>>
>> does not always show the string. If I maximise/resize the plot then the
>> string
>> appears.
>>
>> Best wishes,
>>
>> Gabriel
>>
>> --
>> 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
Reply | Threaded
Open this post in threaded view
|

Re: Suggestion for Plot Profile

Michael Schmid
Hi Fred,

yes, I agree - sorry, I have not read it carefully.

The hint with overloading the CPU was a good one; I could not reproduce
it before, but I have seen the problem when running in parallel a median
with radius=100 on a 5000x5000 RGB noise image in parallel (this
operation takes ages and puts almost 100% load on all CPU cores).

So it definitely looks like a race condition. I'll have a quick look at
it, but I can't promise much.

Michael
________________________________________________________________
On 12.03.21 03:42, Fred Damen wrote:

> Greetings Michael,
>
> If I read Gabriel's issue correctly, the problem is not that the label
> disappears, the problem is that sometimes the label does not initially
> appear in the GUI, albeit when the plotwindow is convinced to redisplay
> the label shows in the GUI.  This sounds similar to problems that I have
> had in the past, (subject: plot window bug), where the plot window was
> displayed with a size other that what I had requested and upon causing a
> redisplay the window would adjust to the requested size.  I was able to
> force a redisplay programmatically in Java by calling calling
> windowActivated(null) and then drawPlot again.  The problem on my Linux
> machine tended to happen more often the more it was overloaded, thus my
> suspension of a race condition between Java proper and ImageJ in regards
> to the GUI.
>
> Fred
>
> PS: Wayne has already fixed this specific problem.
>
> On Thu, March 11, 2021 3:13 pm, Michael Schmid wrote:
>> Hi Gabriel,
>>
>> sorry, I can't reproduce the problem. The label "horizontal" remains
>> visible when resizing or maximizing the plot, even with
>> Image>Adjust>Size. It also remains in Live Mode.
>> Even "Duplicate" copies it (but it loses the information that this is a
>> plot).
>>
>> Is the remaining text of the subtitle line (image size, 8-bit, memory)
>> still there? If not, it could be either a problem of the graphics driver
>> or the interaction of Java with the Window Manager of the operating
>> system.
>>
>> When the label has disappeared, with the plot being the active window,
>> could you please try this JavaScript?
>>
>>     imp=IJ.getImage();
>>     IJ.log(imp.getProperty("Label"));
>>
>> It should print the label "horizontal" to the log.
>>
>>
>> Michael
>> ________________________________________________________________
>> On 11.03.21 20:29, Gabriel Landini wrote:
>>> On Thursday, 11 March 2021 13:00:33 GMT [hidden email] wrote:
>>>>> On Mar 10, 2021, at 9:31 AM, Gabriel Landini <[hidden email]>
>>>>> wrote:
>>>>> I have a suggestion:
>>>
>>>> Thanks to Michael Schmid, ImageJ displays â?ohorizontalâ? in the image
>>>> info
>>>> line for column average plots and â?overticalâ? for row average plots.
>>>
>>> Thank you!! For some reason I think there might be a refresh of the plot
>>> missing?
>>>
>>> newImage("Untitled", "RGB ramp", 256, 256, 1);
>>> run("Select All");
>>> run("Plot Profile");
>>> //selectWindow("Untitled");
>>> //setKeyDown("alt"); run("Plot Profile");
>>>
>>> does not always show the string. If I maximise/resize the plot then the
>>> string
>>> appears.
>>>
>>> Best wishes,
>>>
>>> Gabriel
>>>
>>> --
>>> 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
>

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

Re: Suggestion for Plot Profile

Gabriel Landini
In reply to this post by Fred Damen
I replied earlier but the mailing list does not seem to be working?

That's right! it is as Fred indicated: the label does not appear from the
start. I need to resize the plot to make it visible. Sorry if my previous mail
was unclear.

It seems to me that after the label is added, the location where it appears is
not refreshed/repainted. Maybe the label should be added earlier, when the
image size is added?

Regards
Gabriel




On Friday, 12 March 2021 02:42:26 GMT [hidden email] wrote:

> Greetings Michael,
>
> If I read Gabriel's issue correctly, the problem is not that the label
> disappears, the problem is that sometimes the label does not initially
> appear in the GUI, albeit when the plotwindow is convinced to redisplay
> the label shows in the GUI.  This sounds similar to problems that I have
> had in the past, (subject: plot window bug), where the plot window was
> displayed with a size other that what I had requested and upon causing a
> redisplay the window would adjust to the requested size.  I was able to
> force a redisplay programmatically in Java by calling calling
> windowActivated(null) and then drawPlot again.  The problem on my Linux
> machine tended to happen more often the more it was overloaded, thus my
> suspension of a race condition between Java proper and ImageJ in regards
> to the GUI.
>
> Fred
>
> PS: Wayne has already fixed this specific problem.
>
> On Thu, March 11, 2021 3:13 pm, Michael Schmid wrote:
> > Hi Gabriel,
> >
> > sorry, I can't reproduce the problem. The label "horizontal" remains
> > visible when resizing or maximizing the plot, even with
> > Image>Adjust>Size. It also remains in Live Mode.
> > Even "Duplicate" copies it (but it loses the information that this is a
> > plot).
> >
> > Is the remaining text of the subtitle line (image size, 8-bit, memory)
> > still there? If not, it could be either a problem of the graphics driver
> > or the interaction of Java with the Window Manager of the operating
> > system.
> >
> > When the label has disappeared, with the plot being the active window,
> > could you please try this JavaScript?
> >
> >    imp=IJ.getImage();
> >    IJ.log(imp.getProperty("Label"));
> >
> > It should print the label "horizontal" to the log.
> >
> >
> > Michael
> > ________________________________________________________________
> >
> > On 11.03.21 20:29, Gabriel Landini wrote:
> >> On Thursday, 11 March 2021 13:00:33 GMT [hidden email] wrote:
> >>>> On Mar 10, 2021, at 9:31 AM, Gabriel Landini <[hidden email]>
> >>>> wrote:
> >>>
> >>>> I have a suggestion:
> >>> Thanks to Michael Schmid, ImageJ displays â?ohorizontalâ? in the image
> >>> info
> >>> line for column average plots and â?overticalâ? for row average plots.
> >>
> >> Thank you!! For some reason I think there might be a refresh of the plot
> >> missing?
> >>
> >> newImage("Untitled", "RGB ramp", 256, 256, 1);
> >> run("Select All");
> >> run("Plot Profile");
> >> //selectWindow("Untitled");
> >> //setKeyDown("alt"); run("Plot Profile");
> >>
> >> does not always show the string. If I maximise/resize the plot then the
> >> string
> >> appears.
> >>
> >> Best wishes,
> >>
> >> Gabriel
> >>
> >> --
> >> 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

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

Re: Suggestion for Plot Profile

Bill Christens-Barry-2
In reply to this post by Gabriel Landini
Hi Gabriel,

In macro code that you included in a follow up to your original post on this topic the last two lines are commented:

  newImage("Untitled", "RGB ramp", 256, 256, 1);
  run("Select All");
  run("Plot Profile");
  //selectWindow("Untitled");
  //setKeyDown("alt"); run("Plot Profile");

On my machine with macOS 10.14.6 running ImageJ1.53i28, if those two lines are uncommented I observe that the label showing the orientation does not initially appear in the second, "vertical" plot that is displayed but can be made to appear by then resizing that window, all as you describe. I imagine the commenting of those lines was meant to be undone?

Bill

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

Re: Suggestion for Plot Profile

Michael Schmid
Hi Bill,

a fix for this bug is already on the way to Wayne.
The bug was depending on CPU load, initially making it difficult to
reproduce for me.

Michael
________________________________________________________________
On 12.03.21 15:43, Bill Christens-Barry wrote:

> Hi Gabriel,
>
> In macro code that you included in a follow up to your original post on this topic the last two lines are commented:
>
>    newImage("Untitled", "RGB ramp", 256, 256, 1);
>    run("Select All");
>    run("Plot Profile");
>    //selectWindow("Untitled");
>    //setKeyDown("alt"); run("Plot Profile");
>
> On my machine with macOS 10.14.6 running ImageJ1.53i28, if those two lines are uncommented I observe that the label showing the orientation does not initially appear in the second, "vertical" plot that is displayed but can be made to appear by then resizing that window, all as you describe. I imagine the commenting of those lines was meant to be undone?
>
> Bill
>
> --
> 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
|

Re: Suggestion for Plot Profile

Gabriel Landini
In reply to this post by Bill Christens-Barry-2
On Friday, 12 March 2021 14:43:06 GMT [hidden email] wrote:

> In macro code that you included in a follow up to your original post on this
> topic the last two lines are commented:
>
>   newImage("Untitled", "RGB ramp", 256, 256, 1);
>   run("Select All");
>   run("Plot Profile");
>   //selectWindow("Untitled");
>   //setKeyDown("alt"); run("Plot Profile");
>
> On my machine with macOS 10.14.6 running ImageJ1.53i28, if those two lines
> are uncommented I observe that the label showing the orientation does not
> initially appear in the second, "vertical" plot that is displayed but can
> be made to appear by then resizing that window, all as you describe. I
> imagine the commenting of those lines was meant to be undone?

Hi Bill,
Thanks for checking this.
The issue was easier to see in my setup if the lines were commented (i.e.
while doing a single horizontal plot). I included the other 2 lines to see
what happened if I called the vertical version of the plot).

If uncommented, the second plot also missed the label, as you reproduced.
Michael kindly offered a solution to this.

Best wishes

Gabriel

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

Re: Suggestion for Plot Profile

Stein Rørvik
In reply to this post by Bill Christens-Barry-2
I see the same behaviour under Windows 10/64.
The label is not shown for either of the plots, but appear if the windows are resized.

Stein

-----Original Message-----
Sent: 12. mars 2021 15:43
Subject: Re: Suggestion for Plot Profile

Hi Gabriel,

In macro code that you included in a follow up to your original post on this topic the last two lines are commented:

  newImage("Untitled", "RGB ramp", 256, 256, 1);
  run("Select All");
  run("Plot Profile");
  //selectWindow("Untitled");
  //setKeyDown("alt"); run("Plot Profile");

On my machine with macOS 10.14.6 running ImageJ1.53i28, if those two lines are uncommented I observe that the label showing the orientation does not initially appear in the second, "vertical" plot that is displayed but can be made to appear by then resizing that window, all as you describe. I imagine the commenting of those lines was meant to be undone?

Bill

--
ImageJ mailing list: https://eur03.safelinks.protection.outlook.com/?url=http%3A%2F%2Fimagej.nih.gov%2Fij%2Flist.html&amp;data=04%7C01%7Cstein.rorvik%40sintef.no%7C3dcd27c75cda416a0aba08d8e5654235%7Ce1f00f39604145b0b309e0210d8b32af%7C1%7C1%7C637511570367187475%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000&amp;sdata=C3k9Onxx%2Bw62wCUBy2q7AhbzLSFkkhIMOmoN9crDTWA%3D&amp;reserved=0

--
ImageJ mailing list: http://imagej.nih.gov/ij/list.html