Getting help
You can book Zoom time with Ione Fine here.
To book time with Oliver Wu email dw67
Getting onto the STF computer
- Use “Remote Desktop Connection” to login to the computer
IP 10.159.241.74
Login name is: STF-Collective
Password is: imaging!
You may want to select Show Options at the bottom right.
Then select the upper tab Display and change Colors to High Color (16 bit) if you are struggling with speed a little.
Orienting yourself on the STF computer
- Ignore the CHF-STF Admin folder
- The CHN-STF folder contains 3 subfolders
Members
This folder should contain your own personal folder. Inside it you should have two copies of gather_data.R. One is called gather_data.R and the other is called gather_data_example.R. The idea is that you don’t change gather_data_example.R.
That means you have one working copy that you don’t change, and one you can mess around with.
Code examples
This is where you collect examples of R code. NEVER ALTER CODE IN THIS FOLDER. You shouldn’t need to go into this folder unless you’ve made a mistake in your old folder and need to replace your code example. If you need to do that COPY the code from this folder into your own folder.
Downloading the data to work locally
If you have R on your computer usually it’s easiest to download the data to work locally. Just send yourself the zipped file local_download.zip. It’s too big to email to yourself, so the easiest way to get it to yourself is to pop it on your google drive.
Once you have it on your own computer, then unzip it. Pull the CHN-STF folder out of the local_download folder and put it somewhere on your computer. Find the path (right click for properties). So, for example the path should look something like this:
C:\Users\Ione Fine\Documents\code\CHN-STF
Inside CHN-STF/members either create a folder with your name in it (make it exactly the same as the remote directory) OR copy over your members folder from the remote STF-CHN machine
Data
Inside this directory are two subfolders: MRI and surveys
MRI/derivatives/freesurfer
Good places to finding out what part of the brain does what includes this chapter.
This folder contains the data from each participant. Inside the folder recon-all you will find excel spreadsheets describing the volume, area, and cortical thickness of various areas.
aseg_stats. This contains the results of subcortical segmentation, includes areas like the thalamus and putamen. Values in the excel table are as follows, once you are more likely to use in analyses are bolded.
ColHeaders | Index | SegId | NVoxels | Volume_mm3 | StructName | normMean | normStdDev | normMin | normMax | normRange |
ignore | ignore | ignore | ignore | structure volume in mm3 | structure name | mean intensity value of structure | std of intensity | min intensity | max intensity | intensity range |
Specialized areas subcortical segmentation
brainstemSsVolumes, amygNucCVolumes, hippoSfVolumes, These contain volumes of each area, plus estimated volumes of segmentions of each area in mm3.
Cortical parcellation files
aparc files contain surface parcellations. There are a variety of these depending on the region/atlas that is being parcellated – each one has left and right hemisphere.
Each excel sheet has a column for each area, and a value for that column. If the excel spreadsheet name includes ‘area_mm2‘ then the excel sheet is reporting on the surface area of that area. There are three different segmentations (in the order that they were added to Freesurfer).
aparc. These are surface parcellations of cortex based on the DK atlas. (Don’t use one with pial in it’s name.)
aparc.a2009s. These are surface parcellations of cortex based on the Destrieux atlas.
aparc.DKTatlas. These are surface parcellations of cortex based on the DKT atlas.
Surveys
Contains all the current survey questions. There is an associated pdf in the same folder which contains the codebook (basically an explanation of each variable in the excel spreadsheet).
Questions include the following. Every MR participant should have a survey and the subject_id (e.g. STFC022) is the way of linking the two. Some people filled out the survey, but didn’t do the MR scan.
The questions cover a really broad range of topics.
- Demographics (Age, SES)
- Videogame Use
- Attitudes to Learning
- Fatigue
- Religion/Spirituality
- Meditation
- Physical Activity
- Memory
- Sleep
- Audio Device Use
- Family (Siblings)
- Concussion/TBI
- Emotional Expression and Regulation
- Social Anxiety
- Hormones
- Reality TV
- Depression
- Autism Spectrum Disorder (ASD)
- ADHD
- ASL
- Bilingualism
- Collectivism/Individualism
- Rumination
- Self-Reflection and Insight
- Decision Making
- Positive Psychology
- Resistance to Change
- Self-Identity
- Watts Connectedness Scale
- Neuroticism
- Openness
- Self-Assessment
- Warwick-Edinburgh Mental Well-being Scale (WEMWBS)
- Depression Anxiety and Stress Scale (DASS)
- Nature Connectedness
- Living Condition/Community
Creating a New Excel Spreadsheet
Now you are oriented, you are ready to roll!
Double click gather_data.R. It should open R.
You will need to change the following lines:
Lines 7-10: The first path is correct for the CHN-STF computer. Replace this with your computer path if you are running locally
Line 14: memberDir: Replace with the name of your folder.
Line 15: outFileName: Select an output filename for the csv file that will be created
Line 17: subjectName: STFC will create a spreadsheet for all participants with both survey and MR data. Or you can focus on one participant using STFC014
Line 21: surveyFileName: Make sure you are pulling in the correct survey (double check the last four digits!)
Line 23: surveyFields: Choose which survey fields you are interested in (pick some fun ones from the pdf codebook)
Line 26: MRFileName: Choose which MR excel sheet you want to pull data from
Line 27: MRFields: Choose which MR variables you are interested in
Run the program
Click source in the upper right.
If it runs correctly it will generate you an excel output file!
How to fix common errors
>cannot open file ‘C:/Users/STF-Collective/Documents/CHN-STF/data/surveys/greenspace_personality/STFCHNSurvey_DATA_2024-04-02_1217.csv’: No such file or directory
This means you have the wrong survey name. Usually this means (1) the survey has been updated and the four-digit identifier at the end has changed, (2) you have your slashes the wrong way around (they should be this way ‘/’ or you have the wrong number of slashes.