STIRA  0.1
Public Member Functions | Static Public Member Functions | List of all members
stira::imagetools::GridGenerator Class Reference

Generates different predefined grids. More...

#include <GridGenerator.h>

Public Member Functions

 GridGenerator ()
 constructor
 
 ~GridGenerator ()
 destructor
 

Static Public Member Functions

static ArrayGrid< double > * GenerateEmpty (int width=256, int height=256, double intensity=127.0)
 generates a flat image of given dimensions and given constant intensity More...
 
static ArrayGrid< double > * GenerateEmptyPlusGaussianNoise (int width=256, int height=256, double intensity=127.0, double sigma=10.0)
 generates a flat image of given dimensions and given constant intensity contaminated with gaussian noise with given sigma More...
 
static ArrayGrid< double > * GenerateHorizontalGradient (int width=256, int height=256)
 generates a simple grid with horizontal intensity gradient More...
 
static ArrayGrid< double > * GenerateVerticalGradient (int width=256, int height=256)
 generates a simple grid with horizontal intensity gradient More...
 
static ArrayGrid< double > * GenerateHorizontalSineWave (int width, int height, double frequency)
 generates a simple grid with a horizontal frequency sine wave More...
 
static ArrayGrid< double > * GenerateVerticalSineWave (int width, int height, double frequency)
 generates a simple grid with vertical frequency sine wave More...
 
static ArrayGrid< double > * GenerateEuclideanSpots (int width, int height, double frequency)
 generates a simple grid with Euclidean spot intensities Used in AM halftoning; see PhD Stefaan Lippens, Ghent University, 2008-2009: "Advanced Techniques for Digital Halftoning", p 194 eq 7.4 More...
 
static ArrayGrid< double > * GenerateStarChart (int sideSize, int nrPeriods)
 generates a square with a star-shaped structure In fact a sine that goes in polar coordinates nrPeriods times over the angular polar coordinate, while kept constant along the radial polar coordinate More...
 
static ArrayGrid< double > * GenerateBars (int width, int height, int barWidth=50)
 generates a grid of alternating horizontal black and white bars A version of this pattern where the bars become gradually blurred more and more is placed under filter::GaussConvolve for dependancy reasons (depends on gaussian filtering) More...
 
static ArrayGrid< double > * GenerateLine (int width, int height, double length, double angle)
 
static ArrayGrid< double > * GenerateSquare (int width, int height, double suqareWidth)
 
static ArrayGrid< double > * GenerateDisk (int width, int height, double diskWidth)
 
static ArrayGrid< double > * GenerateAiry (int width, int height, double airyWidth)
 generates an Airy filter kernel more details, see http://en.wikipedia.org/wiki/Airy_disc More...
 
static ArrayGrid< double > * GenerateGaussian (int width, int height, double sigma)
 generates a circular symmetric Gaussian filter kernel More...
 
static ArrayGrid< double > * GenerateGaussian (int width, int height, double sigmaX, double sigmaY)
 generates a Gaussian filter kernel More...
 
static ArrayGrid< double > * GenerateGaussian (int width, int height, double sigma1, double sigma2, double rho)
 generates a Gaussian filter kernel More...
 
static ArrayGrid< double > * GenerateGaussianFirstDerivativeX (int width, int height, double sigmaX, double sigmaY)
 generates a first derivative in x of Gaussian filter kernel More...
 
static ArrayGrid< double > * GenerateGaussianFirstDerivativeY (int width, int height, double sigmaX, double sigmaY)
 generates a first derivative in y of Gaussian filter kernel More...
 
static ArrayGrid< double > * GenerateGaussianSecondDerivativeX (int width, int height, double sigmaX, double sigmaY)
 generates a second derivative in x of Gaussian filter kernel More...
 
static ArrayGrid< double > * GenerateGaussianSecondDerivativeY (int width, int height, double sigmaX, double sigmaY)
 generates a second derivative in y of Gaussian filter kernel More...
 
static ArrayGrid< double > * GenerateGaussianMixedDerivativesXY (int width, int height, double sigmaX, double sigmaY)
 generates mixed first derivatives in x and y of Gaussian filter kernel More...
 
static ArrayGrid< double > * GenerateDeltaPeak (int width, int height, int x, int y, double intensity)
 generates delta peak More...
 
static ArrayGrid< double > * GenerateInverseZonePlate ()
 generates the inverse zoneplate test image 512x512 pixels
 
static ArrayGrid< double > * GenerateZonePlate ()
 generates the classical zoneplate test image 512x512 pixels
 
static ArrayGrid< double > * GenerateLogFrequencyContrastChart ()
 generates Log Frequency-Contrast test image as shown on http://www.imatest.com/docs/log_f_Cont.html Change in frequency here is exponential of sqrt of x (empirical) Change in contrast is inverse square of y (like in doc imatest)
 
static ArrayGrid< double > * GenerateSheppLogan (double factor=1.0)
 generates the classical Shepp-Logan phantom for CT 512x512 pixels Based on http://server.oersted.dtu.dk/ftp/jaj/31655/ct_programs/ (no longer available) Hugh Murrell, Computer Aided Tomography, The Mathematica Journal, 1996, Vol 6, No. 2, pp.60-65 similar to java code of Thevenaz found on http://bigwww.epfl.ch/thevenaz/shepplogan/ More...
 
static ArrayGrid< int > * GenerateIsingTexture ()
 generates a random field texture using Ising model and simulated annealing
 

Detailed Description

Generates different predefined grids.

Member Function Documentation

ArrayGrid< double > * stira::imagetools::GridGenerator::GenerateAiry ( int  width,
int  height,
double  airyWidth 
)
static

generates an Airy filter kernel more details, see http://en.wikipedia.org/wiki/Airy_disc

Warning
uses j1(x) Bessel function from X/Open System Interfaces Extensions to math.h. These are not present in any ANSI or ISO C standard. see http://en.wikipedia.org/wiki/Math.h
Parameters
widthwidth of the grid
heightheight of the grid
airyWidthwidth of the PSF
Returns
grid with the generated Airy filter kernel

References stira::imagedata::ArrayGrid< T >::DivideBy(), stira::imagedata::ArrayGrid< T >::GetValue(), and stira::imagedata::ArrayGrid< T >::SetValue().

Referenced by stira::deconvolve::SimulateDegradation::~SimulateDegradation().

ArrayGrid< double > * stira::imagetools::GridGenerator::GenerateBars ( int  width,
int  height,
int  barWidth = 50 
)
static

generates a grid of alternating horizontal black and white bars A version of this pattern where the bars become gradually blurred more and more is placed under filter::GaussConvolve for dependancy reasons (depends on gaussian filtering)

Parameters
widthwidth of the test pattern
heightheight of the test pattern
barWidthwidth of a bar in the image

References stira::common::DrawFigures::BresenhamDrawLine(), stira::imagedata::ArrayGrid< T >::DivideBy(), stira::imagedata::ArrayGrid< T >::GetValue(), and stira::imagedata::ArrayGrid< T >::SetValue().

Referenced by stira::filter::GaussConvolve::CreateBlurredBars().

ArrayGrid< double > * stira::imagetools::GridGenerator::GenerateDeltaPeak ( int  width,
int  height,
int  x,
int  y,
double  intensity 
)
static

generates delta peak

Parameters
widthwidth of the grid
heightheight of the grid
xx coordinate of delta peak
yy coordinate of delta peak
intensityintensity of delta peak Well, normally, we would have an infinite peak at a mathematical point, but a pixel is not a mathematical point, so we allow extra scaling how high this peak is
Returns
grid with the generated delta peak

References stira::imagedata::ArrayGrid< T >::SetValue().

ArrayGrid< double > * stira::imagetools::GridGenerator::GenerateEmpty ( int  width = 256,
int  height = 256,
double  intensity = 127.0 
)
static

generates a flat image of given dimensions and given constant intensity

Parameters
widthwidth of grid to generate
heighheight of grid to generate
intensityconstant intensity for all grid pixels
ArrayGrid< double > * stira::imagetools::GridGenerator::GenerateEmptyPlusGaussianNoise ( int  width = 256,
int  height = 256,
double  intensity = 127.0,
double  sigma = 10.0 
)
static

generates a flat image of given dimensions and given constant intensity contaminated with gaussian noise with given sigma

Warning
grid values are NOT clipped to some range
Parameters
widthwidth of grid to generate
heighheight of grid to generate
intensityconstant intensity for all grid pixels
sigmasigma of the Gaussian noise (mu = 0)

References stira::imagedata::ArrayGrid< T >::SetValue().

ArrayGrid< double > * stira::imagetools::GridGenerator::GenerateEuclideanSpots ( int  width,
int  height,
double  frequency 
)
static

generates a simple grid with Euclidean spot intensities Used in AM halftoning; see PhD Stefaan Lippens, Ghent University, 2008-2009: "Advanced Techniques for Digital Halftoning", p 194 eq 7.4

Parameters
widthwidth of grid to generate
heightheight of grid to generate
frequencyfrequency of the spots

References stira::imagedata::ArrayGrid< T >::SetValue().

ArrayGrid< double > * stira::imagetools::GridGenerator::GenerateGaussian ( int  width,
int  height,
double  sigma 
)
static

generates a circular symmetric Gaussian filter kernel

Parameters
widthwidth of the grid
heightheight of the grid
sigmasigma of the PSF
Returns
grid with the generated Gaussian filter kernel

Referenced by stira::filter::GaussConvolve::DerivativeConvolveFFT(), stira::fouriertools::FFT::GaussConvolve(), stira::filter::DifferenceOfGaussians::Run(), and stira::deconvolve::SimulateDegradation::~SimulateDegradation().

ArrayGrid< double > * stira::imagetools::GridGenerator::GenerateGaussian ( int  width,
int  height,
double  sigmaX,
double  sigmaY 
)
static

generates a Gaussian filter kernel

Parameters
widthwidth of the grid
heightheight of the grid
sigmaXsigma in x direction for the PSF
sigmaYsigma in y direction for the PSF
Returns
grid with the generated Gaussian filter kernel

References stira::imagedata::ArrayGrid< T >::DivideBy(), stira::common::MathUtils::Gaussian(), stira::imagedata::ArrayGrid< T >::GetValue(), and stira::imagedata::ArrayGrid< T >::SetValue().

ArrayGrid< double > * stira::imagetools::GridGenerator::GenerateGaussian ( int  width,
int  height,
double  sigma1,
double  sigma2,
double  rho 
)
static

generates a Gaussian filter kernel

Parameters
widthwidth of the grid
heightheight of the grid
sigma1sigma1 for the PSF
sigma2sigma2 for the PSF
rhorho for the PSF ( must be in ] -1, 1 [ or we divide by 0 )
Returns
grid with the generated Gaussian filter kernel

References stira::imagedata::ArrayGrid< T >::DivideBy(), stira::imagedata::ArrayGrid< T >::GetValue(), and stira::imagedata::ArrayGrid< T >::SetValue().

ArrayGrid< double > * stira::imagetools::GridGenerator::GenerateGaussianFirstDerivativeX ( int  width,
int  height,
double  sigmaX,
double  sigmaY 
)
static

generates a first derivative in x of Gaussian filter kernel

Parameters
widthwidth of the grid
heightheight of the grid
sigmasigma for the filter kernel
Returns
grid with the generated first derivative in x of Gaussian filter kernel

References stira::common::MathUtils::GaussianDx(), stira::imagedata::ArrayGrid< T >::GetValue(), and stira::imagedata::ArrayGrid< T >::SetValue().

Referenced by stira::filter::GaussConvolve::DerivativeConvolveFFT().

ArrayGrid< double > * stira::imagetools::GridGenerator::GenerateGaussianFirstDerivativeY ( int  width,
int  height,
double  sigmaX,
double  sigmaY 
)
static

generates a first derivative in y of Gaussian filter kernel

Parameters
widthwidth of the grid
heightheight of the grid
sigmasigma for the filter kernel
Returns
grid with the generated first derivative in y of Gaussian filter kernel

References stira::common::MathUtils::GaussianDy(), stira::imagedata::ArrayGrid< T >::GetValue(), and stira::imagedata::ArrayGrid< T >::SetValue().

Referenced by stira::filter::GaussConvolve::DerivativeConvolveFFT().

ArrayGrid< double > * stira::imagetools::GridGenerator::GenerateGaussianMixedDerivativesXY ( int  width,
int  height,
double  sigmaX,
double  sigmaY 
)
static

generates mixed first derivatives in x and y of Gaussian filter kernel

Parameters
widthwidth of the grid
heightheight of the grid
sigmasigma for the filter kernel
Returns
grid with the generated PSF

References stira::common::MathUtils::GaussianDxDy(), stira::imagedata::ArrayGrid< T >::GetValue(), and stira::imagedata::ArrayGrid< T >::SetValue().

Referenced by stira::filter::GaussConvolve::DerivativeConvolveFFT().

ArrayGrid< double > * stira::imagetools::GridGenerator::GenerateGaussianSecondDerivativeX ( int  width,
int  height,
double  sigmaX,
double  sigmaY 
)
static

generates a second derivative in x of Gaussian filter kernel

Parameters
widthwidth of the grid
heightheight of the grid
sigmasigma for the filter kernel
Returns
grid with the generated PSF

References stira::common::MathUtils::GaussianSecondDerivateX1D(), stira::imagedata::ArrayGrid< T >::GetValue(), and stira::imagedata::ArrayGrid< T >::SetValue().

Referenced by stira::filter::GaussConvolve::DerivativeConvolveFFT().

ArrayGrid< double > * stira::imagetools::GridGenerator::GenerateGaussianSecondDerivativeY ( int  width,
int  height,
double  sigmaX,
double  sigmaY 
)
static

generates a second derivative in y of Gaussian filter kernel

Parameters
widthwidth of the grid
heightheight of the grid
sigmasigma for the filter kernel
Returns
grid with the generated PSF

References stira::common::MathUtils::GaussianD2y(), and stira::imagedata::ArrayGrid< T >::SetValue().

Referenced by stira::filter::GaussConvolve::DerivativeConvolveFFT().

ArrayGrid< double > * stira::imagetools::GridGenerator::GenerateHorizontalGradient ( int  width = 256,
int  height = 256 
)
static

generates a simple grid with horizontal intensity gradient

Parameters
widthwidth of grid to generate
heightheight of grid to generate

References stira::imagedata::ArrayGrid< T >::SetValue().

ArrayGrid< double > * stira::imagetools::GridGenerator::GenerateHorizontalSineWave ( int  width,
int  height,
double  frequency 
)
static

generates a simple grid with a horizontal frequency sine wave

Parameters
widthwidth of grid to generate
heightheight of grid to generate
frequencyfrequency of the sine wave

References stira::imagedata::ArrayGrid< T >::SetValue().

ArrayGrid< double > * stira::imagetools::GridGenerator::GenerateSheppLogan ( double  factor = 1.0)
static

generates the classical Shepp-Logan phantom for CT 512x512 pixels Based on http://server.oersted.dtu.dk/ftp/jaj/31655/ct_programs/ (no longer available) Hugh Murrell, Computer Aided Tomography, The Mathematica Journal, 1996, Vol 6, No. 2, pp.60-65 similar to java code of Thevenaz found on http://bigwww.epfl.ch/thevenaz/shepplogan/

Parameters
factorfactor with which to multiply the intensities inside the small inner ellipses to modify the contrast

References stira::imagedata::ArrayGrid< T >::GetHeight(), stira::imagedata::ArrayGrid< T >::GetValue(), stira::imagedata::ArrayGrid< T >::GetWidth(), and stira::imagedata::ArrayGrid< T >::SetValue().

ArrayGrid< double > * stira::imagetools::GridGenerator::GenerateStarChart ( int  sideSize,
int  nrPeriods 
)
static

generates a square with a star-shaped structure In fact a sine that goes in polar coordinates nrPeriods times over the angular polar coordinate, while kept constant along the radial polar coordinate

Parameters
sideSizesize of single side of the square
nrPeriodsnumber of periods of the sine wave along the angular coordinate

References stira::imagedata::ArrayGrid< T >::SetValue().

ArrayGrid< double > * stira::imagetools::GridGenerator::GenerateVerticalGradient ( int  width = 256,
int  height = 256 
)
static

generates a simple grid with horizontal intensity gradient

Parameters
widthwidth of grid to generate
heightheight of grid to generate

References stira::imagedata::ArrayGrid< T >::SetValue().

ArrayGrid< double > * stira::imagetools::GridGenerator::GenerateVerticalSineWave ( int  width,
int  height,
double  frequency 
)
static

generates a simple grid with vertical frequency sine wave

Parameters
widthwidth of grid to generate
heightheight of grid to generate
frequencyfrequency of the sine wave

References stira::imagedata::ArrayGrid< T >::SetValue().


The documentation for this class was generated from the following files: