00001 #ifndef GEOIMAGE_H
00002 #define GEOIMAGE_H
00003
00004
00005 #include "pdscalibdata/NDArrIOV1.h"
00006 #include "PSCalib/GeometryAccess.h"
00007 #include "ndarray/ndarray.h"
00008 #include <stdint.h>
00009
00010 #include <QObject>
00011
00012 namespace PSQt {
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033 class GeoImage : public QObject
00034 {
00035 Q_OBJECT
00036
00037 public:
00038
00039 typedef PSCalib::GeometryAccess::image_t raw_image_t;
00040 typedef uint32_t image_t;
00041
00042 typedef boost::shared_ptr<PSCalib::GeometryObject> shpGO;
00043 typedef pdscalibdata::NDArrIOV1<double,1> NDAIO;
00044
00045 GeoImage(PSCalib::GeometryAccess*,
00046 const std::string& fname_img = std::string(),
00047 const int& xcent = 2000,
00048 const int& ycent = 2000);
00049
00050 GeoImage(const std::string& fname_geo = std::string(),
00051 const std::string& fname_img = std::string(),
00052 const int& xcent = 2000,
00053 const int& ycent = 2000);
00054
00055 void setFirstImage();
00056
00057
00058 ndarray<raw_image_t, 2>& getImage();
00059
00060 ndarray<image_t,2> getNormalizedImage();
00061 ndarray<image_t,2> getRandomImage();
00062
00063 public slots:
00064 void onGeometryIsLoaded(PSCalib::GeometryAccess*);
00065 void onGeoIsChanged(shpGO& geo);
00066 void onImageFileNameIsChanged(const std::string& str);
00067 void testSignalImageIsUpdated(ndarray<GeoImage::raw_image_t,2>&);
00068
00069 signals :
00070 void imageIsUpdated(ndarray<GeoImage::raw_image_t,2>&);
00071
00072 private:
00073 std::string m_fname_geo;
00074 std::string m_fname_img;
00075 int m_xcent;
00076 int m_ycent;
00077
00078 PSCalib::GeometryAccess* m_geometry;
00079 ndarray<const double, 1> m_anda;
00080
00081 double m_pix_scale_size;
00082 unsigned m_size;
00083 NDAIO* m_ndaio;
00084
00085
00086
00087
00088
00089 inline const char* _name_(){return "GeoImage";}
00090 void connectTestSignalsSlots();
00091 void checkFileNames();
00092 void loadGeometryFromFile(const std::string& fname_geo);
00093 void setGeometryPars();
00094 void loadImageArrayFromFile(const std::string& fname_img);
00095 void updateImage();
00096 };
00097
00098
00099 }
00100
00101 #endif // GEOIMAGE_H
00102