Skip to content

Commit 7e9d6da

Browse files
committed
add interpolated channels to the final ICA plot
1 parent 92808a8 commit 7e9d6da

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

45 files changed

+75
-5
lines changed

LICENSE.txt

100644100755
File mode changed.

README.md

100644100755
File mode changed.

addAutomagicPaths.m

100644100755
File mode changed.

autoEmail.p

100644100755
File mode changed.

automagic_resources/AutomagicWorkflow.jpg

100644100755
File mode changed.

automagic_resources/automagic.jpg

100644100755
File mode changed.

automagic_resources/wiki/BIDSderivatives.png

100644100755
File mode changed.

automagic_resources/wiki/BIDSstructure.png

100644100755
File mode changed.

automagic_resources/wiki/automagic_menue.png

100644100755
File mode changed.

automagic_resources/wiki/dataFolderStructure.png

100644100755
File mode changed.

automagic_resources/wiki/eeglab_menu.png

100644100755
File mode changed.

automagic_resources/wiki/epxort-to-bids.png

100644100755
File mode changed.

automagic_resources/wiki/importGUI.png

100644100755
File mode changed.

automagic_resources/wiki/mainGUI.png

100644100755
File mode changed.

automagic_resources/wiki/plugin_struct.png

100644100755
File mode changed.

automagic_resources/wiki/preprocessing-panel.png

100644100755
File mode changed.

automagic_resources/wiki/project-panel.png

100644100755
File mode changed.

automagic_resources/wiki/qualityAssessment.png

100644100755
File mode changed.

automagic_resources/wiki/qualityRating.png

100644100755
File mode changed.

automagic_resources/wiki/ratingGUI.png

100644100755
File mode changed.

automagic_resources/wiki/resultsFolderStructure.png

100644100755
File mode changed.

automagic_resources/wiki/settingsGUI.png

100644100755
File mode changed.

automagic_resources/wiki/visual_output.png

100644100755
File mode changed.

eeglab_plugin/ImportParams.m

100644100755
File mode changed.

eeglab_plugin/importResultsGUI.fig

100644100755
File mode changed.

eeglab_plugin/importResultsGUI.m

100644100755
File mode changed.

eeglab_plugin/pop_automagic.m

100644100755
File mode changed.

eeglab_plugin/pop_import.m

100644100755
File mode changed.

eegplugin_automagic.m

100644100755
File mode changed.

loadingScreen.m

100644100755
File mode changed.

matlab_scripts/MARA-master.zip

100644100755
File mode changed.

matlab_scripts/NoiseTools.zip

100644100755
File mode changed.

matlab_scripts/README.md

100644100755
File mode changed.

matlab_scripts/VisLab-EEG-Clean-Tools.zip

100644100755
File mode changed.

matlab_scripts/amica-master.zip

100644100755
File mode changed.

matlab_scripts/cbrewer.zip

100644100755
File mode changed.

matlab_scripts/clean_rawdata2.1.zip

100644100755
File mode changed.

matlab_scripts/eeglab14_1_2b.zip

100644100755
File mode changed.

matlab_scripts/inexact_alm_rpca.zip

100644100755
File mode changed.

playful2.jpg

100644100755
File mode changed.

preprocessing/performTrimData.m

+9
Original file line numberDiff line numberDiff line change
@@ -83,4 +83,13 @@
8383
EEG = pop_select(EEG, 'point', [new_start new_end]);
8484

8585
end
86+
87+
% remove boundaries for PREP
88+
eTypes = find(strcmpi({EEG.event.type}, 'boundary'));
89+
if ~isempty(eTypes)
90+
if eTypes(1) == 1
91+
EEG.event(1) = [];
92+
end
93+
end
94+
8695
end

preprocessing/preprocess.m

+6-4
Original file line numberDiff line numberDiff line change
@@ -479,7 +479,7 @@
479479
title_text = '\color{red}No EOG-Regression requested';
480480
cla(eogRegress_subplot)
481481
else
482-
title_text = 'EOG regressed out';
482+
title_text = 'EOG regressed out (only good channels)';
483483
end
484484
title(title_text);
485485
colorbar;
@@ -495,10 +495,12 @@
495495
title_text = '\color{red}ICA FAILED';
496496
cla(ica_subplot)
497497
else
498-
title_text = 'ICA corrected clean data';
498+
title_text = 'ICA corrected clean data (only good channels)';
499499
end
500-
elseif(~isempty(RPCAParams))
501-
title_text = 'RPCA corrected clean data';
500+
elseif (~isempty(RPCAParams))
501+
title_text = 'RPCA corrected clean data (only good channels)';
502+
elseif (~isempty(ICLabelParams))
503+
title_text = 'ICLabel corrected clean data (only good channels)';
502504
else
503505
title_text = '';
504506
end

removeAutomagicPath.m

100644100755
File mode changed.

runAutomagic.m

100644100755
File mode changed.

src/Block.m

+60-1
Original file line numberDiff line numberDiff line change
@@ -618,7 +618,65 @@ function interpolate(self)
618618
% originally
619619
original_nans = setdiff(nanchans, interpolate_chans);
620620
EEG.data(original_nans, :) = NaN;
621+
622+
% Find the colormap selected
623+
if strcmp(automagic.params.Settings.colormap,'Default')
624+
CT = 'jet';
625+
else
626+
cm = automagic.params.Settings.colormap;
627+
[~,CT]=evalc('cbrewer(''div'', cm, 64)');
628+
end
629+
630+
% overwirte ICA figure
631+
if exist(strcat(self.imageAddress, '.fig'), 'file')
632+
633+
clear fig;
634+
% open figure
635+
fig = open(strcat(self.imageAddress, '.fig'));
636+
637+
% % delete old figure
638+
% delete(strcat(self.imageAddress, '.jpg'));
639+
640+
ica_subplot = subplot(11,1,8:9);
641+
cla(ica_subplot);
642+
imagesc(EEG.data);
643+
colormap(CT);
644+
caxis([-100 100])
645+
XTicks = [];
646+
set(gca,'XTick',XTicks)
647+
XTicketLabels = [];
648+
set(gca,'XTickLabel',XTicketLabels)
649+
650+
% select correct title
651+
if (~isempty(automagic.params.MARAParams))
652+
if strcmp(automagic.mara.performed, 'FAILED')
653+
title_text = '\color{red}ICA FAILED';
654+
cla(ica_subplot)
655+
else
656+
title_text = 'ICA corrected clean data';
657+
end
658+
elseif (~isempty(automagic.params.RPCAParams))
659+
title_text = 'RPCA corrected clean data';
660+
elseif (~isempty(automagic.params.ICLabelParams))
661+
title_text = 'ICLabel corrected clean data';
662+
else
663+
title_text = '';
664+
end
621665

666+
title(title_text);
667+
colorbar;
668+
% save new figure
669+
print(fig, strcat(self.imageAddress), '-djpeg', '-r100');
670+
671+
% delete old figure (.fig)
672+
delete(strcat(self.imageAddress, '.fig'));
673+
674+
close(fig);
675+
clear fig;
676+
else
677+
warning('Interpolated channels were not added to the ICA figure')
678+
end
679+
622680
% Downsample the new file and save it
623681
PrepCsts = self.CGV.PreprocessingCsts;
624682
reduced.data = (downsample(EEG.data', self.dsRate))'; %#ok<STRNU>
@@ -1170,7 +1228,8 @@ function saveFiles(self, EEG, automagic, fig1, fig2, fig3) %#ok<INUSL>
11701228

11711229
% save results
11721230
set(fig1,'PaperUnits','inches','PaperPosition',[0 0 10 8])
1173-
print(fig1, self.imageAddress, '-djpeg', '-r200');
1231+
print(fig1, self.imageAddress, '-djpeg', '-r200'); % as jpg
1232+
saveas(fig1, strcat(self.imageAddress, '.fig')); % as fig
11741233
close(fig1);
11751234
print(fig2, strcat(self.imageAddress, '_orig'), '-djpeg', '-r100');
11761235
close(fig2);

0 commit comments

Comments
 (0)