Go to the source code of this file.
Data Structures | |
struct | _Clarity_Dim3_t |
Type for specifying image 3D image dimensions. More... | |
Defines | |
#define | C_FUNC_DEF |
#define | NULL 0L |
Typedefs | |
typedef _Clarity_Dim3_t | Clarity_Dim3 |
Type for specifying image 3D image dimensions. | |
Enumerations | |
enum | ClarityResult_t { CLARITY_FFT_FAILED, CLARITY_OUT_OF_MEMORY, CLARITY_DEVICE_OUT_OF_MEMORY, CLARITY_INVALID_OPERATION, CLARITY_INVALID_ARGUMENT, CLARITY_SUCCESS } |
Enumerates the number and type of errors that the Clarity library may produce. More... | |
Functions | |
C_FUNC_DEF Clarity_Dim3 | Clarity_Dim3FromArray (int dimArray[3]) |
Creates a Clarity_Dim from a three-element integer array representing dimensions in x, y, and z. | |
C_FUNC_DEF ClarityResult_t | Clarity_Register () |
Clients should call this function prior to calling any other Clarity function. | |
C_FUNC_DEF ClarityResult_t | Clarity_UnRegister () |
Clients should call this function when finished with the Clarity library. | |
C_FUNC_DEF ClarityResult_t | Clarity_SetNumberOfThreads (unsigned n) |
Sets the number of threads that should be used by the Clarity library. | |
C_FUNC_DEF ClarityResult_t | Clarity_ImagePadSpatialShift (float *dst, Clarity_Dim3 dstDim, float *src, Clarity_Dim3 srcDim, int shift[3], float fillValue) |
Utility function to create a new image of a desired size containing the shifted contents of the input image. | |
C_FUNC_DEF ClarityResult_t | Clarity_ImageClip (float *dst, Clarity_Dim3 dstDim, float *src, Clarity_Dim3 srcDim) |
Utility function to clip out a portion of an image. | |
C_FUNC_DEF ClarityResult_t | Clarity_WienerDeconvolve (float *inImage, Clarity_Dim3 imageDim, float *kernelImage, Clarity_Dim3 kernelDim, float *outImage, float epsilon) |
Applies a Wiener filter for deconvolution. | |
C_FUNC_DEF ClarityResult_t | Clarity_JansenVanCittertDeconvolve (float *inImage, Clarity_Dim3 imageDim, float *kernelImage, Clarity_Dim3 kernelDim, float *outImage, int iterations) |
Classic Jansen-van Cittert formulation for constrained iterative deconvolution. | |
C_FUNC_DEF ClarityResult_t | Clarity_SmoothedJansenVanCittertDeconvolve (float *inImage, Clarity_Dim3 imageDim, float *kernelImage, Clarity_Dim3 kernelDim, float *outImage, unsigned iterations, unsigned smoothInterval, float *smoothSigma[3]) |
WARNING: This function's implementation is incomplete and produces undefined results. | |
C_FUNC_DEF ClarityResult_t | Clarity_IDivergenceDeconvolve (float *inImage, Clarity_Dim3 imageDim, float *kernelImage, Clarity_Dim3 kernelDim, float *outImage) |
WARNING: This function's implementation is incomplete and produces undefined results. | |
C_FUNC_DEF ClarityResult_t | Clarity_MaximumLikelihoodDeconvolve (float *inImage, Clarity_Dim3 imageDim, float *kernelImage, Clarity_Dim3 kernelDim, float *outImage, int iterations) |
Maximum-likelihood deconvolution method cited in the paper: J.B. | |
C_FUNC_DEF ClarityResult_t | Clarity_BlindMaximumLikelihoodDeconvolve (float *outImage, float *inImage, float *psfImage, Clarity_Dim3 dim, unsigned iterations) |
Blind maximum-likelihood deconvolution method cited in the paper: J.B. | |
C_FUNC_DEF ClarityResult_t | Clarity_Convolve (float *inImage, Clarity_Dim3 imageDim, float *kernel, Clarity_Dim3 kernelDim, float *outImage) |
Convolves two images of equal dimensions. |
#define C_FUNC_DEF |
#define NULL 0L |
typedef struct _Clarity_Dim3_t Clarity_Dim3 |
Type for specifying image 3D image dimensions.
enum ClarityResult_t |
Enumerates the number and type of errors that the Clarity library may produce.
C_FUNC_DEF ClarityResult_t Clarity_BlindMaximumLikelihoodDeconvolve | ( | float * | outImage, | |
float * | inImage, | |||
float * | psfImage, | |||
Clarity_Dim3 | dim, | |||
unsigned | iterations | |||
) |
Blind maximum-likelihood deconvolution method cited in the paper: J.B.
Sibarita, Deconvolution microscopy, Adv. Biochem. Engin./Biotechnology (2005) 95: 201-243.
outImage | Caller-allocated buffer holding result of Wiener filter. Dimensions of this buffer are given by dim. | |
inImage | Image to be deconvolved. Dimensions of this buffer are given by dim. | |
psfImage | Image of the point-spread function of the system that produced the image in the outImage parameter. | |
dim | Dimension of outImage, inImage, and psfImage. | |
iterations | Number of algorithm iterations to run. |
C_FUNC_DEF ClarityResult_t Clarity_Convolve | ( | float * | inImage, | |
Clarity_Dim3 | imageDim, | |||
float * | kernel, | |||
Clarity_Dim3 | kernelDim, | |||
float * | outImage | |||
) |
Convolves two images of equal dimensions.
inImage | Real image to convolve. | |
imageDim | Dimensions of image to convolve. | |
kernel | Convolution kernel. | |
kernelDim | Dimensions of convolution kernel. | |
outImage | Resulting real image of convolution of inImage and kernel. |
C_FUNC_DEF Clarity_Dim3 Clarity_Dim3FromArray | ( | int | dimArray[3] | ) |
Creates a Clarity_Dim from a three-element integer array representing dimensions in x, y, and z.
dimArray | The three-element array. |
C_FUNC_DEF ClarityResult_t Clarity_IDivergenceDeconvolve | ( | float * | inImage, | |
Clarity_Dim3 | imageDim, | |||
float * | kernelImage, | |||
Clarity_Dim3 | kernelDim, | |||
float * | outImage | |||
) |
WARNING: This function's implementation is incomplete and produces undefined results.
Unimplemented, but promising, deconvolution method based on the paper: J. Markham and J.A. Conchello, Fast maximum-likelihood image-restoration algorithms for three-dimensional fluorescence microscopy, J. Opt. Soc. Am. A, Vol. 18, No. 5, May 2001.
inImage | Image to be deconvolved. Dimensions of this buffer are given by imageDim. | |
imageDim | Dimensions of inImage. | |
kernelImage | Image of the blurring kernel of the system that produced the image in inImage. | |
kernelDim | Dimensions of kernelImage. | |
outImage | Caller-allocated buffer holding result of Wiener filter. Dimensions of this buffer are given by imageDim. |
C_FUNC_DEF ClarityResult_t Clarity_ImageClip | ( | float * | dst, | |
Clarity_Dim3 | dstDim, | |||
float * | src, | |||
Clarity_Dim3 | srcDim | |||
) |
Utility function to clip out a portion of an image.
Useful for truncating the result of a convolution of a padded image.
dst | Destination buffer for clipped result. Buffer must be allocated by the caller. | |
dstDim | Dimensions of the destination buffer. Implicitly represents a coordinate in the source image. The clipped image corresponds to cropping the source image from the origin to coordinate (x, y, z). | |
src | Source buffer image to clip. Assumed to be larger or equal in size in all three dimensions to the clipped image. | |
srcDim | Dimensions of the source buffer. |
C_FUNC_DEF ClarityResult_t Clarity_ImagePadSpatialShift | ( | float * | dst, | |
Clarity_Dim3 | dstDim, | |||
float * | src, | |||
Clarity_Dim3 | srcDim, | |||
int | shift[3], | |||
float | fillValue | |||
) |
Utility function to create a new image of a desired size containing the shifted contents of the input image.
Useful for padding and shifting convolution kernels.
dst | Destination buffer for shifted result. Buffer must be allocated by the caller. | |
dstDim | Dimensions of the destination buffer. | |
src | Source buffer for image data to be shiftd. | |
srcDim | Dimensions of the source buffer. | |
shift | Three-element array corresponding the spatial shift in x, y, and z. Shifting operates cyclically across image boundaries. | |
fillValue | Value to which pixels in parts of the new image not corresponding to a shifted pixel get set. |
C_FUNC_DEF ClarityResult_t Clarity_JansenVanCittertDeconvolve | ( | float * | inImage, | |
Clarity_Dim3 | imageDim, | |||
float * | kernelImage, | |||
Clarity_Dim3 | kernelDim, | |||
float * | outImage, | |||
int | iterations | |||
) |
Classic Jansen-van Cittert formulation for constrained iterative deconvolution.
inImage | Image to be deconvolved. Dimensions of this buffer are given by imageDim. | |
imageDim | Dimensions of inImage. | |
kernelImage | Image of the blurring kernel of the system that produced the image in inImage. | |
kernelDim | Dimensions of kernelImage. | |
outImage | Caller-allocated buffer holding result of Wiener filter. Dimensions of this buffer are given by imageDim. | |
iterations | Number of algorithm iterations to run. |
C_FUNC_DEF ClarityResult_t Clarity_MaximumLikelihoodDeconvolve | ( | float * | inImage, | |
Clarity_Dim3 | imageDim, | |||
float * | kernelImage, | |||
Clarity_Dim3 | kernelDim, | |||
float * | outImage, | |||
int | iterations | |||
) |
Maximum-likelihood deconvolution method cited in the paper: J.B.
Sibarita, Deconvolution microscopy, Adv. Biochem. Engin./Biotechnology (2005) 95: 201-243.
inImage | Image to be deconvolved. Dimensions of this image are given by imageDim. | |
imageDim | Dimensions of the input image. | |
kernelImage | Image of the point-spread function of the system that produced. Dimensions of this image are given by psfDim. | |
kernelDim | Dimensions of the PSF image. | |
outImage | Caller-allocated buffer holding result of filter. Dimensions of this buffer are given by imageDim. | |
iterations | Number of algorithm iterations to run. |
C_FUNC_DEF ClarityResult_t Clarity_Register | ( | ) |
Clients should call this function prior to calling any other Clarity function.
Initializes underlying libraries and sets the number of threads to the number of cores on the system.
C_FUNC_DEF ClarityResult_t Clarity_SetNumberOfThreads | ( | unsigned | n | ) |
Sets the number of threads that should be used by the Clarity library.
Usually, you want this to be the same as the number of cores on the CPU. By default, Clarity runs on a number of threads equal to the number of cores on the CPU on which it is running.
n | Number of threads on which to run. |
C_FUNC_DEF ClarityResult_t Clarity_SmoothedJansenVanCittertDeconvolve | ( | float * | inImage, | |
Clarity_Dim3 | imageDim, | |||
float * | kernelImage, | |||
Clarity_Dim3 | kernelDim, | |||
float * | outImage, | |||
unsigned | iterations, | |||
unsigned | smoothInterval, | |||
float * | smoothSigma[3] | |||
) |
WARNING: This function's implementation is incomplete and produces undefined results.
Implementation of the Jansen-van Cittert formulation for constrained iterative deconvolution that applies a smoothing step every few iterations to reduce noise amplification.
inImage | Image to be deconvolved. Dimensions of this buffer are given by imageDim. | |
imageDim | Dimensions of inImage. | |
kernelImage | Image of the blurring kernel of the system that produced the image in inImage. | |
kernelDim | Dimensions of kernelImage. | |
outImage | Caller-allocated buffer holding result of Wiener filter. Dimensions of this buffer are given by imageDim. | |
iterations | Number of algorithm iterations to run. | |
smoothInterval | Iteration interval between applications of smoothing. | |
smoothSigma | Blurring Gaussian kernel parameters. |
C_FUNC_DEF ClarityResult_t Clarity_UnRegister | ( | ) |
Clients should call this function when finished with the Clarity library.
It cleans up and releases resources used by the Clarity library.
C_FUNC_DEF ClarityResult_t Clarity_WienerDeconvolve | ( | float * | inImage, | |
Clarity_Dim3 | imageDim, | |||
float * | kernelImage, | |||
Clarity_Dim3 | kernelDim, | |||
float * | outImage, | |||
float | epsilon | |||
) |
Applies a Wiener filter for deconvolution.
inImage | Image to be deconvolved. Dimensions of this buffer are given by imageDim. | |
imageDim | Dimensions of inImage. | |
kernelImage | Image of the blurring kernel of the system that produced the image in inImage. | |
kernelDim | Dimensions of kernelImage. | |
outImage | Caller-allocated buffer holding result of Wiener filter. Dimensions of this buffer are given by imageDim. | |
epsilon | Constant standing in place of the ratio between power spectra of noise and the power spectra of the underlying image, which are unknown parameters. In practice, acts as a smoothing factor. Typically set in the range 0.001 to 0.1. |