Skip to content

Commit 2386817

Browse files
authored
Merge pull request #44 from cpp-lln-lab/dev
[REL] new release
2 parents a6e8a2b + 1fbfea2 commit 2386817

19 files changed

+56
-43
lines changed

.all-contributorsrc

+1-1
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,6 @@
5656
"projectOwner": "cpp-lln-lab",
5757
"repoType": "github",
5858
"repoHost": "https://github.com",
59-
"skipCi": false,
59+
"skipCi": true,
6060
"contributorsSortAlphabetically": true
6161
}

audioLocTranslational.m

100644100755
+11-6
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@
4545

4646
% Prepare for the output logfiles with all
4747
logFile.extraColumns = cfg.extraColumns;
48+
logFile = saveEventsFile('init', cfg, logFile);
4849
logFile = saveEventsFile('open', cfg, logFile);
4950

5051
% disp(cfg);
@@ -85,13 +86,15 @@
8586
thisEvent.fixationTarget = cfg.design.fixationTargets(iBlock, iEvent);
8687
thisEvent.soundTarget = cfg.design.soundTargets(iBlock, iEvent);
8788

89+
thisEvent.isStim = logFile.isStim;
90+
8891
% we wait for a trigger every 2 events
8992
if cfg.pacedByTriggers.do && mod(iEvent, 2) == 1
9093
waitForTrigger( ...
91-
cfg, ...
92-
cfg.keyboard.responseBox, ...
93-
cfg.pacedByTriggers.quietMode, ...
94-
cfg.pacedByTriggers.nbTriggers);
94+
cfg, ...
95+
cfg.keyboard.responseBox, ...
96+
cfg.pacedByTriggers.quietMode, ...
97+
cfg.pacedByTriggers.nbTriggers);
9598
end
9699

97100
% % % REFACTOR THIS FUNCTION % % %
@@ -116,7 +119,7 @@
116119
% collect the responses and appends to the event structure for
117120
% saving in the tsv file
118121
responseEvents = getResponse('check', cfg.keyboard.responseBox, cfg, ...
119-
getOnlyPress);
122+
getOnlyPress);
120123

121124
triggerString = ['trigger_' cfg.design.blockNames{iBlock}];
122125
saveResponsesAndTriggers(responseEvents, cfg, logFile, triggerString);
@@ -132,7 +135,7 @@
132135

133136
% trigger monitoring
134137
triggerEvents = getResponse('check', cfg.keyboard.responseBox, cfg, ...
135-
getOnlyPress);
138+
getOnlyPress);
136139

137140
triggerString = 'trigger_baseline';
138141
saveResponsesAndTriggers(triggerEvents, cfg, logFile, triggerString);
@@ -152,6 +155,8 @@
152155

153156
eyeTracker('Shutdown', cfg);
154157

158+
% remove the sound data from the cfg before saving it.
159+
cfg = rmfield(cfg, 'soundData');
155160
createJson(cfg, cfg);
156161

157162
farewellScreen(cfg);

initEnv.m

+2-2
Original file line numberDiff line numberDiff line change
@@ -56,8 +56,8 @@
5656

5757
if numel(dir(libDirectory)) <= 2 % Means that the external is empty
5858
error(['Git submodules are not cloned!', ...
59-
'Try this in your terminal:', ...
60-
' git submodule update --recursive ']);
59+
'Try this in your terminal:', ...
60+
' git submodule update --recursive ']);
6161
else
6262
addDependencies();
6363
end
-604 KB
Binary file not shown.
-604 KB
Binary file not shown.
Binary file not shown.
Binary file not shown.
-604 KB
Binary file not shown.
-604 KB
Binary file not shown.
Binary file not shown.
Binary file not shown.

input/equateRmsWav.m

+1-1
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ function runFunction (referenceWavFn, targetWavFn)
5555

5656
% correct for the rms differences in each channel
5757
finalWav = [targetWav(:, 1) * (referenceRMS(1) / targetRms(1)) ...
58-
targetWav(:, 2) * (referenceRMS(2) / targetRms(2))];
58+
targetWav(:, 2) * (referenceRMS(2) / targetRms(2))];
5959

6060
% check that the rms of the final is similar to the original
6161
finalRms = rms(finalWav);

lib/CPP_BIDS

Submodule CPP_BIDS updated 131 files

lib/CPP_PTB

Submodule CPP_PTB updated 112 files

setParameters.m

100644100755
+20-15
Original file line numberDiff line numberDiff line change
@@ -9,16 +9,18 @@
99
% setParamters.m file is
1010
% change that if you want the data to be saved somewhere else
1111
cfg.dir.output = fullfile( ...
12-
fileparts(mfilename('fullpath')), '..', ...
13-
'output');
12+
fileparts(mfilename('fullpath')), 'output');
1413

1514
%% Debug mode settings
1615

1716
cfg.debug.do = false; % To test the script out of the scanner, skip PTB sync
1817
cfg.debug.smallWin = false; % To test on a part of the screen, change to 1
1918
cfg.debug.transpWin = false; % To test with trasparent full size screen
2019

21-
cfg.verbose = false;
20+
cfg.verbose = 1;
21+
cfg.skipSyncTests = 0;
22+
23+
cfg.audio.devIdx = 3; % 5 %11
2224

2325
%% Engine parameters
2426

@@ -32,9 +34,11 @@
3234
cfg = setKeyboards(cfg);
3335

3436
% MRI settings
37+
3538
cfg = setMRI(cfg);
39+
cfg.suffix.acquisition = '0p75mmEv';
3640

37-
cfg.pacedByTriggers.do = true;
41+
cfg.pacedByTriggers.do = false;
3842

3943
%% Experiment Design
4044

@@ -43,19 +47,20 @@
4347
cfg.design.motionType = 'translation';
4448
cfg.design.names = {'static'; 'motion'};
4549
% 0: L--R--L; 180: R--L--R;
46-
cfg.design.motionDirections = [0 0 180 180];
47-
cfg.design.nbRepetitions = 14;
48-
cfg.design.nbEventsPerBlock = 12;
50+
cfg.design.motionDirections = [0 180];
51+
cfg.design.nbRepetitions = 21;
52+
cfg.design.nbEventsPerBlock = 6;
4953

5054
%% Timing
5155

5256
% FOR 7T: if you want to create localizers on the fly, the following must be
53-
% multiples of the scanneryour sequence TR
57+
% multiples of the scanner sequence TR
5458
%
5559
% IBI
5660
% block length = (cfg.eventDuration + cfg.ISI) * cfg.design.nbEventsPerBlock
5761

58-
cfg.timing.eventDuration = 0.850; % second
62+
% for info: not actually used since "defined" by the sound duration
63+
% cfg.timing.eventDuration = 0.850; % second
5964

6065
% Time between blocs in secs
6166
cfg.timing.IBI = 0;
@@ -94,7 +99,7 @@
9499

95100
% Instruction
96101
cfg.task.instruction = ['1 - Detect the RED fixation cross\n' ...
97-
'2 - Detected the shorter repeated sounds'];
102+
'2 - Detected the shorter repeated sounds'];
98103

99104
% Fixation cross (in pixels)
100105
cfg.fixation.type = 'cross';
@@ -105,7 +110,7 @@
105110
cfg.fixation.xDisplacement = 0;
106111
cfg.fixation.yDisplacement = 0;
107112

108-
cfg.target.maxNbPerBlock = 2;
113+
cfg.target.maxNbPerBlock = 1;
109114
cfg.target.duration = 0.5; % In secs
110115

111116
cfg.extraColumns = {'direction', 'soundTarget', 'fixationTarget', 'event', 'block', 'keyName'};
@@ -135,9 +140,9 @@
135140
function cfg = setKeyboards(cfg)
136141
cfg.keyboard.escapeKey = 'ESCAPE';
137142
cfg.keyboard.responseKey = { ...
138-
'r', 'g', 'y', 'b', ...
139-
'd', 'n', 'z', 'e', ...
140-
't'}; % dnze rgyb
143+
'r', 'g', 'y', 'b', ...
144+
'd', 'n', 'z', 'e', ...
145+
't'}; % dnze rgyb
141146
cfg.keyboard.keyboard = [];
142147
cfg.keyboard.responseBox = [];
143148

@@ -155,7 +160,7 @@
155160
cfg.mri.repetitionTime = 1.8;
156161

157162
cfg.bids.MRI.Instructions = ['1 - Detect the RED fixation cross\n' ...
158-
'2 - Detected the shorter repeated sounds'];
163+
'2 - Detected the shorter repeated sounds'];
159164
cfg.bids.MRI.TaskDescription = [];
160165

161166
end

subfun/doAuditoryMotion.m

100644100755
+1-1
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,6 @@
7676
% Get the end time
7777
waitForEndOfPlayback = 1; % hard coding that will need to be moved out
7878
[onset, ~, ~, estStopTime] = PsychPortAudio('Stop', cfg.audio.pahandle, ...
79-
waitForEndOfPlayback);
79+
waitForEndOfPlayback);
8080

8181
duration = estStopTime - onset;

subfun/expDesign.m

100644100755
+11-11
Original file line numberDiff line numberDiff line change
@@ -86,23 +86,23 @@
8686
% 2 events apart
8787
% - targets cannot be on the first or last event of a block
8888

89-
% Fixation targets
9089
nbTarget = numTargetsForEachBlock(iBlock);
9190

91+
% Fixation targets
92+
forbiddenPositions = [];
9293
chosenPosition = setTargetPositionInSequence( ...
93-
NB_EVENTS_PER_BLOCK, ...
94-
nbTarget, ...
95-
[1 NB_EVENTS_PER_BLOCK]);
94+
NB_EVENTS_PER_BLOCK, ...
95+
nbTarget, ...
96+
forbiddenPositions);
9697

9798
fixationTargets(iBlock, chosenPosition) = 1;
9899

99100
% Sound targets
100-
nbTarget = numTargetsForEachBlock(iBlock);
101-
101+
forbiddenPositions = [chosenPosition];
102102
chosenPosition = setTargetPositionInSequence( ...
103-
NB_EVENTS_PER_BLOCK, ...
104-
nbTarget, ...
105-
[1 NB_EVENTS_PER_BLOCK]);
103+
NB_EVENTS_PER_BLOCK, ...
104+
nbTarget, ...
105+
forbiddenPositions);
106106

107107
soundTargets(iBlock, chosenPosition) = 1;
108108

@@ -150,8 +150,8 @@
150150
NB_REPEATS_BASE_VECTOR = NB_EVENTS_PER_BLOCK / length(STATIC_DIRECTIONS);
151151

152152
static_directions = repmat( ...
153-
STATIC_DIRECTIONS, ...
154-
1, NB_REPEATS_BASE_VECTOR);
153+
STATIC_DIRECTIONS, ...
154+
1, NB_REPEATS_BASE_VECTOR);
155155

156156
for iMotionBlock = 1:NB_REPETITIONS
157157

subfun/saveResponsesAndTriggers.m

100644100755
+1
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ function saveResponsesAndTriggers(responseEvents, cfg, logFile, triggerString)
1515
end
1616
end
1717

18+
responseEvents(1).isStim = logFile.isStim;
1819
responseEvents(1).fileID = logFile.fileID;
1920
responseEvents(1).extraColumns = logFile.extraColumns;
2021
saveEventsFile('save', cfg, responseEvents);

tests/test_expDesign.m

+6-4
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,9 @@ function test_exDesignBasic()
2828

2929
% make sure that we have the right number of blocks of the right length
3030
assertTrue(all(size(cfg.design.directions) == [ ...
31-
cfg.design.nbRepetitions * numel(cfg.design.names), ...
32-
cfg.design.nbEventsPerBlock]));
31+
cfg.design.nbRepetitions * ...
32+
numel(cfg.design.names), ...
33+
cfg.design.nbEventsPerBlock]));
3334

3435
% check that we do not have more than the required number of targets per
3536
% block
@@ -62,8 +63,9 @@ function test_exDesignBasicOtherSetUp()
6263

6364
% make sure that we have the right number of blocks of the right length
6465
assertTrue(all(size(cfg.design.directions) == [ ...
65-
cfg.design.nbRepetitions * numel(cfg.design.names), ...
66-
cfg.design.nbEventsPerBlock]));
66+
cfg.design.nbRepetitions * ...
67+
numel(cfg.design.names), ...
68+
cfg.design.nbEventsPerBlock]));
6769

6870
% check that we do not have more than the required number of targets per
6971
% block

0 commit comments

Comments
 (0)