Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

adding Le Petit Prince to public repo #3

Draft
wants to merge 5 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
61 changes: 61 additions & 0 deletions le_petit_prince/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
## Display settings

* Clone the primary display to the slave monitor.
* Display resolution - 1920 x 1080, refresh rate - 60 Hz.

## How to run

* Download the audio files (`.wav` files with suffix `task-lppFR`) from OpenNeuro: https://openneuro.org/datasets/ds003643/versions/2.0.1
Copy link
Collaborator Author

@man-shu man-shu Apr 21, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I had added the openneuro link in the README. We should probably add more info about where to save these stim files so that the script can find it.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I had added the openneuro link in the README. We should probably add more info about where to save these stim files so that the script can find it.

Maybe in that case having the files directly here is better, so that we don't give much room for confusion?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We definitely can put the files here, Christophe also said so. We were discussing simply pointing to openneuro, so as to avoid any legal issues and having to take them down from multiple places in the future.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I may have said the converse recently, But I think that it's OK to just have the link.

* Print the `protocol/questions_reponses_a_imprimer.pdf` file to mark participant's answers after each run
* Go into the task folder:

```
$ cd le_petit_prince/protocol
```

### Practice

* No practice

### Scanner task

* Run the script `run-lepetitprince-mri.sh` as follows:

```
$ sh run-lepetitprince-mri.sh
```

* Select the run and press Enter.

* Ask the questions after each run and mark the answers on the printed sheet. Open the file `questions_a_presenter.pdf` for the participant with the command shown, eg.:

```
$ evince -s -p 4 questions_a_presenter.pdf
```

* This would open the pdf at page 4 after run 1 and similarly, prompts after each run show corresponding page number in the pdf.

## How to quit

Don't. (`Ctrl + C` in emergency)

## Responses

* No responses except for the verbal ones after each acquisition run

## Design

* 2 sessions
* 5 runs (session 1) + 4 runs and 1 localizer (session 2)

## Software info

* Python 3.8.5, Expyriment 0.10.0.
* Primary script `run-lepetitprince-mri.sh`
* Secondary scripts `lepp_mri.py` for runs 1-9 and `localizer/localizer-speech.py` for the localizer.

## Other info

* Specified paths and scripts were originally run and tested on Ubuntu OS, so might need mods for running on Windows OS.
* `instructions_for_participants` contain original instructions in French and their English translations (from Google Translate) with `EN_` prefix
* same goes for `protocol/questions_reponses_a_imprimer.pdf` and `protocol/questions_a_presenter.pdf`
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
73 changes: 73 additions & 0 deletions le_petit_prince/localizer/list.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
subj,ntrial,cond,sent_dur,fname,sent_onset
1,1,french,1948,localizer_01A.wav,2000
1,2,french,2516,localizer_01B.wav,4448
1,3,french,1640,localizer_01C.wav,7464
1,4,control,2358,localizer_r_02A.wav,15104
1,5,control,3094,localizer_r_02B.wav,17962
1,6,control,2139,localizer_r_02C.wav,21556
1,7,french,2292,localizer_03A.wav,29695
1,8,french,3145,localizer_03B.wav,32487
1,9,french,2227,localizer_03C.wav,36132
1,10,control,2013,localizer_r_04A.wav,44359
1,11,control,2674,localizer_r_04B.wav,46872
1,12,control,1696,localizer_r_04C.wav,50046
1,13,french,2805,localizer_05A.wav,57742
1,14,french,2386,localizer_05B.wav,61047
1,15,french,2400,localizer_05C.wav,63933
1,16,control,2241,localizer_r_06A.wav,72333
1,17,control,2455,localizer_r_06B.wav,75074
1,18,control,2521,localizer_r_06C.wav,78029
1,19,french,2288,localizer_07A.wav,86550
1,20,french,2292,localizer_07B.wav,89338
1,21,french,2115,localizer_07C.wav,92130
1,22,control,2698,localizer_r_08A.wav,100245
1,23,control,3028,localizer_r_08B.wav,103443
1,24,control,2311,localizer_r_08C.wav,106971
1,25,french,2260,localizer_09A.wav,115282
1,26,french,2842,localizer_09B.wav,118042
1,27,french,1519,localizer_09C.wav,121384
1,28,control,2609,localizer_r_10A.wav,128903
1,29,control,2959,localizer_r_10B.wav,132012
1,30,control,2288,localizer_r_10C.wav,135471
1,31,french,1924,localizer_11A.wav,143759
1,32,french,2656,localizer_11B.wav,146183
1,33,french,1924,localizer_11C.wav,149339
1,34,control,1948,localizer_r_01A.wav,157263
1,35,control,2516,localizer_r_01B.wav,159711
1,36,control,1640,localizer_r_01C.wav,162727
1,37,control,2260,localizer_r_09A.wav,170367
1,38,control,2842,localizer_r_09B.wav,173127
1,39,control,1519,localizer_r_09C.wav,176469
1,40,french,2358,localizer_02A.wav,183988
1,41,french,3094,localizer_02B.wav,186846
1,42,french,2139,localizer_02C.wav,190440
1,43,control,2292,localizer_r_03A.wav,198579
1,44,control,3145,localizer_r_03B.wav,201371
1,45,control,2227,localizer_r_03C.wav,205016
1,46,french,2013,localizer_04A.wav,213243
1,47,french,2674,localizer_04B.wav,215756
1,48,french,1696,localizer_04C.wav,218930
1,49,control,2805,localizer_r_05A.wav,226626
1,50,control,2386,localizer_r_05B.wav,229931
1,51,control,2400,localizer_r_05C.wav,232817
1,52,french,2241,localizer_06A.wav,241217
1,53,french,2455,localizer_06B.wav,243958
1,54,french,2521,localizer_06C.wav,246913
1,55,control,2288,localizer_r_07A.wav,255434
1,56,control,2292,localizer_r_07B.wav,258222
1,57,control,2115,localizer_r_07C.wav,261014
1,58,french,2609,localizer_10A.wav,269129
1,59,french,2959,localizer_10B.wav,272238
1,60,french,2288,localizer_10C.wav,275697
1,61,control,1924,localizer_r_11A.wav,283985
1,62,control,2656,localizer_r_11B.wav,286409
1,63,control,1924,localizer_r_11C.wav,289565
1,64,french,2111,localizer_12A.wav,297489
1,65,french,1761,localizer_12B.wav,300100
1,66,french,1701,localizer_12C.wav,302361
1,67,french,2698,localizer_08A.wav,310062
1,68,french,3028,localizer_08B.wav,313260
1,69,french,2311,localizer_08C.wav,316788
1,70,control,2111,localizer_r_12A.wav,325099
1,71,control,1761,localizer_r_12B.wav,327710
1,72,control,1701,localizer_r_12C.wav,329971
142 changes: 142 additions & 0 deletions le_petit_prince/localizer/localizer-speech.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,142 @@
#! /usr/bin/env python
# updated: <2016-02-04 Esther LIN>
# -*- coding: utf-8 -*-

import pandas as pd
import os.path as op
import sys
import expyriment
from expyriment import design, control, stimuli, io, misc
import pygame

pygame.init()


'''
sent1 = stimuli.Audio("fr_localizer_03_22050.wav")
sent1.preload()
sent1.present()
'''

if len(sys.argv) < 2:
print(sys.argv[0] + " csvfile")
print("The csvfile must contained the list of stimuli and onset times")
sys.exit()
else:
stimuli_table = sys.argv[1]

exp = design.Experiment(name="bilingue_localizer")

# comment out the following two lines if running the real experiment:
control.set_develop_mode(True)
control.defaults.open_gl = 2

'''
FIXATION_DURATION = 1000
WORD_DURATION = 300
BLOC_DURATION = 6000
RESPONSE_KEYS = [misc.constants.K_b, misc.constants.K_y]
MAX_RESPONSE_DURATION = 1000 # need to be less than (900 + min ITI)
'''

##
control.initialize(exp)

## load the stimuli table into a block of trials
stim_tbl = pd.read_csv(stimuli_table)

block = design.Block(name="block1")

trial_items = []

for (i, stim_info) in stim_tbl.iterrows():
trial = design.Trial()
trial.set_factor("subj", stim_info.subj)
trial.set_factor("nbloc", stim_info.nbloc)
trial.set_factor("langue", stim_info.langue)
trial.set_factor("sent_onset", stim_info.sent_onset)
trial.set_factor("sent_dur", stim_info.sent_dur)
trial.set_factor("stims", stim_info.fname)



sound_fnames = [str("./sound_files/"+stim_info['fname'])]
trial_items.append(sound_fnames)
# transform the strings into surfaces to be blit on the screen
for w in sound_fnames:
stim = stimuli.Audio(w)
trial.add_stimulus(stim)
block.add_trial(trial)

exp.add_block(block) # note that there is only one block in this experiment

exp.data_variable_names = ["subj", "nbloc", "langue", "sent_onset",
"real_sentence_onset_before","real_sentence_onset_after","sent_dur","filename"]

### A few useful objects and functions

## define fixation crosses
fixcrossGreen = stimuli.FixCross(size=(45, 45), line_width=5,
colour=(0, 255, 0))
fixcrossGreen.preload()

fixcrossGrey = stimuli.FixCross(size=(45, 45), line_width=3,
colour=(192, 192, 192))
fixcrossGrey.preload()

'''
http://www.rapidtables.com/web/color/silver-color.htm
lightgray rgb(211,211,211)
silver rgb(192,192,192)
darkgray rgb(169,169,169)
gray rgb(128,128,128)
'''


def clear_screen():
exp.screen.clear()
exp.screen.update()


def wait_for_MRI_synchro():
fixcrossGreen.present(clear=True, update=True)
exp.keyboard.wait_char('t')


def wait_until(clock, time):
# busy loop wait
while (clock.time < time):
pass

############ MAIN LOOP

control.start(exp)


for block in exp.blocks:
wait_for_MRI_synchro()
clear_screen()

# present the fixation cross
fixcrossGrey.present()

clock = expyriment.misc.Clock()

for itrial, trial in enumerate(block.trials):
#print "Trial: #"+itrial
for stim in trial.stimuli:
stim.preload()

# present the sentence
wait_until(clock, trial.get_factor("sent_onset"))
real_sentence_onset_before = clock.time
stim.present()
real_sentence_onset_after = clock.time

io.Keyboard.process_control_keys()

exp.data.add([trial.get_factor("subj"), trial.get_factor('nbloc'),
trial.get_factor('langue'), trial.get_factor('sent_onset'),
real_sentence_onset_before,real_sentence_onset_after,trial.get_factor('sent_dur')," ".join(trial_items[itrial])])

control.end()
74 changes: 74 additions & 0 deletions le_petit_prince/localizer/sound_files/aga.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
0,
0,aga.csv
1948,localizer_01A.wav
2516,localizer_01B.wav
1640,localizer_01C.wav
2358,localizer_02A.wav
3094,localizer_02B.wav
2139,localizer_02C.wav
2292,localizer_03A.wav
3145,localizer_03B.wav
2227,localizer_03C.wav
2013,localizer_04A.wav
2674,localizer_04B.wav
1696,localizer_04C.wav
2805,localizer_05A.wav
2386,localizer_05B.wav
2400,localizer_05C.wav
2241,localizer_06A.wav
2455,localizer_06B.wav
2521,localizer_06C.wav
2288,localizer_07A.wav
2292,localizer_07B.wav
2115,localizer_07C.wav
2698,localizer_08A.wav
3028,localizer_08B.wav
2311,localizer_08C.wav
2260,localizer_09A.wav
2842,localizer_09B.wav
1519,localizer_09C.wav
2609,localizer_10A.wav
2959,localizer_10B.wav
2288,localizer_10C.wav
1924,localizer_11A.wav
2656,localizer_11B.wav
1924,localizer_11C.wav
2111,localizer_12A.wav
1761,localizer_12B.wav
1701,localizer_12C.wav
1948,localizer_r_01A.wav
2516,localizer_r_01B.wav
1640,localizer_r_01C.wav
2358,localizer_r_02A.wav
3094,localizer_r_02B.wav
2139,localizer_r_02C.wav
2292,localizer_r_03A.wav
3145,localizer_r_03B.wav
2227,localizer_r_03C.wav
2013,localizer_r_04A.wav
2674,localizer_r_04B.wav
1696,localizer_r_04C.wav
2805,localizer_r_05A.wav
2386,localizer_r_05B.wav
2400,localizer_r_05C.wav
2241,localizer_r_06A.wav
2455,localizer_r_06B.wav
2521,localizer_r_06C.wav
2288,localizer_r_07A.wav
2292,localizer_r_07B.wav
2115,localizer_r_07C.wav
2698,localizer_r_08A.wav
3028,localizer_r_08B.wav
2311,localizer_r_08C.wav
2260,localizer_r_09A.wav
2842,localizer_r_09B.wav
1519,localizer_r_09C.wav
2609,localizer_r_10A.wav
2959,localizer_r_10B.wav
2288,localizer_r_10C.wav
1924,localizer_r_11A.wav
2656,localizer_r_11B.wav
1924,localizer_r_11C.wav
2111,localizer_r_12A.wav
1761,localizer_r_12B.wav
1701,localizer_r_12C.wav
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Loading