xdrt package

Submodules

xdrt.utils module

xdrt.utils.camel_to_snake(name)[source]
xdrt.utils.make_integer(z)[source]
xdrt.utils.parse_xvi_datetime(datetime_str)[source]
xdrt.utils.parse_xvi_url(url)[source]

xdrt.xdr_reader module

class xdrt.xdr_reader.XDRHeader(header_dict)[source]

Bases: object

property affine
property direction
property origin
parse_array_keys()[source]
property spacing
static xdr_affine_to_affine(affine_xdr, min_ext)[source]
class xdrt.xdr_reader.XDRImage(header, data=None)[source]

Bases: object

Placeholder for the XDR Image.

xdrt.xdr_reader.postprocess_xdr_image(xdr_image: xdrt.xdr_reader.XDRImage, temporal_average: str, slope: float, intercept: float, cast: str) xdrt.xdr_reader.XDRImage[source]
xdrt.xdr_reader.read(xdr_filename, stop_before_data=False)[source]

Read XDR file.

Returns
XDRImage
xdrt.xdr_reader.read_as_simpleitk(xdr_image, lps_orientation=True, save_header=False)[source]

Read XDR file as an SimpleITK image.

Returns
sitk.Image or list of sitk.Image

xdrt.xvi_reader module

class xdrt.xvi_reader.Patient(patient_id, first_name, last_name, date_of_birth)[source]

Bases: NamedTuple

Create new instance of Patient(patient_id, first_name, last_name, date_of_birth)

date_of_birth: datetime.datetime

Alias for field number 3

first_name: str

Alias for field number 1

last_name: str

Alias for field number 2

patient_id: str

Alias for field number 0

class xdrt.xvi_reader.Scan(scan_uid, date_time, version, level, window, filename)[source]

Bases: NamedTuple

Create new instance of Scan(scan_uid, date_time, version, level, window, filename)

date_time: datetime.datetime

Alias for field number 1

filename: pathlib.Path

Alias for field number 5

level: float

Alias for field number 3

scan_uid: str

Alias for field number 0

version: str

Alias for field number 2

window: float

Alias for field number 4

class xdrt.xvi_reader.XVIReconstruction(path: pathlib.Path)[source]

Bases: object

Object holding an XVI file.

Parameters
xvi_filenamepathlib.Path

Path to XVI file.

files_rootpathlib.Path

Path to the root directory where the files can be found. This will be prepended to the reconstruction filename as derived from xvi_filename. If set, there will be a check if the reconstruction files exist.

Module contents

Top-level package for XDR Toolkit.