Skip to content

osirix.dicom

Classes that represent the core objects within the OsiriX database.

All attributes for these classes are immutable.

Example usage
import osirix
from osirix.dicom import DicomStudy, DicomSeries

database = osirix.current_browser()  # Get the current browser instance
studies, series = database.database_selection()  # Get the current selection by the user
for study in studies:
    print(f"This is a DicomStudy instance with name {obj.study_name}")
for serie in series:
    print(f"This is a DicomSeries instance with description {obj.series_description}")

DicomImage

Bases: OsirixBase

An instance representing a Dicom image within the OsiriX database.

complete_path property

The path of the source Dicom file.

date property

The date in which the Dicom image were acquired.

height property

The number of rows in the image

instance_number property

The instance number for the Dicom image.

modality property

The modality of the Dicom image.

number_of_frames property

The number of frames within the Dicom image.

series property

The DicomSeries instance in which the image is contained.

slice_location property

The slice location of the image.

Note that this is never perfect; it can be better to read the source dicom instance and use the ImagePositionPatient parameter.

sop_instance_uid property

The SOP instance UID for the image.

width property

The number of columns in the image

DicomSeries

Bases: OsirixBase

An instance representing a Dicom series within the OsiriX database.

date property

The date in which the series was acquired.

images property

The Dicom Image instances associated with the series.

modality property

The modality of the Dicom series.

next_series property

The next Dicom Series in the OsiriX database.

number_of_images property

The number of images within the Dicom series.

paths property

The Dicom file paths associated with the series.

Returns:

Type Description
List[str]

A list of absolute paths.

patient_name property

The patient name of the Dicom series

previous_series property

The previous Dicom Series in the OsiriX database.

series_description property

The series description.

series_instance_uid property

The series instance UID.

This seems to generate some unexpected results. It is better to access directly by reading the dicom files (via DicomSeries.paths) using the pydicom library.

sop_class_uid property

The series SOP class UID.

study property

The Dicom Study containing the series.

sorted_images()

Dicom image instances sorted by OsiriX user preferences.

These preferences are determined in OsiriX Preferences / Database / Sorting.

Returns:

Type Description
List[DicomImage]

A list of sorted DicomImage instances.

DicomStudy

Bases: OsirixBase

An instance representing a Dicom study within the OsiriX database.

date property

The date in which the Dicom data were acquired.

date_added property

The date in which the Dicom data were added to the OsiriX database.

date_of_birth property

The patient date of birth for the Dicom study.

images property

The Dicom Image instances associated with the study.

institution_name property

The name of the institution where the Dicom study was performed.

modalities property

The modalities available within the Dicom study.

Modalities are seperated by a double backslash (e.g. "PT\CT")

no_files property

The number of files comprising the Dicom study.

number_of_images property

The number of images within the Dicom study.

paths property

The Dicom file absolute paths associated with the study.

This will ignore any paths associated with the OsiriX ROI Dicom SRs.

patient_id property

The patient ID of the Dicom study.

patient_name property

The patient name of the Dicom study

patient_sex property

The patient sex of the Dicom study.

patient_uid property

The patient UID of the Dicom study.

performing_physician property

The performing physician name for the Dicom study.

raw_no_files property

The number of raw image files within the Dicom study.

Note that this will include the OsiriX ROI SR files if any exist. Using no_files provides the number of accessible images.

referring_physician property

The referring physician name for the Dicom study.

series property

The Dicom Series instances associated with the study.

This will ignore any series associated with the OsiriX ROI Dicom SRs.

study_instance_uid property

The study instance UID for the Dicom series.

study_name property

The study name for the Dicom series.