00001 /* 00002 #ifndef __pHistogram_h__ 00003 #define __pHistogram_h__ 00004 00005 // -------------------------------------------------------------------------------------------- 00006 // WX headers inclusion. 00007 // For compilers that support precompilation, includes <wx/wx.h>. 00008 // -------------------------------------------------------------------------------------------- 00009 00010 #include <wx/wxprec.h> 00011 #ifdef __BORLANDC__ 00012 #pragma hdrstop 00013 #endif 00014 #ifndef WX_PRECOMP 00015 #include <wx/wx.h> 00016 #endif 00017 */ 00018 00019 //-------------------------------------------------------------------------------------------- 00020 // Includes 00021 //-------------------------------------------------------------------------------------------- 00022 00023 //--------------------- 00024 // VTK 00025 //--------------------- 00026 00027 #include "vtkImageData.h" 00028 #include "vtkMetaImageReader.h" 00029 00030 00031 //----------------- 00032 // C++ 00033 //----------------- 00034 #include <iostream> 00035 #include <string> 00036 #include <vector> 00037 //-------------------------------------------------------------------------------------------- 00038 // Class definition 00039 //-------------------------------------------------------------------------------------------- 00040 00041 class pHistogram //:public wxObject 00042 { 00043 00044 //---------------------------------------------------------------------------------------- 00045 // Methods definition 00046 //---------------------------------------------------------------------------------------- 00047 public: 00048 00049 /* 00050 Constructor 00051 */ 00052 pHistogram(std::string filePath); 00053 /* 00054 Constructor 00055 */ 00056 pHistogram(vtkImageData* imageData); 00057 ~pHistogram(); 00058 /* 00059 @param filePath: is the path where the image is 00060 */ 00061 void setImagePath(std::string filePath); 00062 /* 00063 Return the points of the histogram of the image 00064 */ 00065 std::vector <int> getPoints(); 00066 /* 00067 Calculate the histogram and save it in the attribute points 00068 it is used if the user had given the file's path 00069 */ 00070 //private: 00071 void buildHistogram(); 00072 /* 00073 Calculate the histogram and save it in the attribute points 00074 it is used if the user had given the imageData 00075 */ 00076 void buildHistogram(vtkImageData* imageData); 00077 /* 00078 getting ready the points 00079 */ 00080 void initializePoints(int xDimension); 00081 /* 00082 constructing the histogram 00083 */ 00084 void setPoints(vtkImageData* imageData); 00085 /* 00086 Returns the poins of the histograms 00087 */ 00088 vtkImageData* getHistogram(); 00089 /* 00090 hash por getting the index for the histogram vector of the original 00091 image 00092 */ 00093 int getIndex(int gValue); 00094 /* 00095 Setting the size 00096 */ 00097 void setSize(int nSize); 00098 /* 00099 Get Image Size 00100 */ 00101 int getImageSize(); 00102 /* 00103 Get Size of the histogram 00104 */ 00105 int getSize(); 00106 /* 00107 Get the maximum value of grey of the histogram 00108 */ 00109 int getMaximumLevelOfGrey(); 00110 /* 00111 Get the minimum value of grey of the histogram 00112 */ 00113 int getMinimumLevelOfGrey(); 00114 /* 00115 get a point of the Histogram 00116 given the grey value 00117 */ 00118 int getHistogramPoint(int gValue); 00119 00120 00121 //---------------------------------------------------------------------------------------- 00122 // Attributes declaration 00123 //---------------------------------------------------------------------------------------- 00124 private: 00125 /* 00126 Points of the histogram of 00127 the image 00128 */ 00129 vtkImageData* points; 00130 /* 00131 The path of the image 00132 */ 00133 std::string path; 00134 /* 00135 the size of histogram vector 00136 */ 00137 int size; 00138 /* 00139 Maximum Level of grey 00140 */ 00141 int maxLevelOfGrey; 00142 /* 00143 Minimum Level of grey 00144 */ 00145 int minLevelOfGrey; 00146 /* 00147 image size 00148 */ 00149 int sizeImage; 00150 00151 //DECLARE_CLASS (pHistogram) 00152 }; 00153 00154 //#endif 00155 00156