Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
behinger committed Mar 2, 2021
2 parents 3847d31 + 645edc8 commit f411df0
Show file tree
Hide file tree
Showing 25 changed files with 729 additions and 174 deletions.
13 changes: 9 additions & 4 deletions docs/docs_sphinx/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,11 @@
:align: center
:width: 30 %

Unfold 1.1 - EEG Deconvolution Toolbox
Unfold 1.2 - EEG Deconvolution Toolbox
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
A toolbox for *deconvolution* of overlapping EEG (Pupil, LFP etc.) signals and *(non)-linear modeling*

New in 1.2 (December 2020): More automatic cleaning tools (ASR, Entropy-Based). Many Bugfixes, better Documentation and better error-codes.

Reference Papers
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Expand All @@ -41,9 +42,13 @@ What can you do with *unfold*?
* (Optional) **regularization** using glmnet
* Temporal Response Functions (TRFs)

Unmixed - Unfold addon for mixed Models
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
A new addon *unmixed*, allowing to use mixed models can be found in its alpha version version `here <https://github.com/unfoldtoolbox/unmixed>`_
Unfold.jl - a Beta-Toolbox in Julia
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
We are developing a sister-toolbox for Julia. It is not feature-par with matlab-unfold yet, e.g. splines are missing and no plotting tools. But it allows to specify more flexible basisfunctions, e.g. different types for different events and different lengths. It also fully supports MixedModels (but that part is still untested in practice, besides unittests).

(deprecated) Unmixed - Unfold addon for mixed Models
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
(deprecated) The addon *unmixed*, allowing to use mixed models can be found in its alpha version version `here <https://github.com/unfoldtoolbox/unmixed>`_

Requirements
^^^^^^^^^^^^^^^^^
Expand Down
12 changes: 6 additions & 6 deletions docs/tutorials/tutorial2_2x2_long.html

Large diffs are not rendered by default.

19 changes: 9 additions & 10 deletions init_unfold.m
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,14 @@
projectFolder = fileparts(which('init_unfold.m'));
scriptDir = fullfile(projectFolder,'src');

if ~exist('eeg_checkset','file')
try
eeglab redraw
catch
warning('%s(): EEGLAB could not be found in your path. Please add it to your path. Otherwise, you should be fine EXCEPT if you want to use uf_epoch() (for massive univariate modeling without overlap correction) which requires EEGLAB.\n',mfilename)
addpath(fullfile(projectFolder,'lib','eeglab'))
end
end

addpath(genpath(scriptDir))
addpath(fullfile(projectFolder,'lib','erplab'))
Expand All @@ -16,17 +24,8 @@

addpath(fullfile(projectFolder,'lib','glmnet_matlab'))

if ~exist('eeg_checkset','file')
try
eeglab redraw
catch
warning('%s(): EEGLAB could not be found in your path. Please add it to your path. Otherwise, you should be fine EXCEPT if you want to use uf_epoch() (for massive univariate modeling without overlap correction) which requires EEGLAB.\n',mfilename)
addpath(fullfile(projectFolder,'lib','eeglab'))
end
end

if ~exist('gramm','file')
warning('%s():\ngramm could not be found. Did you run "git submodule update --init" to initialize submodules?\n',mfilename)
end

fprintf('Done.\n')
fprintf('Done.\n')
2 changes: 1 addition & 1 deletion lib/eegvis
Submodule eegvis updated 34 files
+227 −0 eegvis_imagesc/eegvis_imagesc.m
+9 −0 eegvis_imagesc/slice_display-master/.gitignore
+21 −0 eegvis_imagesc/slice_display-master/LICENSE
+76 −0 eegvis_imagesc/slice_display-master/README.md
+ eegvis_imagesc/slice_display-master/colormaps.mat
+ eegvis_imagesc/slice_display-master/example_dual_coded_map.jpg
+ eegvis_imagesc/slice_display-master/example_thresholded_t_map.jpg
+ eegvis_imagesc/slice_display-master/examples/data/F_vs_B_significant_voxels_FWE_voxel_level.nii
+7 −0 eegvis_imagesc/slice_display-master/examples/data/README.md
+ eegvis_imagesc/slice_display-master/examples/data/RPV.nii
+ eegvis_imagesc/slice_display-master/examples/data/ResMS.nii
+ eegvis_imagesc/slice_display-master/examples/data/SPM.mat
+ eegvis_imagesc/slice_display-master/examples/data/beta_0001.nii
+ eegvis_imagesc/slice_display-master/examples/data/con_0002.nii
+ eegvis_imagesc/slice_display-master/examples/data/con_0003.nii
+ eegvis_imagesc/slice_display-master/examples/data/ess_0001.nii
+ eegvis_imagesc/slice_display-master/examples/data/mask.nii
+ eegvis_imagesc/slice_display-master/examples/data/spmF_0001.nii
+ eegvis_imagesc/slice_display-master/examples/data/spmT_0002.nii
+ eegvis_imagesc/slice_display-master/examples/data/spmT_0003.nii
+42 −0 eegvis_imagesc/slice_display-master/examples/example01.m
+45 −0 eegvis_imagesc/slice_display-master/examples/example02.m
+23 −0 eegvis_imagesc/slice_display-master/make_colormaps.m
+226 −0 eegvis_imagesc/slice_display-master/sd_config_figure.m
+284 −0 eegvis_imagesc/slice_display-master/sd_config_layers.m
+192 −0 eegvis_imagesc/slice_display-master/sd_config_settings.m
+292 −0 eegvis_imagesc/slice_display-master/sd_display.m
+91 −0 eegvis_imagesc/slice_display-master/sd_get_image_specs.m
+47 −0 eegvis_imagesc/slice_display-master/sd_get_slice.m
+22 −0 eegvis_imagesc/slice_display-master/sd_slice_to_alpha.m
+88 −0 eegvis_imagesc/slice_display-master/sd_slice_to_rgb.m
+11 −1 readme.md
+13 −3 topo_butter/plot_butterfly.m
+26 −13 topo_butter/plot_topo.m
4 changes: 2 additions & 2 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ run('init_unfold.m')
Check out the [toolbox tutorials](https://www.unfoldtoolbox.org/toolboxtutorials.html) for more information!
```
EEG = tutorial_simulate_data('2x2')
EEG = uf_designmat('eventtypes',{'fixation'},'formula','y ~ 1+ cat(stimulusType)*cat(color)')
EEG = uf_timeexpandDesignmat('timelimits',[-0.5 1])
EEG = uf_designmat(EEG,'eventtypes',{'fixation'},'formula','y ~ 1+ cat(stimulusType)*cat(color)')
EEG = uf_timeexpandDesignmat(EEG,'timelimits',[-0.5 1])
EEG = uf_glmfit(EEG)
% (strictly speaking optional, but recommended)
ufresult = uf_condense(EEG)
Expand Down
8 changes: 5 additions & 3 deletions src/uf_toolbox/internal/uf_unfoldbetaSetname.m
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

% parse inputs
cfg = finputcheck(varargin,...
{'deconv','integer',[0,1,-1],-1, ... % -1 is autodetect
{'deconv','integer',[0,1,-1],-1; ... % -1 is autodetect
'dataField','string','',''...
},'mode','ignore');

Expand All @@ -14,11 +14,13 @@
if cfg.deconv == -1

% autodetect
assert(isfield(ufresult,'beta') | isfield(ufresult,'beta_nodc'),'Error: to use autodetect at least the field ufresult.beta or ufresult.beta_nodc needs to exist')
assert(~isempty(cfg.dataField) || isfield(ufresult,'beta') || isfield(ufresult,'beta_nodc'),'Error: to use autodetect at least the field ufresult.beta or ufresult.beta_nodc needs to exist')
fn = fieldnames(ufresult);

% get size of betas
if isfield(ufresult,'beta')
if ~isempty(cfg.dataField)
sizeBeta = size(ufresult.(cfg.dataField));
elseif isfield(ufresult,'beta')
sizeBeta = size(ufresult.beta);
else
sizeBeta = size(ufresult.beta_nodc);
Expand Down
13 changes: 10 additions & 3 deletions src/uf_toolbox/uf_addmarginal.m
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,9 @@
% RECURSION ALERT!
if length(betaSetname) > 1
for b = betaSetname
ufresult_tmp = uf_addmarginal(ufresult,'betaSetname',b{1});
cfg.betaSetname = b{1};
ufresult_tmp = uf_addmarginal(ufresult,cfg);

ufresult.(b{1}) = ufresult_tmp.(b{1});
end
return
Expand All @@ -110,7 +112,9 @@
fprintf('\nRe-running uf_condense() to recover unconverted splines\n')
ufresult_avg = uf_condense(ufresult); % re-genererate, (without "evaluated" predictors)


if ~isempty(setdiff(cfg.betaSetname,fieldnames(ufresult_avg)))
error('currently we do not support custom fieldnames in uf_addmarginal. The reason is that we have to get the values at the average via uf_condense which does not return it for the other values. You have to do this calculations manually')
end
% Calculate marginal effect
if strcmp(cfg.type,'MEM')
fprintf('Calculating marginal effect at the mean of each spline/continuous predictor.\n');
Expand Down Expand Up @@ -196,7 +200,10 @@
% multiple times, we can add the same marginal

for p = unique(eventParamNames)

if isempty(p) % happens if TRF is in the mix
fprintf("found an TRF, ignoring it")
continue
end
% Find the names & types of the other parameters
currEvent = e_Idx(strcmp(p,eventParamNames));
otherEvents = setdiff(e_Idx,currEvent);
Expand Down
Loading

0 comments on commit f411df0

Please sign in to comment.