SimulationViewerEyeRegion.H
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038 #ifndef SIMULATIONVIEWEREYEREGION_H_DEFINED
00039 #define SIMULATIONVIEWEREYEREGION_H_DEFINED
00040
00041 #include "Component/ModelParam.H"
00042
00043
00044
00045 #include "Neuro/SimulationViewerEyeMvt.H"
00046 #include "Simulation/SimEvents.H"
00047
00048
00049 class TestImages;
00050
00051 typedef TestImages::SceneData Scene;
00052 typedef TestImages::ObjData Object;
00053
00054
00055 const uint NULL_OBJ = -1;
00056
00057 class SimulationViewerEyeRegion : public SimulationViewerEyeMvt {
00058 public:
00059
00060
00061
00062
00063
00064 SimulationViewerEyeRegion(OptionManager& mgr,
00065 const std::string& descrName =
00066 "EyeRegion Simulation Viewer",
00067 const std::string& tagName =
00068 "SimulationViewerEyeRegion");
00069
00070
00071 virtual ~SimulationViewerEyeRegion();
00072
00073
00074
00075 uint findHitRegion(const Point2D<int> pt, uint frameNum);
00076 uint findHitRegion(const Point2D<int> pt)
00077 {return findHitRegion(pt, itsFrameNumber);}
00078
00079 std::string listAllRegionsHit(const Point2D<int> pt, uint frameNum);
00080 std::string listAllRegionsHit(const Point2D<int> pt)
00081 {return listAllRegionsHit(pt, itsFrameNumber);}
00082
00083 double rankForeground(Object obj);
00084 protected:
00085
00086
00087
00088
00089
00090
00091
00092
00093
00094
00095 Image< PixRGB<byte> > getTraj(SimEventQueue& q);
00096 void extraSampleProcessing(const rutz::shared_ptr<EyeData> data);
00097 void writeROIOutput(Point2D<int> pos);
00098 void drawEye(const rutz::shared_ptr<EyeData> data, const uint trackerNum);
00099 void drawFOA(const Point2D<int> target, const uint trackerNum);
00100 void drawRegions(Object obj);
00101 void drawRegions() {drawRegions(getSceneObj(NULL_OBJ));}
00102
00103 Object getSceneObj(uint objID, uint FrameNum);
00104 Object getSceneObj(uint objID) {return getSceneObj(objID,itsFrameNumber);}
00105 std::string getObjName(uint objID);
00106
00107 std::string craftSVEMOutput(const std::string tfn,
00108 const rutz::shared_ptr<EyeData> data);
00109 std::string craftRegionOutput(const rutz::shared_ptr<EyeData> data);
00110
00111 void start1();
00112 void stop1();
00113
00114 OModelParam<std::string> itsRegionOutFname;
00115 OModelParam<std::string> itsXMLFname;
00116 OModelParam<std::string> itsSelectedObjects;
00117 OModelParam<std::string> itsObjectDrawMode;
00118 OModelParam<std::string> itsHighlightMode;
00119 OModelParam<bool> itsPrependHeader;
00120 NModelParam<uint> itsLineThickness;
00121 NModelParam<double> itsHitTransparency;
00122 NModelParam<bool> itsRandomColoring;
00123
00124 rutz::shared_ptr<TestImages> itsObjectsInfo;
00125
00126 std::ofstream *itsRegionOutFile;
00127 Image< PixRGB<byte> > itsRegions;
00128 Image< PixRGB<byte> > itsTargetsMask;
00129
00130 uint itsNumObjects;
00131 uint itsCurrRegionID;
00132 rutz::shared_ptr<EyeData> itsObjectEntry;
00133 SimTime itsObjectOnset;
00134 uint itsObjectFrameOnset;
00135
00136 std::vector<PixRGB<byte> > itsRandColors;
00137 std::vector<std::string> itsObjectsNames;
00138 bool itsRegHeaderWritten;
00139 private:
00140
00141 };
00142
00143 #endif
00144
00145
00146
00147
00148
00149