Skip to content

Getting started

Rob Campbell edited this page Mar 12, 2017 · 5 revisions

A typical data set might consist of about a quarter of a million TIFFs per channel. The goal of StitchIt is to assemble (stitch) these small tiles into planes, such that each channel of each optical section is stored in a single large TIFF image. Once the data have been stitched, StitchIt offers further tools to correct for artifacts and facilitate subsequent analyses.

Serial 2-photon tomography systems have good resolution but the acquisition session might last anywhere from a few hours to a few days. StitchIt has a tool called syncAndCrunch that pre-processes tiles during acquisition, displays the last completed slice on the web, and automatically stitches the data at the conclusion of acquisition. This is useful since pre-processing of the images is more time consuming than stitching. We have found monitoring the state of the acquisition to be enormously helpful. In the past we have used this to rescue samples that would otherwise have been lost to things like laser instability, too much or too little laser power, incorrect PMT gain, air bubbles on the objective, etc.

Setting up to analyse during acquisition

Data are streamed directly from the acquisition machine (two in the case of the TissueVision 1000) to a server. In our setup the buffer server acts as a storage location only and does not have compute power. The syncAndCrunch function running on the analysis machine periodically pulls data off the buffer server for pre-processing. Stitching is conducted automatically once acquisition completes. Stitched datasets that pass quality criteria are stored long-term on a large secure server. The analysis machine and buffer server can only hold a limited number of data sets and are not secure. For various uninteresting reasons, syncAndCrunch does not directly interact with two TissueVision acquisition machines.

Running syncAndCrunch

The following is an example of how to start an analysis session in MATLAB. We recommend running this on a terminal using tmux or screen. This is very useful, since you can attach to the session remotely over the command line.

localDir = '/mnt/myLocalData'; %Data will be sent here
serverDir = '/mnt/buffer/Data/myData/PFY_0123'; %Path to data on server
syncAndCrunch(localDir, serverDir,1:3,1:3,0,1)

Briefly, the above command initiates a cycle that alternates between copying data from the buffer server to the local disk on the analysis machine, processing those data, and displaying a preview of the last completed section to the web. In the above command, the two 1:3 arguments instruct the analysis to run the bidirectional scanning correction and illumination correction on all three channels.
The 0 tells it not delete channel 3 (which we sometimes do, since there is no option in TissueVision's software to select which channels to acquire). The final argument tells the function to make preview images based on channel 1. Once acquisition is complete (all sections have been acquired) the data are automatically stitched. You can force stitching early by creating a file called ‘FINISHED’ in localDir or serverDir. Alternatively, quit with ctrl+c and stitch manually. Note: syncAndCrunch assembles stitched images at the end of acquisition because it uses all available tiles to calculate the grand average images used for illumination correction. Stitched data are stored as one tiff per optical section in a directory called stitchedImages_100. Data from each channel are stored in separate sub-directories. See here for a more detailed walk-through of the process.

Configuring syncAndCrunch

In addition to the command-line arguments, syncAndCrunch (and other StitchIt functions) reads settings from an INI file (e.g. define the webserver to which preview images are kept). You should set up the INI file for your system before attempting to use syncAndCrunch.