Multichannel?

120 views
Skip to first unread message

Ignacio Marin

unread,
Feb 4, 2022, 8:02:30 AMFeb 4
to Miniscope
Hi all, 

Is there any way to connect 2 or more miniscopes (with their respective DAQ) simultaneously to the same computer?
 
Thanks!

Ignacio

Federico Sangiuliano

unread,
Feb 5, 2022, 12:14:33 AMFeb 5
to Miniscope
Hello Ignacio. The miniscope software supports this by adding the devices you want to connect on the userConfig file.

Arun Cherkkil

unread,
Apr 2, 2022, 3:00:38 PMApr 2
to Miniscope
Hi all, 

I had a similar question on how to connect multiple Miniscopes to same PC. Could you share how explain how to add the devices on the userConfig file ? 

Thanks, 
Arun 

Federico Sangiuliano

unread,
Apr 4, 2022, 8:13:31 PMApr 4
to Miniscope
Hello Arun, I'll show an example on how to connect multiple devices to a computer. For this example, I'm going to connect two v4 miniscopes using two DAQs and a behavioral camera connected over USB in the miniscope software (v1.11) as shown in the figure below

daq_miniscopes.png

First we need to modify the "UserConfigExample-primary.json" file to add the two imaging devices. I prefer to use Sublime as a text editor, but you can also modify this file using notepad++ or similar. Starting at line 107 you can find the portion of code that refers to the imaging devices: miniscopes and (behavior) cameras. In that file a miniscope and a behavior camera are already included, so we only need to add the second miniscope. To do this, in the end of the definition of the first miniscope you will have to add a comma following the bracket, and add the following

                "miniscope2": {
                "COMMENT_deviceName": "This can be whatever you want. It should be unique for each device though.",
                "COMMENT_deviceType": "This should be a supported deviceType listed in the videoDevice.json file.",
                "COMMENT_deviceType2": "Supported types include 'Miniscope_V4_BNO' and 'Miniscope_V3'",
                "deviceType": "Miniscope_V4_BNO",
                "COMMENT_headOrientation": "If using a V4 Miniscope you should set enabled to true so stream and record head orientation data from the onboard IMU.",
                "headOrientation": {
                    "enabled": true,
                    "filterBadData": true,
                    "COMMENT_plotTrace": "Add or remove 'roll' 'pitch' and/or 'yaw' to define which get plotted in the time trace display.",
                    "plotTrace": ["roll", "pitch", "yaw"]
                },
                "COMMENT_deviceID": "All UVC camera devices on your computer have a unique deviceID starting with '0'. Try numbers until you find the one that connects to the correct Miniscope.",
                "COMMENT_deviceID2": "This number will never be more than one minus the number of cameras devices (including Miniscopes) connected to your computer.",
                "deviceID": 2,
                "showSaturation": true,
                "COMMENT_ROI": "You can define an ROI here or select one in the GUI. You can also completely remove this section if you don't want to trim the FOV at all.",
                "ROI": {
                    "notes": "This defines the bounding box of the portion of the video that is saved to disk",
                    "note3": "Edge values are zero indexed",
                    "leftEdge": 0,
                    "topEdge": 0,
                    "width": 600,
                    "height": 600
                },
                "COMMENT_compression": "Imaging data is save in .avi file format. You can choose what type of video compression to apply when saving data.",
                "COMMENT_compression2": "We suggest using a lossless compression CODEC for Miniscope data. This would be either GREY or FFV1. GREY does no compression. FFV1 losslessly compresses the data but can be CPU intensive.",
                "COMMENT_compression3": "We generally use FFV1 is our computer can keep up with it. If you notice the frame buffer filling up completely while recording you should switch to GREY.",
                "compression": "FFV1",
                "framesPerFile": 1000,
                "COMMENT_window": "The window keys define how the GUI for this device will be setup. They don't affect the actual recorded data.",
                "windowScale": 1,
                "windowX": 800,
                "windowY": 100,
                "COMMENT": "gain, ewl, led0, frameRate allow you to design the initial values the Miniscope boots up with. These can be later adjusted in the GUI.",
                "gain": "Low", "COMMENT_gain": "Low, Medium, High are 1x, 2x, and 3.5x",
                "ewl": 50,
                "led0": 10,
                "frameRate": "20FPS"
            }

Which is the same as the first miniscope already included in the example file. To check if this was entered correctly, load the configuration file to the software and it should look like this

load_correct.png

In this example, I named my miniscopes "miniscope1" and "miniscope2", and the behavior camera "behavCamera", as shown above. After hitting run we get the following

ejemplo_webcam_2miniscopes.png

You can also find the example user configuration file in the attachments (named "UserConfigExample-Dual_miniscope4_plusBehavCam"). Please let me know if you have any questions

Federico
UserConfigExample-Dual_miniscope4_plusBehavCam.json

Arun Cherkkil

unread,
Apr 4, 2022, 9:10:42 PMApr 4
to Miniscope
Hi Federico,

Thanks for explaining the process. Currently, I am using Version 3 . Would this work with Ver3 miniscopes as well?  Also when doing simultaneous measurements, does the recording start simultaneously in both the cameras frame by frame.or will there be latency issues. I will try this out and let you know if I have any questions.

Thanks and Regards, 
Arun 

Federico Sangiuliano

unread,
Apr 5, 2022, 3:51:44 AMApr 5
to Miniscope
Hello Arun. Sure, this solution will work with v3 miniscopes. The only change you have to make is the "deviceType" to  "Miniscope_V3". Otherwise everything is the same

  • Also when doing simultaneous measurements, does the recording start simultaneously in both the cameras frame by frame.or will there be latency issues
The recording for all the cameras will start at the same time. However, it's very unlikely that they get clocked at the same exact time frame by frame. Instead, each frame will be timestamped independently.

I hope this helps

Federico 
Reply all
Reply to author
Forward
0 new messages