Skip to content

Commit

Permalink
NeuroScope2: Improved handling of table heights in the sidemenu on sm…
Browse files Browse the repository at this point in the history
…aller screens.
  • Loading branch information
petersenpeter committed Mar 15, 2023
1 parent 05240ed commit 4d65336
Showing 1 changed file with 38 additions and 6 deletions.
44 changes: 38 additions & 6 deletions NeuroScope2.m
Original file line number Diff line number Diff line change
Expand Up @@ -401,8 +401,8 @@ function NeuroScope2(varargin)

UI.panel.center = uix.VBox( 'Parent', UI.grid_panels, 'Spacing', 0, 'Padding', 0 ); % Center flex box
% UI.panel.right = uix.VBoxFlex('Parent',UI.grid_panels,'position',[0 0.66 0.26 0.31]); % Right panel
set(UI.grid_panels, 'Widths', [250 -1],'MinimumWidths',[220 1]); % set grid panel size
set(UI.grid_panels, 'Widths', [250 -1],'MinimumWidths',[5 1]); % set grid panel size
set(UI.grid_panels, 'Widths', [270 -1],'MinimumWidths',[220 1]); % set grid panel size
set(UI.grid_panels, 'Widths', [270 -1],'MinimumWidths',[5 1]); % set grid panel size
% Separation of the center box into three panels: title panel, plot panel and lower info panel
UI.panel.plots = uipanel('position',[0 0 1 1],'BorderType','none','Parent',UI.panel.center,'BackgroundColor','k'); % Main plot panel
UI.panel.info = uix.HBox('Parent',UI.panel.center, 'Padding', 1); % Lower info panel
Expand Down Expand Up @@ -494,15 +494,15 @@ function NeuroScope2(varargin)
UI.epochAxes = axes('Parent',UI.panel.epochs.main,'Units','Normalize','Position',[0 0 1 1],'YLim',[0,1],'YTick',[],'ButtonDownFcn',@ClickEpochs,'XTick',[]); axis tight %,'Color',UI.settings.background,'XColor',UI.settings.primaryColor,'TickLength',[0.005, 0.001],'XMinorTick','on',,'Clipping','off');

% Time series data
UI.panel.timeseriesdata.main = uipanel('Title','Time series data','Position',[0 0.2 1 0.1],'Units','normalized','Parent',UI.panel.general.main);
UI.panel.timeseriesdata.main = uipanel('Title','Raw time series data','Position',[0 0.2 1 0.1],'Units','normalized','Parent',UI.panel.general.main);
UI.table.timeseriesdata = uitable(UI.panel.timeseriesdata.main,'Data',{false,'','',''},'Units','normalized','Position',[0 0.20 1 0.80],'ColumnWidth',{20 35 125 45},'columnname',{'','Tag','File name','nChan'},'RowName',[],'ColumnEditable',[true false false false],'CellEditCallback',@showIntan);
UI.panel.timeseriesdata.showTimeseriesBelowTrace = uicontrol('Parent',UI.panel.timeseriesdata.main,'Style','checkbox','Units','normalized','Position',[0 0 0.5 0.20], 'value', 0,'String','Below traces','Callback',@showTimeseriesBelowTrace,'KeyPressFcn', @keyPress,'tooltip','Show time series data below traces');
uicontrol('Parent',UI.panel.timeseriesdata.main,'Style','pushbutton','Units','normalized','Position',[0.5 0 0.49 0.19],'String','Edit','Callback',@editIntanMeta,'KeyPressFcn', @keyPress,'tooltip','Edit session metadata');

% Defining flexible panel heights
set(UI.panel.general.main, 'Heights', [65 210 -200 35 -100 35 100 40 150],'MinimumHeights',[65 210 160 35 140 35 50 30 150]);
set(UI.panel.general.main, 'Heights', [65 210 -200 35 -100 35 100 40 150],'MinimumHeights',[65 210 200 35 140 35 50 30 150]);
UI.panel.general.main1.MinimumWidths = 218;
UI.panel.general.main1.MinimumHeights = 935;
UI.panel.general.main1.MinimumHeights = 975;

% % % % % % % % % % % % % % % % % % % % % %
% 2. PANEL: Spikes related metrics
Expand Down Expand Up @@ -578,7 +578,7 @@ function NeuroScope2(varargin)

% Events
UI.panel.events.table = uipanel('Parent',UI.panel.other.main,'title','Events (*.events.mat)');
UI.table.events_data = uitable(UI.panel.events.table,'Data', {'','',false,false,false},'Units','normalized','Position',[0 0 1 1],'ColumnWidth',{20 65 42 50 45},'columnname',{'','Name','Show','Active','Below'},'RowName',[],'ColumnEditable',[false false true true true],'CellEditCallback',@setEventData,'CellSelectionCallback',@table_events_click);
UI.table.events_data = uitable(UI.panel.events.table,'Data', {'','',false,false,false},'Units','normalized','Position',[0 0 1 1],'ColumnWidth',{20 85 42 50 45},'columnname',{'','Name','Show','Active','Below'},'RowName',[],'ColumnEditable',[false false true true true],'CellEditCallback',@setEventData,'CellSelectionCallback',@table_events_click);

UI.panel.events.main = uipanel('Parent',UI.panel.other.main);
UI.panel.events.showEventsIntervals = uicontrol('Parent',UI.panel.events.main,'Style','checkbox','Units','normalized','Position',[0.01 0.8 0.32 0.19], 'value', 0,'String','Intervals','Callback',@showEventsIntervals,'KeyPressFcn', @keyPress,'tooltip','Show events intervals');
Expand Down Expand Up @@ -4955,6 +4955,38 @@ function initData(basepath,basename)
% Timeseries files
updateTimeSeriesDataList

% Defining flexible panel heights for lists of electrode groups, channel tags and analog and digital timeseries
tableHeights_ElectrodeGroups = max([data.session.extracellular.nElectrodeGroups*18+50,150]);
tableHeights_ChannelTags = numel(UI.channelTags)*18+50;
if isfield(data.session,'timeSeries') && ~isempty(data.session.timeSeries)
nfiles = numel(fieldnames(data.session.timeSeries));
else
nfiles = 0;
end
tableHeights_Timeseries3 = nfiles*18+50;

set(UI.panel.general.main, 'MinimumHeights',[65 210 tableHeights_ElectrodeGroups 35 tableHeights_ChannelTags 35 50 30 tableHeights_Timeseries3]);
UI.panel.general.main1.MinimumHeights = 505 + tableHeights_ElectrodeGroups + tableHeights_ChannelTags + tableHeights_Timeseries3;

% Defining flexible panel heights for events and timeseries files
if isfield(UI.data.detectecFiles,'events') && ~isempty(data.session.timeSeries)
nfiles = numel(UI.data.detectecFiles.events);
else
nfiles = 0;
end
tableHeights_Events = nfiles*18+50;

if isfield(UI.data.detectecFiles,'timeseries')
nfiles = numel(UI.data.detectecFiles.timeseries);
else
nfiles = 0;
end
tableHeights_TimeSeries = nfiles*18+30;

set(UI.panel.other.main, 'MinimumHeights',[tableHeights_Events 150 100 150 tableHeights_TimeSeries 40]);
UI.panel.other.main1.MinimumHeights = 520 + tableHeights_Events + tableHeights_TimeSeries;


% Generating epoch interval-visualization
delete(UI.epochAxes.Children)
if isfield(data.session,'epochs')
Expand Down

0 comments on commit 4d65336

Please sign in to comment.