Main Page   Modules  

Images


Functions

VimosImage * imageArith (VimosImage *ima1, VimosImage *ima2, VimosOperator optype)
VimosImage * constArith (VimosImage *ima_in, double constant, VimosOperator optype)
int imageArithLocal (VimosImage *ima1, VimosImage *ima2, VimosOperator optype)
int constArithLocal (VimosImage *ima_in, double constant, VimosOperator optype)
VimosImage * VmFrAveFil (VimosImage *ima_in, int filtsizex, int filtsizey, int excludeCenter)
VimosImage * VmFrMedFil (VimosImage *ima_in, int filtsizex, int filtsizey, int excludeCenter)
VimosImage * VmFrFilter (VimosImage *image, int xSize, int ySize, FilterMethod method, int excludeCenter)
VimosImage * VmImNorm (VimosImage *ima_in, Method meth)
VimosImage * frComb (VimosImage **ima_list, int num, CombMethod combMethod, CombParameters *combParameter, int flag)
VimosImage * frCombSum (VimosImage **ima_list, int num)
VimosImage * frCombAverage (VimosImage **ima_list, int num)
VimosImage * frCombMedian (VimosImage **ima_list, int num, int flag)
VimosImage * frCombMinMaxReject (VimosImage **ima_list, int minrej, int maxrej, int num)
VimosImage * OLDfrCombMinMaxReject (VimosImage **ima_list, double minrej, double maxrej, int num)
VimosImage * frCombKSigma (VimosImage **ima_list, double dklow, double dkhigh, int num)
float imageMean (VimosImage *ima_in)
float imageMedian (VimosImage *ima_in)
float imageAverageDeviation (VimosImage *image, float level)
float imageSigma (VimosImage *image)
float imageMedSigma (VimosImage *image)
float imageMinimum (VimosImage *ima_in)
float imageMaximum (VimosImage *ima_in)
VimosDpoint * imageHistogram (VimosImage *ima_in, unsigned int nbins)
float imageMode (VimosImage *ima_in)
float sumPixelsInImage (VimosImage *ima_in, int x, int y, int nx, int ny)
float * collapse2Dto1D (VimosImage *ima_in, int x, int y, int nx, int ny, Direction collapse)
VimosPixel * finePosition (VimosImage *ima_in, VimosPixel *p_list, int npix, double r1, double r2, double r3)
VimosPixel * finePositionSimple (VimosImage *ima_in, VimosPixel *in_pixel, double r1)
VimosImage * imageShift (VimosImage *imageIn, float xshift, float yshift, int outXlen, int outYlen, float outVal)
char ** getFitsFileExtensionsNames (fitsfile *fptr, int *extNum)
VimosBool createFitsImage (char *filename, VimosImage *image, const char *category)

Detailed Description

The module provides the image datatype and the fundamental operations.

Function Documentation

float* collapse2Dto1D VimosImage *    ima_in,
int    x,
int    y,
int    nx,
int    ny,
Direction    collapse
 

@memo Collapse a rectangle inside an image into one column/row.

Returns:
the collapsed array
Parameters:
ima_in  input image
x  x lower left corner of the rectangle
y  y lower left corner of the rectangle
nx  number of pixels in x
ny  number of pixels in y
collapse  direction of collape: ROW or COLUMNS
@doc collapse a rectangle inside an image into one column. Compute the sum of the rows or of the columns of a rectangle. Input an Image, the lower left corner coordinates (x,y) of the rectangle; the number of pixels (nx, ny) from (x,y), and the collapsing direction: collapse ROW: sum of rows and collapse COLUMN: sum of columns.

Author:
P. Sartoretti , C. Izzo

VimosImage* constArith VimosImage *    ima_in,
double    constant,
VimosOperator    optype
 

@memo Arithmetic operations between an image and a constant. Result is a new image.

Returns:
Pointer to the resulting image
Parameters:
ima_in  pointer to image
constant  constant
optype  operation type
@doc Arithmetic operations between an image and a constant. The result is a new image. The aritmetic operations are VM_OPER_ADD, VM_OPER_SUB, VM_OPER_MUL, VM_OPER_DIV

Author:
P. Sartoretti

int constArithLocal VimosImage *    ima_in,
double    constant,
VimosOperator    optype
 

@memo Arithmetic operations between an image and a constant. Result is stored in the input image.

Returns:
0 on success 1 on failure
Parameters:
ima_in  pointer to image
constant  constant
optype  operation type
@doc Arithmetic operations between an image and a constant. The result is stored in the input image. The aritmetic operations are VM_OPER_ADD, VM_OPER_SUB, VM_OPER_MUL, VM_OPER_DIV

Author:
P. Sartoretti

VimosBool createFitsImage char *    filename,
VimosImage *    image,
const char *    category
 

@memo Write a VimosImage into a disk FITS file

Returns:
VM_TRUE or VM_FALSE.
Parameters:
filename  name of the fitsfile
image  Vimos Image to be written as a FITS file
category  Category of image to write
@doc Create a disk image FITS file from structure VimosImage

Author:
C. Izzo

VimosPixel* finePosition VimosImage *    ima_in,
VimosPixel *    p_list,
int    npix,
double    r1,
double    r2,
double    r3
 

@memo Refine the peak centers by computing the baricenter.

Returns:
the list of corrected positions
Parameters:
ima_in  input image
p_list  list of pixel position to refine
npix  size of p_list array
r1  defines a disk in which the barycenter will be computed
r2  inner radius of the ring where the background is computed
r3  outer radius of the ring where the background is computed
@doc Refine the peak centers, by computing a barycenter The 3 doubles (r1, r2, r3) define 3 circle radiuses: r2 and r3 define a ring centered on each pixel in the list, around which the background will be estimated. r1 defines a disk in which the barycenter will be computed, i.e. the centroid pixel, weighted by pixel values, from which the background value has been subtracted: x_center = (1/sum(pixel[i]-bg))*(sum(x[i] * (pixel[i]-bg))) y_center = (1/sum(pixel[i]-bg))*(sum(y[i] * (pixel[i]-bg)))

Author:
P. Sartoretti. Algorithm (fine_position_centers) taken from Eclipse (N.Devillard)

VimosPixel* finePositionSimple VimosImage *    ima_in,
VimosPixel *    in_pixel,
double    r1
 

@memo Refine a peak center by computing the baricenter.

Returns:
the peak corrected positions or NULL if the peak is not found.
Parameters:
ima_in  input image
in_pixel  expected position of the peak
r1  defines a square around expected position where to look for the peak
@doc Refine a single peak centers, by computing a barycenter. Define a squared region of the image of dimension r1 around expected position and compute baricenter (for baricenter determination see doc of "findPeak2D")

Author:
P. Sartoretti and C.Izzo

VimosImage* frComb VimosImage **    ima_list,
int    num,
CombMethod    combMethod,
CombParameters *    combParameter,
int    flag
 

@memo Combine a list of images.

Returns:
Pointer to the resulting image
Parameters:
ima_list  Pointer to the array of images to combine
num  Number of images to combine
combMethod  Combination method
combParameter  Used just when combination the method requires extra parameters, as in COMB_REJECT or COMB_KSIGMA.
flag  Reject or not -32000 values in input
@doc Combine a list of images according to the method. Possible methods are COMB_KSIGMA, COMB_MEDIAN, COMB_AVERAGE, COMB_SUM, COMB_REJECT, and AUTO. AUTO automatically selects the combination method based on the number of frames

Author:
P. Sartoretti, C.Izzo

VimosImage* frCombAverage VimosImage **    ima_list,
int    num
 

@memo Compute average image of a list of images.

Returns:
Pointer to the resulting image
Parameters:
ima_list  pointer to the array of images to combine
num  number of images
@doc Average a list of images. Result is a newly allocated image.

Author:
P. Sartoretti

VimosImage* frCombKSigma VimosImage **    ima_list,
double    dklow,
double    dkhigh,
int    num
 

@memo Combine a list of images with rejection of pixels outside a K*sigma threshold (sigma-clipping)

Returns:
Pointer to the resulting image
Parameters:
ima_list  pointer to the array of images to combine
klow  number of sigma for low values sigma-clipping
khigh  number of sigma for high values sigma-clipping
num  number of images
@doc Combine frame with rejection of pixels outside a k*sigma treshold. The threshold is calculated on the median value, and not on the average to limit the influence of bad pixels. Input a list of images; klow to set the low treshold (=median-klow*sigma), and khigh to set the high treshold (=median+khigh*sigma). Result is a newly allocated image.

Author:
P. Sartoretti

VimosImage* frCombMedian VimosImage **    ima_list,
int    num,
int    flag
 

@memo Compute median image of a list of images.

Returns:
Pointer to the resulting image
Parameters:
ima_list  pointer to the array of images to combine
num  number of images
@doc Compute median image of a list of images. Result is a newly allocated image.

Author:
P. Sartoretti

VimosImage* frCombMinMaxReject VimosImage **    ima_list,
int    minrej,
int    maxrej,
int    num
 

@memo Combine images with rejection of highest/lowest pixels values.

Returns:
Pointer to the resulting image
Parameters:
ima_list  pointer to the array of images to combine
minrej  number of pixels to min-reject
maxrej  number of pixels to max-reject
num  number of images
@doc A zero value for both minrej and maxrej is illegal, and in that case a NULL pointer is returned. If the total number of pixels to be rejected is greater then or equal to the number of input images, nothing is done and a NULL pointer is returned.

Author:
P.Sartoretti, C.Izzo

VimosImage* frCombSum VimosImage **    ima_list,
int    num
 

@memo Sum a list of images.

Returns:
Pointer to the resulting image
Parameters:
ima_list  pointer to the array of images to combine
num  number of images
@doc Sum a list of images. Result is a newly allocated image.

Author:
P. Sartoretti

char** getFitsFileExtensionsNames fitsfile *    fptr,
int *    extNum
 

@memo Get the list of

Returns:
list of extension names.
Parameters:
fptr  pointer to fitsfile
extNum  pointer to extension number
@doc Create a list of extension names of a FITS file

Author:
C. Izzo

VimosImage* imageArith VimosImage *    ima1,
VimosImage *    ima2,
VimosOperator    optype
 

@memo Arithmetic operations between 2 images. Result is a new image.

Returns:
Pointer to the resulting image
Parameters:
ima1  pointer to first image
ima2  pointer to second image
optype  operation type
@doc Arithmetic operations between 2 images. The 2 images must have the same dimensions. The output is 1 newly allocated image. The aritmetic operations are VM_OPER_ADD, VM_OPER_SUB, VM_OPER_MUL, VM_OPER_DIV

Author:
P. Sartoretti

int imageArithLocal VimosImage *    ima1,
VimosImage *    ima2,
VimosOperator    optype
 

@memo Arithmetic operations between 2 images. Result is stored in the first image.

Returns:
0 on success 1 on failure
Parameters:
ima1  pointer to first image
ima2  pointer to second image
optype  operation type
@doc Arithmetic operations between 2 images. The 2 images must have the same dimensions. The output is stored in the first image. The aritmetic operations are VM_OPER_ADD, VM_OPER_SUB, VM_OPER_MUL, VM_OPER_DIV

Author:
P. Sartoretti

float imageAverageDeviation VimosImage *    image,
float    level
 

@memo Compute average deviation from any given value

Returns:
average deviation
Parameters:
image  input image
level  reference value
@doc Compute average deviation from any given value

Author:
C. Izzo

VimosDpoint* imageHistogram VimosImage *    ima_in,
unsigned int    nbins
 

@memo Compute image histogram

Returns:
the histogram
Parameters:
ima_in  input image
nbins  number of bins for the histogram
@doc Compute an image histogram. Input one image and the number of bins for the histogram. Output a list of [nbins] VimosDpoints, where x contains the central pixelvalue for each bin, and y contains the number of pixels in this bin.

Author:
P. Sartoretti. This algorithm is taken from Eclipse (N.Devillard)

float imageMaximum VimosImage *    ima_in
 

@memo Compute image maximum value of an image

Returns:
the maximum value
Parameters:
ima_in  input image
@doc Compute the maximum value of an image

Author:
P. Sartoretti

float imageMean VimosImage *    ima_in
 

@memo Compute the average value of an image

Returns:
the average value, or 0 in case of failure
Parameters:
ima_in  input image
@doc Compute the average value of an image

Author:
P. Sartoretti

float imageMedian VimosImage *    ima_in
 

@memo Compute the median value of an image

Returns:
the median value, or 0 in case of failure
Parameters:
ima_in  input image
@doc Compute the median value of an image. Use median-wirth.

Author:
P. Sartoretti

float imageMedSigma VimosImage *    image
 

@memo Compute image sigma using median value instead of mean estimate

Returns:
the sigma value
Parameters:
image  input image
@doc Compute the sigma value of an image using the median value instead of the mean

Author:
P. Sartoretti

float imageMinimum VimosImage *    ima_in
 

@memo Compute image minimum value of an image

Returns:
the maximum value
Parameters:
ima_in  input image
@doc Compute the minimum value of an image

Author:
P. Sartoretti

float imageMode VimosImage *    ima_in
 

@memo Compute image mode value of an image

Returns:
the mode, or -1 in case of failure
Parameters:
ima_in  input image
@doc Compute the mode value of an image (i.e. the histo peak position) It depends on the number of bins (binzise). Here take the bin size = 1 data unit (i.e. bin number =(int) max - min)

Author:
P. Sartoretti

VimosImage* imageShift VimosImage *    imageIn,
float    xshift,
float    yshift,
int    outXlen,
int    outYlen,
float    outVal
 

@memo Shift an image in X and/or Y

Returns:
Pointer to the resulting image
Parameters:
imageIn  pointer to input image
xshift  shift in X coordinate
yshift  shift in Y coordinate
outVal  substitution value
@doc Image shifting. The output is 1 newly allocated image.

Author:
P. Franzetti

float imageSigma VimosImage *    image
 

@memo Compute image sigma

Returns:
the sigma value,
Parameters:
image  input image
@doc Compute the sigma value of an image

Author:
P. Sartoretti

VimosImage* OLDfrCombMinMaxReject VimosImage **    ima_list,
double    minrej,
double    maxrej,
int    num
 

@memo Combine images with rejection of high/low pixels values.

Returns:
Pointer to the resulting image
Parameters:
ima_list  pointer to the array of images to combine
minrej  percent of pixels to min-reject
maxrej  percent of pixels to max-reject
num  number of images
@doc Percentages are expressed with numbers from 0 to 100. If the percent of pixels to max or min reject is less then the min percentage step (i.e. 100/num), no image will be min or max rejected. Not more than 90 percent of pixel values can be rejected: if such threshold is trespassed, a NULL pointer is returned.

Author:
P. Sartoretti

float sumPixelsInImage VimosImage *    ima_in,
int    x,
int    y,
int    nx,
int    ny
 

@memo Compute the sum of all pixelvalues in a rectangle.

Returns:
the sum, or -1 in case of failure
Parameters:
ima_in  input image
x  x lower left corner of the rectangle
y  y lower left corner of the rectangle
nx  number of pixels in x
ny  number of pixels in y
@doc Compute the sum of all pixelvalues in a rectangle. The rectangle is given by the lower left corner coordinates (x,y) and the number of pixels nx and ny.

Author:
P. Sartoretti

VimosImage* VmFrAveFil VimosImage *    ima_in,
int    filtsizex,
int    filtsizey,
int    excludeCenter
 

@memo Apply a average filter to an image.

Returns:
Pointer to the resulting image
Parameters:
ima_in  pointer to input image
filtsizex  size in x of the filter box
filtsizey  size in y of the filter box
excludeCenter  flag to exclude the center of the box in the computation of the average
@doc Apply an optimized average filter of sizes filtsizex, filtsixey to an image. The output is a newly allocated image. Set excludeCenter flag to 1 to exclude the center of the median kernel from the median computation. If the median kernel extends over the image edges, the boundary points are repeated such that the box has always the same size (this is a modification compared to the original algorithm).

Author:
C.Izzo. The original algorithm is taken from Eclipse (N.Devillard)

VimosImage* VmFrFilter VimosImage *    image,
int    xSize,
int    ySize,
FilterMethod    method,
int    excludeCenter
 

@memo Filter an image.

Returns:
Pointer to the resulting image
Parameters:
image  pointer to input image
xSize  size in x of the filter box
ySize  size in y of the filter box
method  filter method
excludecenter  flag to exclude the center of the box in the computation of the median
@doc Apply a filter of choice to an image. Available method are median, average, gaussian filter. An automatic method can be specified.

See also:
VmFrMedFil, VmFrAveFil
Author:
C.Izzo and P.Sartoretti

VimosImage* VmFrMedFil VimosImage *    ima_in,
int    filtsizex,
int    filtsizey,
int    excludeCenter
 

@memo Apply a median filter to an image.

Returns:
Pointer to the resulting image
Parameters:
ima_in  pointer to input image
filtsizex  size in x of the filter box
filtsizey  size in y of the filter box
excludecenter  flag to exclude the center of the box in the computation of the median
@doc Apply an optimized median filter of sizes filtsizex, filtsixey to an image. The output is a newly allocated image. Set excludeCenter flag to 1 to exclude the center of the median kernel from the median computation. If the median kernel extends over the image edges, the boundary points are repeated such that the box has always the same size (this is a modification compared to the original algorithm).

Author:
P. Sartoretti, C.Izzo. Algorithm taken from Eclipse (N.Devillard)

VimosImage* VmImNorm VimosImage *    ima_in,
Method    meth
 

@memo Normalize an image.

Returns:
Pointer to the resulting image
Parameters:
ima_in  pointer to input image
meth  normalization method
@doc Normalize an image. Possible normalization methods are: MEAN normalize image to its mean value, MEDIAN: normalize image to its median value, and MODE: normalize image to its mode. The output is a newly allocated image.

Author:
P. Sartoretti


Generated on Thu Jul 8 11:45:05 2004 for VIMOS DRS Reference Manual by doxygen1.2.13.1 written by Dimitri van Heesch, © 1997-2001