kushalkolar / serenity

Realtime analysis & visualization of calcium imaging data
GNU General Public License v3.0
1 stars 0 forks source link

Latest ideas #12

Open kushalkolar opened 1 year ago

kushalkolar commented 1 year ago

We're using improv to handle process & memory management. Visualization data will be sent to jupyter using zmq.

Need to write and decide the following:

  1. Acquisition information. Probably just a json dict that is submitted via zmq from matlab after the improv setup is invoked. We want:

    • mesmerize batch dir or database name
    • animal_id
    • channel information
    • shape of each channel
    • dtype
    • framerate
    • laser power
    • zoom
    • all other scanimage info
    • date
  2. Per-frame acquisition header of size 5,000 bytes with each frame that is sent via zmq from matlab/scanimage:

    1. frame_index - uint32
    2. trial_index - uint32
    3. trigger_state - uint32
    4. timestamp - float32
    5. Many empty bytes for future use We could just define these using a yaml file or something.

Note: 5,000 byte header is less than 1% the size of (512 512 2) bytes which is the size of a 512 x 512 int16 frame.

  1. Matlab class using parfeval to send data using zmq. The frame data and per-frame acquisition information are sent together in a single zmq message as raw bytes in this format:

    • header: 5,000 bytes
    • channel_a: shape_x shape_y dtype.nbytes
    • channel_b: shape_x shape_y dtype.nbytes
  2. MesmerizeWriter to write incoming data as a "batch item"

  3. How to keep the cnmf Estimates object and read from it during live visualization.

kushalkolar commented 1 year ago

zmq brainstorming

image

kushalkolar commented 1 year ago

Probably better to use a store for:

  1. Storing acquisition metadata so it can be accessed by all actors
  2. Storing UUID and params for this acquisition