Skip to content

Commit

Permalink
Merge pull request #740 from int-brain-lab/iblrigv8dev
Browse files Browse the repository at this point in the history
8.25.0
  • Loading branch information
bimac authored Nov 15, 2024
2 parents 6671d7b + 5ad937d commit 51f0ef2
Show file tree
Hide file tree
Showing 20 changed files with 1,284 additions and 420 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
Changelog
=========

8.25.0
------
* feature: fiber photometry loader
* feature: dataframe converter for Bpod session data
* removed: remaining tkinter dialogs

8.24.7
------
* fix: debiasing not working in trainingCW
Expand Down
140 changes: 140 additions & 0 deletions devices/neurophotometrics/FP3002_digital_inputs.bonsai
Original file line number Diff line number Diff line change
@@ -0,0 +1,140 @@
<?xml version="1.0" encoding="utf-8"?>
<WorkflowBuilder Version="2.8.2"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:p1="clr-namespace:Neurophotometrics.V2;assembly=Neurophotometrics"
xmlns:io="clr-namespace:Bonsai.IO;assembly=Bonsai.System"
xmlns="https://bonsai-rx.org/2018/workflow">
<Workflow>
<Nodes>
<Expression xsi:type="ExternalizedMapping">
<Property Name="PortName" DisplayName="PortName" />
</Expression>
<Expression xsi:type="Combinator">
<Combinator xsi:type="p1:FP3002">
<p1:AcquisitionMode>StartPhotometry</p1:AcquisitionMode>
<p1:PortName>COM4</p1:PortName>
<p1:Regions>
<p1:PhotometryRegion>
<p1:Index>0</p1:Index>
<p1:Channel>Green</p1:Channel>
<p1:Rectangle>
<p1:Location>
<p1:X>824</p1:X>
<p1:Y>492</p1:Y>
</p1:Location>
<p1:Size>
<p1:Width>166</p1:Width>
<p1:Height>180</p1:Height>
</p1:Size>
<p1:X>824</p1:X>
<p1:Y>492</p1:Y>
<p1:Width>166</p1:Width>
<p1:Height>180</p1:Height>
</p1:Rectangle>
<p1:Name>G0</p1:Name>
</p1:PhotometryRegion>
<p1:PhotometryRegion>
<p1:Index>1</p1:Index>
<p1:Channel>Green</p1:Channel>
<p1:Rectangle>
<p1:Location>
<p1:X>703</p1:X>
<p1:Y>353</p1:Y>
</p1:Location>
<p1:Size>
<p1:Width>154</p1:Width>
<p1:Height>180</p1:Height>
</p1:Size>
<p1:X>703</p1:X>
<p1:Y>353</p1:Y>
<p1:Width>154</p1:Width>
<p1:Height>180</p1:Height>
</p1:Rectangle>
<p1:Name>G1</p1:Name>
</p1:PhotometryRegion>
<p1:PhotometryRegion>
<p1:Index>2</p1:Index>
<p1:Channel>Green</p1:Channel>
<p1:Rectangle>
<p1:Location>
<p1:X>943</p1:X>
<p1:Y>134</p1:Y>
</p1:Location>
<p1:Size>
<p1:Width>180</p1:Width>
<p1:Height>176</p1:Height>
</p1:Size>
<p1:X>943</p1:X>
<p1:Y>134</p1:Y>
<p1:Width>180</p1:Width>
<p1:Height>176</p1:Height>
</p1:Rectangle>
<p1:Name>G2</p1:Name>
</p1:PhotometryRegion>
<p1:PhotometryRegion>
<p1:Index>3</p1:Index>
<p1:Channel>Green</p1:Channel>
<p1:Rectangle>
<p1:Location>
<p1:X>767</p1:X>
<p1:Y>180</p1:Y>
</p1:Location>
<p1:Size>
<p1:Width>176</p1:Width>
<p1:Height>182</p1:Height>
</p1:Size>
<p1:X>767</p1:X>
<p1:Y>180</p1:Y>
<p1:Width>176</p1:Width>
<p1:Height>182</p1:Height>
</p1:Rectangle>
<p1:Name>G3</p1:Name>
</p1:PhotometryRegion>
</p1:Regions>
</Combinator>
</Expression>
<Expression xsi:type="Combinator">
<Combinator xsi:type="p1:PhotometryData" />
</Expression>
<Expression xsi:type="ExternalizedMapping">
<Property Name="FileName" DisplayName="FileNamePhotometry" />
</Expression>
<Expression xsi:type="Combinator">
<Combinator xsi:type="p1:PhotometryWriter">
<p1:IncludeRegions>false</p1:IncludeRegions>
<p1:IncludePlots>false</p1:IncludePlots>
<p1:IncludeVideo>false</p1:IncludeVideo>
<p1:FileName>D:\iblrigv8_data\neurophotometrics\2024-10-10\T142948\raw_photometry.csv</p1:FileName>
<p1:Suffix>None</p1:Suffix>
</Combinator>
</Expression>
<Expression xsi:type="Combinator">
<Combinator xsi:type="p1:DigitalIOs">
<p1:Input0>true</p1:Input0>
<p1:Input1>true</p1:Input1>
<p1:Output0>false</p1:Output0>
<p1:Output1>false</p1:Output1>
</Combinator>
</Expression>
<Expression xsi:type="ExternalizedMapping">
<Property Name="FileName" DisplayName="FileNameDigitalInput" />
</Expression>
<Expression xsi:type="io:CsvWriter">
<io:FileName>D:\iblrigv8_data\neurophotometrics\2024-10-10\T142948\digital_inputs.csv</io:FileName>
<io:Append>false</io:Append>
<io:Overwrite>false</io:Overwrite>
<io:Suffix>None</io:Suffix>
<io:IncludeHeader>false</io:IncludeHeader>
</Expression>
</Nodes>
<Edges>
<Edge From="0" To="1" Label="Source1" />
<Edge From="1" To="2" Label="Source1" />
<Edge From="1" To="5" Label="Source1" />
<Edge From="2" To="4" Label="Source1" />
<Edge From="3" To="4" Label="Source2" />
<Edge From="5" To="7" Label="Source1" />
<Edge From="6" To="7" Label="Source2" />
</Edges>
</Workflow>
</WorkflowBuilder>
101 changes: 101 additions & 0 deletions devices/neurophotometrics/FP3002_digital_inputs.bonsai.layout
Original file line number Diff line number Diff line change
@@ -0,0 +1,101 @@
<?xml version="1.0" encoding="utf-8"?>
<VisualizerLayout xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
>
<DialogSettings>
<Visible>false</Visible>
<Location>
<X>0</X>
<Y>0</Y>
</Location>
<Size>
<Width>0</Width>
<Height>0</Height>
</Size>
<WindowState>Normal</WindowState>
</DialogSettings>
<DialogSettings>
<Visible>false</Visible>
<Location>
<X>0</X>
<Y>0</Y>
</Location>
<Size>
<Width>0</Width>
<Height>0</Height>
</Size>
<WindowState>Normal</WindowState>
</DialogSettings>
<DialogSettings>
<Visible>false</Visible>
<Location>
<X>0</X>
<Y>0</Y>
</Location>
<Size>
<Width>0</Width>
<Height>0</Height>
</Size>
<WindowState>Normal</WindowState>
</DialogSettings>
<DialogSettings>
<Visible>false</Visible>
<Location>
<X>0</X>
<Y>0</Y>
</Location>
<Size>
<Width>0</Width>
<Height>0</Height>
</Size>
<WindowState>Normal</WindowState>
</DialogSettings>
<DialogSettings>
<Visible>false</Visible>
<Location>
<X>0</X>
<Y>0</Y>
</Location>
<Size>
<Width>0</Width>
<Height>0</Height>
</Size>
<WindowState>Normal</WindowState>
</DialogSettings>
<DialogSettings>
<Visible>false</Visible>
<Location>
<X>0</X>
<Y>0</Y>
</Location>
<Size>
<Width>0</Width>
<Height>0</Height>
</Size>
<WindowState>Normal</WindowState>
</DialogSettings>
<DialogSettings>
<Visible>false</Visible>
<Location>
<X>0</X>
<Y>0</Y>
</Location>
<Size>
<Width>0</Width>
<Height>0</Height>
</Size>
<WindowState>Normal</WindowState>
</DialogSettings>
<DialogSettings>
<Visible>false</Visible>
<Location>
<X>0</X>
<Y>0</Y>
</Location>
<Size>
<Width>0</Width>
<Height>0</Height>
</Size>
<WindowState>Normal</WindowState>
</DialogSettings>
</VisualizerLayout>
13 changes: 13 additions & 0 deletions devices/neurophotometrics/_neurophotometrics_fpData.channels.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
Condition,No LED ON,L415,L470,L560
No additional signal,0,1,2,4
Output 1 signal HIGH,8,9,10,12
Output 0 signal HIGH,16,17,18,20
Stimulation ON,32,33,34,36
GPIO Line 2 HIGH,64,65,66,68
GPIO Line 3 HIGH,128,129,130,132
Input 1 HIGH,256,257,258,260
Input 0 HIGH,512,513,514,516
Output 0 signal HIGH + Stimulation,48,49,50,52
Output 0 signal HIGH + Input 0 signal HIGH,528,529,530,532
Input 0 signal HIGH + Stimulation,544,545,546,548
Output 0 HIGH + Input 0 HIGH + Stimulation,560,561,562,564
68 changes: 68 additions & 0 deletions docs/source/usage_neurophotometrics.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
Neurophotometrics recording with iblrigv8
=========================================

This document describes how to use the iblrigv8 software to record Photometry using Neurophotometrics FP3002 system.

Setup
-----

- iblrigv8 is installed according to the instructions
- `settings/iblrig_settings.yaml` file is configured with the local folder and remote folder for the data transfer.
- `settings/hardware_settings.yaml` file is configured with the neurophotometrics device

.. code:: yaml
RIG_NAME: photometry
MAIN_SYNC: False
device_neurophotometrics:
DEVICE_MODEL: NP3002
BONSAI_EXECUTABLE: C:\Users\IBLuser\AppData\Local\Bonsai\Bonsai.exe
BONSAI_WORKFLOW: devices\neurophotometrics\FP3002.bonsai
COM_NEUROPHOTOMETRY: COM3
Starting a photometry recording
--------------------------------

- Start the Bonsai workflow by running the following command in powershell:
.. code:: powershell
cd C:\iblrigv8\
venv\scripts\Activate.ps1
start_neurophotometrics
- in Bonsai click on the FP3002 node and load the desired photometry settings file
- start the task

The photometry recording will start and the photometry data will be saved in the data local folder with the following stucture:
- {local_data_folder}\neurophotometrics\yyyy-mm-dd\THHMMSS
Where yyyy-mm-dd is the date of the recording and HHMMSS is the time of the recording.



Starting a photometry session
--------------------------------

- Start the Bonsai workflow by running the following command in powershell:
.. code:: powershell
cd C:\iblrigv8\
venv\scripts\Activate.ps1
start_photometry_session --subject=Mickey --roi G0 G1 --location NBM SI
Copy command
------------

Usage
~~~~~

To initiate the data transfer from the local server to the remote server, open a terminal and type.

.. code:: powershell
C:\iblrigv8\venv\scripts\Activate.ps1
transfer_data --tag photometry
The transfer local and remote directories are set in the
``iblrig/settings/iblrig_settings.py`` file.

2 changes: 1 addition & 1 deletion iblrig/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
# 5) git tag the release in accordance to the version number below (after merge!)
# >>> git tag 8.15.6
# >>> git push origin --tags
__version__ = '8.24.7'
__version__ = '8.25.0'


from iblrig.version_management import get_detailed_version_string
Expand Down
1 change: 0 additions & 1 deletion iblrig/base_choice_world.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
from pydantic import NonNegativeFloat, NonNegativeInt

import iblrig.base_tasks
import iblrig.graphic
from iblrig import choiceworld, misc
from iblrig.hardware import SOFTCODE
from iblrig.pydantic_definitions import TrialDataModel
Expand Down
Loading

0 comments on commit 51f0ef2

Please sign in to comment.