Workflow Description#
Please refer to the Bonsai Language Guide to develop a foundation in Bonsai before proceeding.
Produce UCLA Miniscope v4 Data#
The
UCLAMiniscopeV4node represents aUCLAMiniscopeV4operator. TheUCLAMiniscopeV4operator is a source operator as indicated by its node’s green color and the orientation of its grey arc. Source operators produce data.The
UCLAMiniscopeV4operator’s output (Bonsai.Miniscope.V4Frame) has four members. They can be accessed by right-clicking theUCLAMiniscopeV4node and hovering the cursor over the Output option in the pop-up menu. Left-clicking on one of these members automatically places a newMemberSelectornodes. These nodes can also be placed by searching modules in the search bar in the Toolbox pane or the using theCtrl+Ehotkey.The
MemberSelectoroperators are transform operators as indicated by the nodes’ blue color and lack of grey bar. Transform operators transform data. TheMemberSelectoroperator transforms data by selecting one or multiple members of its input to output.In this workflow,
Quaternion,FrameNumber, andImagemembers are selected fromBonsai.Miniscope.V4Frameto be passed to two divergent branches.
Save Image Data#
The
Imagenode connects to aVideoWriternode. TheVideoWriteroperator writes data to a video file according to settings in the Properties pane that appears after left-clicking theVideoWriternode.There are two
VideoWriteroperators. The first one is from theBonsai.Visionpackage, and the second one is from theBonsai.FFmpegpackage. They are both sink operators as indicated by the nodes’ purple color and the orientation of its grey arc. A sink operator saves data or triggers external events.The first
VideoWriteroperator is enabled. It can be disabled by clicking it and pressing Ctrl+D. It is configured to save video using a Y800 (no compression) codec.The second
VideoWriteroperator is disabled. It can be enabled by clicking it and pressing Ctrl+Shift+D. It is configured to save video using an 8-bit FFV1 (lossless compression) codec.The
Annotationnodes (which contain a “#” symbol) are simply there to indicate the difference between theBonsai.Vision.VideoWriteroperator and theBonsai.FFmpeg.VideoWriteroperator. They don’t provide any functional difference in the workflow. You can think of them like comments in code.
Save Timestamped Quaternion Data#
The
FrameNumber, Quaternionnode connects to theTimestampnode. TheTimestampoperator appends timestamps to items that are emitted by the upstream operator.The
Timestampnode connects to theCsvWriternode. TheCsvWriteroperator writes data to a csv file according to settings in the Properties pane that appears after left-clicking theCsvWriternode.
To continue learning about using the UCLA Miniscope v4 and Miniscope-DAQ in Bonsai, refer to the Trigger Workflow Description