Menu

Helper Module for Deep Learning.

Module provides functions to prepare different datasets from HCP.
  1. the T1 and associated brain masks.

class pynet.datasets.hcp.Item(input_path, output_path, metadata_path)
property input_path

Alias for field number 0

property metadata_path

Alias for field number 2

property output_path

Alias for field number 1

pynet.datasets.hcp.fetch_hcp_brain(datasetdir, low=False, small=True)[source]

Fetch/prepare the HCP T1/brain mask dataset for pynet.

Go to ‘https://db.humanconnectome.org’ and get an account and log in. Then, click on the Amazon S3 button that should give you a key pair. Then use ‘aws configure’ to add this to our machine. AWS Access Key ID: ************ AWS Secret Access Key: ************ Default region name: eu-west-3 Default output format: json

Parameters

datasetdir: str

the dataset destination folder.

low: bool, default False

set images in low resolution.

small: bool, default True

fetch 45 brains if true, else 1200 brains.

Returns

item: namedtuple

a named tuple containing ‘input_path’, ‘output_path’, and ‘metadata_path’.

pynet.datasets.hcp.get_hcp_data(datasetdir, subject_prefix, modality, low)[source]

Get the requested data.

Parameters

datasetdir: str

the dataset destination folder.

subject_prefix: str

subject path.

modality: str

type of image to be extracted (‘T1w’ or ‘MNINonLinear’).

low: bool

set image in low resolution.

Returns

data: dict

the loaded data.

pynet.datasets.hcp.load_image(filename, low=False)[source]

Load an MRI image.

High resolution images are resampled to (256, 312, 256) and low resolution images are resampled to (32, 40, 32) which can be divided by 8.

Parameters

filename: str

file to be loaded.

low: bool, default False

set image in low resolution.

Returns

img_data: np.array

loaded image.

Follow us

© 2019, pynet developers .
Inspired by AZMIND template.