gingerbread package#

Subpackages#

Submodules#

gingerbread.data_download module#

class gingerbread.data_download.MedqueryDataDownloader#

Bases: object

MedqueryDataDownloader class for connecting to MedQuery and downloading data.

mq#

pymedquery instance

Type:

pymq.PyMedQuery

download_data(project_id: str, get_affines: bool = False, get_all: bool = True, include_mask: bool = False, batch_size: int = 20) NoReturn#

Download data from MedQuery and save it to disk.

Note

Instanciate the class and use this method to download data from MedQuery and save it to disk. For more information about data extraction from MedQuery, see {INSERT LINK HERE}.

Parameters:
  • project_id (str) – Project ID

  • get_affines (bool, optional) – Get affines, by default False

  • get_all (bool, optional) – Get all, by default True

  • include_mask (bool, optional) – Include mask, by default False

  • batch_size (int, optional) – Batch size, by default 20

Return type:

None

hdf5_to_nifti_all(hdf5_path: str, output_dir: str) NoReturn#

Convert hdf5 file to nifti file.

Parameters:
  • hdf5_path (str) – Path to hdf5 file

  • output_dir (str) – Path to output directory

Return type:

None

Attention

This method assumed that the hdf5 file contains affine matrices and data. If this is not the case, the method will not work.

hdf5_to_nifti_single(hdf5_path: str, output_dir: str, series_uid: str) NoReturn#

Convert single series to nifti file.

Parameters:
  • hdf5_path (str) – Path to hdf5 file

  • output_dir (str) – Path to output directory

  • series_uid (str) – Series UID

Return type:

None

Attention

This method assumed that the hdf5 file contains affine matrices and data. If this is not the case, the method will not work.

Module contents#