====== Differences ====== This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision | ||
analysis:amplipex:artifacts [2014/01/20 19:59] ecarmichael |
analysis:amplipex:artifacts [2018/04/17 15:20] (current) |
||
---|---|---|---|
Line 21: | Line 21: | ||
cfg.coninuous = 'yes'; | cfg.coninuous = 'yes'; | ||
cfg.viewmode = 'vertical'; % this shows all of the channels vertically | cfg.viewmode = 'vertical'; % this shows all of the channels vertically | ||
- | cfg = ft_databrowser(cfg,data_art_rem); | + | cfg = ft_databrowser(cfg,data_trl); |
+ | data_trl.cfg = cfg; % rewrite the cfg back into the data set | ||
</code> | </code> | ||
Line 27: | Line 28: | ||
{{:analysis:amplipex:artifact_wiki.png?750|}} | {{:analysis:amplipex:artifact_wiki.png?750|}} | ||
- | The selected artifact regions are not altered within the data itself, instead the start and end of each artifact are saved as part of the cfg structure: data_trl.cfg.artfctdef.visual.artifact . From here we can change these regions to values of our choice. | + | The selected artifact regions are not altered within the data itself, instead the start and end of each artifact are saved as part of the cfg structure: data_trl.cfg.artfctdef.visual.artifact . So now can change these regions to any value of our choice. |
Line 33: | Line 34: | ||
%% Mannual Artifact removal | %% Mannual Artifact removal | ||
art_value = 0; %Value to replace the data within artifact regions | art_value = 0; %Value to replace the data within artifact regions | ||
- | artifacts = data_art_rem.cfg.artfctdef.visual.artifact; | + | artifacts = data_trl.cfg.artfctdef.visual.artifact; |
- | trials = data_art_rem.cfg.trl; | + | trials = data_trl.cfg.trl; |
for iArt = 1:length(artifacts) | for iArt = 1:length(artifacts) | ||
for iTrial = 1:length(trials) | for iTrial = 1:length(trials) | ||
if trials(iTrial,1)<= artifacts(iArt,1) && trials(iTrial,2)>= artifacts(iArt,2) | if trials(iTrial,1)<= artifacts(iArt,1) && trials(iTrial,2)>= artifacts(iArt,2) | ||
if artifacts(iArt,1)-trials(iTrial,1) ==0 | if artifacts(iArt,1)-trials(iTrial,1) ==0 | ||
- | data_art_rem.trial{1,iTrial}(1:16,(1:artifacts(iArt,2)-trials(iTrial,1)))=art_value; | + | data_trl.trial{1,iTrial}(1:16,(1:artifacts(iArt,2)-trials(iTrial,1)))=art_value; |
else | else | ||
- | data_art_rem.trial{1,iTrial}(1:16,(artifacts(iArt,1)-trials(iTrial,1):artifacts(iArt,2)-trials(iTrial,1)))=art_value; | + | data_trl.trial{1,iTrial}(1:16,(artifacts(iArt,1)-trials(iTrial,1):artifacts(iArt,2)-trials(iTrial,1)))=art_value; |
end | end | ||
end | end | ||
Line 49: | Line 50: | ||
- | From here we can visualize the | + | Now we can visualize the data regions that have been replaced to ensure they have been correctly converted. |
+ | |||
+ | <code matlab> | ||
+ | cfg.viewmode = 'vertical'; % this shows all of the channels vertically | ||
+ | ft_databrowser(cfg,data_trl); | ||
+ | </code> | ||
+ | |||
+ | From here we can run any further ft analysis. |