Philosophy of the program - galizia-lab/pyview GitHub Wiki

PyView is organized in a series of separate steps/sections, each with its own flags (settings).

(Tltr? Just read the headers and jump a page ahead to “Hands on handbook” – you can always come back here!)

Define experiment -> create a list file

An experiment consists of multiple measurements in one animal (or preparation). For example, we record odor-evoked activity patterns in the brain of an insect: a single animal is exposed to different odorants and controls, and maybe treated with pharmacological substances. A list needs to be created to collect this information: stimulus identity, stimulus timing, pharmacological treatment, measurement length, storage place for original data as well as technical details of the measurements (e.g. frame rate).

You can create a list file using Excel (or any other spreadsheet program), or create it adapting the scripts in the log2list_examples folder. (Many setups create a .log file during measurements which contains, among others, the file names of the data, and the time of measurements, and the python scripts use those .log files to create the .list files).

Load data and calculate signals-> yields raw data and signals

Loading data uses many settings/flags that indicate important information: Where does the data come from, i.e. what format is the raw data: Zeiss confocal microscope, Till Photonics imaging system, 3D-TIFF-stack, etc; whether you want to apply filters when loading (e.g. against bleaching, movement correction, noise filters...), or reduce data size (e.g. apply post-hoc binning).

The raw data is converted into signals, e.g. deltaF/F, or ratiometric calculations. Settings for signal calculation include, for example, which frames to use for F0 calculation.

Interact with data -> use ILTIS, yields .coor and .area files

ILTIS is a stand-alone package used for interactive calcium imaging data visualization. A fork of ILTIS has been integrated into PyView-GUI, which allows to interactively look at imaging data. Multiple traces from different areas within a measurement, or multiple traces from a location in different measurements can be visualized. Raw data and signals can be compared. Movement artefacts, other artefacts, peculiarities – all is accessible in a fast and efficient way.

Within ILTIS, you can define regions of interest (ROIs, defined here in the .coor file) for calculating traces (e.g. the location of cell bodies, or of olfactory glomeruli or other brain areas). Furthermore, you can define the area of the brain in the image – this is useful for visualization purposes, or for bleach correction settings.

Create overviews -> yields activity images

Within PyView-GUI, you can create false-color coded images of your measurements. Many settings (flags) are needed: do you want to calculate a maximum response, or the absolute response at a given time point? What filter? Color-table? Value for maximum-minimum activity? Activity shown only in the brain (use .area file) or also outside? Additional information? All flags can be tested in detail.

Scripting 1 -> yields tapestries

With all the settings that were experimented with PyView-GUI, you can now use scripts to run identical mathematics on all measurements for all animals of your experiments, using the same code that was used by PyView-GUI. This results in a “tapestry”, which allows you to compare, for example, response magnitude across animals, or to compare response patterns (scale each image to its own maximum) or compare response magnitude (scale all images to a global maximum). You need a dedicated file that contains all the settings (a .yml file), and a file that defines which measurements to show in what order along the tapestry. A bit of organization, but great insight into your data!

Create time courses -> yields traces

Within PyView-GUI, you can create activity traces, using the ROIs defined in the .coor file.

Scripting 2 -> yields time trace files

With all the settings that were experimented with in PyView-GUI, you can now use scripts to calculate time traces for all ROIs and all animals, writing the resulting data into a spreadsheet file. The important thing here: all animals, all measurements were treated with exactly identical settings (filters etc), making the resulting data statistically sound and comparable. The spreadsheet files contain time traces along with plenty of metadata (stimulus identity, timing of the stimulus, name of the ROI, etc), which can then be analyzed with standard statistics packages (e.g. compare response magnitude between two different pharmacological treatments, by running a test on column “response” with parameter “pharmacological treatment” and subjects “animal”). Users can use any standard statistics package of their choice to perform solid statistics (R, S, Python, SPSS…), or apply machine learning algorithms and classifiers to the extracted numerical data. This allows for qualitative and quantitative evaluation of intra-animal and inter-animal hypotheses.

Create movies -> yields single movies

Within PyView-GUI, you can create movies of your measurements. Many settings (flags) are needed: do you want to apply a filter? Which color- table? Additional information, such as time-point of stimulus, or numbers indicating time passed? All flags can be tested in detail.

Scripting 3 -> yields movies

With all the settings that were experimented with in PyView-GUI, you can now create movies for all your measurements in all animals using the exact same settings and using the exact same code as PyView-GUI. Off-line movie creation is feasible even with a slow computer – just come back the next day.

Previous page Contents Next page
Introduction Contents Hands-on tutorial with synthetic data