Skip to content

Commit

Permalink
GUI: Show info on NIRS head model in headmodel panel if other modalities
Browse files Browse the repository at this point in the history
  • Loading branch information
rcassani committed Dec 9, 2024
1 parent a214bd1 commit 4871b89
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 10 deletions.
2 changes: 1 addition & 1 deletion doc/license.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<body alink="#fff000" link="#fff000" vlink="#fff000">
<h4><span style="font-family: Arial Black; color: #ffffff;"><strong>THERE IS NO UNDO BUTTON!<BR>SET UP A <FONT color=red>BACKUP</FONT> OF YOUR DATABASE</strong></span></h4>
<HR>
<!-- LICENCE_START -->Version: 3.241206 (06-Dec-2024)<br>
<!-- LICENCE_START -->Version: 3.241209 (09-Dec-2024)<br>
<span style="font-style: italic;">COPYRIGHT &copy; 2000-2024
USC &amp; McGill University.<br>
</span>
Expand Down
2 changes: 1 addition & 1 deletion doc/version.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
% Brainstorm
% v. 3.241206 (06-Dec-2024)
% v. 3.241209 (09-Dec-2024)
32 changes: 24 additions & 8 deletions toolbox/forward/panel_headmodel.m
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@


%% ===== CREATE PANEL =====
function [bstPanelNew, panelName] = CreatePanel(isMeg, isEeg, isEcog, isSeeg, isMixed) %#ok<DEFNU>
function [bstPanelNew, panelName] = CreatePanel(isMeg, isEeg, isEcog, isSeeg, isMixed, isNirs) %#ok<DEFNU>
panelName = 'HeadmodelOptions';
% Java initializations
import java.awt.*;
Expand All @@ -41,6 +41,10 @@
isSeeg = 0;
isMixed = 0;
end
% Call without 'isNIRS'
if (nargin < 6)
isNirs = 0;
end
% Create main main panel
jPanelNew = gui_river([8,10], [0,15,20,15]);

Expand Down Expand Up @@ -124,6 +128,17 @@
jCheckMethodSEEG = [];
jComboMethodSEEG = [];
end
% === NIRS ===
if isNirs
% Checkbox
jCheckMethodNIRS = gui_component('CheckBox', jPanelMethod, 'br', 'NIRS: ');
jCheckMethodNIRS.setSelected(0);
jCheckMethodNIRS.setEnabled(0)
% Label
gui_component('Label', jPanelMethod, 'tab hfill', ['<HTML><FONT color="#777777">To compute head model for NIRS, use process:<BR>' ...
'NIRS > Sources > Compute head model from fluence<BR>' ...
'(NIRSTORM plugin is required)']);
end
% Attach sub panel to NewPanel
jPanelNew.add('br hfill', jPanelMethod);

Expand Down Expand Up @@ -329,15 +344,16 @@ function UpdateComment(varargin)
isEeg = any(strcmpi(sStudies(i).Channel.DisplayableSensorTypes, 'EEG'));
isEcog = any(strcmpi(sStudies(i).Channel.DisplayableSensorTypes, 'ECOG'));
isSeeg = any(strcmpi(sStudies(i).Channel.DisplayableSensorTypes, 'SEEG'));
isNIRS = any(strcmpi(sStudies(i).Channel.DisplayableSensorTypes, 'NIRS'));
isNirs = any(strcmpi(sStudies(i).Channel.DisplayableSensorTypes, 'NIRS'));
end
end
% Check that at least one modality is available
if isNIRS
errMessage = ['To compute head model for NIRS, use process:' 10 'NIRS > Sources > Compute head model from fluence' 10 'NIRSTORM plugin is required'];
return;
elseif ~isMeg && ~isEeg && ~isEcog && ~isSeeg
errMessage = 'No valid sensor types to estimate a head model.';
if ~isMeg && ~isEeg && ~isEcog && ~isSeeg
if isNirs
errMessage = ['To compute head model for NIRS, use process:' 10 'NIRS > Sources > Compute head model from fluence' 10 'NIRSTORM plugin is required'];
else
errMessage = 'No valid sensor types to estimate a head model.';
end
return;
end
% Check if the first subject has a "Source model" atlas
Expand All @@ -356,7 +372,7 @@ function UpdateComment(varargin)
end
% Display options panel
if (nargin < 2) || isempty(sMethod)
sMethod = gui_show_dialog('Compute head model', @panel_headmodel, 1, [], isMeg, isEeg, isEcog, isSeeg, isMixed);
sMethod = gui_show_dialog('Compute head model', @panel_headmodel, 1, [], isMeg, isEeg, isEcog, isSeeg, isMixed, isNirs);
if isempty(sMethod)
return;
end
Expand Down

0 comments on commit 4871b89

Please sign in to comment.