PSQt/include/ImageProc.h

Go to the documentation of this file.
00001 #ifndef IMAGEPROC_H
00002 #define IMAGEPROC_H
00003 //--------------------------
00004 
00005 #include "PSQt/GeoImage.h"
00006 #include "ndarray/ndarray.h"
00007 #include <stdint.h> // uint8_t, uint32_t, etc.
00008 
00009 #include <QObject>
00010 #include <QPointF>
00011 #include <QMouseEvent>
00012  
00013 namespace PSQt {
00014 
00015 //--------------------------
00016 
00017 /**
00018  *  @ingroup PSQt
00019  *
00020  *  @brief Processing of raw image ndarray after zoom or intensity range selection
00021  *
00022  *  This software was developed for the LCLS project.  If you use all or 
00023  *  part of it, please give an appropriate acknowledgment.
00024  *
00025  *  @see GUIImageViewer
00026  *
00027  *  @version $Id: ImageProc.h 11033 2015-11-26 01:38:24Z dubrovin@SLAC.STANFORD.EDU $
00028  *
00029  *  @author Mikhail Dubrovin
00030  */
00031 
00032 //--------------------------
00033 
00034 class ImageProc : public QObject
00035 {
00036  Q_OBJECT // macro is needed for connection of signals and slots
00037 
00038  public:
00039 
00040     typedef PSQt::GeoImage::raw_image_t raw_image_t; // double
00041 
00042     ImageProc(); 
00043     virtual ~ImageProc();
00044 
00045  public slots:
00046     void onImageIsUpdated(ndarray<GeoImage::raw_image_t,2>&);
00047     void onZoomIsChanged(int&, int&, int&, int&, float&, float&);
00048     void onCenterIsChanged(const QPointF&);
00049     //void onCenterIsMoved(const QPointF&); // signal on each motion of coursor
00050     //void onPressOnAxes(QMouseEvent*, QPointF);
00051     void testSignalRHistIsFilled(ndarray<float, 1>&, const unsigned&, const unsigned&);
00052     void testSignalSHistIsFilled(float*, const float&, const float&, const unsigned&);
00053 
00054     //const ndarray<const raw_image_t, 2> getImage();
00055  signals:
00056     void rhistIsFilled(ndarray<float, 1>&, const unsigned&, const unsigned&);
00057     void shistIsFilled(float*, const float&, const float&, const unsigned&);
00058 
00059 
00060  private:
00061     inline const char* _name_(){return "ImageProc";}
00062     void evaluateRadialIndexes();
00063     void fillRadialHistogram();
00064     void fillSpectralHistogram(const float& amin=0, const float& amax=0, const unsigned& nbins=100);
00065     void getIntensityLimits(float& amin, float& amax);
00066     void getIntensityLimitsV1(float& amin, float& amax);
00067 
00068     float m_rbin_width;
00069     bool m_image_is_set;
00070     bool m_center_is_set;
00071     bool m_zoom_is_set;
00072     bool m_rindx_is_set;
00073     bool m_rhist_is_set;
00074     bool m_shist_is_set;
00075 
00076     unsigned m_ixmax;
00077     unsigned m_iymax;
00078     unsigned m_irmax;
00079     unsigned m_zirmin;
00080     unsigned m_zirmax;
00081 
00082     int m_zxmin;
00083     int m_zymin;
00084     int m_zxmax;
00085     int m_zymax;
00086 
00087     float    m_amin;
00088     float    m_amax;
00089     unsigned m_nbins;
00090 
00091     QPointF m_center;
00092     ndarray<GeoImage::raw_image_t,2> m_nda_image; 
00093     ndarray<unsigned,2> m_nda_rindx;
00094     ndarray<float, 1> m_nda_rhist;
00095     //ndarray<float, 1> m_nda_shist;
00096 
00097     //float*    p_rsum;
00098     //unsigned* p_rsta;
00099     //float*    p_ssta;
00100     float     p_rsum[2000];
00101     unsigned  p_rsta[2000];
00102     float     p_ssta[2000];
00103 };
00104 
00105 //--------------------------
00106 } // namespace PSQt
00107 
00108 #endif // IMAGEPROC_H
00109 //--------------------------

Generated on 19 Dec 2016 for PSANAmodules by  doxygen 1.4.7