Using CTVs - galizia-lab/pyview GitHub Wiki
[[TOC]]
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.
CTVs are used to generate overviews and tapestries.
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.
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.
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.
CTV_Method = 0
This is an alias for CTV_Method = 303
CTV_Method = 22
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.
CTV_Method = 222
A - B, where
A=average of four frames starting at CTV_lastframe
B=average of four frames starting at CTV_firstframe.
CTV_Method = 35
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
CTV_Method = 300
Mean of all frames (useful for simulated photographs)
CTV_Method = 301
Mean of frames 5 to 10, which is generally before stimulus onset. Useful for morphological views.
CTV_Method = 302
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
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.
CTV_Method = 330
Median of all frames (useful for simulated photographs)
CTV_Method = 331
Median of frames 5 to 10, which is generally before stimulus onset.
CTV_Method = 332
Median of frames between flags values <first_frame> and <last_frame>.
CTV_Method = 333
Same as CTV_Method = 303, but using median instead of mean.