cibrrig.gui

Attributes

brain_xyz_path

ba

DEFAULT_SUBJECTS_PATH

DEFAULT_ARCHIVE_PATH

DEFAULT_WORKING_PATH

OCCIPITAL_APEX

OCCIPITAL_NADIR

LAMBDA_IBL

PITCH_CORRECTION

COLORS

INSERTION_TYPES

DEFAULT_WIRING

POSSIBLE_WIRINGS

Classes

DirectorySelector

GUI to select paths for backup. Expands QWidget.

OptoFileFinder

Dialog box to select the opto_calibration.json file if it is not found

WiringEditor

Dialog box to select the wiring file

InsertionTableAppBase

NpxInsertionTableApp

OptoInsertionTableApp

NotesDialog

Functions

get_tip(x, y, z, d, phi, theta)

Ripped from iblatlas because we don't want to use the

insertion2IBL(df)

Convert insertion coordinates to IBL coordinates

convert2ccf(df)

Convert IBL coordinates to CCF coordinates

plot_probe_insertion(df, save_fn)

plot_probe_insertion_urchin(df, save_fn)

plot_probe_insertion_ibl(df, save_fn)

plot_insertion_layout(df, save_fn)

Module Contents

cibrrig.gui.brain_xyz_path[source]
cibrrig.gui.ba[source]
cibrrig.gui.DEFAULT_SUBJECTS_PATH[source]
cibrrig.gui.DEFAULT_ARCHIVE_PATH[source]
cibrrig.gui.DEFAULT_WORKING_PATH[source]
cibrrig.gui.OCCIPITAL_APEX[source]
cibrrig.gui.OCCIPITAL_NADIR[source]
cibrrig.gui.LAMBDA_IBL[source]
cibrrig.gui.PITCH_CORRECTION = 0[source]
cibrrig.gui.COLORS = ['#ff0000', '#00ff00', '#0000ff', '#ffff00', '#ff00ff', '#00ffff', '#ff8000', '#ff0080',...[source]
cibrrig.gui.INSERTION_TYPES = ['npx1.0', 'npx2.0', 'opto_200um', 'opto_400um', 'opto_600um'][source]
cibrrig.gui.DEFAULT_WIRING[source]
cibrrig.gui.POSSIBLE_WIRINGS[source]
cibrrig.gui.get_tip(x, y, z, d, phi, theta)[source]

Ripped from iblatlas because we don’t want to use the the atlas nor assume that the probe insertion point should be at the brain

cibrrig.gui.insertion2IBL(df)[source]

Convert insertion coordinates to IBL coordinates dataframe must have the following columns: - Insertion ML (microns) - Insertion AP (microns) - Insertion DV (microns) - Reference (“occipital apex”, “occipital nadir”, “lambda”, “bregma”)

Parameters:

df (pd.DataFrame) – DataFrame with insertion coordinates

Returns:

DataFrame with IBL coordinates

Return type:

pd.DataFrame

cibrrig.gui.convert2ccf(df)[source]

Convert IBL coordinates to CCF coordinates

In IBL frame, bregma is at (0,0,0) and right is positive x, rostral is positive y, dorsal is positive z x,y,z -> ML, AP, DV

In CCF frame, bregma is at (5400, 5739, 332) (AP,ML,DV) and right is positive x, caudal is positive y, ventral is positive z

dataframe must have the following columns: - x - y - z - phi (azimuth/yaw) - theta (pitch/elevation) - Depth (microns)

Parameters:

df (pd.DataFrame) – DataFrame with IBL coordinates

Returns:

DataFrame with CCF coordinates

Return type:

pd.DataFrame

cibrrig.gui.plot_probe_insertion(df, save_fn)[source]
async cibrrig.gui.plot_probe_insertion_urchin(df, save_fn)[source]
cibrrig.gui.plot_probe_insertion_ibl(df, save_fn)[source]
cibrrig.gui.plot_insertion_layout(df, save_fn)[source]
class cibrrig.gui.DirectorySelector[source]

Bases: PyQt5.QtWidgets.QWidget

GUI to select paths for backup. Expands QWidget.

This class provides a graphical user interface (GUI) for selecting local and remote paths for backup, as well as options for removing optogenetic artifacts and running ephys quality control.

local_run_path[source]

Path to the local run directory.

Type:

Path

remote_archive_path[source]

Path to the remote archive directory.

Type:

Path

remote_working_path[source]

Path to the remote working directory.

Type:

Path

remove_opto_artifact[source]

Option to remove optogenetic artifacts.

Type:

bool

run_ephys_qc[source]

Option to run ephys quality

Type:

bool

Parameters:

QWidget (QWidget) – Base class QWidget.

local_run_path[source]
remote_archive_path[source]
remote_working_path[source]
remove_opto_artifact = False[source]
run_ephys_qc = True[source]
init_ui()[source]

Initialize the UI layout.

select_local_run_path()[source]

Select the local run path with UI

select_remote_archive_path()[source]

Select the remote archive path with UI

select_remote_working_path()[source]

Select the remote working path with UI

toggle_remove_opto_artifact(state)[source]

Toggle the remove_opto_artifact checkbox

get_gates()[source]
infer_num_probes()[source]
get_session_info()[source]
submit()[source]
get_paths()[source]

Return the selected paths and options

class cibrrig.gui.OptoFileFinder(title='')[source]

Bases: PyQt5.QtWidgets.QDialog

Dialog box to select the opto_calibration.json file if it is not found

opto_file[source]

Path to the opto_calibration.json file

Type:

Path

opto_file_selected[source]
select_button[source]
opto_file = None[source]
select_file()[source]

Select the opto_calibration.json file with UI

skip_file()[source]

Skip the opto_calibration.json file

get_opto_file()[source]
class cibrrig.gui.WiringEditor(title='')[source]

Bases: PyQt5.QtWidgets.QDialog

Dialog box to select the wiring file

output_wiring

Dictionary of the selected wiring

Type:

dict

digital_entries

Dictionary of the digital mapping (channels: signals)

Type:

dict

analog_entries

Dictionary of the analog mapping (channels: signals)

Type:

dict

title = ''[source]
initUI()[source]

Initialize the UI layout

on_digital_value_changed(combo_box, key)[source]

Update the digital value

on_analog_value_changed(combo_box, key)[source]

Update the analog value

save_values()[source]

Save the output wiring attributes

get_output_wiring()[source]
class cibrrig.gui.InsertionTableAppBase(n_rows=1, n_gates=20, name='', save_fn=None)[source]

Bases: PyQt5.QtWidgets.QDialog

n_gates = 20[source]
save_fn = None[source]
name = ''[source]
df = None[source]
table[source]
get_headers()[source]
add_row(row)[source]
get_insertion_types()[source]
update_angles(row)[source]
add_new_row()[source]
delete_last_row()[source]
copy_previous_row(current_row_count)[source]
add_new_column()[source]
export_to_dataframe()[source]
convert_and_export()[source]
create_dataframe()[source]
get_insertions()[source]
to_csv()[source]
load_csv()[source]

Load a csv and populate the table if it exists

populate_table()[source]

Populate the table with data from a dataframe

class cibrrig.gui.NpxInsertionTableApp(n_rows=1, n_gates=10, name='', save_fn=None)[source]

Bases: InsertionTableAppBase

get_insertion_types()[source]
add_row(row)[source]
convert_and_export()[source]
class cibrrig.gui.OptoInsertionTableApp(n_rows=1, n_gates=10, name='', save_fn=None)[source]

Bases: InsertionTableAppBase

get_headers()[source]
get_insertion_types()[source]
add_row(row)[source]
convert_and_export()[source]
class cibrrig.gui.NotesDialog(n_gates, notes_fn)[source]

Bases: PyQt5.QtWidgets.QDialog

notes_fn[source]
overall_notes_text[source]
text_fields = [][source]
submit()[source]
save_notes()[source]
load_notes()[source]