Skip to content

Commit

Permalink
MRI viewer: Add warning before editing fiducials
Browse files Browse the repository at this point in the history
  • Loading branch information
ftadel committed Feb 20, 2022
1 parent 3d0158c commit af0fdd4
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 2 deletions.
2 changes: 1 addition & 1 deletion doc/license.html
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.220218 (18-Feb-2022)<br>
<!-- LICENCE_START -->Version: 3.220220 (20-Feb-2022)<br>
<span style="font-style: italic;">COPYRIGHT &copy; 2000-2022
USC &amp; McGill University.<br>
</span>
Expand Down
2 changes: 1 addition & 1 deletion doc/version.txt
@@ -1,2 +1,2 @@
% Brainstorm
% v. 3.220218 (18-Feb-2022)
% v. 3.220220 (20-Feb-2022)
16 changes: 16 additions & 0 deletions toolbox/gui/figure_mri.m
Expand Up @@ -518,6 +518,22 @@ function SetFigureStatus(hFig, isEditFiducials, isEditVolume, isOverlay, isEeg,
if ~isChanged
return;
end
% Warning if surfaces or recordings
SubjectFile = getappdata(hFig, 'SubjectFile');
sSubject = bst_get('Subject', SubjectFile);
sStudies = bst_get('StudyWithSubject', SubjectFile);
if ((~isempty(isEditFiducials) && isEditFiducials) || (~isempty(isEditVolume) && isEditVolume)) && ((~isempty(sSubject) && ~isempty(sSubject.Surface)) || (~isempty(sStudies) && any(~cellfun(@isempty, {sStudies.Channel}))))
isConfirm = java_dialog('confirm', [...
'Surfaces or MEG/EEG recordings have already been imported for subject "' sSubject.Name '".' 10 10 ...
'Editing the MRI orientation or the position of the NAS/LPA/RPA anatomical fiducials' 10 ...
'might break the coregistration between the different files, you might have to ' 10 ...
'import everything again. THERE IS NO UNDO BUTTON - MAKE A BACKUP FIRST.' 10 10 ...
'Are you sure you want to edit the MRI volume now?'], 'Edit MRI');
if ~isConfirm
Handles.isEditVolume = 0;
Handles.isEditFiducials = 0;
end
end
% Update figure handles
bst_figures('SetFigureHandles', hFig, Handles);

Expand Down

0 comments on commit af0fdd4

Please sign in to comment.