Collections Class
- class imagedata.Study(data, opts=None)[source]
Study – Read and sort images into a collection of Series objects.
Study(data, opts=None)
Examples
>>> from imagedata import Study >>> study = Study('directory/') >>> for uid in study: >>> series = study[uid]
- Parameters:
data – URL to input data, or list of Series instances
opts – Dict of input options, mostly for format specific plugins (argparse.Namespace or dict) * ‘strict_values’: Whether study attributes should match in each series (bool)
- Returns:
Study instance
- write(url, opts=None, formats=None)[source]
Write image data, calling appropriate format plugins
- Parameters:
self – Study instance
url – output destination url
opts – Output options (argparse.Namespace or dict)
formats – list of output formats, overriding opts.output_format (list or str)
- Raises:
imagedata.collections.UnknownOptionType – When opts cannot be made into a dict.
TypeError – List of output format is not list().
ValueError – Wrong number of destinations given, or no way to write multidimensional image.
imagedata.formats.WriteNotImplemented – Cannot write this image format.
- class imagedata.Patient(data, opts=None)[source]
Patient – Read and sort images into a collection of Study objects.
Patient(data, opts=None)
Examples
>>> from imagedata import Patient >>> patient = Patient('directory/') >>> for uid in patient: >>> study = patient[uid]
- Parameters:
data – URL to input data, or list of Study instances
opts – Dict of input options, mostly for format specific plugins (argparse.Namespace or dict) * ‘strict_values’: Whether attributes should match in each study (bool)
- Returns:
Patient instance
- write(url, opts=None, formats=None)[source]
Write image data, calling appropriate format plugins
- Parameters:
self – Patient instance
url – output destination url
opts – Output options (argparse.Namespace or dict)
formats – list of output formats, overriding opts.output_format (list or str)
- Raises:
imagedata.collections.UnknownOptionType – When opts cannot be made into a dict.
TypeError – List of output format is not list().
ValueError – Wrong number of destinations given, or no way to write multidimensional image.
imagedata.formats.WriteNotImplemented – Cannot write this image format.
- class imagedata.Cohort(data, opts=None)[source]
Cohort – Read and sort images into a collection of Patient objects.
Cohort(data, opts=None)
Examples
>>> from imagedata import Cohort >>> cohort = Cohort('directory/') >>> for id in cohort: >>> patient = cohort[id]
- Parameters:
data – URL to input data, or list of Patient instances
opts – Dict of input options, mostly for format specific plugins (argparse.Namespace or dict) * ‘strict_values’: Whether attributes should match in each study (bool)
- Returns:
Cohort instance
- write(url, opts=None, formats=None)[source]
Write image data, calling appropriate format plugins
- Parameters:
self – Cohort instance
url – output destination url
opts – Output options (argparse.Namespace or dict)
formats – list of output formats, overriding opts.output_format (list or str)
- Raises:
imagedata.collections.UnknownOptionType – When opts cannot be made into a dict.
TypeError – List of output format is not list().
ValueError – Wrong number of destinations given, or no way to write multidimensional image.
imagedata.formats.WriteNotImplemented – Cannot write this image format.