Skip to content
Max Turner edited this page Apr 8, 2022 · 6 revisions

Visprotocol / Visanalysis datafiles

Visanalysis is based on .hdf5 data files produced by visprotocol experiments

The basic hierarchy of these data files can be seen using HDFView or with the visanalysis DataGUI:

Screen Shot 2022-03-02 at 2 42 01 PM

visanalysis attaches experimental data and metadata to these datafiles to make more portable, compact, and organized structures for your imaging data. After you have preprocessed your images and generated regions of interest, your downstream analysis pipelines can then rely solely on the .hdf5 file.

The analysis pipeline

A typical visanalysis pipeline looks like the following:

  1. Collect data using visprotocol and whatever other acquisition systems you use. Visanalysis uses plugins to connect a data file format (e.g. a proprietary imaging software format and metadata) to the ImagingDataObject. The base plugin class describes the methods you will need to overwrite to design your own plugin, should you need to.
  2. Attach metadata to your visanalysis data file. You can do this using the DataGUI or in a script [e.g. see attach_data.py]. This will attach acquisition metadata, stimulus tracking photodiode data, and any other DAQ inputs you have collected, directly to the .hdf5 file. The file will grow in size. It is always a good idea to back up your raw data file before attaching any data to it.
  3. Motion correct your images, if necessary. I recommend using brainsss for volumetric time series data. For single-plane imaging, I have been happy with thunder-registration. You can also write your own motion correction tools using ANTsPy.
  4. Generate ROIs. You can draw ROIs by hand using the DataGUI or generate them some other way (e.g. by atlas or region alignment - see examples/mask_responses.py). The ROI masks and the resulting traces can then be attached directly to the data file.
  5. In your own analysis scripts or notebooks, instantiate an ImagingDataObject based on the .hdf5 file you have generated. See /examples/plotting_responses.py for a walk-through of how to instantiate an ImagingDataObject, and what sorts of attributes and methods it makes available to you. Generally this object uses stimulus timing information to create epoch/trial responses and their associated stimulus parameters.
  6. Do your analysis. There are some shared analysis tools in analysis/shared_analysis.py, including common things like:
  • Filter trials by some specified parameter values
  • Filter data files in a database for specified protocols and fly metadata (e.g. return all the flies of this genotype where you ran x protocol)
  • Plot all the ROI responses split by unique parameter conditions
Clone this wiki locally