suite2p.gui package

Submodules

suite2p.gui.buttons module

class suite2p.gui.buttons.QuadButton(bid, Text, parent=None)[source]

Bases: PyQt5.QtWidgets.QPushButton

custom QPushButton class for quadrant plotting requires buttons to put into a QButtonGroup (parent.quadbtns)

allows only 1 button to pressed at a time

press(parent, bid)[source]
class suite2p.gui.buttons.SizeButton(bid, Text, parent=None)[source]

Bases: PyQt5.QtWidgets.QPushButton

buttons to make trace box bigger or smaller

press(parent)[source]
class suite2p.gui.buttons.TopButton(bid, parent=None)[source]

Bases: PyQt5.QtWidgets.QPushButton

selection of top neurons

press(parent)[source]
top_selection(parent)[source]
suite2p.gui.buttons.make_cellnotcell(parent)[source]

buttons for cell / not cell views at top

suite2p.gui.buttons.make_quadrants(parent)[source]

make quadrant buttons

suite2p.gui.buttons.make_selection(parent)[source]

buttons to draw a square on view

suite2p.gui.classgui module

class suite2p.gui.classgui.ListChooser(Text, parent=None)[source]

Bases: PyQt5.QtWidgets.QDialog

apply_class(parent)[source]
build_classifier(parent)[source]
exit_list()[source]
load_cell()[source]
load_text()[source]
save_default(parent)[source]
suite2p.gui.classgui.activate(parent, inactive)[source]
suite2p.gui.classgui.add_to(parent)[source]
suite2p.gui.classgui.class_activated(parent)[source]
suite2p.gui.classgui.class_default(parent)[source]
suite2p.gui.classgui.class_file(parent)[source]
suite2p.gui.classgui.class_masks(parent)[source]
suite2p.gui.classgui.disable(parent)[source]
suite2p.gui.classgui.load(parent, name)[source]
suite2p.gui.classgui.load_classifier(parent)[source]
suite2p.gui.classgui.load_data(parent, keys, trainfiles)[source]
suite2p.gui.classgui.load_default_classifier(parent)[source]
suite2p.gui.classgui.load_list(parent)[source]
suite2p.gui.classgui.load_s2p_classifier(parent)[source]
suite2p.gui.classgui.make_buttons(parent, b0)[source]
suite2p.gui.classgui.reset_default(parent)[source]
suite2p.gui.classgui.save(parent, train_stats, train_iscell, keys)[source]
suite2p.gui.classgui.save_list(parent)[source]
suite2p.gui.classgui.save_model(name, train_stats, train_iscell, keys)[source]

suite2p.gui.drawroi module

class suite2p.gui.drawroi.ROIDraw(parent)[source]

Bases: PyQt5.QtWidgets.QMainWindow

add_ROI(pos=None)[source]
check_proc(event)[source]
closeEvent(self, QCloseEvent)[source]
close_GUI()[source]
create_masks_of_cells(mean_img)[source]
keyPressEvent(self, QKeyEvent)[source]
mouse_moved(pos)[source]
normalize_img_add_masks()[source]
plot_clicked(event)[source]
plot_trace()[source]
proc_ROI()[source]
class suite2p.gui.drawroi.ViewButton(bid, Text, parent=None)[source]

Bases: PyQt5.QtWidgets.QPushButton

press(parent, bid)[source]
suite2p.gui.drawroi.masks_and_traces(ops, stat_manual, stat_orig)[source]

main extraction function inputs: ops and stat creates cell and neuropil masks and extracts traces returns: F (ROIs x time), Fneu (ROIs x time), F_chan2, Fneu_chan2, ops, stat F_chan2 and Fneu_chan2 will be empty if no second channel

class suite2p.gui.drawroi.sROI(iROI, parent=None, pos=None, diameter=None, color=None, yrange=None, xrange=None)[source]

Bases: object

draw(parent, imy, imx, dy, dx)[source]
position(parent)[source]
remove(parent)[source]

suite2p.gui.graphics module

suite2p.gui.graphics.ROI_index(ops, stat)[source]

matrix Ly x Lx where each pixel is an ROI index (-1 if no ROI present)

class suite2p.gui.graphics.TraceBox(parent=None, border=None, lockAspect=False, enableMouse=True, invertY=False, enableMenu=True, name=None, invertX=False)[source]

Bases: pyqtgraph.graphicsItems.PlotItem.PlotItem.PlotItem

mouseDoubleClickEvent(self, QGraphicsSceneMouseEvent)[source]
zoom_plot()[source]
class suite2p.gui.graphics.ViewBox(parent=None, border=None, lockAspect=False, enableMouse=True, invertY=False, enableMenu=True, name=None, invertX=False)[source]

Bases: pyqtgraph.graphicsItems.ViewBox.ViewBox.ViewBox

mouseClickEvent(ev)[source]
mouseDoubleClickEvent(self, QGraphicsSceneMouseEvent)[source]
mouseDragEvent(ev, axis=None)[source]
zoom_plot()[source]
suite2p.gui.graphics.init_range(parent)[source]

suite2p.gui.gui2p module

class suite2p.gui.gui2p.MainWindow(statfile=None)[source]

Bases: PyQt5.QtWidgets.QMainWindow

ROI_position()[source]
ROI_remove()[source]
ROI_selection()[source]
ROIs_on(state)[source]
dragEnterEvent(self, QDragEnterEvent)[source]
dropEvent(self, QDropEvent)[source]
ichosen_stats()[source]
keyPressEvent(self, QKeyEvent)[source]
make_buttons()[source]
make_graphics(b0)[source]
mode_change(i)[source]

changes the activity mode that is used when multiple neurons are selected or in visualization windows like rastermap or for correlation computation!

activityMode = 0 : F 1 : Fneu 2 : F - 0.7 * Fneu (default) 3 : spks

uses binning set by self.bin

number_chosen()[source]
plot_clicked(event)[source]

left-click chooses a cell, right-click flips cell to other view

select_cells(ypix, xpix)[source]
top_number_chosen()[source]
update_plot()[source]
zoom_cell(state)[source]
zoom_to_cell()[source]
suite2p.gui.gui2p.run(statfile=None)[source]

suite2p.gui.io module

suite2p.gui.io.enable_views_and_classifier(parent)[source]
suite2p.gui.io.export_fig(parent)[source]
suite2p.gui.io.load_NWB(parent)[source]
suite2p.gui.io.load_again(parent, Text)[source]
suite2p.gui.io.load_behavior(parent)[source]
suite2p.gui.io.load_custom_mask(parent)[source]
suite2p.gui.io.load_dialog(parent)[source]
suite2p.gui.io.load_dialog_NWB(parent)[source]
suite2p.gui.io.load_dialog_folder(parent)[source]
suite2p.gui.io.load_files(name)[source]

give stat.npy path and load all needed files for suite2p

suite2p.gui.io.load_folder(parent)[source]
suite2p.gui.io.load_proc(parent)[source]
suite2p.gui.io.load_to_GUI(parent, basename, procs)[source]
suite2p.gui.io.make_masks_and_enable_buttons(parent)[source]
suite2p.gui.io.save_iscell(parent)[source]
suite2p.gui.io.save_mat(parent)[source]
suite2p.gui.io.save_merge(parent)[source]
suite2p.gui.io.save_redcell(parent)[source]

suite2p.gui.masks module

class suite2p.gui.masks.ColorButton(bid, Text, parent=None)[source]

Bases: PyQt5.QtWidgets.QPushButton

press(parent, bid)[source]
suite2p.gui.masks.add_roi(parent, n, i)[source]

add roi n to view i

suite2p.gui.masks.beh_masks(parent)[source]
suite2p.gui.masks.chan2_masks(parent)[source]
suite2p.gui.masks.chan2_prob(parent)[source]
suite2p.gui.masks.cmap_change(parent)[source]
suite2p.gui.masks.corr_masks(parent)[source]
suite2p.gui.masks.custom_masks(parent)[source]
suite2p.gui.masks.draw_colorbar(colormap='hsv')[source]
suite2p.gui.masks.draw_masks(parent)[source]

creates RGB masks using stat and puts them in M0 or M1 depending on whether or not iscell is True for a given ROI :param ops: mean_image, Vcorr :param stat: xpix,ypix :param iscell: vector with True if ROI is cell :param ops_plot: plotROI, view, color, randcols

outputs:

M0: ROIs that are True in iscell M1: ROIs that are False in iscell

suite2p.gui.masks.flip_for_class(parent, iscell)[source]
suite2p.gui.masks.flip_plot(parent)[source]
suite2p.gui.masks.flip_roi(parent)[source]

flips roi to other plot there are 3 levels of overlap so this may be buggy if more than 3 cells are on top of each other

suite2p.gui.masks.hsv2rgb(cols)[source]
suite2p.gui.masks.init_masks(parent)[source]

creates RGB masks using stat and puts them in M0 or M1 depending on whether or not iscell is True for a given ROI :param ops: mean_image, Vcorr :param stat: xpix,ypix,xext,yext :param iscell: vector with True if ROI is cell :param ops_plot: plotROI, view, color, randcols

outputs:

M0: ROIs that are True in iscell M1: ROIs that are False in iscell

suite2p.gui.masks.istat_hsv(istat)[source]
suite2p.gui.masks.istat_transform(istat, colormap='hsv')[source]
suite2p.gui.masks.make_buttons(parent, b0)[source]

color buttons at row b0

suite2p.gui.masks.make_chosen_ROI(M0, ypix, xpix, v)[source]
suite2p.gui.masks.make_chosen_circle(M0, ycirc, xcirc, col, sat)[source]
suite2p.gui.masks.make_colorbar(parent, b0)[source]
suite2p.gui.masks.make_colors(parent)[source]
suite2p.gui.masks.plot_colorbar(parent)[source]
suite2p.gui.masks.plot_masks(parent, M)[source]
suite2p.gui.masks.rastermap_masks(parent)[source]
suite2p.gui.masks.redraw_masks(parent, ypix, xpix)[source]

redraw masks after roi added/removed

suite2p.gui.masks.remove_roi(parent, n, i0)[source]

removes roi n from view i0

suite2p.gui.masks.rgb_masks(parent, col, c)[source]

suite2p.gui.menus module

suite2p.gui.menus.classifier(parent)[source]
suite2p.gui.menus.mainmenu(parent)[source]
suite2p.gui.menus.manual_label(parent)[source]
suite2p.gui.menus.mergebar(parent)[source]
suite2p.gui.menus.plugins(parent)[source]
suite2p.gui.menus.regPC_window(parent)[source]
suite2p.gui.menus.reg_window(parent)[source]
suite2p.gui.menus.registration(parent)[source]
suite2p.gui.menus.run_suite2p(parent)[source]
suite2p.gui.menus.suggest_merge(parent)[source]
suite2p.gui.menus.vis_window(parent)[source]
suite2p.gui.menus.visualizations(parent)[source]

suite2p.gui.merge module

class suite2p.gui.merge.LineEdit(key, parent=None)[source]

Bases: PyQt5.QtWidgets.QLineEdit

get_text()[source]
set_text(ops)[source]
class suite2p.gui.merge.MergeWindow(parent=None)[source]

Bases: PyQt5.QtWidgets.QDialog

compute_merge_list(parent)[source]
do_merge(parent)[source]
set_merge_list(parent, goodind)[source]
suggest_merge(parent)[source]
suite2p.gui.merge.apply(parent)[source]
suite2p.gui.merge.distance_matrix(parent, ilist)[source]
suite2p.gui.merge.do_merge(parent)[source]
suite2p.gui.merge.merge_activity_masks(parent)[source]

suite2p.gui.reggui module

class suite2p.gui.reggui.BinaryPlayer(parent=None)[source]

Bases: PyQt5.QtWidgets.QMainWindow

add_masks()[source]
add_raw()[source]
add_red()[source]
add_zstack()[source]
cell_chosen()[source]
cell_mask()[source]
compute_z(parent)[source]
createButtons(parent)[source]
fitToWindow()[source]
go_to_frame()[source]
jump_to_frame()[source]
keyPressEvent(self, QKeyEvent)[source]
load_zstack()[source]
make_masks()[source]
next_frame()[source]
number_chosen()[source]
open()[source]
openCombined(save_folder)[source]
openFile(filename, fromgui)[source]
open_combined()[source]
pause()[source]
plot_clicked(event)[source]
plot_trace()[source]
plot_zcorr()[source]
setup_views()[source]
start()[source]
updateButtons()[source]
updateFrameSlider()[source]
zoom_image()[source]
class suite2p.gui.reggui.PCViewer(parent=None)[source]

Bases: PyQt5.QtWidgets.QMainWindow

createButtons()[source]
keyPressEvent(self, QKeyEvent)[source]
next_frame()[source]
open()[source]
openFile(filename)[source]
pause()[source]
plot_clicked(event)[source]
plot_frame()[source]
start()[source]
zoom_plot()[source]
suite2p.gui.reggui.subsample_frames(ops, nsamps, reg_loc)[source]

suite2p.gui.rungui module

class suite2p.gui.rungui.LineEdit(k, key, parent=None)[source]

Bases: PyQt5.QtWidgets.QLineEdit

get_text(intkeys, boolkeys)[source]
set_text(ops)[source]
class suite2p.gui.rungui.OpsButton(bid, Text, parent=None)[source]

Bases: PyQt5.QtWidgets.QPushButton

press(parent, bid)[source]
class suite2p.gui.rungui.RunWindow(parent=None)[source]

Bases: PyQt5.QtWidgets.QDialog

add_batch()[source]
add_ops()[source]
bin_folder()[source]
clean_script()[source]
compile_ops_db()[source]
create_buttons()[source]
finished()[source]

finished(self, int) [signal]

get_folders()[source]
get_h5py()[source]
load_db()[source]
load_ops(name=None)[source]
parse_inputformat()[source]
remove_ops()[source]
reset_ops()[source]
revert_default_ops()[source]
run_S2P()[source]
save_default_ops()[source]
save_folder()[source]
save_ops()[source]
save_text()[source]
started()[source]
stderr_write()[source]
stdout_write()[source]
stop()[source]
class suite2p.gui.rungui.TextChooser(parent=None)[source]

Bases: PyQt5.QtWidgets.QDialog

exit_list()[source]
class suite2p.gui.rungui.VerticalLabel(text=None)[source]

Bases: PyQt5.QtWidgets.QWidget

paintEvent(self, QPaintEvent)[source]

suite2p.gui.traces module

suite2p.gui.traces.collapse_scale(parent)[source]
suite2p.gui.traces.collapse_trace(parent)[source]
suite2p.gui.traces.deconv_on(parent)[source]
suite2p.gui.traces.expand_scale(parent)[source]
suite2p.gui.traces.expand_trace(parent)[source]
suite2p.gui.traces.make_buttons(parent, b0)[source]
suite2p.gui.traces.nc_chosen(parent)[source]
suite2p.gui.traces.neuropil_on(parent)[source]
suite2p.gui.traces.plot_trace(parent)[source]
suite2p.gui.traces.traces_on(parent)[source]

suite2p.gui.utils module

suite2p.gui.utils.boundary(ypix, xpix)[source]

returns pixels of mask that are on the exterior of the mask

suite2p.gui.utils.circle(med, r)[source]

returns pixels of circle with radius 1.25x radius of cell (r)

suite2p.gui.views module

class suite2p.gui.views.RangeSlider(parent=None, *args)[source]

Bases: PyQt5.QtWidgets.QSlider

A slider for ranges.

This class provides a dual-slider for ranges, where there is a defined maximum and minimum, as is a normal slider, but instead of having a single slider value, there are 2 slider values.

This class emits the same signals as the QSlider base class, with the exception of valueChanged

Found this slider here: https://www.mail-archive.com/pyqt@riverbankcomputing.com/msg22889.html and modified it

high()[source]
level_change()[source]
low()[source]
mouseMoveEvent(self, QMouseEvent)[source]
mousePressEvent(self, QMouseEvent)[source]
mouseReleaseEvent(self, QMouseEvent)[source]
paintEvent(self, QPaintEvent)[source]
setHigh(high)[source]
setLow(low)[source]
class suite2p.gui.views.ViewButton(bid, Text, parent=None)[source]

Bases: PyQt5.QtWidgets.QPushButton

custom QPushButton class for quadrant plotting requires buttons to put into a QButtonGroup (parent.viewbtns)

allows only 1 button to pressed at a time

press(parent, bid)[source]
suite2p.gui.views.init_views(parent)[source]

make views using parent.ops

views in order:

“Q: ROIs”, “W: mean img”, “E: mean img (enhanced)”, “R: correlation map”, “T: max projection”, “Y: mean img chan2, corr”, “U: mean img chan2”,

assigns parent.views

suite2p.gui.views.make_buttons(parent)[source]

view buttons

suite2p.gui.views.plot_views(parent)[source]

set parent.view1 and parent.view2 image based on parent.ops_plot[‘view’]

suite2p.gui.visualize module

class suite2p.gui.visualize.NeuronSlider(parent=None)[source]

Bases: suite2p.gui.visualize.RangeSlider

level_change()[source]
class suite2p.gui.visualize.RangeSlider(parent=None, *args)[source]

Bases: PyQt5.QtWidgets.QSlider

A slider for ranges.

This class provides a dual-slider for ranges, where there is a defined maximum and minimum, as is a normal slider, but instead of having a single slider value, there are 2 slider values.

This class emits the same signals as the QSlider base class, with the exception of valueChanged

Found this slider here: https://www.mail-archive.com/pyqt@riverbankcomputing.com/msg22889.html and modified it

high()[source]
level_change()[source]
low()[source]
mouseMoveEvent(self, QMouseEvent)[source]
mousePressEvent(self, QMouseEvent)[source]
mouseReleaseEvent(self, QMouseEvent)[source]
paintEvent(self, QPaintEvent)[source]
setHigh(high)[source]
setLow(low)[source]
class suite2p.gui.visualize.SatSlider(parent=None)[source]

Bases: suite2p.gui.visualize.RangeSlider

level_change()[source]
class suite2p.gui.visualize.Slider(bid, parent=None)[source]

Bases: PyQt5.QtWidgets.QSlider

level_change(parent, bid)[source]
class suite2p.gui.visualize.VerticalLabel(text=None)[source]

Bases: PyQt5.QtWidgets.QWidget

paintEvent(self, QPaintEvent)[source]
class suite2p.gui.visualize.VisWindow(parent=None)[source]

Bases: PyQt5.QtWidgets.QMainWindow

LINE_position()[source]
PC_on(plot)[source]
PCreturn()[source]
ROI_position()[source]
THRES_position()[source]
activate()[source]
compute_map()[source]
finished()[source]
keyPressEvent(self, QKeyEvent)[source]
neural_sorting(i)[source]
plot_clicked(event)[source]
plot_traces()[source]
roi_range(roi)[source]
select_cells()[source]
sort_time()[source]
stderr_write()[source]
stdout_write()[source]

Module contents