| mxlib
    c++ tools for analyzing astronomical data and other tasks by Jared R. Males. [git repo] | 
Utilities for modeling image formation. More...
Utilities for modeling image formation.
Definition in file imagingUtils.hpp.
#include <cmath>#include "../math/constants.hpp"#include "../mxError.hpp"#include "imagingArray.hpp"Go to the source code of this file.
| Namespaces | |
| namespace | mx | 
| The mxlib c++ namespace. | |
| Functions | |
| template<typename realT > | |
| realT | mx::wfp::fftPlateScale (size_t pixels, realT metersPerPixel, realT lambda) | 
| Calculate the angular plate scale (radians per pixel) of an image after propagation by FFT. | |
| template<class arrayT > | |
| int | mx::wfp::circularPupil (arrayT &m, typename arrayT::Scalar eps=0, typename arrayT::Scalar rad=0, typename arrayT::Scalar overscan=0) | 
| Fill in an Eigen-like array with a circular pupil mask. | |
| template<class arrayT > | |
| void | mx::wfp::drawLine (arrayT &im, typename arrayT::Scalar x0, typename arrayT::Scalar y0, typename arrayT::Scalar x1, typename arrayT::Scalar y1, typename arrayT::Scalar halfWidth) | 
| Draw a line in an image. | |
| template<typename arrayOutT , typename arrayInT > | |
| void | mx::wfp::makeComplexPupil (arrayOutT &complexPupil, const arrayInT &realPupil, int wavefrontSizePixels) | 
| Create a complex pupil plane wavefront from a real amplitude mask. | |
| template<typename arrayOutT , typename arrayInT > | |
| void | mx::wfp::makeComplexPupil (arrayOutT &complexWavefront, const arrayInT &realAmplitude, const arrayInT &realPhase, int wavefrontSizePixels) | 
| Create a complex wavefront from a real amplitude and a real phase. | |
| template<typename wavefrontT > | |
| void | mx::wfp::tiltWavefront (wavefrontT &complexWavefront, typename wavefrontT::Scalar::value_type xTilt, typename wavefrontT::Scalar::value_type yTilt) | 
| Apply a tilt to a wavefront. | |
| template<typename imageT1 , typename imageT2 > | |
| void | mx::wfp::extractBlock (imageT1 &dest, int imX0, int imXsz, int imY0, int imYsz, imageT2 &src, int wfX0, int wfY0) | 
| Extract a block from one image and insert it into a second. | |
| template<typename imageT1 , typename imageT2 , typename imageT3 > | |
| void | mx::wfp::extractMaskedPixels (imageT1 &dest, const imageT2 &src, const imageT3 &mask) | 
| Extract a pixels from one image and insert them into a second based on a mask. | |
| void mx::wfp::drawLine | ( | arrayT & | im, | 
| typename arrayT::Scalar | x0, | ||
| typename arrayT::Scalar | y0, | ||
| typename arrayT::Scalar | x1, | ||
| typename arrayT::Scalar | y1, | ||
| typename arrayT::Scalar | halfWidth | ||
| ) | 
Draw a line in an image.
| arrayT | is an Eigen-like array with public typedef Scalar | 
| im | [in.out] The input image, modified. | |
| [in] | x0 | the x value, relative to image center, of the starting point | 
| [in] | y0 | the y value, relative to image center, of the starting point | 
| [in] | x1 | the x value, relative to image center, of the end point | 
| [in] | y1 | the y value, relative to image center, of the end point | 
| [in] | halfWidth | the half-width of the line. | 
Definition at line 124 of file imagingUtils.hpp.
| void mx::wfp::extractBlock | ( | imageT1 & | dest, | 
| int | imX0, | ||
| int | imXsz, | ||
| int | imY0, | ||
| int | imYsz, | ||
| imageT2 & | src, | ||
| int | wfX0, | ||
| int | wfY0 | ||
| ) | 
Extract a block from one image and insert it into a second.
| dest | [in/out] the image in which to place the extracted block. Must be pre-allocated. | |
| [in] | imX0 | the x/row-coord of the lower left pixel of the destination region. | 
| [in] | imXsz | the x size (number of rows) of the block | 
| [in] | imY0 | the y/col-coord of the lower left pixel of the desination region | 
| [in] | imYsz | the y=size (number of cols) ov the block | 
| [in] | src | the source of the block. Must be large enough. | 
| [in] | wfX0 | the x/row-coord of the lower left pixel of the source region | 
| [in] | wfY0 | the y/col-coord of the lower left pixel of the source region | 
Definition at line 280 of file imagingUtils.hpp.
References mx::wfp::extractBlock().
Referenced by mx::wfp::extractBlock(), mx::wfp::lyotCoronagraph< _realT, _fpmaskFloatT >::optimizeAPLCMC(), and mx::wfp::lyotCoronagraph< _realT, _fpmaskFloatT >::optimizeAPLCMC().
| void mx::wfp::extractMaskedPixels | ( | imageT1 & | dest, | 
| const imageT2 & | src, | ||
| const imageT3 & | mask | ||
| ) | 
Extract a pixels from one image and insert them into a second based on a mask.
Only pixels with a non-zero value in mask are changed in dest to have the value in src. Other pixels are not modified.
| dest | [in/out] the image in which to place the extracted pixels. Must be the same size as src and mask. | |
| [in] | src | the source of the pixels. Must be the same size as mask. | 
| [in] | mask | the mask image, where any value other than 0 indicates a pixel to extract. Must be the same size as src. | 
Definition at line 314 of file imagingUtils.hpp.
References mx::wfp::extractMaskedPixels(), and mxThrowException.
Referenced by mx::wfp::extractMaskedPixels().