PSQt/include/GeoImage.h

Go to the documentation of this file.
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> // uint8_t, uint32_t, etc.
00009 
00010 #include <QObject>
00011  
00012 namespace PSQt {
00013 
00014 //--------------------------
00015 
00016 /**
00017  *  @ingroup PSQt
00018  *
00019  *  @brief Generates image using geometry and ndarray of intensity.
00020  *
00021  *  This software was developed for the LCLS project.  If you use all or 
00022  *  part of it, please give an appropriate acknowledgment.
00023  *
00024  *  @see GUIMain, WdgImage, ImageProc
00025  *
00026  *  @version $Id: GeoImage.h 11039 2015-12-01 01:18:58Z dubrovin@SLAC.STANFORD.EDU $
00027  *
00028  *  @author Mikhail Dubrovin
00029  */
00030 
00031 //--------------------------
00032 
00033 class GeoImage : public QObject
00034 {
00035  Q_OBJECT // macro is needed for connection of signals and slots
00036 
00037  public:
00038 
00039     typedef PSCalib::GeometryAccess::image_t raw_image_t; // double
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     //const ndarray<const raw_image_t, 2> getImage();
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     //uint32_t*   m_img;
00086     //ndarray<uint32_t, 2> m_nda_img;
00087     //ndarray<const raw_image_t, 2>& p_nda_img;
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 } // namespace PSQt
00100 
00101 #endif // GEOIMAGE_H
00102 //--------------------------

Generated on 19 Dec 2016 for PSANAmodules by  doxygen 1.4.7