is there any way to control to display the single band image like this(0-10 light red 10-50 rea 50-100 dark red...)?

classic Classic list List threaded Threaded
7 messages Options
Reply | Threaded
Open this post in threaded view
|

is there any way to control to display the single band image like this(0-10 light red 10-50 rea 50-100 dark red...)?

speedinghong
Reply | Threaded
Open this post in threaded view
|

Re: is there any way to control to display the single band image like this(0-10 light red 10-50 rea 50-100 dark red...)?

Trevor Clarke
To clarify, are you looking to create a color map and display pixel values in the 0-10 range as light red, etc? If so, then you can create a colormap.

In the Histogram Window, right click and select Color Map
Either select and existing color map (Hot Iron or Hot Iron Alpha may work for you) or create a new one
To create a new one, you can select the Create/Edit Color Map option from that menu. This displays a dialog which lets you add color ramps (interpolations) of 2 or more colors.

If you want to create a very specific color map where exact value mappings are important, you can write a color map file by hand. The format isn't too difficult. There are two versions, .clu and .cgr. There are examples of both formats in your Opticks install directory (in SupportFiles/ColorTables)

.clu Version 2 files (for example HotIron.clu) are the oldest format and are simply digital number to RGB mappings with a name. You can have as many values as you need (HotIron.clu contains 765 mappings) and any values which are not specified (766 and higher for example) are clamped to the closest value in the map.

.clu Version 3 files (for example HotIronAlpha.clu) are the same as version 2 but allow you to specify an alpha channel as well

.cgr Version 4 (RedTemp.cgr for example) are more complex and allow easier specification of gradients. These are the files generated by the Create/Edit Color Map dialog and it's easiest to use that to edit them. The specify a lower and upper value for the color map, transition points for the gradients and the color map itself.

For your application, I'd suggest a .clu. It would look something like: (not a complete color map, you'd need to fill in the missing values)
COMET Color Table
Version                 3
Sample Color Map
Index   Red        Green        Blue       Alpha
0         255         0              0            255
1         255         0              0            255
...
10        255         0              0            255
11        170         0              0            255
...
50        170         0              0            255
51        70           0              0            255
100      70           0              0            255
101      0             0              0            0



On Tue, Nov 20, 2012 at 4:23 AM, speedinghong <[hidden email]> wrote:




--
View this message in context: http://opticks-devs.2021163.n4.nabble.com/is-there-any-way-to-control-to-display-the-single-band-image-like-this-0-10-light-red-10-50-rea-50-1-tp4652871.html
Sent from the opticks-devs mailing list archive at Nabble.com.

------------------------------------------------------------------------------
Monitor your physical, virtual and cloud infrastructure from a single
web console. Get in-depth insight into apps, servers, databases, vmware,
SAP, cloud infrastructure, etc. Download 30-day Free Trial.
Pricing starts from $795 for 25 servers or applications!
http://p.sf.net/sfu/zoho_dev2dev_nov
_______________________________________________
Opticks-devs mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/opticks-devs



--
Trevor R.H. Clarke
Computer Science House
Rochester Institute of Technology
[hidden email]
http://www.csh.rit.edu/~retrev/


------------------------------------------------------------------------------
Monitor your physical, virtual and cloud infrastructure from a single
web console. Get in-depth insight into apps, servers, databases, vmware,
SAP, cloud infrastructure, etc. Download 30-day Free Trial.
Pricing starts from $795 for 25 servers or applications!
http://p.sf.net/sfu/zoho_dev2dev_nov
_______________________________________________
Opticks-devs mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/opticks-devs
Reply | Threaded
Open this post in threaded view
|

Re: is there any way to control to display the single band image like this(0-10 light red 10-50 rea 50-100 dark red...)?

speedinghong
yeah,that's exactly what i'm looking for,thanks.is there any interface in opticks sdk to control that?i want to achieve that in code,and seems it's impossible to dynamically set up the color map?for example,according to the max and min values of the image to seperate the gray values into 7 colors(like 7-10 color1 10-13 color2 13-16 color 3...)
Reply | Threaded
Open this post in threaded view
|

Re: is there any way to control to display the single band image like this(0-10 light red 10-50 rea 50-100 dark red...)?

Trevor Clarke
You can create a ColorMap object. Pass it a .clu/.cgr path to initialize or you can initalize with a vector<ColorType> where the index in the vector corresponds to the digital number. You can pass this ColorMap to RasterLayer::setColorMap(). If you want to change one that's already active, you can just index into he ColorMap and modify the Color.

cmap[0].mRed = 128; // for example


On Tue, Nov 20, 2012 at 9:13 AM, speedinghong <[hidden email]> wrote:
yeah,that's exactly what i'm looking for,thanks.is there any interface in
opticks sdk to control that?i want to achieve that in code,and seems it's
impossible to dynamically set up the color map?for example,according to the
max and min values of the image to seperate the gray values into 7
colors(like 7-10 color1 10-13 color2 13-16 color 3...)



--
View this message in context: http://opticks-devs.2021163.n4.nabble.com/is-there-any-way-to-control-to-display-the-single-band-image-like-this-0-10-light-red-10-50-rea-50-1-tp4652871p4652873.html
Sent from the opticks-devs mailing list archive at Nabble.com.

------------------------------------------------------------------------------
Monitor your physical, virtual and cloud infrastructure from a single
web console. Get in-depth insight into apps, servers, databases, vmware,
SAP, cloud infrastructure, etc. Download 30-day Free Trial.
Pricing starts from $795 for 25 servers or applications!
http://p.sf.net/sfu/zoho_dev2dev_nov
_______________________________________________
Opticks-devs mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/opticks-devs



--
Trevor R.H. Clarke
Computer Science House
Rochester Institute of Technology
[hidden email]
http://www.csh.rit.edu/~retrev/


------------------------------------------------------------------------------
Monitor your physical, virtual and cloud infrastructure from a single
web console. Get in-depth insight into apps, servers, databases, vmware,
SAP, cloud infrastructure, etc. Download 30-day Free Trial.
Pricing starts from $795 for 25 servers or applications!
http://p.sf.net/sfu/zoho_dev2dev_nov
_______________________________________________
Opticks-devs mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/opticks-devs
Reply | Threaded
Open this post in threaded view
|

Re: is there any way to control to display the single band image like this(0-10 light red 10-50 rea 50-100 dark red...)?

speedinghong
does rasterlayer has the interface to add a color bar(color map) in the image right bottom like most color map images do?i don't find it
Reply | Threaded
Open this post in threaded view
|

Re: is there any way to control to display the single band image like this(0-10 light red 10-50 rea 50-100 dark red...)?

Trevor Clarke
There is not a built-in way to do this. You could write code to create an image of a color bar and add it as an annotation object.


On Wed, Nov 21, 2012 at 9:03 AM, speedinghong <[hidden email]> wrote:
does rasterlayer has the interface to add a color bar(color map) in the image
right bottom like most color map images do?i don't find it



--
View this message in context: http://opticks-devs.2021163.n4.nabble.com/is-there-any-way-to-control-to-display-the-single-band-image-like-this-0-10-light-red-10-50-rea-50-1-tp4652871p4652875.html
Sent from the opticks-devs mailing list archive at Nabble.com.

------------------------------------------------------------------------------
Monitor your physical, virtual and cloud infrastructure from a single
web console. Get in-depth insight into apps, servers, databases, vmware,
SAP, cloud infrastructure, etc. Download 30-day Free Trial.
Pricing starts from $795 for 25 servers or applications!
http://p.sf.net/sfu/zoho_dev2dev_nov
_______________________________________________
Opticks-devs mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/opticks-devs



--
Trevor R.H. Clarke
Computer Science House
Rochester Institute of Technology
[hidden email]
http://www.csh.rit.edu/~retrev/


------------------------------------------------------------------------------
Monitor your physical, virtual and cloud infrastructure from a single
web console. Get in-depth insight into apps, servers, databases, vmware,
SAP, cloud infrastructure, etc. Download 30-day Free Trial.
Pricing starts from $795 for 25 servers or applications!
http://p.sf.net/sfu/zoho_dev2dev_nov
_______________________________________________
Opticks-devs mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/opticks-devs
Reply | Threaded
Open this post in threaded view
|

Re: is there any way to control to display the single band image like this(0-10 light red 10-50 rea 50-100 dark red...)?

speedinghong
ok,i know,thanks