Using CTVs - galizia-lab/pyview GitHub Wiki

[[TOC]]

What are CTVs?

CTV stands for "Curve to Value". It essentially is a function that converts a time trace ("Curve") to a scalar ("Value") and is used to convert a calcium imaging recording, which is essentially a collection of pixel-wise time trace data into a an overview frame, in which each pixel is represented by a scalar value.

For what are CTVs used in VIEW?

CTVs are used to generate overviews and tapestries.

How do I specify the CTV that VIEW should use?

The method used for CTV calculation is be specified primarily using the flag CTV_Method. For specific cases, specification of other flags are also required, as detailed in the following subsections.

Internally implemented CTVs

When the flag CTV_Method is set to be a number, VIEW uses an internal CTV. The list of internally implemented CTVs is available in the next section. Some CTV methods, like 22, may use further parameters like CTV_firstframe and CTV_lastframe. Other CTV methods, like 35, might require the stimulus onset and offset values to be specified in measuerement list files.

Custom CTVs

A custom CTV is expected to be in the form of a python function in a file on the filesystem. Here is a guide to creating it. The flag CTV_Method must then be set to the name of the python function and the flag CTV_MethodFile to the path of the file containing the python function.

Which CTVs are currently available?

Definition

This is an alias for CTV_Method = 303

Definition

A - B, where
A=average of three frames around the frame specified by CTV_lastframe
B=average of three frames around the frame specified by CTV_firstframe.

Illustration

ctv22

CTV_Method = 222

Definition

A - B, where
A=average of four frames starting at CTV_lastframe
B=average of four frames starting at CTV_firstframe.

Definition

A - B, where
A=three-frame-average around the maximum response in an interval of 3 seconds after the onset of stimulus
B=mean of 3 frames that are <LE_PrestimEndBackground> frames before the onset of stimulus

Illustration (for stimulus 1)

ctv35_1 ctv35_2

CTV_Method = 300

Definition

Mean of all frames (useful for simulated photographs)

CTV_Method = 301

Definition

Mean of frames 5 to 10, which is generally before stimulus onset. Useful for morphological views.

CTV_Method = 302

Definition

Mean of frames between flags values <first_frame> and <last_frame>. One possible use: calculate morphological image by specifying manually the range of frames to average.

CTV_Method = 303

Definition

Mean of background frames, calculated using first stimulus onset and the flags LE_StartBackground and LE_PrestimEndBackground. Can be useful to visualize and compare baseline values of signals.

Illustration

ctv0

CTV_Method = 330

Definition

Median of all frames (useful for simulated photographs)

CTV_Method = 331

Definition

Median of frames 5 to 10, which is generally before stimulus onset.

CTV_Method = 332

Definition

Median of frames between flags values <first_frame> and <last_frame>.

CTV_Method = 333

Definition

Same as CTV_Method = 303, but using median instead of mean.

⚠️ **GitHub.com Fallback** ⚠️