Skip to content

aicjanelia/LLSM

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

DOI License

Lattice Light-Sheet Microscope (LLSM) Pipeline

This repository contains pipeline code for handling AIC's LLSM data. The pipeline consists of three discrete modules: (1) deskewing, (2) deconvolution, and (3) maximum intensity projection. The pipeline is accessed via the command line using the llsm-pipeline command. Each pipeline module compiles to a separate binary that can be directly executed by calling deskew, decon, or mip on the command line. Use the -h option with any command to get a list of supported arguments.

Dependencies

  • boost-program-options >= 1.73.0
  • boost-filesystem >= 1.73.0
  • ITK >= 5.1.0
  • Python >= 3.8.2
  • CMake

The pipeline assumes that all LLSM settings files have been generated by v4.04505.Development of the LLSM control software. Settings files generated by different versions of the LLSM control software are not likely to be parsed correctly by our parsing routine.

Installation

The LLSM pipeline was purpose built to run on the Janelia cluster. For example, the pipeline assumes that it can directly submit jobs to an LSF cluster. We recommend using VCPKG to install the necessary dependencies.

vcpkg install itk boost-program-options boost-filesystem

Once the dependencies are installed, use CMake to build the binaries.

Pipeline

usage: llsm-pipeline [-h] [--dry-run] [--verbose] input

Batch deskewing, deconvolution, and mip script for LLSM images.

positional arguments:
  input          path to configuration JSON file

optional arguments:
  -h, --help     show this help message and exit
  --dry-run, -d  execute without submitting any bsub jobs
  --verbose, -v  print details (including commands to bsub)

The pipeline is initiated by calling the llsm-pipeline command and providing it with a properly formatted config.json file. See the example directory of this repo for an example config.json. We recommend using the --dry-run command to check your pipeline run before submitting jobs to the cluster.

For most cases, the llsm-pipeline command should be all that is needed. However, the individual modules can be run directly on a single file if needed. See the sections before for information on running the modules separate from the pipeline.

Deskew

deskew: removes skewing induced by sample scanning
usage: deskew [options] path

Allowed options:
  -h [ --help ]                      display this help message
  -x [ --xy-rez ] arg (=0.104000002) x/y resolution (um/px)
  -s [ --step ] arg                  step/interval (um)
  -a [ --angle ] arg (=31.7999992)   objective angle from stage normal 
                                     (degrees)
  -f [ --fill ] arg (=0)             value used to fill empty deskew regions
  -o [ --output ] arg                output file path
  -b [ --bit-depth ] arg (=16)       bit depth (8, 16, or 32) of output image
  -w [ --overwrite ]                 overwrite output if it exists
  -v [ --verbose ]                   display progress and debug information
  --version                          display the version number

The deskew function performs an affine transformation on a LLSM TIFF image to correct the shearing of the data during acquisition. The step/interval parameter refers to the distance travelled by the stage for each slice. This is not the same as the z-step which is equal to step * sin(31.8) * (PI/180.0).

Deconvolution

decon: deconvolves an image with a PSF or PSF parameters
usage: decon [options] path

Allowed options:
  -h [ --help ]                       display this help message
  -k [ --kernel ] arg                 kernel file path
  -n [ --iterations ] arg             deconvolution iterations
  -x [ --xy-rez ] arg (=0.104000002)  x/y resolution (um/px)
  -p [ --kernel-spacing ] arg (=1)    z-step size of kernel
  -q [ --image-spacing ] arg (=1)     z-step size of input image
  -s [ --subtract-constant ] arg (=0) constant intensity value to subtract 
                                      from input image
  -o [ --output ] arg                 output file path
  -b [ --bit-depth ] arg (=16)        bit depth (8, 16, or 32) of output image
  -w [ --overwrite ]                  overwrite output if it exists
  -v [ --verbose ]                    display progress and debug information
  --version                           display the version number

The decon function performs a Richardson-Lucy deconvolution on a deskewed TIFF image. The function requires a centered PSF kernel, the PSF z-step, and the image z-step.

Maximum Intensity Projection (MIP)

mip: generates a maximum intensity projection along the specified axes
usage: mip [options] path

Allowed options:
  -h [ --help ]                      display this help message
  -x [ --x-axis ]                    generate x-axis projection
  -y [ --y-axis ]                    generate y-axis projection
  -z [ --z-axis ]                    generate z-axis projection
  -p [ --xy-rez ] arg (=0.104000002) x/y resolution (um/px)
  -q [ --z-rez ] arg (=0.104000002)  z resolution (um/px)
  -o [ --output ] arg                output file path
  -b [ --bit-depth ] arg (=16)       bit depth (8, 16, or 32) of output image
  -w [ --overwrite ]                 overwrite output if it exists
  -v [ --verbose ]                   display progress and debug information
  --version                          display the version number

The mip function performs a maximum intensity projection on any 3D TIFF image. The function creates mips along any specified axis (i.e., -x, -y, or -z), and the output filenames are appended with the corresponding axis name. The x and y dimensions are scaled to match the resolution of the z dimension.