Skip to content

NINscope software

NINscope edited this page Dec 2, 2021 · 26 revisions

Hardware - Firmware - Software

Installation

Supported versions of Processing

We recommend using Processing version 3.5.4, which has been tested with NINscope. We have reports from users that encounter errors after installation of Processing 4. You can download Processing version 3.5.4 through the following links: Mac OS X | Linux 64-bit | Windows 64-bit | Windows 32-bit

Acquisition software - Data logging

Linux

Mac - Windows

  1. Download Processing from the website https://processing.org/download/.
  2. Install the G4P library. (Processing Menu: Sketch > Import Library... > Add Library...)
  3. Download the video library for NINscope here or alternatively here.
  4. Extract this to the processing libraries folder. (Location: /home/<username>/sketchbook/libraries)
  5. Connect the DAQ to your computer using the USB cable.
  6. Run the following command to load the driver for the serial port:

sudo modprobe usbserial vendor=0x04b4 product=0xf139

  1. Run the following command to grant processing permission to connect to the serial port. ( <username> = your linux username)

sudo chown <username> /dev/ttyUSB0

  1. Clone or download the NINscope folder from Github (https://github.com/ninscope/Software) and start the NINScope.pde sketch inside the folder.

Mac

Linux - Windows

Big Sur has introduced security measures to block third party apps and libraries that are needed to run the acquisition software. We are currently looking into a way to allow access to the required gstreamer libraries, but for now the latest version of MacOs is not supported.

Note that cameras have to be selected from a numbered list instead of by name as in Linux or under Windows since all video devices (including internal webcams) are detected as an enumerated list.

  1. Download Processing from the website https://processing.org/download/.
  2. Download the video library for NINscope here or alternatively here.
  3. Extract this to the Processing library folder. This folder will be generated after running Processing once. ( Location: /Users/<username>/Documents/Processing/libraries )
  4. Restart Processing.
  5. Install the G4P library. (Processing Menu: Sketch > Import Library... > Add Library...)
  6. Connect the DAQ to your computer using the USB cable.
  7. Clone or download the NINscope folder from Github (https://github.com/ninscope/Software) and start the NINScope.pde sketch inside the folder.

Windows

Linux - Mac

⚠️ For Windows 7 follow all steps, for Windows 10 start at step 15.

  1. Connect the DAQ to your computer using the USB cable.
  2. Open Windows Device Manager.
  3. A USB device with the name NINscope will appear in the tree under "Other devices".
  4. Right click NINscope and select "Update Driver Software...".

  1. Select "Browse my computer for driver software" in the next window.

  1. Then select "Let me pick from a......".

  1. Select "Show All Devices" and click on the "Next" button.

  1. Click on "Have Disk..". Browse to the folder containing the driver files. You can download these here: https://github.com/ninscope/Software/blob/master/WinDriver.zip and extract them to a local folder.

  1. Select the "CypressSerial.inf" file and select "USB to UART Adapter". Click Next.

  1. Click Yes to install even if Windows is not recommending it.

  1. A second Device will appear in the tree under "Other devices" named "Virtual Serial Port Device 00".

  1. This time install the driver the same but don't select "USB to UART Adapter" but "USB Serial Port".

  1. A new device will appear under "Ports" with the name "USB Serial Port (COM##).

  1. Remember the COM port # because you have to select it in the drop down menu of the application.

Once driver installation is complete on Windows 7 proceed with the following steps. If you use Windows 10 start below:

  1. Download Processing from the website https://processing.org/download/ and install.
  2. Download the video library for NINscope here or alternatively here.
  3. Extract this to the Processing library folder. Note that a Video folder will be generated in the Processing folder located in 'My Documents' the first time Processing is run. This folder needs to be overwritten with the downloaded Video library folder.
  4. Restart Processing.
  5. Install the G4P library. (Processing Menu: Sketch > Import Library... > Add Library...)
  6. Clone or download the NINscope folder from Github (https://github.com/ninscope/Software) and start the NINScope.pde sketch inside the folder after connecting NINscope to the DAQ box and the DAQ box to your computer.

We recommend turning off Windows 10 Real-Time protection as it causes a slow loading of the GUI


Acquisition Software

Data logging - Installation

Start software and connect a NINscope

The software is written in the Processing language and you can open and run a Processing "sketch" to operate NINscope after you have followed the instruction for software installation. You can also compile the sketch in Processing to create a standalone executable. The video below shows the opening of the sketch, a connection being made with a connected miniscope and the camera controls that can be set.

NINscope control software panning

Turn on / off the accelerometer and display x,y,z channels

The accelerometer is turned on or off in the software and the x,y,z channels are displayed 'realtime' in the GUI. The accelerometer data is logged to disk in a file named LogData.csv.

NINscope control software panning

Expand NINscope acquisition window, translate field-of-view and view pixel histogram

In the main control panel of NINscope acquisition software one can choose to display the connected miniscope in an expanded window. Once this window opens a cursor in a box at the bottom center of the window can be moved around to shift the field-of-view. This feature is useful if one wants to move away from blood vessels or shift the field to a region with more activity. There is also a check box to display a 'real-time' histogram of pixel intensity values.

NINscope control software panning

Settings panel

The settings panel is used to set the optogenetic stimulation parameters, let the NINscope wait for an active high trigger to record a set number of frames, or have NINscope collect a predefined number of frames without waiting for a trigger. If the trigger input is checked, NINscope will be waiting for an incoming 3.3V active high trigger that starts the acquisition (the manual acquisition button will disappear from the main GUI). Check the auto button for automatic stimulus. The stimulus will start after every recording with a delay set at "start delay".

⚠️ Please check the maximum current of the LED before setting the current. Combinations of resistance of the cable , the current of the excitation LED and the current of the stimulus LED may result in a voltage drop on the image sensor and will give visible lines in recordings.

NINscope control software panning

Detecting connected NINscopes

In the main window there is a 'Detect' button. This button serves to determine which NINscope is connected to which serial port. Hitting the button will let the indicator/tracking LED on top of the NINscope blink a number of times. This is useful when two scopes are connected and one has to determine which scope is connected to which serial port.

NINscope control software panning

Example of NINscope use with 2 NINscopes, 1 webcam

Below an example of a recording in which 2 NINscopes were mounted, the accelerometer was switched on and the webcam connected.

NINscope control software panning

Data logging

Acquisition software - Installation

💾 Data folder structure and data logs

When one starts data acquisition, a root folder is created with the current date. In this root folder, a subfolder is created for every subsequent acquisition. The name of the subfolder is Rec_hh_mm_ss (where hh: hours, mm: minutes, ss: seconds). Inside this subfolder, for each connected scope another subfolder is created (listed as Scope1, or Scope2, or Behaviour (the USB webcam data)). The scope folder contains 8-bit grayscale numbered tiffs with minimal headers. The file LogData.csv is also stored and contains 6 columns (frame #, sample # collected from accelerometer, x acceleration, y acceleration, z acceleration, presence (1) or absence (0) of optogenetic stimulation). There is also a TimeStamp.csv file that contains 3 columns (name of device, frame #, timestamp (ms)). Finally, a Notes.txt file exists to which comments can be appended during acquisition. An additional file with settings can be saved from within the NINscope acquisition software to load previously used settings. Snapshots will be saved in a dedicated 'Snapshots' folder.