arbeit
Main Page | Namespace List | Class Hierarchy | Alphabetical List | Compound List | File List | Namespace Members | Compound Members | File Members

ColorMapper.h

Go to the documentation of this file.
00001 //------------------------------------------------------------------------
00002 //
00003 //   Joe Kniss
00004 //     6-20-03
00005 //                   ________    ____   ___ 
00006 //                  |        \  /    | /  /
00007 //                  +---+     \/     |/  /
00008 //                  +--+|  |\    /|     < 
00009 //                  |  ||  | \  / |  |\  \ 
00010 //                  |      |  \/  |  | \  \ 
00011 //                   \_____|      |__|  \__\
00012 //                       Copyright  2003 
00013 //                      Joe Michael Kniss
00014 //                   <<< jmk@cs.utah.edu >>>
00015 //               "All Your Base are Belong to Us"
00016 //-------------------------------------------------------------------------
00017 
00018 /// ColorMapper.h
00019 ///  simian filter
00020 
00021 #ifndef __SIMIAN_COLOR_MAPPER_DOT_H
00022 #define __SIMIAN_COLOR_MAPPER_DOT_H
00023 
00024 #include <core/SourceObj.h>
00025 #include <data/NrroData.h>
00026 
00027 /// base class for color mapping, 
00028 /// also implments some basic color mapping schemes
00029 
00030 class ColorMapper : public SourceObj {
00031 public:
00032    ColorMapper();
00033    virtual ~ColorMapper();
00034 
00035    virtual void           setInput(NrroDataObjSP n);
00036    virtual NrroDataObjSP  getOutput();
00037 
00038    /// can be or'ed together!
00039    enum COLOR_MAPS {
00040       GREY_SCALE_RGB = 1<<0,
00041       RAINBOW_RGB    = 1<<2
00042    };
00043    virtual void setColorMap(int mapId) {_mapId = mapId;}
00044    virtual int  getColorMap()          {return _mapId;}
00045 
00046    /// window/level settings, 
00047    /// turn window/level on(true) and off(false)
00048    virtual void  setWinLevRGB(bool onoff = true) {_autoRGB = !onoff;}
00049    /// set the window/level 
00050    virtual void  setWinLevRGB(float window, float level)
00051    {_windowRGB = window; _levelRGB = level;}
00052    /// get the window level
00053    virtual float getWindowRGB() {return _windowRGB;}
00054    virtual float getLevelRGB()  {return _levelRGB;}
00055    
00056    /// turn alpha window/level on(true) and off(false)
00057    virtual void  setWinLevA(bool onoff = true) {_autoA = !onoff;}
00058    virtual void  setWinLevA(float window, float level)
00059    {_windowA = window; _levelA = level;}
00060    virtual float getWindowA() {return _windowA;}
00061    virtual float getLevelA()  {return _levelA;}
00062 
00063 protected:
00064    virtual void execDef();
00065    
00066    virtual void mapGrey(NrroDataObjSP out, NrroDataObjSP in);
00067    
00068    int _mapId;
00069    bool  _autoRGB;
00070    bool  _autoA;
00071    float _windowRGB;
00072    float _levelRGB;
00073    float _windowA;
00074    float _levelA;
00075 };
00076 
00077 
00078 #endif
00079 
00080 

Send questions, comments, and bug reports to:
jmk