Uploaded image for project: 'Data Management'
  1. Data Management
  2. DM-15427

Add support for setting the color map to display_firefly

    XMLWordPrintable

    Details

    • Type: Story
    • Status: In Progress
    • Resolution: Unresolved
    • Fix Version/s: None
    • Component/s: display_firefly
    • Labels:
      None
    • Story Points:
      2
    • Sprint:
      SUIT Sprint 2018-08, SUIT Sprint 2018-09, SUIT Sprint 2018-10, SUIT Sprint 2018-11, SUIT Sprint 2018-12, SUIT Sprint 2019-01, SUIT Sprint 2019-03, SUIT Sprint 2019-05, SUIT Sprint 2019-07, SUIT Sprint 2019-08, SUIT Sprint 2019-09
    • Team:
      Science User Interface

      Description

      In DM-15218 support is being added to afwDisplay.Display for changing the color map (or color table as it is called in Firefly). Add support for changing the color map to the display_firefly backend.

      The current plan is to not try to come up with a common set of color map names beyond "gray". The names of the color maps will be backend-specific.

        Attachments

          Issue Links

            Activity

            Hide
            shupe David Shupe added a comment -

            Here is an excerpt from src/firefly/js/visualize/ui/ColorTableDropDownView.jsx  that may guide us in choosing names. In Firefly the color tables have numbers as well as names, and they have tooltips too.

             

            import ColorTable0 from 'html/images/cbar/ct-0-gray.png';
            import ColorTable1 from 'html/images/cbar/ct-1-reversegray.png';
            import ColorTable2 from 'html/images/cbar/ct-2-colorcube.png';
            import ColorTable3 from 'html/images/cbar/ct-3-spectrum.png';
            import ColorTable4 from 'html/images/cbar/ct-4-false.png';
            import ColorTable5 from 'html/images/cbar/ct-5-reversefalse.png';
            import ColorTable6 from 'html/images/cbar/ct-6-falsecompressed.png';
            import ColorTable7 from 'html/images/cbar/ct-7-difference.png';
            import ColorTable8 from 'html/images/cbar/ct-8-a-ds9.png';
            import ColorTable9 from 'html/images/cbar/ct-9-b-ds9.png';
            import ColorTable10 from 'html/images/cbar/ct-10-bb-ds9.png';
            import ColorTable11 from 'html/images/cbar/ct-11-he-ds9.png';
            import ColorTable12 from 'html/images/cbar/ct-12-i8-ds9.png';
            import ColorTable13 from 'html/images/cbar/ct-13-aips-ds9.png';
            import ColorTable14 from 'html/images/cbar/ct-14-sls-ds9.png';
            import ColorTable15 from 'html/images/cbar/ct-15-hsv-ds9.png';
            import ColorTable16 from 'html/images/cbar/ct-16-heat-ds9.png';
            import ColorTable17 from 'html/images/cbar/ct-17-cool-ds9.png';
            import ColorTable18 from 'html/images/cbar/ct-18-rainbow-ds9.png';
            import ColorTable19 from 'html/images/cbar/ct-19-standard-ds9.png';
            import ColorTable20 from 'html/images/cbar/ct-20-staircase-ds9.png';
            import ColorTable21 from 'html/images/cbar/ct-21-color-ds9.png';
            

            Here are the tooltips in the Firefly UI:

                    tip:'Gray Scale'
                    tip: 'Reverse Gray Scale'
                    tip: 'Color Cube'
                    tip: 'Spectrum'
                    tip: 'For False Color'
                    tip: 'For False Color - Reversed'
                    tip: 'For False Color - Compressed'
                    tip: 'For difference images'
                    tip: `DS9's a color bar`
                    tip: `DS9's b color bar`
                    tip: `DS9's bb color bar`
                    tip: `DS9's he color bar`
                    tip: `DS9's i8 color bar`
                    tip: `DS9's aips color bar`
                    tip: `DS9's sls color bar`
                    tip: `DS9's hsv color bar`
                    tip: 'Heat (ds9)'
                    tip: 'Cool (ds9)'
                    tip: 'Rainbow (ds9)'
                    tip: 'Standard (ds9)'
                    tip: 'Staircase (ds9)'
                    tip: 'Color (ds9)'
            

            Show
            shupe David Shupe added a comment - Here is an excerpt from src/firefly/js/visualize/ui/ColorTableDropDownView.jsx   that may guide us in choosing names. In Firefly the color tables have numbers as well as names, and they have tooltips too.   import ColorTable0 from 'html/images/cbar/ct-0-gray.png' ; import ColorTable1 from 'html/images/cbar/ct-1-reversegray.png' ; import ColorTable2 from 'html/images/cbar/ct-2-colorcube.png' ; import ColorTable3 from 'html/images/cbar/ct-3-spectrum.png' ; import ColorTable4 from 'html/images/cbar/ct-4-false.png' ; import ColorTable5 from 'html/images/cbar/ct-5-reversefalse.png' ; import ColorTable6 from 'html/images/cbar/ct-6-falsecompressed.png' ; import ColorTable7 from 'html/images/cbar/ct-7-difference.png' ; import ColorTable8 from 'html/images/cbar/ct-8-a-ds9.png' ; import ColorTable9 from 'html/images/cbar/ct-9-b-ds9.png' ; import ColorTable10 from 'html/images/cbar/ct-10-bb-ds9.png' ; import ColorTable11 from 'html/images/cbar/ct-11-he-ds9.png' ; import ColorTable12 from 'html/images/cbar/ct-12-i8-ds9.png' ; import ColorTable13 from 'html/images/cbar/ct-13-aips-ds9.png' ; import ColorTable14 from 'html/images/cbar/ct-14-sls-ds9.png' ; import ColorTable15 from 'html/images/cbar/ct-15-hsv-ds9.png' ; import ColorTable16 from 'html/images/cbar/ct-16-heat-ds9.png' ; import ColorTable17 from 'html/images/cbar/ct-17-cool-ds9.png' ; import ColorTable18 from 'html/images/cbar/ct-18-rainbow-ds9.png' ; import ColorTable19 from 'html/images/cbar/ct-19-standard-ds9.png' ; import ColorTable20 from 'html/images/cbar/ct-20-staircase-ds9.png' ; import ColorTable21 from 'html/images/cbar/ct-21-color-ds9.png' ; Here are the tooltips in the Firefly UI: tip: 'Gray Scale' tip: 'Reverse Gray Scale' tip: 'Color Cube' tip: 'Spectrum' tip: 'For False Color' tip: 'For False Color - Reversed' tip: 'For False Color - Compressed' tip: 'For difference images' tip: `DS9's a color bar` tip: `DS9's b color bar` tip: `DS9's bb color bar` tip: `DS9's he color bar` tip: `DS9's i8 color bar` tip: `DS9's aips color bar` tip: `DS9's sls color bar` tip: `DS9's hsv color bar` tip: 'Heat (ds9)' tip: 'Cool (ds9)' tip: 'Rainbow (ds9)' tip: 'Standard (ds9)' tip: 'Staircase (ds9)' tip: 'Color (ds9)'
            Hide
            shupe David Shupe added a comment -

            The first-draft implementation allows the user to specify a name or a colormap number from 0 to 21. We probably want to offer only a subset of these since some of them are not useful.

            Here is the function signature and docstring:

              def _setImageColormap(self, cmap):
                    """set the colormap
             
                    Parameters:
                    -----------
                    cmap : `str` or `int`
                        name of the colormap, or number.
                        Options:
                        'gray' or 0 : Gray Scale
                        'reversegray' or 1 : Reverse Gray Scale
                        'colorcube' or 2 : Color Cube
                        'spectrum' or 3 : Spectrum
                        'false' or 4 : For False Color
                        'reversefalse' or 5 : For False Color - Reverse
                        'falsecompressed' or 6 : For False Color - Compressed
                        'difference' or 7 : For difference images
                        'a-ds9' or 8 : ds9's a color bar
                        'b-ds9' or 9 : ds9's b color bar
                        'bb-ds9' or 10 : ds9's bb color bar
                        'he-ds9' or 11 : ds9's he color bar
                        'i8-ds9' or 12 : ds9's i8 color bar
                        'aips-ds9' or 13 : ds9's aips color bar
                        'sls-ds9' or 14 : ds9's sls color bar
                        'hsv-ds9' or 15 : ds9's hsv color bar
                        'heat-ds9' or 16 : Heat (ds9)
                        'cool-ds9' or 17 : Cool (ds9)
                        'rainbow-ds9' or 18 : Rainbow (ds9)
                        'standard-ds9' or 19 : Standard (ds9)
                        'staircase-ds9' or 20 : Staircase (ds9)
                        'color-ds9' or 21 : Color (ds9)
                    """
            

            Show
            shupe David Shupe added a comment - The first-draft implementation allows the user to specify a name or a colormap number from 0 to 21. We probably want to offer only a subset of these since some of them are not useful. Here is the function signature and docstring: def _setImageColormap( self , cmap): """ set the colormap   Parameters: - - - - - - - - - - - cmap : ` str ` or ` int ` name of the colormap, or number. Options: 'gray' or 0 : Gray Scale 'reversegray' or 1 : Reverse Gray Scale 'colorcube' or 2 : Color Cube 'spectrum' or 3 : Spectrum 'false' or 4 : For False Color 'reversefalse' or 5 : For False Color - Reverse 'falsecompressed' or 6 : For False Color - Compressed 'difference' or 7 : For difference images 'a-ds9' or 8 : ds9's a color bar 'b-ds9' or 9 : ds9's b color bar 'bb-ds9' or 10 : ds9's bb color bar 'he-ds9' or 11 : ds9's he color bar 'i8-ds9' or 12 : ds9's i8 color bar 'aips-ds9' or 13 : ds9's aips color bar 'sls-ds9' or 14 : ds9's sls color bar 'hsv-ds9' or 15 : ds9's hsv color bar 'heat-ds9' or 16 : Heat (ds9) 'cool-ds9' or 17 : Cool (ds9) 'rainbow-ds9' or 18 : Rainbow (ds9) 'standard-ds9' or 19 : Standard (ds9) 'staircase-ds9' or 20 : Staircase (ds9) 'color-ds9' or 21 : Color (ds9) """
            Hide
            roby Trey Roby added a comment -

            These are fine, but I would prefer to change them to this all though the system instead of just the python mapping them.  We need a ticket for that.  I don't think it is a big effort.

            it will affect ColorTable.java, WebPlotRequest.{js,java}, ImageData.java, ImageDataGroup.java, plus a couple of more js files.

            Show
            roby Trey Roby added a comment - These are fine, but I would prefer to change them to this all though the system instead of just the python mapping them.  We need a ticket for that.  I don't think it is a big effort. it will affect ColorTable.java, WebPlotRequest.{js,java}, ImageData.java, ImageDataGroup.java, plus a couple of more js files.
            Hide
            shupe David Shupe added a comment -

            Yes, we are all agreed to change them all through the system. My intention is for DM-17556 to be the ticket for changing the JS client and the server, but I suppose I did not write it that clearly.

            Show
            shupe David Shupe added a comment - Yes, we are all agreed to change them all through the system. My intention is for DM-17556 to be the ticket for changing the JS client and the server, but I suppose I did not write it that clearly.

              People

              Assignee:
              shupe David Shupe
              Reporter:
              shupe David Shupe
              Watchers:
              Cindy Wang [X] (Inactive), David Shupe, Gregory Dubois-Felsmann, Lee Kelvin, Robert Lupton, Tatiana Goldina, Trey Roby, Xiuqin Wu [X] (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              8 Start watching this issue

                Dates

                Created:
                Updated:

                  Jenkins

                  No builds found.