Skip to content

Commit 737bb59

Browse files
committed
add fMRI tasks SOP as a page
1 parent 6f8a973 commit 737bb59

10 files changed

Lines changed: 229 additions & 4 deletions

File tree

docs/Admin/index.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,10 @@ nav_order: 4
66
---
77

88
# Quick links:
9-
- [holmeslab.bhi#gmail.com](holmeslab.bhi@gmail.com) - Lab manager / research assistants email
10-
- [holmeslab-bhi#googlegroups.com](holmeslab-bhi@googlegroups.com) - Email all active members of Holmes Lab
11-
- [holmesparkes#googlegroups.com](holmesparkes@googlegroups.com) - Email all active members of Holmes Lab + Parkes Lab
12-
- [my.rutgers.edu](my.rutgers.edu) - Where all your reimbursement, payment, HR, insurance, etc. information is.
9+
- [holmeslab.bhi#gmail.com](mailto:holmeslab.bhi@gmail.com) - Lab manager / research assistants email
10+
- [holmeslab-bhi#googlegroups.com](mailto:holmeslab-bhi@googlegroups.com) - Email all active members of Holmes Lab
11+
- [holmesparkes#googlegroups.com](mailto:holmesparkes@googlegroups.com) - Email all active members of Holmes Lab + Parkes Lab
12+
- [my.rutgers.edu](https://my.rutgers.edu/uxp/) - Where all your reimbursement, payment, HR, insurance, etc. information is.
1313
- [Purchasing](https://holmeslab.github.io/holmeslab/docs/Admin/purchasing/) - information and tutorials for purchasing
1414
- [Rutgers Contacts](https://holmeslab.github.io/holmeslab/docs/Admin/rutgers-contacts/) - People/emails to contact for various problems and questions relating to the Holmes Lab at Rutgers University
1515

docs/PCX/.DS_Store

0 Bytes
Binary file not shown.

docs/PCX/fMRI-tasks.md

Lines changed: 128 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,128 @@
1+
# Tasks Overview
2+
## Tasks Explanation:
3+
- Sound_check: a script which will play short beeps to check how the participant’s audio levels are for subsequent tasks
4+
- Flanker task: a task where participants see 4 arrows facing the same direction (called ‘flanker’ arrow), with a blank spot in the middle, and then a 5th arrow (called ‘target’ arrow) appears in the middle of the other 4. The target arrow may be facing the same direction as the initial 4 flankers (congruent) or facing the opposite direction (incongruent). Participants respond on the button box based on which direction the target arrow faces.
5+
- Goal of this task: Instigate cognitive control networks in the brain
6+
- Sound Output: If the participant gets the arrow direction correct, you’ll hear a ‘click’ on your laptop. If the participant gets the arrow wrong, you’ll hear a ‘beep’ on your laptop. If the participant doesn’t respond in time, you’ll hear a ‘buzz’ on your laptop. Listen to the sounds in the /sounds folder.
7+
- Data output: in /data folder
8+
9+
- Listening Language Task: participants see a quick image (1s), and then the screen is a black fixation cross (+). They then hear either a sentence related to that image, or a unrelated list of common words. When participants hear the audio stop, they press the button box. The fixation cross (+) will turn into a star (*) upon button press. Then they wait another second or two, and the star (*) will turn into a square (■). When they see that happen, they respond by pressing the button box again.
10+
- Goal: Map the areas of the brain active when hearing and understanding sentences in context. Uses the lists of common words to regress out the impact of hearing words, and familiar words. Uses the second button press to regress out the motion effects of pressing the button.
11+
- Sound Output: If the participant responds to the star and the square, you’ll hear a ‘click’ on your laptop. If the participant doesn’t respond in time to one or both, you’ll hear a ‘buzz’ on your laptop. Listen to the sounds in the /sounds folder.
12+
- Data output: in /data folder
13+
- The Elevator: short film, just start the task and let it play
14+
- Data output: in /data folder
15+
- Momentous: short film, just start the task and let it play
16+
- Data output: in /data folder
17+
18+
## Psychopy Scripts:
19+
Filepath: Box-Box/Holmes_Lab_Wiki/PCX_Round2/MRI/In_scanner_tasks/<task_name>
20+
- sound_check.py
21+
- flanker_task_TCP_250407.py
22+
- language_task.py
23+
- PlayTheElevator.py
24+
- PlayMomentous.py
25+
26+
Scanning Protocol
27+
• Total time: 01:13:17
28+
• Full doc Rutgers: [https://rutgers.box.com/s/u5zlr6hktxrqej7wcdf94j1gg2exw0gd](https://rutgers.box.com/s/u5zlr6hktxrqej7wcdf94j1gg2exw0gd)
29+
30+
31+
# Setup for Running Tasks
32+
There are 4 tasks:
33+
- Flanker task
34+
- Language task
35+
- The Elevator (Movie task)
36+
- Momentous (Movie task)
37+
38+
## Step 1: Download
39+
- Download the tasks to your scan computer locally. All tasks are located in this box folder: [https://rutgers.box.com/s/qkqr45kfk22q1a3s32qxj8r15022n7ig](https://rutgers.box.com/s/qkqr45kfk22q1a3s32qxj8r15022n7ig)
40+
## Step 2: Psychopy
41+
- If you don’t have psychopy on the scanning computer, you can download based on your operating system on: [https://www.psychopy.org/download.html](https://www.psychopy.org/download.html)
42+
- You should move the PsychoPy application to your applications folder.
43+
if immediately crashing, try searching for your hidden folders in /Users/yourusername and delete folders called .psychopy3 .psychopy2
44+
45+
## Step 3: Site Configurations
46+
- In the Box folder of tasks, go into one of the folders and click on ‘siteConfig_McLean’ (or ‘siteConfig_Rutgers’ based on your site)
47+
- Here you can edit site specific configurations:
48+
- *** If you change any, you can test it in that task. Once you’re satisfied, copy/replace that siteConfig doc to EACH of the task folders. All the task folders have a siteConfig doc which needs to be updated with any changes.
49+
50+
```bash
51+
"scan_trigger": ["5"],
52+
- "scanner_speaker_index": 0.0,
53+
- "scanner_speaker_names": ["External Headphones", "Studio Display Speakers"],
54+
- "laptop_speaker_index": 2.0,
55+
- "laptop_speaker_names": ["MacBook Air Speakers", "MacBook Pro Speakers"],
56+
- "scanner_volume": 1,
57+
- "laptop_volume": 2.0,
58+
- "button_keys": ["1", "2"],
59+
- "text_size": 2.5,
60+
- "star_size": [1,1],
61+
- "square_size": [3,3],
62+
- "image_size": [30,30],
63+
- "mirror_screen": "False",
64+
- "researcher_key": "space",
65+
- "screenToShow": 1,
66+
- "isFullScreen": "True"
67+
- }
68+
69+
```
70+
71+
## Step 4: Speaker Settings
72+
- Go through steps 1-4 of the ‘Running a Task’
73+
- Then press ‘esc’ key to exit the task
74+
- Find the window that says “PsychoPy Runner”
75+
- Make sure the speakers detected by the script are as you would want them – they’re correctly detecting the scanner speaker output and the laptop speaker output
76+
![speaker](tasks/speaker.png)
77+
78+
- If not, look above at the list of all speaker/audio outputs. Find the name of the one which is the scanner/laptop, and add it to the siteConfig for your site (step 3).
79+
![speaker-list](tasks/speaker-list.png)
80+
81+
## Step 5: Button Box Keys
82+
- While the scan laptop is connected to the button box in the scanner room (as in, the scan laptop is hooked up how it would be to run tasks), open up any text file (could be Microsoft word, a note, etc) and press the button keys. If it starts typing letters, you’re hooked up.
83+
- Now press your index finger, and see what key gets typed into your file.
84+
- Do the same for your middle finger.
85+
- These will be your two fingers for the tasks.
86+
- In your siteConfig file, replace this line but changing “1” to whatever key goes its typed with your index finger, and “2” to whatever key is typed with your middle finger
87+
88+
# Running Tasks
89+
## Step 1: Open PsychoPy
90+
Open PsychoPy Application. If you have an older computer, you should quit all other processes running (psychopy can be very buggy, especially when other things are taking up computer memory).
91+
## Step 2: Open Coder View
92+
Open the coder view by clicking on this icon:
93+
![coder](tasks/coder.png)
94+
## Step 3: Open Script
95+
Click the “Open” button to import a file
96+
Go to the place you saved the Psychopy scripts
97+
Open the folder of the task you want to run
98+
Click on the file in the task folder which is a python script
99+
- It’s extension is “.py”
100+
- It says “python script”
101+
![open](tasks/open.png)
102+
## Step 4: Run Task
103+
- Click the green button to run the script
104+
![run](tasks/run.png)
105+
- Enter in the subject’s name and site location
106+
107+
108+
# If giving problems, try the following things:
109+
- If on a Mac, go to System Preferences → Security & Privacy → Privacy tab, then for ‘Accessibility’ and ‘Input Monitoring’, add Psychopy as an app who can access
110+
- Install brew install portaudio, brew install libsndfile, brew install portmidi, brew install liblo and then brew install —cask psychopy and then brew install pipx
111+
- pipx install psychopy-sounddevice, pipx install psychopy-ptb, pipx install psychopy-pyo
112+
- Ended up also having to install git, gitpython, libsndfile, curl, pipx, and then trying to install psychopy from the command line instead of from the standalone since i was still getting dependency issues
113+
- if needed to change preferences, go to builder and click the grey ‘gear’ icon to alter settings. cannot alter settings of already-built scripts via this— this is just how you alter stuff for building scripts.
114+
- make it all in a virtual environment pythonenv using python 3.11
115+
116+
117+
# Data Output from Tasks
118+
Data output from tasks are saved in a subfolder from the folder where the script is, called /data, and a folder for each participant
119+
- So for example, Flanker task data is stored in Box-Box/Holmes_Lab_Wiki/PCX_Round2/MRI/In_scanner_tasks/Flanker_task/data
120+
- Within /data you'll see a folder for each participant
121+
- /PCR200, /PCM201, ...
122+
- Within each /PC*** folder, you'll have 3 files per each run (more if you run multiple times)
123+
- Log file ending in .log
124+
- CSV document with the actual data
125+
- A 'document' unreadable
126+
- Sometimes a CSV with 'trials' in the name that has a lot less info than the normal CSV
127+
128+
- Once a subject is run through [Step 9 of the PCX Data Pipeline](https://holmeslab.github.io/holmeslab/docs/PCX/data-pipeline/), there will also be a TSV file which is BIDS-valid, where the first column is "onset" and second column is "duration"

docs/PCX/mclean-id-forms/.DS_Store

6 KB
Binary file not shown.
Lines changed: 97 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,97 @@
1+
# Tasks Overview
2+
## Tasks Explanation:
3+
- Sound_check: a script which will play short beeps to check how the participant’s audio levels are for subsequent tasks
4+
- Flanker task: a task where participants see 4 arrows facing the same direction (called ‘flanker’ arrow), with a blank spot in the middle, and then a 5th arrow (called ‘target’ arrow) appears in the middle of the other 4. The target arrow may be facing the same direction as the initial 4 flankers (congruent) or facing the opposite direction (incongruent). Participants respond on the button box based on which direction the target arrow faces.
5+
- Goal of this task: Instigate cognitive control networks in the brain
6+
- Sound Output: If the participant gets the arrow direction correct, you’ll hear a ‘click’ on your laptop. If the participant gets the arrow wrong, you’ll hear a ‘beep’ on your laptop. If the participant doesn’t respond in time, you’ll hear a ‘buzz’ on your laptop. Listen to the sounds in the /sounds folder.
7+
- Data output: in /data folder
8+
9+
- Listening Language Task: participants see a quick image (1s), and then the screen is a black fixation cross (+). They then hear either a sentence related to that image, or a unrelated list of common words. When participants hear the audio stop, they press the button box. The fixation cross (+) will turn into a star (*) upon button press. Then they wait another second or two, and the star (*) will turn into a square (■). When they see that happen, they respond by pressing the button box again.
10+
- Goal: Map the areas of the brain active when hearing and understanding sentences in context. Uses the lists of common words to regress out the impact of hearing words, and familiar words. Uses the second button press to regress out the motion effects of pressing the button.
11+
- Sound Output: If the participant responds to the star and the square, you’ll hear a ‘click’ on your laptop. If the participant doesn’t respond in time to one or both, you’ll hear a ‘buzz’ on your laptop. Listen to the sounds in the /sounds folder.
12+
- Data output: in /data folder
13+
- The Elevator: short film, just start the task and let it play
14+
- Data output: in /data folder
15+
- Momentous: short film, just start the task and let it play
16+
- Data output: in /data folder
17+
18+
## Psychopy Scripts:
19+
Filepath: Box-Box/Holmes_Lab_Wiki/PCX_Round2/MRI/In_scanner_tasks/<task_name>
20+
- sound_check.py
21+
- flanker_task_TCP_250407.py
22+
- language_task.py
23+
- PlayTheElevator.py
24+
- PlayMomentous.py
25+
26+
Scanning Protocol
27+
• Total time: 01:13:17
28+
• Full doc Rutgers: [https://rutgers.box.com/s/u5zlr6hktxrqej7wcdf94j1gg2exw0gd](https://rutgers.box.com/s/u5zlr6hktxrqej7wcdf94j1gg2exw0gd)
29+
30+
31+
# Setup for Running Tasks
32+
There are 4 tasks:
33+
- Flanker task
34+
- Language task
35+
- The Elevator (Movie task)
36+
- Momentous (Movie task)
37+
38+
## Step 1: Download
39+
- Download the tasks to your scan computer locally. All tasks are located in this box folder: [https://rutgers.box.com/s/qkqr45kfk22q1a3s32qxj8r15022n7ig](https://rutgers.box.com/s/qkqr45kfk22q1a3s32qxj8r15022n7ig)
40+
## Step 2: Psychopy
41+
- If you don’t have psychopy on the scanning computer, you can download based on your operating system on: [https://www.psychopy.org/download.html](https://www.psychopy.org/download.html)
42+
- You should move the PsychoPy application to your applications folder.
43+
if immediately crashing, try searching for your hidden folders in /Users/yourusername and delete folders called .psychopy3 .psychopy2
44+
45+
## Step 3: Site Configurations
46+
- In the Box folder of tasks, go into one of the folders and click on ‘siteConfig_McLean’ (or ‘siteConfig_Rutgers’ based on your site)
47+
- Here you can edit site specific configurations:
48+
- *** If you change any, you can test it in that task. Once you’re satisfied, copy/replace that siteConfig doc to EACH of the task folders. All the task folders have a siteConfig doc which needs to be updated with any changes.
49+
50+
```bash
51+
"scan_trigger": ["5"],
52+
- "scanner_speaker_index": 0.0,
53+
- "scanner_speaker_names": ["External Headphones", "Studio Display Speakers"],
54+
- "laptop_speaker_index": 2.0,
55+
- "laptop_speaker_names": ["MacBook Air Speakers", "MacBook Pro Speakers"],
56+
- "scanner_volume": 1,
57+
- "laptop_volume": 2.0,
58+
- "button_keys": ["1", "2"],
59+
- "text_size": 2.5,
60+
- "star_size": [1,1],
61+
- "square_size": [3,3],
62+
- "image_size": [30,30],
63+
- "mirror_screen": "False",
64+
- "researcher_key": "space",
65+
- "screenToShow": 1,
66+
- "isFullScreen": "True"
67+
- }
68+
69+
```
70+
71+
## Step 4: Speaker Settings
72+
- Go through steps 1-4 of the ‘Running a Task’
73+
- Then press ‘esc’ key to exit the task
74+
- Find the window that says “PsychoPy Runner”
75+
- Make sure the speakers detected by the script are as you would want them – they’re correctly detecting the scanner speaker output and the laptop speaker output
76+
77+
## Step 5: Button Box Keys
78+
- While the scan laptop is connected to the button box in the scanner room (as in, the scan laptop is hooked up how it would be to run tasks), open up any text file (could be Microsoft word, a note, etc) and press the button keys. If it starts typing letters, you’re hooked up.
79+
- Now press your index finger, and see what key gets typed into your file.
80+
- Do the same for your middle finger.
81+
- These will be your two fingers for the tasks.
82+
- In your siteConfig file, replace this line but changing “1” to whatever key goes its typed with your index finger, and “2” to whatever key is typed with your middle finger
83+
84+
# Running Tasks
85+
## Step 1: Open PsychoPy
86+
Open PsychoPy Application. If you have an older computer, you should quit all other processes running (psychopy can be very buggy, especially when other things are taking up computer memory).
87+
## Step 2: Open Coder View
88+
Open the coder view by clicking on this icon:
89+
![coder](/tasks/coder.png)
90+
## Step 3: Open Script
91+
Click the “Open” button to import a file
92+
Go to the place you saved the Psychopy scripts
93+
Open the folder of the task you want to run
94+
Click on the file in the task folder which is a python script
95+
- It’s extension is “.py”
96+
- It says “python script”
97+
- It’s

docs/PCX/tasks/coder.png

124 KB
Loading

docs/PCX/tasks/open.png

168 KB
Loading

docs/PCX/tasks/run.png

342 KB
Loading

docs/PCX/tasks/speaker-list.png

211 KB
Loading

docs/PCX/tasks/speaker.png

755 KB
Loading

0 commit comments

Comments
 (0)