casa  5.7.0-16
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
ImageTwoPtCorr.h
Go to the documentation of this file.
1 //# ImageTwoPtCorr.h: Compute two point correlation function of an image
2 //# Copyright (C) 1996,1997,1998,1999,2000,2001,2003
3 //# Associated Universities, Inc. Washington DC, USA.
4 //#
5 //# This library is free software; you can redistribute it and/or modify it
6 //# under the terms of the GNU Library General Public License as published by
7 //# the Free Software Foundation; either version 2 of the License, or (at your
8 //# option) any later version.
9 //#
10 //# This library is distributed in the hope that it will be useful, but WITHOUT
11 //# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
12 //# FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public
13 //# License for more details.
14 //#
15 //# You should have received a copy of the GNU Library General Public License
16 //# along with this library; if not, write to the Free Software Foundation,
17 //# Inc., 675 Massachusetts Ave, Cambridge, MA 02139, USA.
18 //#
19 //# Correspondence concerning AIPS++ should be addressed as follows:
20 //# Internet email: aips2-request@nrao.edu.
21 //# Postal address: AIPS++ Project Office
22 //# National Radio Astronomy Observatory
23 //# 520 Edgemont Road
24 //# Charlottesville, VA 22903-2475 USA
25 //#
26 //# $Id: ImageTwoPtCorr.h 20229 2008-01-29 15:19:06Z gervandiepen $
27 
28 #ifndef IMAGES_IMAGETWOPTCORR_H
29 #define IMAGES_IMAGETWOPTCORR_H
30 
31 #include <casa/aips.h>
34 
35 namespace casacore{
36 
37 class IPosition;
38 }
39 
40 namespace casa { //# NAMESPACE CASA - BEGIN
41 
42 
43 // <summary>
44 // Compute two point correlation functions from images
45 // </summary>
46 
47 // <use visibility=export>
48 
49 // <reviewed reviewer="" date="yyyy/mm/dd" tests="" demos="">
50 // </reviewed>
51 
52 // <prerequisite>
53 // <li> <linkto class=casacore::LatticeTwoPtCorr>LatticeTwoPtCorr</linkto>
54 // <li> <linkto class=casacore::ImageInterface>ImageInterface</linkto>
55 // <li> <linkto class=casacore::TempImage>TempImage</linkto>
56 // </prerequisite>
57 
58 // <etymology>
59 // Compute the two point correlation function of an image
60 // </etymology>
61 
62 // <synopsis>
63 // This class allows you to compute two point correlation functions
64 // from an image over planes of the specified two axes. Presently
65 // only autocorrelations and in particualt the structure function are implemented.
66 //
67 // The structure function is <src>S(x,y) = < [image(i,j) - image(i+x,j+y)]**2 ></src>
68 // where x and y are absolute integer shifts (or lags) and the
69 // ensemble average is for each lag pair, x&y.
70 // </synopsis>
71 //
72 // <example>
73 // <srcblock>
74 // </srcblock>
75 // </example>
76 
77 
78 // <motivation>
79 // Taking the Structure casacore::Function of an image is a basic part of image analysis
80 // </motivation>
81 
82 // <todo asof="2003/12/13">
83 // <li> Add more types
84 // <li> Add crosscorrelation
85 // </todo>
86 
87 
88 template <class T> class ImageTwoPtCorr
89 {
90 public:
91 
92 // Default constructor
93  ImageTwoPtCorr ();
94 
95 // Copy constructor (reference semantics)
96  ImageTwoPtCorr(const ImageTwoPtCorr& other) = delete;
97 
98 // Assignment (reference semantics)
100 
101 // Destructor
102  ~ImageTwoPtCorr();
103 
104 // Compute the desired autocorrelation function for the specified plane. You specify
105 // which two axes to compute the structure function over. If the
106 // axes array is empty (or not an argument), then the Sky plane
107 // is selected if it exists, otherwise
108 // the first two axes are selected. The casacore::CoordinateSystem of the output image
109 // is overwritten. The miscellaneous items (casacore::ImageInfo, MiscInfo, Logger)
110 // are copied from the input image to the output.
111 // <group>
113  const casacore::ImageInterface<T>& in,
114  const casacore::IPosition& axes,
116  casacore::Bool progress=true) const;
118  const casacore::ImageInterface<T>& in,
120  casacore::Bool progress=true) const;
121 // </group>
122 
123 // Helper function to set up the axes vector. If axes is of length 0,
124 // it looks for the Sky (casacore::DirectionCoordinate). If that's not there,
125 // you get the first two axes in the image.
127  const casacore::CoordinateSystem& cSys);
128 
129 // Helper function to provide output image shape given the input shape
130 // and the axes to find the structure function over.
131  static casacore::IPosition setUpShape (const casacore::IPosition& inShape, const casacore::IPosition& axes);
132 
133 private:
134 
135 
136 // Copy MiscInfo, casacore::ImageInfo, and logSInk to output
138  const casacore::ImageInterface<T>& in) const;
139 
140 // Overwrite the CoordinateSystem
142  const casacore::ImageInterface<T>& in,
143  const casacore::IPosition& axes) const;
144 
145 // Set the brightness unit
146  void setUnit (casacore::ImageInterface<T>& out) const;
147 
148 };
149 
150 } //# NAMESPACE CASA - END
151 
152 #ifndef CASACORE_NO_AUTO_TEMPLATES
153 #include <imageanalysis/ImageAnalysis/ImageTwoPtCorr.tcc>
154 #endif //# CASACORE_NO_AUTO_TEMPLATES
155 #endif
A Vector of integers, for indexing into Array&lt;T&gt; objects.
Definition: IPosition.h:119
void autoCorrelation(casacore::ImageInterface< T > &out, const casacore::ImageInterface< T > &in, const casacore::IPosition &axes, typename casacore::LatticeTwoPtCorr< T >::Method method, casacore::Bool progress=true) const
Compute the desired autocorrelation function for the specified plane.
Compute two point correlation functions from images.
ImageTwoPtCorr & operator=(const ImageTwoPtCorr &other)
Assignment (reference semantics)
A base class for astronomical images.
ImageTwoPtCorr()
Default constructor.
void setCoordinateSystem(casacore::ImageInterface< T > &out, const casacore::ImageInterface< T > &in, const casacore::IPosition &axes) const
Overwrite the CoordinateSystem.
bool Bool
Define the standard types used by Casacore.
Definition: aipstype.h:42
static casacore::IPosition setUpAxes(const casacore::IPosition &axes, const casacore::CoordinateSystem &cSys)
Helper function to set up the axes vector.
static casacore::IPosition setUpShape(const casacore::IPosition &inShape, const casacore::IPosition &axes)
Helper function to provide output image shape given the input shape and the axes to find the structur...
~ImageTwoPtCorr()
Destructor.
void copyMiscellaneous(casacore::ImageInterface< T > &out, const casacore::ImageInterface< T > &in) const
Copy MiscInfo, casacore::ImageInfo, and logSInk to output.
Interconvert pixel and world coordinates.
void setUnit(casacore::ImageInterface< T > &out) const
Set the brightness unit.
#define casacore
&lt;X11/Intrinsic.h&gt; #defines true, false, casacore::Bool, and String.
Definition: X11Intrinsic.h:42