osirix.browser_controller
Provides access to core functionality of the OsiriX database.
There should only ever be one, but it is OK to create multiple pyOsiriX instances, they will
just contiain the same osirixrpc_uid
.
Example usage
BrowserController
Bases: OsirixBase
copy_files_into_database(files)
Copy files into the Osirix database.
Note that this will always copy files, rather than copy by link, therefore doubling the memory requirements. It is safe to delete the source Dicom data after import, if you wish to do so.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
files |
List[str]
|
The list of files to copy, as absolute paths. |
required |
database_selection()
Queries the user selection of Dicom images.
Returns:
Type | Description |
---|---|
List[DicomStudy]
|
The selected Dicom study instances |
List[DicomSeries]
|
The selected Dicom series instances |
open_viewer_2d(dicom_images)
Open a 2D viewer for an array of osirix.dicom.DicomImage instances.
Note that images will be loaded in the order in which they are presented as input here.
Use the properties of DicomImage to ensure that they are loaded in order (e.g. sorted by
the slice_location
or instance_number
properties).
Parameters:
Name | Type | Description | Default |
---|---|---|---|
dicom_images |
NDArray
|
The array of images to display. Must be one dimensional and have at least one element. |
required |
Returns:
Type | Description |
---|---|
ViewerController
|
The resulting new viewer controller. |
Raises:
Type | Description |
---|---|
ValueError
|
When the number of images in |
ValueError
|
When |
ValueError
|
When instances other than DicomImage are provided in |
open_viewer_4d(dicom_images)
Open a 4D viewer for an array of arrays of osirix.dicom.DicomImage instances.
As per the open_viewer_2d
method, each frames will be presented in the order in which
the DicomImage instances are presented to the function.
Note that no pre-checks are performed to ensure OsiriX can actually display the data (e.g. same slice locations are provided for each frame).
Parameters:
Name | Type | Description | Default |
---|---|---|---|
dicom_images |
NDArray
|
An array of shape (N_frames, N_images). |
required |
Returns:
Type | Description |
---|---|
ViewerController
|
The resulting new viewer controller. |
Raises:
Type | Description |
---|---|
ValueError
|
When N_frames is less than 2. |
ValueError
|
When N_images is less than 1. |
ValueError
|
When |
ValueError
|
When instances other than DicomImage are provided in the |