00001 #ifndef __IMAGESHAPEFINDER_H 00002 #define __IMAGESHAPEFINDER_H 00003 00004 #include "ImageSelectionCube.h" 00005 #include <vector> 00006 00062 class ImageShapeFinder { 00063 00064 public: 00065 00077 ImageShapeFinder(int x, int y, int w, int h, std::vector<double>* vals); 00078 00079 ~ImageShapeFinder(); 00080 00081 00083 int algorithm ; 00084 void setAlgorithm (int choice) { 00085 algorithm = choice ; 00086 } 00087 00088 00089 00090 00102 void setSelectedValues(std::vector<double> sel); 00103 00104 00109 std::vector<ImageSelectionCube*> getSelections(); 00110 00111 00120 double getValueAtLocal(int x, int y, int z); 00121 00122 00132 double getValueAtOverall(int x, int y, int z); 00133 00134 00135 00136 protected: 00137 std::vector<ImageSelectionCube*> selections; 00138 std::vector<double>* layer; 00139 std::vector<double> inSelection; 00140 int lowx; 00141 int lowy; 00142 int width; 00143 int height; 00144 int curDir ; 00145 00146 00147 00148 std::vector<int> * paths ; 00149 bool pathsFilled ; 00150 00155 void doSelecting(); 00156 00172 int nextBorderPoint(int i, std::vector<bool> &flags); 00173 00174 00181 bool isSelectable(double val); 00182 00183 00191 int adjacentBorderPixs(int i, std::vector<bool> &flags); 00192 00203 int findLongestPath(int i, std::vector<bool> &flags); 00204 00219 int findLongestPathLength(int i, std::vector<bool> &flags, int source); 00220 00221 00236 std::vector<bool> checkLegalAdjacents(int i); 00237 00244 void handlePoint(int i, std::vector<bool> &flags); 00245 00252 void handleLine(int i, std::vector<bool> &flags); 00253 00261 void handlePoly(int i, std::vector<bool> &flags); 00262 }; 00263 00264 #endif 00265
Home |
Search |
Disclaimers & Privacy |
Contact Us GLIMSView Maintainer: dsoltesz@usgs.gov |