patchGNU Octave - Patches: patch #8722, [octave forge] (image) implement...


patch #8722: [octave forge] (image) implement impixelinfo and impixelinfoval

Submitted by:  None
Submitted on:  Fri 21 Aug 2015 05:14:32 PM UTC  
Category:  Forge : new function Priority:  5 - Normal
Status:  In Progress Privacy:  Public
Assigned to:  None Originator Email:  -email is unavailable-
Open/Closed:  Open

Add a New Comment (Rich Markup)

You are not logged in

Please log in, so followups can be emailed to you.


( Jump to the original submission)

Fri 03 Nov 2017 09:50:40 AM UTC, comment #15: 

@Avinoam: I forgot these patches... Or as far as I remember I lost track because I tired to hunt a bug with different text extent (which was a part of these patches)

I've created a repo on github:

If someone help to polish it send a short message with github user and I#ll give write access.

Andreas Weber <andy1978>
Project Member
Wed 22 Feb 2017 09:30:06 PM UTC, comment #14: 

What's the status of impixelinfo and impixelinfoval patches?

Avinoam Kalma <avinoam>
Project Member
Thu 08 Sep 2016 09:33:04 PM UTC, comment #13: 

I didn't know that the axes could return the currentpoint in axes data coordinates (I used figures currentpoint), which would have saved me a lot of trouble as I had to change figure coordinates into axes coordinates  (which depends on many things ...).
Andy's implementation is much cleaner and simpler. Forget about mine.

Pantxo Diribarne <pantxo>
Project Member
Thu 08 Sep 2016 09:12:00 PM UTC, comment #12: 

Oh how dissapointed I am ... I have worked out independently an implementation of impixelinfo and impixelinfoval. They are still in a draft state but I attached them here (before reading what has been done) and in case anything can be helpful.

(file #38455, file #38456)

Pantxo Diribarne <pantxo>
Project Member
Wed 13 Jul 2016 03:09:57 PM UTC, comment #11: 

It looks like you've got it pretty much in hand, so please go ahead. I was going to take a different approach, and am not nearly as far along as you are.


Eric Addison <easports>
Wed 13 Jul 2016 08:30:03 AM UTC, comment #10: 

@Eric: Do you want to work on impixelinfo and impixelinfoval or should I polish the patch?

Andreas Weber <andy1978>
Project Member
Thu 07 Jul 2016 03:23:27 PM UTC, comment #9: 

I've splited the function as discussed with carandraug, see attached tgz. the doit.m is just a helper to check for BW, RGB, grayscale images and so on.

(file #37757)

Andreas Weber <andy1978>
Project Member
Thu 07 Jul 2016 01:31:26 PM UTC, comment #8: 

As discussed on IRC with andy:

> I just looked at your impixelinfo. I think that should be done as impixelinfoval. Matlab seems to include the impixelinfoval control inside the other so it probably impixelinfo calls impixelinfoval.

> carandraug: Do you understand this? "...When created with impixelinfo, the tool is a uipanel object.... When created with impixelinfoval, the tool is a uicontrol object...
> I'm not familiar with ui* object and thought a uicontrol style=text is the same as a panel

> a control is element that you can interact with such as button, piece of text, dropdown menu, etc. A panel is just a place where you can put stuff (other panels or a control)
> so what that sentence means is that impixelinfoval will create a uicontrol with the text only. If you use impixelinfo, then it creates a panel with the text "Pixel Info" which is followed by a uicontrol (the one that created by impixelinfoval) that shows the actual pixelinfp
> this separation of things allows you to place the pixelinfo somewhere else, in your own uipanel

Carnë Draug <carandraug>
Project Member
Thu 07 Jul 2016 12:44:46 PM UTC, comment #7: 

I started implementing impixelinfo last year. I'll attach the last version

(file #37751)

Andreas Weber <andy1978>
Project Member
Thu 07 Jul 2016 11:50:17 AM UTC, comment #6: 

This behaviour needs to be implemented in the image package as impixelinfoval and impixelinfo.

I believe that the development versions of octave make this possible. You will need to create a uicontrol object of type text. Then you need to set a listener on the image that changes the text as the mouse moves over the image.

After looking at the two functions, might be easier to implement impixelinfoval first. The function impixelinfo can then make use of impixelinfoval.

Carnë Draug <carandraug>
Project Member
Thu 07 Jul 2016 01:16:30 AM UTC, comment #5: 

Yes, you're welcome to ask any questions.  I won't necessarily know the answers, but someone else may.

Lachlan Andrew <lachlan>
Wed 06 Jul 2016 10:29:36 PM UTC, comment #4: 

Hi Lachlan!

Thanks for noticing! I would love to get these functions implemented. I will work on these through the weekend.

I know you are probably busy, but could I ask you a few questions as I work through this, most likely related to the best plan for integrating with octave-core?

Thanks again!

Eric Addison <easports>
Wed 06 Jul 2016 01:55:15 PM UTC, comment #3: 

Thanks for this patch, Eric.  I have been wanting something like this!

Do you have any time to refresh the patch and implement impixelinfo and impixelinfoval?  It would be great to get this into Release 4.2.0, but that goes into feature freeze in a week or so.

Lachlan Andrew <lachlan>
Mon 24 Aug 2015 02:13:22 PM UTC, comment #2: 

Understood. I was unaware of those functions in MATLAB. I will move the functionality to impixelinfo and inpixelinfoval.

Thanks for the info!

Eric Addison <easports>
Mon 24 Aug 2015 12:03:26 PM UTC, comment #1: 

This should be done optionally and not by default. Specifically, this should be the job of the missing functions impixelinfo and impixelinfoval (which would be part of the image package).

Carnë Draug <carandraug>
Project Member
Fri 21 Aug 2015 05:14:32 PM UTC, original submission:  

This patch attempts to address the following entry on the Octave wiki projects page (

-- On 'imagesc' plots, report the matrix values also based on the mouse position, updating on mouse moving.

This has been accomplished by altering the Figure::updateStatusBar() method to take an additional QString parameter, i.e.

Figure::updateStatusBar (ColumnVector pt, QString val)

The method was updated to display this QString in the message bar, i.e.

    m_statusBar->showMessage (QString ("(%1, %2)%3")
                              .arg (pt(0), 0, 'g', 5)
                              .arg (pt(1), 0, 'g', 5)
The QString was built inside of the Canvas::canvasMouseMoveEvent() method. The added code computes the integer index location of the mouse in the x and y directions from a combination of the current mouse pixel position and the xdata and ydata properties of the graphics object, then uses these indices to retrieve the double value from cdata. Here is the added code:

          ColumnVector v = ap.pixel2coord (event->x (), event->y ());
          QString val = QString ("");
          if (currentObj.isa ("image"))
              octave_value xdata = currentObj.get ("xdata");
              octave_value ydata = currentObj.get ("ydata");
              octave_value cdata = currentObj.get ("cdata");
              int x = floor (xdata.size ()(0) * v(0)
                             / xdata.matrix_value()(xdata.size ()(0)-1) - 0.5);
              int y = floor (ydata.size ()(0) * v(1)
                             / ydata.matrix_value ()(ydata.size ()(0)-1) - 0.5);
              val = QString (" : %1").arg (cdata.matrix_value ()(y,x),0,'g',5);
          fig->updateStatusBar (v,val);



(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:

Attached Files
file #38455:  impixelinfoval.m added by pantxo (6KiB - text/x-objcsrc)
file #38456:  impixelinfo.m added by pantxo (3KiB - text/x-objcsrc)
file #37757:  impixelinfo.tar.gz added by andy1978 (2KiB - application/gzip)
file #37751:  impixelinfo.m added by andy1978 (3KiB - d2l/unknowntype)
file #34690:  displayImageValues.diff added by None (3KiB - text/x-patch - Diff file to update Figure.h,, and Canvas.h)


Depends on the following items: None found

   bug dependencies.


Carbon-Copy List
  • -email is unavailable- added by mtmiller (Updated the item)
  • -email is unavailable- added by avinoam (Posted a comment)
  • -email is unavailable- added by avinoam
  • -email is unavailable- added by avinoam
  • -email is unavailable- added by pantxo (Updated the item)
  • -email is unavailable- added by andy1978 (Updated the item)
  • -email is unavailable- added by lachlan (Posted a comment)
  • -email is unavailable- added by easports (Posted a comment)
  • -email is unavailable- added by None (Submitted the item)

    Do you think this task is very important?
    If so, you can add your encouragement to it.
    This task has 0 encouragements so far.

    Only logged-in users can vote.




    Follow 12 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2018-04-10 mtmiller CategoryNone => Forge : new function
        Summaryimplement impixelinfo and impixelinfoval => [octave forge] (image) implement impixelinfo and impixelinfoval
    2018-03-26 pantxo Dependencies- => bugs #53476 is dependent
    2017-02-22 avinoam Carbon-Copy- => Added
        Carbon-Copy- => Added
    2016-09-08 pantxo Attached File- => Added impixelinfoval.m, #38455
        Attached File- => Added impixelinfo.m, #38456
    2016-07-07 andy1978 Attached File- => Added impixelinfo.tar.gz, #37757
    2016-07-07 andy1978 Attached File- => Added impixelinfo.m, #37751
    2016-07-07 carandraug SummaryFor image() and imagesc(), added value readout in status bar when mousing over a figure => implement impixelinfo and impixelinfoval
    2016-07-07 lachlan StatusNone => In Progress
    2015-08-21 None Attached File- => Added displayImageValues.diff, #34690

    Back to the top

    Powered by Savane 3.5