diff --git a/.all-contributorsrc b/.all-contributorsrc
index 2af0bfc..755542a 100644
--- a/.all-contributorsrc
+++ b/.all-contributorsrc
@@ -16,6 +16,23 @@
"ideas"
]
},
+ {
+ "login": "Remi-Gau",
+ "name": "Remi Gau",
+ "avatar_url": "https://avatars3.githubusercontent.com/u/6961185?v=4",
+ "profile": "https://remi-gau.github.io/",
+ "contributions": [
+ "code",
+ "design",
+ "ideas",
+ "bug",
+ "userTesting",
+ "review",
+ "question",
+ "infra",
+ "maintenance"
+ ]
+ },
{
"login": "marcobarilari",
"name": "marcobarilari",
diff --git a/README.md b/README.md
index 46d5393..4c69387 100644
--- a/README.md
+++ b/README.md
@@ -1,6 +1,6 @@
[](https://github.com/cpp-lln-lab/localizer_auditory_motion/actions)
-[](#contributors-)
+[](#contributors-)

@@ -143,6 +143,7 @@ Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/d
diff --git a/audioLocTranslational.m b/audioLocTranslational.m
old mode 100644
new mode 100755
index 8138387..d09a467
--- a/audioLocTranslational.m
+++ b/audioLocTranslational.m
@@ -45,6 +45,7 @@
% Prepare for the output logfiles with all
logFile.extraColumns = cfg.extraColumns;
+ logFile = saveEventsFile('init', cfg, logFile);
logFile = saveEventsFile('open', cfg, logFile);
% disp(cfg);
@@ -85,13 +86,15 @@
thisEvent.fixationTarget = cfg.design.fixationTargets(iBlock, iEvent);
thisEvent.soundTarget = cfg.design.soundTargets(iBlock, iEvent);
+ thisEvent.isStim = logFile.isStim;
+
% we wait for a trigger every 2 events
if cfg.pacedByTriggers.do && mod(iEvent, 2) == 1
waitForTrigger( ...
- cfg, ...
- cfg.keyboard.responseBox, ...
- cfg.pacedByTriggers.quietMode, ...
- cfg.pacedByTriggers.nbTriggers);
+ cfg, ...
+ cfg.keyboard.responseBox, ...
+ cfg.pacedByTriggers.quietMode, ...
+ cfg.pacedByTriggers.nbTriggers);
end
% % % REFACTOR THIS FUNCTION % % %
@@ -116,7 +119,7 @@
% collect the responses and appends to the event structure for
% saving in the tsv file
responseEvents = getResponse('check', cfg.keyboard.responseBox, cfg, ...
- getOnlyPress);
+ getOnlyPress);
triggerString = ['trigger_' cfg.design.blockNames{iBlock}];
saveResponsesAndTriggers(responseEvents, cfg, logFile, triggerString);
@@ -132,7 +135,7 @@
% trigger monitoring
triggerEvents = getResponse('check', cfg.keyboard.responseBox, cfg, ...
- getOnlyPress);
+ getOnlyPress);
triggerString = 'trigger_baseline';
saveResponsesAndTriggers(triggerEvents, cfg, logFile, triggerString);
diff --git a/initEnv.m b/initEnv.m
index ec6eefe..7af9378 100644
--- a/initEnv.m
+++ b/initEnv.m
@@ -56,8 +56,8 @@
if numel(dir(libDirectory)) <= 2 % Means that the external is empty
error(['Git submodules are not cloned!', ...
- 'Try this in your terminal:', ...
- ' git submodule update --recursive ']);
+ 'Try this in your terminal:', ...
+ ' git submodule update --recursive ']);
else
addDependencies();
end
diff --git a/input/Motion/sub-pilot001/sub-pilot001_LRL.wav b/input/Motion/sub-pilot001/sub-pilot001_LRL.wav
deleted file mode 100644
index f90f9e8..0000000
Binary files a/input/Motion/sub-pilot001/sub-pilot001_LRL.wav and /dev/null differ
diff --git a/input/Motion/sub-pilot001/sub-pilot001_LRL_T.wav b/input/Motion/sub-pilot001/sub-pilot001_LRL_T.wav
deleted file mode 100644
index 5a5a0a4..0000000
Binary files a/input/Motion/sub-pilot001/sub-pilot001_LRL_T.wav and /dev/null differ
diff --git a/input/Motion/sub-pilot001/sub-pilot001_LRL_T_rms.wav b/input/Motion/sub-pilot001/sub-pilot001_LRL_T_rms.wav
index de9d2dd..ee5c613 100644
Binary files a/input/Motion/sub-pilot001/sub-pilot001_LRL_T_rms.wav and b/input/Motion/sub-pilot001/sub-pilot001_LRL_T_rms.wav differ
diff --git a/input/Motion/sub-pilot001/sub-pilot001_LRL_rms.wav b/input/Motion/sub-pilot001/sub-pilot001_LRL_rms.wav
index e82bc70..f348ac5 100644
Binary files a/input/Motion/sub-pilot001/sub-pilot001_LRL_rms.wav and b/input/Motion/sub-pilot001/sub-pilot001_LRL_rms.wav differ
diff --git a/input/Motion/sub-pilot001/sub-pilot001_RLR.wav b/input/Motion/sub-pilot001/sub-pilot001_RLR.wav
deleted file mode 100644
index a81b613..0000000
Binary files a/input/Motion/sub-pilot001/sub-pilot001_RLR.wav and /dev/null differ
diff --git a/input/Motion/sub-pilot001/sub-pilot001_RLR_T.wav b/input/Motion/sub-pilot001/sub-pilot001_RLR_T.wav
deleted file mode 100644
index e5e2bdc..0000000
Binary files a/input/Motion/sub-pilot001/sub-pilot001_RLR_T.wav and /dev/null differ
diff --git a/input/Motion/sub-pilot001/sub-pilot001_RLR_T_rms.wav b/input/Motion/sub-pilot001/sub-pilot001_RLR_T_rms.wav
index 1a1dc3a..7298cc6 100644
Binary files a/input/Motion/sub-pilot001/sub-pilot001_RLR_T_rms.wav and b/input/Motion/sub-pilot001/sub-pilot001_RLR_T_rms.wav differ
diff --git a/input/Motion/sub-pilot001/sub-pilot001_RLR_rms.wav b/input/Motion/sub-pilot001/sub-pilot001_RLR_rms.wav
index c52f0fc..5c64152 100644
Binary files a/input/Motion/sub-pilot001/sub-pilot001_RLR_rms.wav and b/input/Motion/sub-pilot001/sub-pilot001_RLR_rms.wav differ
diff --git a/input/equateRmsWav.m b/input/equateRmsWav.m
index e0caf2e..b2aacf7 100644
--- a/input/equateRmsWav.m
+++ b/input/equateRmsWav.m
@@ -55,7 +55,7 @@ function runFunction (referenceWavFn, targetWavFn)
% correct for the rms differences in each channel
finalWav = [targetWav(:, 1) * (referenceRMS(1) / targetRms(1)) ...
- targetWav(:, 2) * (referenceRMS(2) / targetRms(2))];
+ targetWav(:, 2) * (referenceRMS(2) / targetRms(2))];
% check that the rms of the final is similar to the original
finalRms = rms(finalWav);
diff --git a/lib/CPP_BIDS b/lib/CPP_BIDS
index c6659f7..269aa60 160000
--- a/lib/CPP_BIDS
+++ b/lib/CPP_BIDS
@@ -1 +1 @@
-Subproject commit c6659f74e995ab870336bc266fe849c554a9f044
+Subproject commit 269aa609262df425a56ff073b3f109a19e24a3cf
diff --git a/lib/CPP_PTB b/lib/CPP_PTB
index 179cc21..abb172e 160000
--- a/lib/CPP_PTB
+++ b/lib/CPP_PTB
@@ -1 +1 @@
-Subproject commit 179cc21c759f382891c2611e41a6d38e4c876bab
+Subproject commit abb172e99fc1ee871cf8eb1fb00daac31748d7c1
diff --git a/setParameters.m b/setParameters.m
old mode 100644
new mode 100755
index 3ef43c7..5d9d7d8
--- a/setParameters.m
+++ b/setParameters.m
@@ -9,8 +9,7 @@
% setParamters.m file is
% change that if you want the data to be saved somewhere else
cfg.dir.output = fullfile( ...
- fileparts(mfilename('fullpath')), '..', ...
- 'output');
+ fileparts(mfilename('fullpath')), 'output');
%% Debug mode settings
@@ -18,7 +17,10 @@
cfg.debug.smallWin = false; % To test on a part of the screen, change to 1
cfg.debug.transpWin = false; % To test with trasparent full size screen
- cfg.verbose = false;
+ cfg.verbose = 1;
+ cfg.skipSyncTests = 0;
+
+ cfg.audio.devIdx = 3; % 5 %11
%% Engine parameters
@@ -32,9 +34,11 @@
cfg = setKeyboards(cfg);
% MRI settings
+
cfg = setMRI(cfg);
+ cfg.suffix.acquisition = '0p75mmEv';
- cfg.pacedByTriggers.do = true;
+ cfg.pacedByTriggers.do = false;
%% Experiment Design
@@ -43,19 +47,20 @@
cfg.design.motionType = 'translation';
cfg.design.names = {'static'; 'motion'};
% 0: L--R--L; 180: R--L--R;
- cfg.design.motionDirections = [0 0 180 180];
- cfg.design.nbRepetitions = 14;
- cfg.design.nbEventsPerBlock = 12;
+ cfg.design.motionDirections = [0 180];
+ cfg.design.nbRepetitions = 21;
+ cfg.design.nbEventsPerBlock = 6;
%% Timing
% FOR 7T: if you want to create localizers on the fly, the following must be
- % multiples of the scanneryour sequence TR
+ % multiples of the scanner sequence TR
%
% IBI
% block length = (cfg.eventDuration + cfg.ISI) * cfg.design.nbEventsPerBlock
- cfg.timing.eventDuration = 0.850; % second
+ % for info: not actually used since "defined" by the sound duration
+ % cfg.timing.eventDuration = 0.850; % second
% Time between blocs in secs
cfg.timing.IBI = 0;
@@ -94,7 +99,7 @@
% Instruction
cfg.task.instruction = ['1 - Detect the RED fixation cross\n' ...
- '2 - Detected the shorter repeated sounds'];
+ '2 - Detected the shorter repeated sounds'];
% Fixation cross (in pixels)
cfg.fixation.type = 'cross';
@@ -105,7 +110,7 @@
cfg.fixation.xDisplacement = 0;
cfg.fixation.yDisplacement = 0;
- cfg.target.maxNbPerBlock = 2;
+ cfg.target.maxNbPerBlock = 1;
cfg.target.duration = 0.5; % In secs
cfg.extraColumns = {'direction', 'soundTarget', 'fixationTarget', 'event', 'block', 'keyName'};
@@ -135,9 +140,9 @@
function cfg = setKeyboards(cfg)
cfg.keyboard.escapeKey = 'ESCAPE';
cfg.keyboard.responseKey = { ...
- 'r', 'g', 'y', 'b', ...
- 'd', 'n', 'z', 'e', ...
- 't'}; % dnze rgyb
+ 'r', 'g', 'y', 'b', ...
+ 'd', 'n', 'z', 'e', ...
+ 't'}; % dnze rgyb
cfg.keyboard.keyboard = [];
cfg.keyboard.responseBox = [];
@@ -155,7 +160,7 @@
cfg.mri.repetitionTime = 1.8;
cfg.bids.MRI.Instructions = ['1 - Detect the RED fixation cross\n' ...
- '2 - Detected the shorter repeated sounds'];
+ '2 - Detected the shorter repeated sounds'];
cfg.bids.MRI.TaskDescription = [];
end
diff --git a/subfun/doAuditoryMotion.m b/subfun/doAuditoryMotion.m
old mode 100644
new mode 100755
index 828f335..f957b9d
--- a/subfun/doAuditoryMotion.m
+++ b/subfun/doAuditoryMotion.m
@@ -76,6 +76,6 @@
% Get the end time
waitForEndOfPlayback = 1; % hard coding that will need to be moved out
[onset, ~, ~, estStopTime] = PsychPortAudio('Stop', cfg.audio.pahandle, ...
- waitForEndOfPlayback);
+ waitForEndOfPlayback);
duration = estStopTime - onset;
diff --git a/subfun/expDesign.m b/subfun/expDesign.m
old mode 100644
new mode 100755
index 0faa544..4c5083a
--- a/subfun/expDesign.m
+++ b/subfun/expDesign.m
@@ -86,23 +86,23 @@
% 2 events apart
% - targets cannot be on the first or last event of a block
- % Fixation targets
nbTarget = numTargetsForEachBlock(iBlock);
+ % Fixation targets
+ forbiddenPositions = [];
chosenPosition = setTargetPositionInSequence( ...
- NB_EVENTS_PER_BLOCK, ...
- nbTarget, ...
- [1 NB_EVENTS_PER_BLOCK]);
+ NB_EVENTS_PER_BLOCK, ...
+ nbTarget, ...
+ forbiddenPositions);
fixationTargets(iBlock, chosenPosition) = 1;
% Sound targets
- nbTarget = numTargetsForEachBlock(iBlock);
-
+ forbiddenPositions = [chosenPosition];
chosenPosition = setTargetPositionInSequence( ...
- NB_EVENTS_PER_BLOCK, ...
- nbTarget, ...
- [1 NB_EVENTS_PER_BLOCK]);
+ NB_EVENTS_PER_BLOCK, ...
+ nbTarget, ...
+ forbiddenPositions);
soundTargets(iBlock, chosenPosition) = 1;
@@ -150,8 +150,8 @@
NB_REPEATS_BASE_VECTOR = NB_EVENTS_PER_BLOCK / length(STATIC_DIRECTIONS);
static_directions = repmat( ...
- STATIC_DIRECTIONS, ...
- 1, NB_REPEATS_BASE_VECTOR);
+ STATIC_DIRECTIONS, ...
+ 1, NB_REPEATS_BASE_VECTOR);
for iMotionBlock = 1:NB_REPETITIONS
diff --git a/subfun/saveResponsesAndTriggers.m b/subfun/saveResponsesAndTriggers.m
old mode 100644
new mode 100755
index 61f8e5a..719be71
--- a/subfun/saveResponsesAndTriggers.m
+++ b/subfun/saveResponsesAndTriggers.m
@@ -15,6 +15,7 @@ function saveResponsesAndTriggers(responseEvents, cfg, logFile, triggerString)
end
end
+ responseEvents(1).isStim = logFile.isStim;
responseEvents(1).fileID = logFile.fileID;
responseEvents(1).extraColumns = logFile.extraColumns;
saveEventsFile('save', cfg, responseEvents);
diff --git a/tests/test_expDesign.m b/tests/test_expDesign.m
index a224c55..5ef89da 100644
--- a/tests/test_expDesign.m
+++ b/tests/test_expDesign.m
@@ -28,8 +28,9 @@ function test_exDesignBasic()
% make sure that we have the right number of blocks of the right length
assertTrue(all(size(cfg.design.directions) == [ ...
- cfg.design.nbRepetitions * numel(cfg.design.names), ...
- cfg.design.nbEventsPerBlock]));
+ cfg.design.nbRepetitions * ...
+ numel(cfg.design.names), ...
+ cfg.design.nbEventsPerBlock]));
% check that we do not have more than the required number of targets per
% block
@@ -62,8 +63,9 @@ function test_exDesignBasicOtherSetUp()
% make sure that we have the right number of blocks of the right length
assertTrue(all(size(cfg.design.directions) == [ ...
- cfg.design.nbRepetitions * numel(cfg.design.names), ...
- cfg.design.nbEventsPerBlock]));
+ cfg.design.nbRepetitions * ...
+ numel(cfg.design.names), ...
+ cfg.design.nbEventsPerBlock]));
% check that we do not have more than the required number of targets per
% block