Skip to content

Workflow

Joris Vincent edited this page Nov 16, 2017 · 15 revisions

Abstract workflow

Generally, how we generate and present stimuli using the OneLights is as follows:

Pre-session

  1. Calibrate the OneLight
  2. Define a nominal background around which to modulate
  3. Define a nominal direction of modulation
  4. Define a temporal profile of modulation / a timeseries of contrast in a direction.

Pre-acquisition

  1. Correct the direction
  2. Combine the background, direction and temporal profile into a modulation
  3. Create settings (i.e. apply gamma-function)
  4. Create starts-stops

During acquisition

  1. Apply starts-stops

Post-acquisition

  1. Validate corrected direction

Code-flow (call stack)

In practice, the flow (i.e., the call stack) in the OLApproach_XXXX and OLApproachSupport codebase is outlined below. For each function call, parenthetical reference indicates which preceding function/script made the call, or, "(man)" for manual call.

Pre-session

  1. tbUseProject('OLApproach_XXXX') (man) uses ToolboxToolbox to resolve dependencies on other toolboxes, and execute the local hook to define approach and machine specific preferences (e.g., directory structures).
  2. SetupXXXXApproach.m (man) defines some initial approach parameters, most importantly the name of the approach, the name(s) of the calibration file(s) to use, the names of any directions to use, and the names of any backgrounds to use. Then creates the nominal backgrounds (3). and nominal directions (4).
  3. OLMakeBackgroundNominalPrimaries (2.)
    1. OLBackgroundNominalParamsDictionary (3.)
    2. OLBackgroundNominalDictionaryDefaults (3a.)
    3. OLBackgroundNominalDictionaryValidate (3a.)
    4. OLReceptorIsolateMakeBackgroundNominalPrimaries (3.)
  4. OLMakeDirectionNominalPrimaries (2.)
    1. OLDirectionNominalParamsDictionary (4.)
    2. OLDirectionNominalDictionaryDefaults (4a.)
    3. OLDirectionNominalDictionaryValidate (4a.)
    4. OLReceptorIsolateMakeDirectionNominalPrimaries (4.)

Currently, these steps reference (2), create (3a-c; 4a-c), read from (3d; 4d) and write to (3d; 4d), dictionaries and cache-files. These serve to standardize parameters, to precompute things that don't have to be computed day-of, and to document how the underlying architecture work. Work is in progress to separate the underlying functional architecture generating backgrounds and directions, from the dictionary and caching systems.

During session

  1. RunXXX (man). The remainder of the call stack is initiated by a protocol script, with a name usually starting with . This protocol script is manually called by the experimenter at the start of a session, and controls any number of acquisitions.

Pre-acquisition

Retrieve nominal directions and nominal backgrounds referenced by name in the protocol params

  1. OLMakeDirectionCorrectedPrimaries (5.) corrects the primaries day-of, by measuring the spectra the nominal primaries produce, and searching over primary space to get closer to the desired spectra.
  2. OLMakeModulationStartsStops (7.)
    1. OLReceptorIsolateMakeModulationStartsStops (8.)
    2. OLCalculateStartsStopsModulation (8a.)
    3. OLPrimaryToSettings (8b.)
    4. OLSettingsToStartsStops (8c.)
  3. OLValidateDirectionCorrectedPrimaries (5.)
  4. OLAnalyzeDirectionCorrectedPrimaries (5.)

During acquisition

  1. ApproachEngine (5.)

Post-acquisition

  1. OLValidateDirectionCorrectedPrimaries (5.)
  2. OLAnalyzeDirectionCorrectedPrimaries (5.)
Clone this wiki locally