ImageHistogramsCalculator.h

Go to the documentation of this file.
00001 //# ImageHistogramCalculatorr.h: 2D convolution of an image
00002 //# Copyright (C) 1996,1997,1998,1999,2000,2001,2002,2003
00003 //# Associated Universities, Inc. Washington DC, USA.
00004 //#
00005 //# This library is free software; you can redistribute it and/or modify it
00006 //# under the terms of the GNU Library General Public License as published by
00007 //# the Free Software Foundation; either version 2 of the License, or (at your
00008 //# option) any later version.
00009 //#
00010 //# This library is distributed in the hope that it will be useful, but WITHOUT
00011 //# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
00012 //# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Library General Public
00013 //# License for more details.
00014 //#
00015 //# You should have received a copy of the GNU Library General Public License
00016 //# along with this library; if not, write to the Free Software Foundation,
00017 //# Inc., 675 Massachusetts Ave, Cambridge, MA 02139, USA.
00018 //#
00019 //# Correspondence concerning AIPS++ should be addressed as follows:
00020 //#        Internet email: aips2-request@nrao.edu.
00021 //#        Postal address: AIPS++ Project Office
00022 //#                        National Radio Astronomy Observatory
00023 //#                        520 Edgemont Road
00024 //#                        Charlottesville, VA 22903-2475 USA
00025 //#
00026 //# $Id: Image2DConvolver.h 20229 2008-01-29 15:19:06Z gervandiepen $
00027 
00028 #ifndef IMAGES_IMAGEHISTOGRAMSCALCULATOR_H
00029 #define IMAGES_IMAGEHISTOGRAMSCALCULATOR_H
00030 
00031 #include <imageanalysis/ImageAnalysis/ImageTask.h>
00032 
00033 #include <casa/aips.h>
00034 
00035 namespace casa {
00036 
00037 // <summary>
00038 // This class computes histograms of image pixel values.
00039 // </summary>
00040 
00041 // <use visibility=export>
00042 
00043 // <reviewed reviewer="" date="yyyy/mm/dd" tests="" demos="">
00044 // </reviewed>
00045 
00046 // <prerequisite>
00047 // </prerequisite>
00048 
00049 // <etymology>
00050 //  This class computes histograms of image pixel values.
00051 // </etymology>
00052 
00053 // <synopsis>
00054 // This class computes histograms of image pixel values.
00055 // </synopsis>
00056 
00057 // <example>
00058 // <srcBlock>
00059 // </srcBlock>
00060 // </example>
00061 
00062 // <motivation>
00063 // users like histograms.
00064 // </motivation>
00065 //   <li> 
00066 // </todo>
00067 
00068 class ImageHistogramsCalculator : public ImageTask<Float> {
00069 public:
00070 
00071         const static String CLASS_NAME;
00072 
00073         ImageHistogramsCalculator() = delete;
00074 
00075         ImageHistogramsCalculator(
00076                 const SPCIIF image, const Record *const &regionPtr,
00077             const String& mask
00078         );
00079         
00080         ImageHistogramsCalculator(const ImageHistogramsCalculator &other) = delete;
00081 
00082         ~ImageHistogramsCalculator();
00083 
00084         ImageHistogramsCalculator &operator=(const ImageHistogramsCalculator &other) = delete;
00085 
00086         Record compute() const;
00087 
00088         String getClass() const { return CLASS_NAME; }
00089 
00090         // set cursor axes
00091         void setAxes(const vector<uInt>& axes) { _axes = axes; };
00092 
00093         // should the histogram be cumulative
00094         void setCumulative(Bool b) { _cumulative = b; }
00095 
00096         // If true, force the storage lattice to be written to disk.
00097         void setDisk(Bool b) { _disk = b; }
00098 
00099         // If true, the counts should be returned as log10 of the actual counts
00100         void setDoLog10(Bool b) { _doLog10 = b; }
00101 
00102         // set include range
00103         void setIncludeRange(const vector<double>& r) { _includeRange = r; }
00104 
00105         // If true list stats to logger
00106         void setListStats(Bool b) { _listStats = b; }
00107 
00108         // set number of bins
00109         void setNBins(uInt n) { _nbins = n; }
00110 
00111 
00112 protected:
00113 
00114         CasacRegionManager::StokesControl _getStokesControl() const {
00115                 return CasacRegionManager::USE_ALL_STOKES;
00116         }
00117 
00118     vector<Coordinate::Type> _getNecessaryCoordinates() const {
00119         return vector<Coordinate::Type>();
00120     }
00121 
00122     inline Bool _supportsMultipleRegions() const {return True;}
00123 
00124 private:
00125     Bool _disk = False;
00126     Bool _cumulative = False;
00127     Bool _listStats = False;
00128     Bool _doLog10 = False;
00129     vector<uInt> _axes;
00130     uInt _nbins = 25;
00131     vector<double> _includeRange;
00132 
00133 };
00134 
00135 }
00136 #endif
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines

Generated on 31 Aug 2016 for casa by  doxygen 1.6.1