2.1.1.2. rpt_dosi.db

2.1.1.2.1. Classes

PatientTreatmentDatabase

Store information about a patient treatment:

CycleTreatmentDatabase

Class to manage metadata, providing methods to convert to/from dict and JSON.

TimepointTreatmentDatabase

Store filenames, not paths, paths are computed on the fly.

2.1.1.2.2. Functions

db_get_time_interval(cycle, acquisition)

create_test_db(data_folder, db_file_path)

compute_time_activity_curve(cycle, roi_names[, spect_name])

2.1.1.2.3. Module Contents

rpt_dosi.db.db_get_time_interval(cycle, acquisition)[source]
class rpt_dosi.db.PatientTreatmentDatabase(filename, create=False, sync_metadata_image=False)[source]

Bases: rpt_dosi.metadata.ClassWithMetaData

Store information about a patient treatment: - all cycles, all imaging timepoints - consider a hierarchy folders patient/cycle_id/timepoint_id/images - from / to json files - when store to a json file, the database folder MUST be the one of the json file

patient/

db.json cycle1/

tp1/

ct.nii.gz spect.nii.gz

tp2/ …

cycle2/ …

_metadata_fields[source]
patient_id = None[source]
body_weight_kg = None[source]
cycles[source]
_db_file_path = None[source]
_db_data_path = None[source]
info()[source]
property db_data_path[source]
property db_file_path[source]
__str__()[source]
number_of_timepoints()[source]
number_of_rois()[source]
number_of_images()[source]
get_cycle(cycle_id)[source]
__getitem__(key)[source]
add_cycle(cycle)[source]
remove_cycle(cycle_id)[source]
add_new_cycle(cycle_id)[source]
add_dicom_ct(cycle_id, tp_id, folder_path)[source]
write(filename=None, sync_metadata_image=True, sync_policy='auto')[source]
write_metadata_images()[source]
sync_metadata_images(sync_policy='auto')[source]
read(filename, sync_metadata_image)[source]
to_dict()[source]

Store the metadata attributes to a dictionary.

from_dict(data)[source]

Set the metadata attributes of the instance from a dictionary.

check_folders_exist()[source]
check_files_exist()[source]
check_files_metadata()[source]
class rpt_dosi.db.CycleTreatmentDatabase(db, cycle_id)[source]

Bases: rpt_dosi.metadata.ClassWithMetaData

Class to manage metadata, providing methods to convert to/from dict and JSON. The class fields that are considered as metadata are store in _metadata_fields.

_metadata_fields[source]
db[source]
cycle_id[source]
injection_activity_mbq = None[source]
_injection_datetime = None[source]
injection_radionuclide = None[source]
timepoints[source]
info()[source]
__str__()[source]
property injection_datetime[source]
get_timepoint(tp_id)[source]
__getitem__(key)[source]
add_timepoint(tp)[source]
add_new_timepoint(tp_id)[source]
property cycle_path[source]
to_dict()[source]

Store the metadata attributes to a dictionary.

from_dict(data)[source]

Set the metadata attributes of the instance from a dictionary.

sync_metadata_images(sync_policy='auto')[source]
write_metadata_images()[source]
check_folders_exist()[source]
check_files_exist()[source]
check_files_metadata()[source]
class rpt_dosi.db.TimepointTreatmentDatabase(cycle, tp_id)[source]

Bases: rpt_dosi.metadata.ClassWithMetaData

Store filenames, not paths, paths are computed on the fly. The folders are build from db/cycle/timepoint

_metadata_fields[source]
cycle[source]
timepoint_id[source]
_acquisition_datetime = None[source]
images[source]
rois[source]
info()[source]
__str__()[source]
to_dict()[source]

Store the metadata attributes to a dictionary.

from_dict(data)[source]

Set the metadata attributes of the instance from a dictionary.

property acquisition_datetime[source]
sync_metadata_images(sync_policy='auto')[source]
sync_metadata_image(image_name, sync_policy='auto')[source]
sync_metadata_roi(roi_name, sync_policy='auto')[source]
write_metadata_images()[source]
property timepoint_path[source]
property rois_path[source]
get_roi(roi_id)[source]
get_roi_path(roi_id)[source]
get_metaimage(image_name)[source]
get_image_file_path(image_name)[source]
property time_from_injection_h[source]
add_image_from_file(image_name, input_path, image_type=None, filename=None, mode='copy', unit=None, file_exist_ok=False)[source]
add_image(image_name, meta_image)[source]
add_rois(roi_list, mode='copy', exist_ok=False)[source]
add_roi(roi)[source]
add_roi_from_file(roi_id, input_path, mode='copy', exist_ok=False)[source]
check_folders_exist()[source]
check_files_exist()[source]
check_files_metadata()[source]
rpt_dosi.db.create_test_db(data_folder, db_file_path)[source]
rpt_dosi.db.compute_time_activity_curve(cycle, roi_names, spect_name='spect')[source]