From f1ea4baf358dcb5f51b02ad83143d7e46be70843 Mon Sep 17 00:00:00 2001 From: Daniel Aharoni Date: Mon, 4 Jan 2021 00:02:38 -0800 Subject: [PATCH] Clean up example user config files for version 1.10 release --- ...figExample-V4Miniscope-plus-2-WebCams.json | 142 ++++++++++++++ .../UserConfigExample.json | 0 .../UserConfigExample_Dual_MiniCAM.json | 0 ...serConfigExample_Dual_MiniCAM_PLUS_V4.json | 0 .../UserConfigExample_MiniCAM_DLC_Trace.json | 0 .../UserConfigExample_MiniLFM.json | 0 .../UserConfigExample_V3_Miniscope.json | 0 ...figExample_V3_Miniscope_Plus_BehavCam.json | 0 .../UserConfigExample_V4_2C_Miniscope.json | 0 .../UserConfigExample_V4_BNO_Miniscope.json | 0 ..._V4_BNO_Miniscope_traceDisplay - Copy.json | 0 ...serConfigExample_V4_BNO_Plus_BehavCam.json | 0 ...onfigExample_V4_Playback_traceDisplay.json | 0 .../UserConfigExample_WebCam.json | 0 .../UserConfigExample_WebCam_DLC_trace.json | 0 ...UserConfigExample_WebCam_V4_DLC_Trace.json | 0 ...erConfigExample_WebCam_w_traceDisplay.json | 0 deviceConfigs/userConfigProps.json | 10 +- source/controlpanel.cpp | 20 +- source/tracedisplay.cpp | 2 +- ...onfigExample-V3-Miniscope-plus-WebCam.json | 120 ++++++++++++ ...onfigExample-V4-Miniscope-plus-WebCam.json | 126 +++++++++++++ ...figExample-V4Miniscope-plus-2-WebCams.json | 142 ++++++++++++++ userConfigs/UserConfigExample-primary.json | 177 ++++++++++++++++++ 24 files changed, 729 insertions(+), 10 deletions(-) create mode 100644 My User Configs/UserConfigExample-V4Miniscope-plus-2-WebCams.json rename {userConfigs => My User Configs}/UserConfigExample.json (100%) rename {userConfigs => My User Configs}/UserConfigExample_Dual_MiniCAM.json (100%) rename {userConfigs => My User Configs}/UserConfigExample_Dual_MiniCAM_PLUS_V4.json (100%) rename {userConfigs => My User Configs}/UserConfigExample_MiniCAM_DLC_Trace.json (100%) rename {userConfigs => My User Configs}/UserConfigExample_MiniLFM.json (100%) rename {userConfigs => My User Configs}/UserConfigExample_V3_Miniscope.json (100%) rename {userConfigs => My User Configs}/UserConfigExample_V3_Miniscope_Plus_BehavCam.json (100%) rename {userConfigs => My User Configs}/UserConfigExample_V4_2C_Miniscope.json (100%) rename {userConfigs => My User Configs}/UserConfigExample_V4_BNO_Miniscope.json (100%) rename {userConfigs => My User Configs}/UserConfigExample_V4_BNO_Miniscope_traceDisplay - Copy.json (100%) rename {userConfigs => My User Configs}/UserConfigExample_V4_BNO_Plus_BehavCam.json (100%) rename {userConfigs => My User Configs}/UserConfigExample_V4_Playback_traceDisplay.json (100%) rename {userConfigs => My User Configs}/UserConfigExample_WebCam.json (100%) rename {userConfigs => My User Configs}/UserConfigExample_WebCam_DLC_trace.json (100%) rename {userConfigs => My User Configs}/UserConfigExample_WebCam_V4_DLC_Trace.json (100%) rename {userConfigs => My User Configs}/UserConfigExample_WebCam_w_traceDisplay.json (100%) create mode 100644 userConfigs/UserConfigExample-V3-Miniscope-plus-WebCam.json create mode 100644 userConfigs/UserConfigExample-V4-Miniscope-plus-WebCam.json create mode 100644 userConfigs/UserConfigExample-V4Miniscope-plus-2-WebCams.json create mode 100644 userConfigs/UserConfigExample-primary.json diff --git a/My User Configs/UserConfigExample-V4Miniscope-plus-2-WebCams.json b/My User Configs/UserConfigExample-V4Miniscope-plus-2-WebCams.json new file mode 100644 index 0000000..d7a9d56 --- /dev/null +++ b/My User Configs/UserConfigExample-V4Miniscope-plus-2-WebCams.json @@ -0,0 +1,142 @@ +{ + "dataDirectory": "C:/FILL/OUT/THIS/PATH", + "directoryStructure": [ + "researcherName", + "experimentName", + "animalName", + "customEntry0", + "date", + "time" + ], + "researcherName": "Dr_Miniscope", + "experimentName": "Experiment0", + "animalName": "Fully Ball", + "customEntry0": "customEntValHere", + + "recordLengthinSeconds": 600, + + "executableOnStartRecording": { + "enabled": false, + "filePath": "C:/FILL/OUT/THIS/PATH.exe", + "arguments": ["arg1", "arg2"] + }, + "executableOnStopRecording": { + "enabled": false, + "filePath": "C:/FILL/OUT/THIS/PATH.exe", + "arguments": ["arg1", "arg2", "arg3"] + }, + + "COMMENT_behaviorTracker": "The behavior tracker is currently in beta testing. It requires you to have a functional Python environment with DeepLabCut-Live setup.", + "COMMENT_behaviorTracker2": "For info on setting up DLC-Live go here, https://github.com/DeepLabCut/DeepLabCut-live", + "COMMENT_behaviorTracker3": "Currently only the type of 'DeepLabCut-Live' is supported. You need to provide an absolute path to your Pythong environment and DLC model.", + "COMMENT_behaviorTracker4": "If you don't to use the behaviorTracker either remove this section or set 'enabled' to false. More info can be found in the primary user config example file.", + "behaviorTracker": { + "enabled": false, + "type": "DeepLabCut-Live", + "pyEnvPath": "C:/PATH/TO/ENV", + "modelPath": "C:/PATH/TO/DLC/MODEL", + "resize": 0.5, + "pCutoffDisplay": 0.3, + "windowX": 200, + "windowY": 100, + "windowScale": 0.75, + "occupancyPlot": { + "enabled": true, + "numBinsX": 100, + "numBinsY": 100, + "poseIdxToUse": [0, 1, 2, 3, 4] + }, + + "poseIdxForTraceDisplay": ["0wh", "1w", "2w"], + + "poseOverlay": { + "enabled": true, + "COMMENT": "Cant be 'point','line',or 'ribbon.", + "type": "point", + "numOfPastPoses": 6, + "markerSize": 20, + "skeleton": { + "enabled": true, + "connectedIndices": [ + [0, 1, 2, 3, 4, 5], + [6, 7, 8, 9, 10, 11], + [12, 13] + ] + } + } + }, + + "traceDisplay": { + "enabled": true, + "type": "scrolling", + "windowX": 100, + "windowY": 100, + "windowWidth": 600, + "windowHeight": 800 + }, + + "devices": { + "miniscopes": { + "My V4 Miniscope": { + "deviceType": "Miniscope_V4_BNO", + "headOrientation": { + "enabled": true, + "filterBadData": true, + "plotTrace": ["roll", "pitch", "yaw"] + }, + "COMMENT": "Change the deviceID to match the input number of your Miniscope.", + "deviceID": 1, + "showSaturation": true, + "ROI": { + "leftEdge": 0, + "topEdge": 0, + "width": 600, + "height": 600 + }, + "compression": "FFV1", + "framesPerFile": 1000, + "windowScale": 0.75, + "windowX": 800, + "windowY": 100, + "gain": "Low", + "ewl": 50, + "led0": 10, + "frameRate": "20FPS" + } + }, + "cameras": { + "My First WebCam":{ + "deviceType": "WebCam", + "deviceID": 0, + "showSaturation": true, + "ROI": { + "leftEdge": 0, + "topEdge": 0, + "width": 640, + "height": 480 + }, + "compression": "MJPG", + "framesPerFile": 1000, + "windowScale": 0.5, + "windowX": 800, + "windowY": 600 + }, + "My Second WebCam":{ + "deviceType": "Minicam-Mono-XGA", + "deviceID": 2, + "showSaturation": true, + "ROI": { + "leftEdge": 0, + "topEdge": 0, + "width": 640, + "height": 480 + }, + "compression": "MJPG", + "framesPerFile": 1000, + "windowScale": 0.5, + "windowX": 800, + "windowY": 600 + } + } + } +} diff --git a/userConfigs/UserConfigExample.json b/My User Configs/UserConfigExample.json similarity index 100% rename from userConfigs/UserConfigExample.json rename to My User Configs/UserConfigExample.json diff --git a/userConfigs/UserConfigExample_Dual_MiniCAM.json b/My User Configs/UserConfigExample_Dual_MiniCAM.json similarity index 100% rename from userConfigs/UserConfigExample_Dual_MiniCAM.json rename to My User Configs/UserConfigExample_Dual_MiniCAM.json diff --git a/userConfigs/UserConfigExample_Dual_MiniCAM_PLUS_V4.json b/My User Configs/UserConfigExample_Dual_MiniCAM_PLUS_V4.json similarity index 100% rename from userConfigs/UserConfigExample_Dual_MiniCAM_PLUS_V4.json rename to My User Configs/UserConfigExample_Dual_MiniCAM_PLUS_V4.json diff --git a/userConfigs/UserConfigExample_MiniCAM_DLC_Trace.json b/My User Configs/UserConfigExample_MiniCAM_DLC_Trace.json similarity index 100% rename from userConfigs/UserConfigExample_MiniCAM_DLC_Trace.json rename to My User Configs/UserConfigExample_MiniCAM_DLC_Trace.json diff --git a/userConfigs/UserConfigExample_MiniLFM.json b/My User Configs/UserConfigExample_MiniLFM.json similarity index 100% rename from userConfigs/UserConfigExample_MiniLFM.json rename to My User Configs/UserConfigExample_MiniLFM.json diff --git a/userConfigs/UserConfigExample_V3_Miniscope.json b/My User Configs/UserConfigExample_V3_Miniscope.json similarity index 100% rename from userConfigs/UserConfigExample_V3_Miniscope.json rename to My User Configs/UserConfigExample_V3_Miniscope.json diff --git a/userConfigs/UserConfigExample_V3_Miniscope_Plus_BehavCam.json b/My User Configs/UserConfigExample_V3_Miniscope_Plus_BehavCam.json similarity index 100% rename from userConfigs/UserConfigExample_V3_Miniscope_Plus_BehavCam.json rename to My User Configs/UserConfigExample_V3_Miniscope_Plus_BehavCam.json diff --git a/userConfigs/UserConfigExample_V4_2C_Miniscope.json b/My User Configs/UserConfigExample_V4_2C_Miniscope.json similarity index 100% rename from userConfigs/UserConfigExample_V4_2C_Miniscope.json rename to My User Configs/UserConfigExample_V4_2C_Miniscope.json diff --git a/userConfigs/UserConfigExample_V4_BNO_Miniscope.json b/My User Configs/UserConfigExample_V4_BNO_Miniscope.json similarity index 100% rename from userConfigs/UserConfigExample_V4_BNO_Miniscope.json rename to My User Configs/UserConfigExample_V4_BNO_Miniscope.json diff --git a/userConfigs/UserConfigExample_V4_BNO_Miniscope_traceDisplay - Copy.json b/My User Configs/UserConfigExample_V4_BNO_Miniscope_traceDisplay - Copy.json similarity index 100% rename from userConfigs/UserConfigExample_V4_BNO_Miniscope_traceDisplay - Copy.json rename to My User Configs/UserConfigExample_V4_BNO_Miniscope_traceDisplay - Copy.json diff --git a/userConfigs/UserConfigExample_V4_BNO_Plus_BehavCam.json b/My User Configs/UserConfigExample_V4_BNO_Plus_BehavCam.json similarity index 100% rename from userConfigs/UserConfigExample_V4_BNO_Plus_BehavCam.json rename to My User Configs/UserConfigExample_V4_BNO_Plus_BehavCam.json diff --git a/userConfigs/UserConfigExample_V4_Playback_traceDisplay.json b/My User Configs/UserConfigExample_V4_Playback_traceDisplay.json similarity index 100% rename from userConfigs/UserConfigExample_V4_Playback_traceDisplay.json rename to My User Configs/UserConfigExample_V4_Playback_traceDisplay.json diff --git a/userConfigs/UserConfigExample_WebCam.json b/My User Configs/UserConfigExample_WebCam.json similarity index 100% rename from userConfigs/UserConfigExample_WebCam.json rename to My User Configs/UserConfigExample_WebCam.json diff --git a/userConfigs/UserConfigExample_WebCam_DLC_trace.json b/My User Configs/UserConfigExample_WebCam_DLC_trace.json similarity index 100% rename from userConfigs/UserConfigExample_WebCam_DLC_trace.json rename to My User Configs/UserConfigExample_WebCam_DLC_trace.json diff --git a/userConfigs/UserConfigExample_WebCam_V4_DLC_Trace.json b/My User Configs/UserConfigExample_WebCam_V4_DLC_Trace.json similarity index 100% rename from userConfigs/UserConfigExample_WebCam_V4_DLC_Trace.json rename to My User Configs/UserConfigExample_WebCam_V4_DLC_Trace.json diff --git a/userConfigs/UserConfigExample_WebCam_w_traceDisplay.json b/My User Configs/UserConfigExample_WebCam_w_traceDisplay.json similarity index 100% rename from userConfigs/UserConfigExample_WebCam_w_traceDisplay.json rename to My User Configs/UserConfigExample_WebCam_w_traceDisplay.json diff --git a/deviceConfigs/userConfigProps.json b/deviceConfigs/userConfigProps.json index a96c4d2..0eea511 100644 --- a/deviceConfigs/userConfigProps.json +++ b/deviceConfigs/userConfigProps.json @@ -25,6 +25,10 @@ }, "executableOnStartRecording": { + "enabled": { + "type": "Bool", + "tips": "This enables or disabled the .exe file from being called." + }, "filePath": { "type": "FilePath", "tips": "This is an absolute path to a .exe file you want to have executed at the start of recording. This is usually used to syncronize some third party hardware." @@ -35,6 +39,10 @@ } }, "executableOnStopRecording": { + "enabled": { + "type": "Bool", + "tips": "This enables or disabled the .exe file from being called." + }, "filePath": { "type": "FilePath", "tips": "This is an absolute path to a .exe file you want to have executed at the start of recording. This is usually used to syncronize some third party hardware." @@ -277,7 +285,7 @@ }, "compression": { "type": "String", - "tips": "Imaging data is save in .avi file format. You can choose what type of video compression to apply when saving data. 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. 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." + "tips": "Imaging data is save in .avi file format. You can choose what type of video compression to apply when saving data. A Lossly compression CODEC is generally fine for behavior video data. We like to use MJPG or XVID. When you start the software it will tell you all supported CODECs on your computer." }, "framesPerFile": { "type": "Integer", diff --git a/source/controlpanel.cpp b/source/controlpanel.cpp index df2dac7..2bfc8dd 100644 --- a/source/controlpanel.cpp +++ b/source/controlpanel.cpp @@ -127,11 +127,13 @@ void ControlPanel::onRecordActivated() if (m_userConfig.contains("executableOnStartRecording")) { // Lets setup a exe to execute exeInfo = m_userConfig["executableOnStartRecording"].toObject(); - argArray = m_userConfig["arguments"].toArray(); - for (int i=0; i < argArray.size(); i++) { - argList.append(argArray[i].toString()); + if (exeInfo["enabled"].toBool(true)) { + argArray = m_userConfig["arguments"].toArray(); + for (int i=0; i < argArray.size(); i++) { + argList.append(argArray[i].toString()); + } + QProcess::startDetached(exeInfo["filePath"].toString(""), argList); } - QProcess::startDetached(exeInfo["filePath"].toString(""), argList); } // Construct uc props that might have been changed by user @@ -162,11 +164,13 @@ void ControlPanel::onStopActivated() if (m_userConfig.contains("executableOnStopRecording")) { // Lets setup a exe to execute exeInfo = m_userConfig["executableOnStopRecording"].toObject(); - argArray = m_userConfig["arguments"].toArray(); - for (int i=0; i < argArray.size(); i++) { - argList.append(argArray[i].toString()); + if (exeInfo["enabled"].toBool(true)) { + argArray = m_userConfig["arguments"].toArray(); + for (int i=0; i < argArray.size(); i++) { + argList.append(argArray[i].toString()); + } + QProcess::startDetached(exeInfo["filePath"].toString(""), argList); } - QProcess::startDetached(exeInfo["filePath"].toString(""), argList); } recordStop(); diff --git a/source/tracedisplay.cpp b/source/tracedisplay.cpp index fbac478..b6e6f0a 100644 --- a/source/tracedisplay.cpp +++ b/source/tracedisplay.cpp @@ -84,7 +84,7 @@ TraceDisplay::TraceDisplay() // Initially sets x labels QList tempLabels; for (int i=0;i < 5; i++) { - tempLabels.append(QString::number(i ,'f',1) + "s"); + tempLabels.append(QString::number(i*2 ,'f',1) + "s"); } setXLabel(tempLabels); } diff --git a/userConfigs/UserConfigExample-V3-Miniscope-plus-WebCam.json b/userConfigs/UserConfigExample-V3-Miniscope-plus-WebCam.json new file mode 100644 index 0000000..47db40f --- /dev/null +++ b/userConfigs/UserConfigExample-V3-Miniscope-plus-WebCam.json @@ -0,0 +1,120 @@ +{ + "dataDirectory": "C:/FILL/OUT/THIS/PATH", + "directoryStructure": [ + "researcherName", + "experimentName", + "animalName", + "customEntry0", + "date", + "time" + ], + "researcherName": "Dr_Miniscope", + "experimentName": "Experiment0", + "animalName": "Fully Ball", + "customEntry0": "customEntValHere", + + "recordLengthinSeconds": 600, + + "executableOnStartRecording": { + "enabled": false, + "filePath": "C:/FILL/OUT/THIS/PATH.exe", + "arguments": ["arg1", "arg2"] + }, + "executableOnStopRecording": { + "enabled": false, + "filePath": "C:/FILL/OUT/THIS/PATH.exe", + "arguments": ["arg1", "arg2", "arg3"] + }, + + "COMMENT_behaviorTracker": "The behavior tracker is currently in beta testing. It requires you to have a functional Python environment with DeepLabCut-Live setup.", + "COMMENT_behaviorTracker2": "For info on setting up DLC-Live go here, https://github.com/DeepLabCut/DeepLabCut-live", + "COMMENT_behaviorTracker3": "Currently only the type of 'DeepLabCut-Live' is supported. You need to provide an absolute path to your Pythong environment and DLC model.", + "COMMENT_behaviorTracker4": "If you don't to use the behaviorTracker either remove this section or set 'enabled' to false. More info can be found in the primary user config example file.", + "behaviorTracker": { + "enabled": false, + "type": "DeepLabCut-Live", + "pyEnvPath": "C:/PATH/TO/ENV", + "modelPath": "C:/PATH/TO/DLC/MODEL", + "resize": 0.5, + "pCutoffDisplay": 0.3, + "windowX": 200, + "windowY": 100, + "windowScale": 0.75, + "occupancyPlot": { + "enabled": true, + "numBinsX": 100, + "numBinsY": 100, + "poseIdxToUse": [0, 1, 2, 3, 4] + }, + + "poseIdxForTraceDisplay": ["0wh", "1w", "2w"], + + "poseOverlay": { + "enabled": true, + "COMMENT": "Cant be 'point','line',or 'ribbon.", + "type": "point", + "numOfPastPoses": 6, + "markerSize": 20, + "skeleton": { + "enabled": true, + "connectedIndices": [ + [0, 1, 2, 3, 4, 5], + [6, 7, 8, 9, 10, 11], + [12, 13] + ] + } + } + }, + + "traceDisplay": { + "enabled": true, + "type": "scrolling", + "windowX": 100, + "windowY": 100, + "windowWidth": 600, + "windowHeight": 800 + }, + + "devices": { + "miniscopes": { + "My V4 Miniscope": { + "deviceType": "Miniscope_V3", + "COMMENT": "Change the deviceID to match the input number of your Miniscope.", + "deviceID": 1, + "showSaturation": true, + "ROI": { + "leftEdge": 0, + "topEdge": 0, + "width": 500, + "height": 300 + }, + "compression": "FFV1", + "framesPerFile": 1000, + "windowScale": 0.75, + "windowX": 800, + "windowY": 100, + "gain": "Low", + "led0": 10, + "frameRate": "20FPS" + } + }, + "cameras": { + "My WebCam":{ + "deviceType": "WebCam", + "deviceID": 0, + "showSaturation": true, + "ROI": { + "leftEdge": 0, + "topEdge": 0, + "width": 640, + "height": 480 + }, + "compression": "MJPG", + "framesPerFile": 1000, + "windowScale": 0.5, + "windowX": 800, + "windowY": 600 + } + } + } +} diff --git a/userConfigs/UserConfigExample-V4-Miniscope-plus-WebCam.json b/userConfigs/UserConfigExample-V4-Miniscope-plus-WebCam.json new file mode 100644 index 0000000..7dccaa1 --- /dev/null +++ b/userConfigs/UserConfigExample-V4-Miniscope-plus-WebCam.json @@ -0,0 +1,126 @@ +{ + "dataDirectory": "C:/FILL/OUT/THIS/PATH", + "directoryStructure": [ + "researcherName", + "experimentName", + "animalName", + "customEntry0", + "date", + "time" + ], + "researcherName": "Dr_Miniscope", + "experimentName": "Experiment0", + "animalName": "Fully Ball", + "customEntry0": "customEntValHere", + + "recordLengthinSeconds": 600, + + "executableOnStartRecording": { + "enabled": false, + "filePath": "C:/FILL/OUT/THIS/PATH.exe", + "arguments": ["arg1", "arg2"] + }, + "executableOnStopRecording": { + "enabled": false, + "filePath": "C:/FILL/OUT/THIS/PATH.exe", + "arguments": ["arg1", "arg2", "arg3"] + }, + + "COMMENT_behaviorTracker": "The behavior tracker is currently in beta testing. It requires you to have a functional Python environment with DeepLabCut-Live setup.", + "COMMENT_behaviorTracker2": "For info on setting up DLC-Live go here, https://github.com/DeepLabCut/DeepLabCut-live", + "COMMENT_behaviorTracker3": "Currently only the type of 'DeepLabCut-Live' is supported. You need to provide an absolute path to your Pythong environment and DLC model.", + "COMMENT_behaviorTracker4": "If you don't to use the behaviorTracker either remove this section or set 'enabled' to false. More info can be found in the primary user config example file.", + "behaviorTracker": { + "enabled": false, + "type": "DeepLabCut-Live", + "pyEnvPath": "C:/PATH/TO/ENV", + "modelPath": "C:/PATH/TO/DLC/MODEL", + "resize": 0.5, + "pCutoffDisplay": 0.3, + "windowX": 200, + "windowY": 100, + "windowScale": 0.75, + "occupancyPlot": { + "enabled": true, + "numBinsX": 100, + "numBinsY": 100, + "poseIdxToUse": [0, 1, 2, 3, 4] + }, + + "poseIdxForTraceDisplay": ["0wh", "1w", "2w"], + + "poseOverlay": { + "enabled": true, + "COMMENT": "Cant be 'point','line',or 'ribbon.", + "type": "point", + "numOfPastPoses": 6, + "markerSize": 20, + "skeleton": { + "enabled": true, + "connectedIndices": [ + [0, 1, 2, 3, 4, 5], + [6, 7, 8, 9, 10, 11], + [12, 13] + ] + } + } + }, + + "traceDisplay": { + "enabled": true, + "type": "scrolling", + "windowX": 100, + "windowY": 100, + "windowWidth": 600, + "windowHeight": 800 + }, + + "devices": { + "miniscopes": { + "My V4 Miniscope": { + "deviceType": "Miniscope_V4_BNO", + "headOrientation": { + "enabled": true, + "filterBadData": true, + "plotTrace": ["roll", "pitch", "yaw"] + }, + "COMMENT": "Change the deviceID to match the input number of your Miniscope.", + "deviceID": 1, + "showSaturation": true, + "ROI": { + "leftEdge": 0, + "topEdge": 0, + "width": 600, + "height": 600 + }, + "compression": "FFV1", + "framesPerFile": 1000, + "windowScale": 0.75, + "windowX": 800, + "windowY": 100, + "gain": "Low", + "ewl": 50, + "led0": 10, + "frameRate": "20FPS" + } + }, + "cameras": { + "My WebCam":{ + "deviceType": "WebCam", + "deviceID": 0, + "showSaturation": true, + "ROI": { + "leftEdge": 0, + "topEdge": 0, + "width": 640, + "height": 480 + }, + "compression": "MJPG", + "framesPerFile": 1000, + "windowScale": 0.75, + "windowX": 800, + "windowY": 600 + } + } + } +} diff --git a/userConfigs/UserConfigExample-V4Miniscope-plus-2-WebCams.json b/userConfigs/UserConfigExample-V4Miniscope-plus-2-WebCams.json new file mode 100644 index 0000000..0c9dc17 --- /dev/null +++ b/userConfigs/UserConfigExample-V4Miniscope-plus-2-WebCams.json @@ -0,0 +1,142 @@ +{ + "dataDirectory": "C:/FILL/OUT/THIS/PATH", + "directoryStructure": [ + "researcherName", + "experimentName", + "animalName", + "customEntry0", + "date", + "time" + ], + "researcherName": "Dr_Miniscope", + "experimentName": "Experiment0", + "animalName": "Fully Ball", + "customEntry0": "customEntValHere", + + "recordLengthinSeconds": 600, + + "executableOnStartRecording": { + "enabled": false, + "filePath": "C:/FILL/OUT/THIS/PATH.exe", + "arguments": ["arg1", "arg2"] + }, + "executableOnStopRecording": { + "enabled": false, + "filePath": "C:/FILL/OUT/THIS/PATH.exe", + "arguments": ["arg1", "arg2", "arg3"] + }, + + "COMMENT_behaviorTracker": "The behavior tracker is currently in beta testing. It requires you to have a functional Python environment with DeepLabCut-Live setup.", + "COMMENT_behaviorTracker2": "For info on setting up DLC-Live go here, https://github.com/DeepLabCut/DeepLabCut-live", + "COMMENT_behaviorTracker3": "Currently only the type of 'DeepLabCut-Live' is supported. You need to provide an absolute path to your Pythong environment and DLC model.", + "COMMENT_behaviorTracker4": "If you don't to use the behaviorTracker either remove this section or set 'enabled' to false. More info can be found in the primary user config example file.", + "behaviorTracker": { + "enabled": false, + "type": "DeepLabCut-Live", + "pyEnvPath": "C:/PATH/TO/ENV", + "modelPath": "C:/PATH/TO/DLC/MODEL", + "resize": 0.5, + "pCutoffDisplay": 0.3, + "windowX": 200, + "windowY": 100, + "windowScale": 0.75, + "occupancyPlot": { + "enabled": true, + "numBinsX": 100, + "numBinsY": 100, + "poseIdxToUse": [0, 1, 2, 3, 4] + }, + + "poseIdxForTraceDisplay": ["0wh", "1w", "2w"], + + "poseOverlay": { + "enabled": true, + "COMMENT": "Cant be 'point','line',or 'ribbon.", + "type": "point", + "numOfPastPoses": 6, + "markerSize": 20, + "skeleton": { + "enabled": true, + "connectedIndices": [ + [0, 1, 2, 3, 4, 5], + [6, 7, 8, 9, 10, 11], + [12, 13] + ] + } + } + }, + + "traceDisplay": { + "enabled": true, + "type": "scrolling", + "windowX": 100, + "windowY": 100, + "windowWidth": 600, + "windowHeight": 800 + }, + + "devices": { + "miniscopes": { + "My V4 Miniscope": { + "deviceType": "Miniscope_V4_BNO", + "headOrientation": { + "enabled": true, + "filterBadData": true, + "plotTrace": ["roll", "pitch", "yaw"] + }, + "COMMENT": "Change the deviceID to match the input number of your Miniscope.", + "deviceID": 2, + "showSaturation": true, + "ROI": { + "leftEdge": 0, + "topEdge": 0, + "width": 600, + "height": 600 + }, + "compression": "FFV1", + "framesPerFile": 1000, + "windowScale": 0.75, + "windowX": 800, + "windowY": 100, + "gain": "Low", + "ewl": 50, + "led0": 10, + "frameRate": "20FPS" + } + }, + "cameras": { + "My First WebCam":{ + "deviceType": "WebCam", + "deviceID": 0, + "showSaturation": true, + "ROI": { + "leftEdge": 0, + "topEdge": 0, + "width": 640, + "height": 480 + }, + "compression": "MJPG", + "framesPerFile": 1000, + "windowScale": 0.75, + "windowX": 700, + "windowY": 600 + }, + "My Second WebCam":{ + "deviceType": "WebCam", + "deviceID": 1, + "showSaturation": true, + "ROI": { + "leftEdge": 0, + "topEdge": 0, + "width": 640, + "height": 480 + }, + "compression": "MJPG", + "framesPerFile": 1000, + "windowScale": 0.75, + "windowX": 900, + "windowY": 600 + } + } + } +} diff --git a/userConfigs/UserConfigExample-primary.json b/userConfigs/UserConfigExample-primary.json new file mode 100644 index 0000000..bbf20fd --- /dev/null +++ b/userConfigs/UserConfigExample-primary.json @@ -0,0 +1,177 @@ +{ + "COMMENT": "This JSON file can be used as a template to build your own user config file for the Miniscope Software.", + "COMMENT2": "Keys with 'COMMENT' in their name are ignored by the software and are here to guide you through making a user config file.", + "COMMENT3": "Once you select or drag&drop a user configuration file into the main window of the software, you will also be able to edit it and see tips.", + + "COMMENT_dataDirectory": "This will be the base folder for your Miniscope recordings. It should be an absolute path using forward slashes /", + "dataDirectory": "C:/FILL/OUT/THIS/PATH", + + "COMMENT_directoryStructure": "When you start a recording the software will construct a folder structure for your experiment. This will be built in the dataDirectory location using the list of keys in directoryStructure.", + "COMMENT_directoryStructure2": "Each key listed in directoryStructure should be defined as well with its corresponding value. You can add your own keys as well.", + "COMMENT_directoryStructure3": "The data and time keys should not have values assigned to them as they will be populated with the recording data and time when you hit record in the software.", + "directoryStructure": [ + "researcherName", + "experimentName", + "animalName", + "customEntry0", + "date", + "time" + ], + "researcherName": "Dr_Miniscope", + "experimentName": "Experiment0", + "animalName": "Fully Ball", + "customEntry0": "customEntValHere", + + "COMMENT_recordLengthinSeconds": "Set this to 0 if you want to manually stop recordings. Any positive number will automatically stop recording at that number of seconds.", + "recordLengthinSeconds": 600, + + "COMMENT_executables": "The 2 sections below allow you to execute an external .exe file on recording start and stop. The 'filePath' is the absolute path to the .exe file. ", + "executableOnStartRecording": { + "enabled": true, + "filePath": "C:/FILL/OUT/THIS/PATH", + "arguments": ["arg1", "arg2"] + }, + "executableOnStopRecording": { + "enabled": true, + "filePath": "C:/FILL/OUT/THIS/PATH", + "arguments": ["arg1", "arg2", "arg3"] + }, + + "COMMENT_behaviorTracker": "The behavior tracker is currently in beta testing. It requires you to have a functional Python environment with DeepLabCut-Live setup.", + "COMMENT_behaviorTracker2": "For info on setting up DLC-Live go here, https://github.com/DeepLabCut/DeepLabCut-live", + "COMMENT_behaviorTracker3": "Currently only the type of 'DeepLabCut-Live' is supported. You need to provide an absolute path to your Pythong environment and DLC model.", + "COMMENT_behaviorTracker4": "If you don't to use the behaviorTracker either remove this section or set 'enabled' to false.", + "behaviorTracker": { + "enabled": false, + "type": "DeepLabCut-Live", + "COMMENT_pyEnvPath": "This should be the absolute path to the base folder of your Pythong environment that can successfully run DLC-Live.", + "COMMENT_pyEnvPath2": "The Miniscope Software initially checks this folder to make sure it contains this exact subfolder, '/Lib/site-packages/dlclive'", + "pyEnvPath": "ABSOLUTE/PATH/TO/PYTHON/ENVIRONMENT", + "modelPath": "ABSOLUTE/PATH/TO/DLC/MODEL", + "COMMENT_resize": "resize will scale the behavior video for DLC-Live. This should be 1 or less. If DLC is running slow you should consider using a smaller resize value.", + "resize": 1, + "COMMENT_pCutoffDisplay": "All DLC pose data will be recording but this pCufOff will set the minimum p value for data to be plotted.", + "pCutoffDisplay": 0.3, + "COMMENT_window": "These 'window' keys affect just the display of the behavior tracker. Set these to fit well within the rest of the GUI.", + "windowX": 200, + "windowY": 100, + "windowScale": 0.75, + "COMMENT_occupancyPlot": "If you want an inset showing animal coverage across the environment set enabled to true.", + "COMMENT_occupancyPlot2": "This will plot the log of a 2D occupancy histogram in the upper right corner of the behavior tracker window.", + "occupancyPlot": { + "enabled": true, + "COMMENT_numBins": "numBins X and Y are the number of spatial bins the behavior camera will be divided into for the occupancy plot.", + "numBinsX": 100, + "numBinsY": 100, + "COMMENT_poseIdxToUse": "The occupancy plotter will take the mean position of the DLC pose indices listed here. It also requires the p value of these to be above the cutoff above to be used in the mean for each frame.", + "poseIdxToUse": [0, 1, 2, 3, 4] + }, + "COMMENT_poseIdxForTraceDisplay": "This array will setup time trace plotting for specific pose indices. You must give it a the index number along with 'w', 'h', or 'wh'.", + "COMMENT_poseIdxForTraceDisplay2": "'w' means it will plot the width or x position. 'h' means it will plot the height or y position.", + "poseIdxForTraceDisplay": ["0wh", "1w", "2w"], + "COMMENT_poseOverlay": "This section enables and sets up the overlaying of pose data on top of the behavior tracker window.", + "poseOverlay": { + "enabled": true, + "COMMENT_type": "type defines how the pose data will be shown. The allowable vales are 'point', 'line', 'ribbon", + "type": "point", + "COMMENT_numOfPastPoses": "The overlay can display recent past positions of joints and fade them out as time goes one. This value sets how many past poses to display in the overlay.", + "numOfPastPoses": 6, + "COMMENT_markerSize": "The markerSize sets how large the points, lines, or ribbons in the overlay will be. Reasonable values are between 3 and 20.", + "markerSize": 20, + "COMMENT_skeleton": "You can enable the below 'skekelton' section if you want to also overlay a skeleton that connects certain pose indices or joints.", + "skeleton": { + "enabled": true, + "COMMENT_connectedIndices": "This is an array of arrays. Each internal array defines the set of connected pose indices or joints to be displayed.", + "connectedIndices": [ + [0, 1, 2, 3, 4, 5], + [6, 7, 8, 9, 10, 11], + [12, 13] + ] + } + } + }, + + "COMMENT_traceDisplay": "traceDisplay defines the parameters for the real-time time trace display. Delete this section or set enabled to false to turn off trace plotting.", + "COMMENT_traceDisplay2": "Currently only the type of 'scrolling' is implemented. The 'window' parameters set up the size and location of the trace display.", + "traceDisplay": { + "enabled": true, + "type": "scrolling", + "windowX": 100, + "windowY": 100, + "windowWidth": 600, + "windowHeight": 800 + }, + + "COMMENT_devices": "'devices' defines all input and output devices to the software.", + "COMMENT_devices2": "The currently supported 'deviceType' can be found in the deviceConfigs/videoDevices.json file and also are displayed in the main window of the software when first loaded.", + "devices": { + "COMMENT_miniscopes": "This is a JSON object of miniscopes along with their parameters. Generally you will only have 1 entry here.", + "miniscopes": { + "miniscopeDeviceName": { + "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": 1, + "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": 0.75, + "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" + } + }, + "COMMENT_cameras": "This is an array of the behavioral cameras along with their parameters. Look at the comments above for Miniscope as these are the same for cameras.", + "cameras": { + "cameraDeviceName":{ + "COMMENT_deviceType": "Supported types include 'WebCam', 'WebCam-320x240','WebCam-640x480','WebCam-1280x720'.", + "COMMENT_deviceType2": "If your behavior camera supports other resolutions you want to use you can add a new entry for it in deviceConfigs/videoDevices.json", + "deviceType": "WebCam-640x480", + "deviceID": 0, + "showSaturation": true, + "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": 640, + "height": 480 + }, + "cameraCalibrationFileLocation": "", + "COMMENT_compression": "A Lossly compression CODEC is generally fine for behavior video data. We like to use MJPG or XVID. When you start the software it will tell you all supported CODECs on your computer.", + "compression": "MJPG", + "framesPerFile": 1000, + "windowScale": 0.5, + "windowX": 800, + "windowY": 600 + } + } + } +}