Difference between revisions of "EPR"

From Wiki
Jump to navigation Jump to search
 
(14 intermediate revisions by the same user not shown)
Line 17: Line 17:
 
=== 3D Deconvolution Steps ===
 
=== 3D Deconvolution Steps ===
  
These steps need to done on a BIG's workstation or server. I recommend Mizar.umassmed.edu because it has a quad core CPU, and 32GB of memory. For GPU deconvolutions, Oxygen.umassmed.edu is available with permission from Karl.
+
These steps need to done on a BIG's workstation or server. I recommend Mizar.umassmed.edu because it has a quad core CPU, and 32GB of memory. To access Mizar via SSH, please send Karl an email and he will add you to sshd_config for ssh access.  For GPU deconvolutions, Oxygen.umassmed.edu is available with permission from Karl.
 +
 
 +
Substitute your username everywhere it shows "<username>". For example, /storage/big1/<username> becomes /storage/big1/kdb
  
 
The following is a list of example steps.
 
The following is a list of example steps.
  
 
* ssh (or [https://www.putty.org/ putty] on Windows) into mizar.umassmed.edu or oxygen.umassmed.edu (with permission)
 
* ssh (or [https://www.putty.org/ putty] on Windows) into mizar.umassmed.edu or oxygen.umassmed.edu (with permission)
 +
<blockquote>
 
::; ssh -l <username> mizar.umassmed.edu
 
::; ssh -l <username> mizar.umassmed.edu
 +
</blockquote>
 
* Change to the parent directory of where your images are located.  
 
* Change to the parent directory of where your images are located.  
 +
<blockquote>
 
::; cd /storage/big1/<username>/tesm/
 
::; cd /storage/big1/<username>/tesm/
 +
</blockquote>
 
* List all the directories
 
* List all the directories
 +
<blockquote>
 
::; ls
 
::; ls
 +
</blockquote>
 
* Convert µManager PSF and Image tiff files to i2i format.  
 
* Convert µManager PSF and Image tiff files to i2i format.  
 +
<blockquote>
 
::; mmtoi2i <directory>
 
::; mmtoi2i <directory>
 +
</blockquote>
 
* Prepare PSF: [[#preppsf]]
 
* Prepare PSF: [[#preppsf]]
 +
<blockquote>
 
:: Prepares a 3-D point spread function (psf)
 
:: Prepares a 3-D point spread function (psf)
 
:::; Example  
 
:::; Example  
 
::::: preppsf -NA 1.4 -n 1.515 -size 0.187 -spaced 0.25 -norm infocus -mask 1 psf.i2i  psf_prep.i2i
 
::::: preppsf -NA 1.4 -n 1.515 -size 0.187 -spaced 0.25 -norm infocus -mask 1 psf.i2i  psf_prep.i2i
 +
</blockquote>
 
* Prepare Images: [[#prepdata]]
 
* Prepare Images: [[#prepdata]]
 +
<blockquote>
 
:: Performs corrections to image data set
 
:: Performs corrections to image data set
 
:::; Example
 
:::; Example
 
::::: prepdata -bg_ref 5 5 3 -norm first  image.i2i image_prep.i2i
 
::::: prepdata -bg_ref 5 5 3 -norm first  image.i2i image_prep.i2i
 +
</blockquote>
 
* Run Deconvolution Software: [[#epr_i2i]]
 
* Run Deconvolution Software: [[#epr_i2i]]
 +
<blockquote>
 
::; epr
 
::; epr
 
::: This is a default version of EPR that runs on a CPUs. It is not GPU accelerated.
 
::: This is a default version of EPR that runs on a CPUs. It is not GPU accelerated.
 +
::; gpu_epr
 +
::: This is the newest version of EPR that enables GPU acceleration for faster 3D Deconvolution. It is currently being updated to run using newest CUDA libraries. This version will be available soon.
 
::; super_epr
 
::; super_epr
 
::: This is an EPR script that enables super-resolution 3D deconvolution. It is not GPU accelerated.
 
::: This is an EPR script that enables super-resolution 3D deconvolution. It is not GPU accelerated.
::; gpu_epr
+
:; Example  
::: This is the newest version of EPR that enables GPU acceleration for faster 3D Deconvolution. It is currently being updated to run using newest CUDA libraries. This version will be available soon.
+
::: epr -V -D -psf psf_prep.i2i -smoothness 0.0005 -iterations 250 image_prep.i2i image_prep_restored.i2i
:::; Example  
+
</blockquote>
::::: epr -V -D -psf psf_prep.i2i -smoothness 0.0005 -iterations 250 image_prep.i2i image_prep_restored.i2i
+
All versions of EPR need a corrected 3D PSF image, the corrected 3D image to be deconvolved, and where the 3D Deconvolved image should be saved. All in i2i format.
All versions of EPR need a 3D PSF image, the 3D image to be deconvolved, and where the 3D Deconvolved image should be saved. All in i2i format.
 
  
 
=== Important EPR Options ===
 
=== Important EPR Options ===
 
+
<blockquote>
 
==== Iterations ====
 
==== Iterations ====
 
 
The number of iterations is the maximum number of iterations that EPR will run if it hasn't reached convergence.  
 
The number of iterations is the maximum number of iterations that EPR will run if it hasn't reached convergence.  
 
::; Suggested: '''-it 300'''
 
::; Suggested: '''-it 300'''
 
   
 
   
 
+
::''Unlike epr and gpu_epr, super_epr only allows setting -sm. Super_epr uses "-co 0.001" and "-it 300" internally.''
''Unlike epr and gpu_epr, super_epr only allows setting -sm. Super_epr uses "-co 0.001" and "-it 300" internally.''
 
 
 
 
==== Convergence ====
 
==== Convergence ====
 
 
Convergence is used to determine when to stop the deconvolution. The range for -co can be between 1 and 0.0001. 0.0001 = true convergence (100%), while 0.001 achieves 90-95% convergence. The smaller the value you use for -co equates to longer times for the deconvolution.  
 
Convergence is used to determine when to stop the deconvolution. The range for -co can be between 1 and 0.0001. 0.0001 = true convergence (100%), while 0.001 achieves 90-95% convergence. The smaller the value you use for -co equates to longer times for the deconvolution.  
::; Default: '''-co 0.001'''
+
::; Suggested
 
+
:::'''-co 0.001'''
''Unlike epr and gpu_epr, super_epr only allows setting -sm. Super_epr uses "-co 0.001" and "-it 300" internally.''
 
  
 +
::''Unlike epr and gpu_epr, super_epr only allows setting -sm. Super_epr uses "-co 0.001" and "-it 300" internally.''
 
==== Smoothness ====
 
==== Smoothness ====
 
 
The most significant option for EPR is smoothness (-sm <number>).
 
The most significant option for EPR is smoothness (-sm <number>).
  
 
The value passed as smoothness is referred to as alpha. Alpha is usually between 0 and RNL (Residual Noise Limit). RNL is reported by prepdata if you know the gain and read specifications of the camera used to acquire the images (see -rnl option for prepdata). These values can be measured empirically. A smaller alpha correspond to less smoothing. (RNL)^2 is usually a good starting choice for alpha. '''You do not want to over deconvolve your images by being too aggressive with alpha (smaller values)'''.
 
The value passed as smoothness is referred to as alpha. Alpha is usually between 0 and RNL (Residual Noise Limit). RNL is reported by prepdata if you know the gain and read specifications of the camera used to acquire the images (see -rnl option for prepdata). These values can be measured empirically. A smaller alpha correspond to less smoothing. (RNL)^2 is usually a good starting choice for alpha. '''You do not want to over deconvolve your images by being too aggressive with alpha (smaller values)'''.
 
 
==== Debug and Verbose ====
 
==== Debug and Verbose ====
 
+
Use -V (verbose) and -D (debug) options to increase the amount of information reported by EPR.
Use -V (verbose) and -D (debug) options to increase the amount of information reports while working on a 3D deconvolution.
+
==== XY-Fold and Z-Fold ====
 +
These two options are only for super_epr.  
 +
:; XY-fold     
 +
:: X and Y pixel sampling increase (currently limited to be 1, 2 or 3)
 +
:; Z-fold
 +
::Z pixel sampling increase (currently limited to be 1, 2 or 3)
 +
</blockquote>
  
 
== Software ==  
 
== Software ==  

Latest revision as of 13:43, 13 March 2019


Exhaustive Photon Restoration

Exhaustive Photon Restoration (EPR) is BIG's 3D Deconvolution routine. It uses a point spread function (PSF) to deconvolve images from a microscope. The PSF is a 3D image of a point source, usually a small fluorescent bead. The PSF should be acquired under similar conditions as the images that will be deconvolved. The fourier transform of the PSF represents the optical transfer function (OTF) of a microscope and is used to deconvolve images in fourier space.

There are three main programs involved in 3D Deconvolution: preppsf, prepdata, and epr. They all use our own i2i image format. We use a program called mmtoi2i to convert µManager images acquired on TESM to i2i files.

preppsf prepares the psf for epr_i2i.

prepdata prepares the images for epr_i2i.

epr (or super_epr or gpu_epr) performs the 3D deconvolution.

An account is needed with the Biomedical Imaging Group to access these programs.

3D Deconvolution Steps

These steps need to done on a BIG's workstation or server. I recommend Mizar.umassmed.edu because it has a quad core CPU, and 32GB of memory. To access Mizar via SSH, please send Karl an email and he will add you to sshd_config for ssh access. For GPU deconvolutions, Oxygen.umassmed.edu is available with permission from Karl.

Substitute your username everywhere it shows "<username>". For example, /storage/big1/<username> becomes /storage/big1/kdb

The following is a list of example steps.

  • ssh (or putty on Windows) into mizar.umassmed.edu or oxygen.umassmed.edu (with permission)
ssh -l <username> mizar.umassmed.edu
  • Change to the parent directory of where your images are located.
cd /storage/big1/<username>/tesm/
  • List all the directories
ls
  • Convert µManager PSF and Image tiff files to i2i format.
mmtoi2i <directory>
Prepares a 3-D point spread function (psf)
Example
preppsf -NA 1.4 -n 1.515 -size 0.187 -spaced 0.25 -norm infocus -mask 1 psf.i2i psf_prep.i2i
Performs corrections to image data set
Example
prepdata -bg_ref 5 5 3 -norm first image.i2i image_prep.i2i
epr
This is a default version of EPR that runs on a CPUs. It is not GPU accelerated.
gpu_epr
This is the newest version of EPR that enables GPU acceleration for faster 3D Deconvolution. It is currently being updated to run using newest CUDA libraries. This version will be available soon.
super_epr
This is an EPR script that enables super-resolution 3D deconvolution. It is not GPU accelerated.
Example
epr -V -D -psf psf_prep.i2i -smoothness 0.0005 -iterations 250 image_prep.i2i image_prep_restored.i2i

All versions of EPR need a corrected 3D PSF image, the corrected 3D image to be deconvolved, and where the 3D Deconvolved image should be saved. All in i2i format.

Important EPR Options

Iterations

The number of iterations is the maximum number of iterations that EPR will run if it hasn't reached convergence.

Suggested
-it 300
Unlike epr and gpu_epr, super_epr only allows setting -sm. Super_epr uses "-co 0.001" and "-it 300" internally.

Convergence

Convergence is used to determine when to stop the deconvolution. The range for -co can be between 1 and 0.0001. 0.0001 = true convergence (100%), while 0.001 achieves 90-95% convergence. The smaller the value you use for -co equates to longer times for the deconvolution.

Suggested
-co 0.001
Unlike epr and gpu_epr, super_epr only allows setting -sm. Super_epr uses "-co 0.001" and "-it 300" internally.

Smoothness

The most significant option for EPR is smoothness (-sm <number>).

The value passed as smoothness is referred to as alpha. Alpha is usually between 0 and RNL (Residual Noise Limit). RNL is reported by prepdata if you know the gain and read specifications of the camera used to acquire the images (see -rnl option for prepdata). These values can be measured empirically. A smaller alpha correspond to less smoothing. (RNL)^2 is usually a good starting choice for alpha. You do not want to over deconvolve your images by being too aggressive with alpha (smaller values).

Debug and Verbose

Use -V (verbose) and -D (debug) options to increase the amount of information reported by EPR.

XY-Fold and Z-Fold

These two options are only for super_epr.

XY-fold
X and Y pixel sampling increase (currently limited to be 1, 2 or 3)
Z-fold
Z pixel sampling increase (currently limited to be 1, 2 or 3)

Software

preppsf

Run the command for full option list: preppsf -h

NAME

   preppsf - prepares a 3-D point spread function (psf) image data set, 
   acquired using a Digital Imaging (light) Microscope, for use with image
   restoration/3-D reconstruction. Normally psf images are first processed
   using prepdata (see below) to apply basic corrections and any background
   corrections, but not temporal corrections.

SYNOPSIS

   preppsf [options] before-image after-image

DESCRIPTION

   preppsf performs further corrections on a psf image data set based on
   the fluorescence D.I.M image formation/acquisition model. The before-
   image argument is the name of a 3-D psf image set, acquired (DIM-1,
   DIM-2, CELLscan, UFM, or other)  and processed using prepdata (see below)
   without the -norm option. The psf is extracted as a symmetric sub-region
   (square in XY) centered at the psf origin (-center), optionally
   normalized for constant total intensity (-norm), and optionally masked
   (-mask) to exclude any extramural data. The after-image argument is the
   file name for the processed psf image set. All options must precede
   input/output image files

Important Information

  • Numerical Aperture of the objective.
  • Index of refraction of immersion medium.
  • Effective Pixel Size at the object in micrometers/pixel
  • DIstance Spacing among Z planes in micrometers.


Example Usage

preppsf -NA 1.4 -n 1.515 -size 0.187 -spaced 0.25 -norm infocus -mask 1 psf_in  psf_out

prepdata

Run the command for full option list: prepdata -h

NAME

   prepdata - prepares a 2-D, 3-D or 4-D image data sets, acquired using a                                                                                                      
   Digital Imaging (light) Microscope, for further processing (e.g. image                                                                                                       
   restoration/3-D reconstruction)                                                                                                                                                 
                                                                                                                                                                                   

SYNOPSIS

   prepdata [options] before-image after-image                                                                                                                                     
                                                                                                                                                                                      

DESCRIPTION

   prepdata performs all necessary corrections on a image data set based on
   the fluorescence D.I.M image formation/acquisition model, and can be
   used to perform basic imaging corrections to many forms of digitally
   acquired image data. The before-image argument is the name of a 3-D image
   set as acquired (DIM-1, DIM-2, CELLscan, UFM, or other). The after-image
   argument is the file name for the corrected image set, ready for further
   processing. The normal order of application of corrections (see -before)
   is basic[->background[->temporal]]. All calculations are performed using
   single-precision floating-point arithmetic. All options must precede
   input and output image file names.

epr_i2i

Run the command for full option list: epr_i2i -h

NAME

   epr_i2i - Exhaustive Photon Replacement (EPR) restores contrast by removing 
   residual out-of-focus light and improves resolution while maintaining 
   numerical accuracy of 3-D images of specimens obtained with serial 
   optical sectioning from wide-field or confocal light microscopy.

SYNOPSIS

   epr_i2i [options] before-image[.i2i] after-image[.i2i]

DESCRIPTION

   epr performs regularized, iterative image restoration with a non-
   negativity constraint.  The before-image is a three dimensional (3-D) 
   TIFF image composed of rectangular, regularly spaced, optical sections.
   Large images are decomposed into smaller, overlapping (in x and y only) 
   image segments for restoration, and the restored segments are recomposed.
   The after-image is the restored 3-D image. All options must appear 
   before the image file names, but the order of options is not important.

Example Usage

epr -psf mypsf_ -smoothness 0.0005 -iterations 250 mycell_ mycell_r