Usage¶
Start by importing EasyHCP.
import easyhcp
-
easyhcp.hcpscraper.
setup_credentials
()[source]¶ Set Up AWS credentials from access keys into a credentials file
Notes
This function will open/create a file ‘~/.aws/credentials’, that will then include a section: [hcp] AWS_ACCESS_KEY_ID=XXXXXXXXXXXXXXXX AWS_SECRET_ACCESS_KEY=XXXXXXXXXXXXXXXX The keys are credentials that you can get from HCP (see https://wiki.humanconnectome.org/display/PublicData/How+To+Connect+to+Connectome+Data+via+AWS)
-
easyhcp.hcpscraper.
get_structural_data
(subject_list, scan_type, preprocessed=True, MNISpace=True, out_dir='.')[source]¶ Gets structural data for a list of subjects, and stores them in BIDS-like format in the specified output directory
Parameters: - subject_list : list
List of subjects to get data for
- scan_type: list
List of types of structural scans to get
- preprocessed : bool
Gets preprocessed data
- MNISpace : bool
Gets data registered in MNI Space
- out_dir : str
Path to output directory
Notes
Local filenames are changed to match our expected conventions. .. [R993021282679-1] Gorgolewski et al. (2016). The brain imaging data structure, a format for organizing and describing outputs of neuroimaging experiments. Scientific Data, 3:: 160044. DOI: 10.1038/sdata.2016.44.
-
easyhcp.hcpscraper.
get_resting_data
(subject_list, scan_run=['rfMRI_REST1_LR', 'rfMRI_REST2_LR', 'rfMRI_REST1_RL', 'rfMRI_REST2_RL'], preprocessed=True, MNISpace=True, out_dir='.')[source]¶ Gets resting data for runs for a list of subjects, and stores them in BIDS-like format in the specified output directory
Parameters: - subject_list : list
List of subjects to get data for
- scan_run: list
List of types of structural scans to get
- preprocessed : bool
Gets preprocessed data
- MNISpace : bool
Gets data registered in MNI Space
- out_dir : str
Path to output directory
Notes
Local filenames are changed to match our expected conventions. .. [Red044de8b140-1] Gorgolewski et al. (2016). The brain imaging data structure, a format for organizing and describing outputs of neuroimaging experiments. Scientific Data, 3:: 160044. DOI: 10.1038/sdata.2016.44.
-
easyhcp.hcpscraper.
train_test_split
(root: str, split_folds: (0.7, 0.2, 0.1), scan_type: list, convert_to_npy: bool = False) → None[source]¶ splits an hcp dataset into train, test, val and converts the .nii.gz files to .npy for easier processing checks shape to ensure t1 and t2 are same dim
Parameters: - root: str
root directory where raw files are stored
- split_folds: tuple(float, float, float)
What fraction to divide data in for train, test, val
- scan_type: list
What scans to divive into train - test splits