User:Sreya28/COSMOS Computational Optical Sectioning Microscopy Open Source Software Package

COSMOS: Computational Optical Sectioning Microscopy Open Source Software Package
COSMOS: Computational Optical Sectioning Microscopy Open Source Software Package is in the last stages of development development by the Computational Imaging Research Laboratory (CIRL) led by Dr.Preza.

Many biological and biomedical applications increasingly require the ability to visualize living specimens at higher resolution and in new ways that provide information not available in the past. To address this growing need, new techniques that extend the limits of traditional microscopes by integrating computations with the microscope. Computational Optical Sectioning Microscopy (COSM) is a method by which thick samples can be sampled using fluorescence microscopy giving more or less the same results as a confocal microscope. This software package offers the user with a chance to produce clearer images by applying a variety of algorithms and functionalities. It can be used efficiently to image thick samples.

COSMOS has four platform-independent graphical user interfaces (GUIs) developed using a visualization tool kit for PSF generation, intensity estimation, image visualization and performance analysis. In the estimation GUI there are currently 5 different algorithms for data processing: the Depth Variant Expectation Maximization algorithm [1], a linear least square algorithm [2], a linear maximum a posteriori algorithm [3], the Jansen-van Cittert algorithm [4], and the Expectation Maximization algorithm [5].

Description of the utilities available in COSMOS
The 4 modules in COSMOS are:

COSM Tools
It is a set of utilities that help to process an image. We can do a total of twelve operations on an image.
 * 1) Info:It outputs dimension of the image, its data type, total size of the image and its maximum, minimum and average values.
 * 2) Remove header:It removes the header and the raw image is stored with the name specified.
 * 3) Add Header:The output image file is obtained with the added header WASHU with the given dimensions of the image, data type and the byte order.
 * 4) Resample:It is used to down sample and up sample the image.
 * 5) Transform:Transform is used to change the dimensions of the image and get one with new dimensions.
 * 6) Shift:The Image is shifted according to requirements.
 * 7) Scale:The Image is scaled according to requirements.
 * 8) Convert:The Image is converted to the desired data type.
 * 9) Compare:The Image is compared to a given reference file.
 * 10) Convolve:Two Images are convolved.
 * 11) Object:Objects can be created using this tool.
 * 12) Variant:An image is formed by a sum of convolutions of each of the strata with an interpolation of the LSFs that are of each side of the strata.

COSM PSF
This application can be used to create Point Spread Function, based on the specimen thickness, the Refractive Index(RI) of Lens, the immersion medium.The generation can be done using two methods:
 * 1) Gibson and Lanni[7].
 * 2) Haeberle[8].

COSM Estimation
This application can be used to reproduce the original Image by applying certain algorithms to the obtained image(blurred)and the PSF.The I Divergence,Mean Square Error,Minimum,Maximum between two images can be obtained using it. A number of algorithms are applied namely
 * 1) Linear Least Square Method: It is a one-step algorithm that yields, in a few seconds, solutions that are optimal. Results from sensitivity studies show that the proposed method is robust to noise and to underestimation of the width of the point-spread function. The method is particularly useful for applications in which processing speed is critical, such as studies of living specimens and time lapse analyses. [2]
 * 2) The Depth Variant Expectation Maximization algorithm:In this algorithm the image is sliced into strata with 2 PSF's on each side of the strata. They are individually deconvolved and then integrated over the depth to obtain the image.[1]
 * 3) A linear maximum a posteriori algorithm:This approach also yields a regularized linear estimator which reduces noise as well as edge artifacts in the reconstruction. The advantage of the linear MAP estimate over the LLS is its ability to regularize the inverse problem by smoothly penalizing components in the image associated with small Eigen values.[3]
 * 4) The Jansen-van Cittert algorithm :It is an example of an iterative deconvolution algorithm. The advantage of such a method is that the process is fairly stable in the presence of noise and error when compared to the non-iterative deconvolution.[4]
 * 5) The Expectation Maximization algorithm:This strata-based model incorporates spherical aberration that worsens as the microscope is focused deeper under the cover slip and is the result of the refractive-index mismatch between the immersion medium and the mounting medium of the specimen. Images of a specimen with known geometry and refractive index show that the model captures the main features of the image.[5]

COSM Viewer
This application is used view the images. It can be used to observe a variety of image formats(.wu,.gif).It can also be used to graph intensities.

How to Use COSMOS

 * 1) Generate the PSF according to the conditions under which the image was taken using the COSM PSF module.
 * 2) Use the COSM Estimation Module to obtain the required image,using the generated PSF and image from microscope.

Generation of Image using Depth Variant Algorithm
A ring object is created using the object sub tab in the COSM Tools.
 * 1) The generation of a test image
 * 1) The Object sub-tab in COSM Tools is opened.
 * 2) The Create tab is opened.
 * 3) The dimensions (128, 1, 256) and the output image file and the data type is given (Float) is entered. The image file section is left blank.
 * 4) Click on the Ellipsoid tab is opened.
 * 5) Enter the Radius (20, 20, 20), the Centre (64, 1, 128). A Value of 1(0 indicates a black, and 1 white).
 * 6) This will generate a white circle (XZ) with radius 16.
 * 7) In order to create a ring we again click on the ellipsoid tab, give the Centre (64, 1,128) and radius (10, 10, 10) and the value of 0.
 * 8) Generation of the LSF
 * 9) Go to the Cosm Psf tab.
 * 10) Select Exact Evaluation for better results tough only marginally more time consuming.
 * 11) We want to divide the image into 10 parts, the ring is divided into 8 parts and a part is above and a part below the ring. Hence 9 PSFs are generated. It is entered in Total Number.
 * 12) The size between pixels is specified as 0.06(Micrometers) and pixels each strata is chosen as 5.
 * 13) The depth interval is chosen as 0.00003mm. It depends on the spacing in z and number of pixels in each stratum.
 * 14) Normally the CosmPsf application would generate a 3D PSF, but we can force it to collapse the Y dimension (sum over it) into a single plane by enabling “Sum over Y”. This 2D PSF is the LSF.
 * 15) Using COSM Estimation to get the Estimated Image
 * 16) The Data Input file The PSF Input File and the Output File is entered.
 * 17) The Iterative, Variant tab is chosen for the best estimation.
 * 18) The EMSV (although this is nothing but the DVEM algorithm) is chosen.
 * 19) We don’t use a penalty as it’s a phantom, real images are noisy and a penalty is used hence.
 * 20) The strata (8), the start of the image (108), the size of each strata (5 pixels) is entered.
 * 21) Changing the number of iterations gives us better resolution.The higher the number of iterations though time consuming,the image is much better.