User Tools

Site Tools


Sidebar

[[people:ContactList|ContactList]]\\ [[protocols:Protocols|Protocols]]\\ [[logs:LogSheets|LogSheets]]\\ [[computing:Computing|Computing]]\\ [[protocols:EotW|EotW]]\\ [[protocols:IssueTracker|IssueTracker]]\\ **Reference** [[guides:Guides|HowToGuides]]\\ [[guides:Manuals|Manuals]]\\ [[literature:Literature]]\\ [[jclub:JournalClub|JournalClub]]\\ [[people:LabAlumni|LabAlumni]]\\ [[analysis:DataAnalysis|DataAnalysis]]\\ **Training** [[guides:TheBasics|TheBasics]]\\ [[tutorials:TutorialList|TutorialList]]\\ [[guides:About|About this wiki]] **Beyond the lab** [[Fellowships]]\\ [[Advice for...]]\\ **Admin** [[orphanswanted|OrphansWanted]]\\

analysis:amplipex

====== Loading Amplipex data into fieldtrip ====== Note: as of Jan/2014, make sure you use the APX_devel branch on GitHub to get the latest version. At some point this will be merged back into master. Eric's Note (Jan 12/2014): Use session R041-2013-08-06 as a test since it contains an events file within the directory. If you are using another session be sure to run the AMPX_getEvetns script in the util/amplipex/loading folder. To load data: <code matlab> channels_to_load = [10:13]; % specify channels in the APX data file to load data = AMPX_loadData('R041-2013-08-06.dat',channels_to_load,20); % note decimation factor of 20 </code> To convert into a fieldtrip data structure: <code matlab> data_ft = AMPX_makeft(data); </code> Make trials (note, this will require an event file to have been created previously, Eric to update explanation of this): <code matlab> %% trl cfg = []; cfg.trialfun = 'ft_trialfun_AMPXsquareTrack'; cfg.trialdef.hdr = data.hdr; cfg.trialdef.pre = 2; % time before the event to be included (It would take roughly 3 seconds to get from one feeder to the next) cfg.trialdef.post = 3; % time after the event to be included (The rats would typically stay for at least 2 seconds while eating) cfg.trialdef.eventtype = 'nose_in_nofires'; % could be 'fires', 'no_fires', 'nose_in_fires', 'nose_in_nofires' [trl, event] = ft_trialfun_AMPXsquareTrack(cfg); cfg.trl = trl; data_trl = ft_redefinetrial(cfg,data_ft); </code> Now you can do the usual ft analysis stuff: <code matlab> %% cfg = []; % start with empty cfg cfg.output = 'pow'; cfg.channel = '10'; cfg.method = 'mtmconvol'; cfg.taper = 'hanning'; cfg.foi = 1:1:100; % frequencies of interest cfg.t_ftimwin = ones(size(cfg.foi)).*0.5; % window size: fixed at 0.5s cfg.toi = -1.5:0.05:2.5; % times of interest </code>

analysis/amplipex.txt · Last modified: 2018/04/17 15:20 (external edit)