Skip to content

Commit df8e366

Browse files
committed
hello world
0 parents  commit df8e366

File tree

9 files changed

+795
-0
lines changed

9 files changed

+795
-0
lines changed

LICENSE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2019 Mathis Lab
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

README.md

Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
<img src="https://images.squarespace-cdn.com/content/v1/57f6d51c9f74566f55ecf271/1564768953154-CH2E4W7M0ORYRGGZP0W0/ke17ZwdGBToddI8pDm48kHJH6WvD-K6SQJl_lpgiA4wUqsxRUqqbr1mOJYKfIPR7LoDQ9mXPOjoJoqy81S2I8N_N4V1vUb5AoIIIbLZhVYy7Mythp_T-mtop-vrsUOmeInPi9iDjx9w8K4ZfjXt2dtyDHbM6wOPdgJbmQh4Pb6c9D9xnXrxbqSawZVwoRTUNCjLISwBs8eEdxAxTptZAUg/Camera+Control-logo-black.png?format=1000w" width="450" title="camera control" alt="cam cntrl" align="center" vspace = "350">
2+
3+
4+
#### record video and system timestamps from Imaging Source USB3 cameras
5+
6+
Python GUI + scripts to record video sync'ed to behavior. Can record from multiple imaging source camera feeds while simultaneously grabbing system timestamps for each recorded frame. One can also record timestamps from one NIDAQ card signal to sync with a behavioral task (records timestamp on the rising edge of a TTL signal).
7+
8+
9+
This software package was written by [Gary Kane](https://github.com/gkane26), post-doctoral fellow @ the [Adaptive Motor Control Lab](https://github.com/AdaptiveMotorControlLab).
10+
11+
**Prerequisite Software:**
12+
1. Windows 10
13+
2. [Anaconda](https://www.anaconda.com/)
14+
3. [Git](https://gitforwindows.org/)
15+
16+
**Required Hardware:**
17+
1. [Imaging Source USB cameras](https://www.theimagingsource.com/)
18+
2. (Optional) NIDAQ card. Necessary to record timestamps from a behavioral task. Signal must be a TTL wired to digital input channel that is not dual-PFI (one that has hardware interrupt capabilities).
19+
20+
## Instructions for Installation:
21+
22+
1. Clone this repository. Open command prompt (type "cmd" into the search bar and hit enter), then type:<br/><br/>
23+
``git clone https://github.com/gkane26/camera_control``
24+
25+
2. Open the camera control directory, **right-click 'install1.bat' and select 'Run as administrator'**<br/><br/>
26+
This script will install imaging source libraries, ffmpeg for command prompt, and create a new conda environment 'camera27'. Upon completion, the window will close suddenly.
27+
28+
3. Run 'install2.bat'.<br/><br/>
29+
This script will finish setting up the conda environment and create a desktop shortcut to open the GUI.
30+
31+
4. Edit the 'write_camera_details.py' script according to your system's camera configuration. A template is provided (write_camera_details_TEMPLATE.py), please do not edit the template. The 'write_camera_details.py' script will write a dictionary to the file 'camera_details.json' containing the following fields:
32+
- a dictionary for each imaging source camera with the fields:
33+
- name = camera name
34+
- crop = cropping parameters
35+
- rotate = rotation angle of image
36+
- exposure = integer exposure values; can edit this in the GUI
37+
- output_dir = default directory to save videos; can edit this in the GUI
38+
- Example:
39+
40+
41+
cam_0 = {'name' : 'Cog Rig',
42+
'crop' : {'top' : 150, 'left' : 225, 'height' : 250, 'width' : 300},
43+
'rotate' : 0,
44+
'exposure' : -14,
45+
'output_dir' : 'C:/Users/user1/Desktop/video'}
46+
47+
48+
- subjects = a list of experimental subjects to select. Can be manually entered in GUI
49+
- labview = a list of labview channels to select, e.g. ['Dev1/port0/line0'] (optional). Can be manually entered in GUI <br/><br/>
50+
51+
52+
## To Run the Program:
53+
54+
Double click the cameraGUI.bat file on the Desktop or open command prompt, navigate to the camera_control directory, and run: ``python camera_control_GUI.py``
55+
56+
1. Select the number of cameras to record from
57+
2. Select and initialize each cameras
58+
3. Select subject, frame rate and output directory, then click 'Set Up Video'
59+
- Will default to the output directory from 'camera_details.json'
60+
- Drop down menus for subject and output directory are populated via 'camera_details.json'
61+
4. To start recording, click the On button. Recording can be turned Off/On multiple times -- frames, system timestamps, and timestamps from the nidaq card will be stored only when 'Record' is set to 'On'.
62+
5. Once finished recording, click 'Save Video', 'Compress & Save Video', or 'Delete Video'
63+
- 'Save Video' saves an .avi file using the DIVX codec to 'output_dir/CameraName_Subject_Date.avi' and timestamp files to 'output_dir/TIMESTAMPS_CameraName_Subject_Date.npy' and (if applicable) 'output_dir/LABVIEW_Subject_Date.npy'. There will be one timestamps file per camera, but only one labview timestamp file per session.
64+
- 'Compress & Save Video' saves as above, but also saves an .mp4 file using ffmpeg compression to 'output_dir/CameraName_Subject_Date.mp4'
65+
- 'Delete Video' will not save any videos of timestamp files. Preliminary video files will be deleted.
66+
6. To record more videos, return to step iii.
67+
68+
## LICENSE
69+
70+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
71+
IMPLIED. Please see [here](/LICENSE) for more information.

TISGrabberSetup_3.4.0.51.exe

2.17 MB
Binary file not shown.

0 commit comments

Comments
 (0)