Storage namespace

Image namespace

class ambra_sdk.storage.image.Image(storage)[source]

Storage Image commands.

cadsr(engine_fqdn: str, namespace: str, study_uid: str, image_uid: str, image_version: str, phi_namespace: Optional[str] = None, only_prepare: bool = False) → Union[requests.models.Response, ambra_sdk.storage.request.PreparedRequest][source]

Gets graphical annotations according to vendor definitions for CAD SR object.

URL: /study/{namespace}/{studyUid}/image/{imageUid}/version/{imageVersion}/cadsr?sid={sid}

Parameters
  • engine_fqdn – Engine FQDN (Required).

  • namespace – Namespace (Required).

  • study_uid – Study uid (Required).

  • image_uid – Image uid (Required).

  • image_version – image version (Required).

  • phi_namespace – A string, set to the UUID of the namespace where the file was attached if it was attached to a shared instance of the study outside of the original storage namespace

  • only_prepare – Get prepared request.

Returns

the vendor-specified graphical annotations, empty if not implemented for the vendor or generating device.

dicom_payload(engine_fqdn: str, namespace: str, study_uid: str, image_uid: str, image_version: str, phi_namespace: Optional[str] = None, pretranscode: Optional[bool] = None, transfer_syntax: Optional[str] = None, only_prepare: bool = False) → Union[requests.models.Response, ambra_sdk.storage.request.PreparedRequest][source]

Gets dicom payload.

URL: {namespace}/{studyUid}/image/{imageUid}/version/{hash}

Parameters
  • engine_fqdn – Engine FQDN (Required).

  • namespace – Namespace (Required).

  • study_uid – Study uid (Required).

  • image_uid – Image uid (Required).

  • image_version – image version (Required).

  • phi_namespace – A string, set to the UUID If set, specifies the phi namespace from which to pull PHI. Will overlay the values onto the phiSource.

  • pretranscode – Get pretranscoded dicom.

  • transfer_syntax – Transfer syntax.

  • only_prepare – Get prepared request.

Returns

dicom.

multipart_chunk_upload(engine_fqdn: str, upload_uuid: str, bytes_part: bytes, chunk_number: int, only_prepare: bool = False) → Union[requests.models.Response, ambra_sdk.storage.request.PreparedRequest][source]

Upload a part of image.

URL: multipart/{upload_uuid}

Parameters
  • engine_fqdn – Engine FQDN (Required).

  • upload_uuid – UUID of the initiated multipart upload (Required).

  • bytes_part – part of image (Required).

  • chunk_number – sequence number, first part has number 0 (Required).

  • only_prepare – Get prepared request.

Returns

status code

multipart_complete(engine_fqdn: str, namespace: str, upload_uuid: str, file_size: int, endpoint: str = 'image', tags='', study_uid: Optional[str] = None, render_wrapped_pdf='', only_prepare: bool = False) → Union[box.box.Box, requests.models.Response, ambra_sdk.storage.request.PreparedRequest][source]

Finish the multipart upload process.

URL: multipart/{upload_uuid}/complete

Parameters
  • engine_fqdn – Engine FQDN (Required).

  • namespace – Namespace (Required).

  • upload_uuid – UUID of the initiated multipart upload (Required).

  • file_size – size of whole file (Required).

  • endpoint – the endpoint to which the reconstructed file needs to be submitted. Only the image and wrap endpoint are supported at the moment.

  • tags – the tags to be used to submit reconstructed file.

  • study_uid – study uid.

  • render_wrapped_pdf – if the file to be submitted should be treated as wrapped pdf.

  • only_prepare – Get prepared request.

Returns

status code

multipart_initiate(engine_fqdn: str, use_box: bool = True, only_prepare: bool = False) → Union[box.box.Box, requests.models.Response, ambra_sdk.storage.request.PreparedRequest][source]

Initiate the multipart upload.

URL: /multipart/initiate?sid={sid}

Parameters
  • engine_fqdn – Engine FQDN (Required).

  • use_box – Use box for response.

  • only_prepare – Get prepared request.

Returns

uuid of multipart upload

upload(engine_fqdn: str, namespace: str, opened_file: Union[_io.BufferedReader, Tuple[str, _io.BufferedReader], Tuple[str, _io.BufferedReader, str], Tuple[str, _io.BufferedReader, str, Dict[str, str]]], study_uid: Optional[str] = None, use_box: bool = True, x_ambrahealth_job_id: Optional[str] = None, only_prepare: bool = False) → Union[box.box.Box, requests.models.Response, ambra_sdk.storage.request.PreparedRequest][source]

Upload image to a namespace.

URL: /namespace/{namespace}/image?sid={sid}

Parameters
  • engine_fqdn – Engine FQDN (Required).

  • namespace – Namespace (Required).

  • opened_file – Opened file (like in requests) (Required). File object, or may be 2-tuples (filename, fileobj), 3-tuples (filename, fileobj, contentype) or 4-tuples (filename, fileobj, contentype, custom_headers).

  • study_uid – study uid

  • use_box – Use box for response.

  • x_ambrahealth_job_id – X-AmbraHealth-Job-Id headers argument

  • only_prepare – Get prepared request.

Returns

image object attributes

wrap(engine_fqdn: str, namespace: str, opened_file: Union[_io.BufferedReader, Tuple[str, _io.BufferedReader], Tuple[str, _io.BufferedReader, str], Tuple[str, _io.BufferedReader, str, Dict[str, str]]], tags: Optional[str] = None, render_wrapped_pdf: Optional[bool] = None, x_ambrahealth_job_id: Optional[str] = None, only_prepare: bool = False) → Union[requests.models.Response, ambra_sdk.storage.request.PreparedRequest][source]

Upload a non DICOM image.

URL: /namespace/{namespace}/wrap?sid={sid}&render_wrapped_pdf={0,1}

Parameters
  • engine_fqdn – Engine FQDN (Required).

  • namespace – Namespace (Required).

  • tags – Any DICOM tags to be overwrite or added should be provided as a form-data field.

  • opened_file – The multipart file to be uploaded should be provided as a form-data field. File object, or may be 2-tuples (filename, fileobj), 3-tuples (filename, fileobj, contentype) or 4-tuples (filename, fileobj, contentype, custom_headers).

  • render_wrapped_pdf – An integer value of either 0 or 1.

  • x_ambrahealth_job_id – X-AmbraHealth-Job-Id headers argument

  • only_prepare – Get prepared request.

Returns

image object attributes

Study namespace

class ambra_sdk.storage.study.Study(storage)[source]

Storage Study.

anonymize(engine_fqdn: str, namespace: str, study_uid: str, region: Dict[str, Any], phi_namespace: Optional[str] = None, to_namespace: Optional[str] = None, new_study_uid: Optional[str] = None, keep_image_uids: Optional[str] = None, color: Optional[str] = None, x_ambrahealth_job_id: Optional[str] = None, is_ai: bool = False, only_prepare: bool = False) → Union[requests.models.Response, ambra_sdk.storage.request.PreparedRequest][source]

Produce a new study that is a copy of the old, with specified pixel regions obscured.

URL: /study/{namespace}/{studyUid}/anonymize

Parameters
  • engine_fqdn – Engine FQDN (Required).

  • namespace – Namespace (Required).

  • study_uid – Study uid (Required).

  • region – Region (Required).

  • phi_namespace – phi namespace

  • to_namespace – The storage namespace into which the new study should be placed (default same as original).

  • new_study_uid – The Study Instance UID of the new study (default is randomly generated).

  • keep_image_uids – Should SOP Instance UIDs of modified copies be same as originals? (default is false)

  • color – HTML-formatted color (rrggbb) of obscured regions (default is black-and-white checkerboard)

  • x_ambrahealth_job_id – X-AmbraHealth-Job-Id headers argument

  • is_ai – This is request from ai stack flag

  • only_prepare – Get prepared request.

Returns

Anonymize study response

The request entity is a JSON object specifying the regions to be obscured. Regions may be specified at study, series, or instance level; but only the highest matching level containing a regions field will be used.

attachment(engine_fqdn: str, namespace: str, study_uid: str, attachment_id: str, version: str, phi_namespace: Optional[str] = None, file_name: Optional[str] = None, only_prepare: bool = False) → Union[requests.models.Response, ambra_sdk.storage.request.PreparedRequest][source]

Gets the selected attachment.

URL: /study/{namespace}/{studyUid}/attachment/{attachmentId}/version/{version}?sid={sid}&phi_namespace={phi_namespace} URL: /study/{namespace}/{studyUid}/attachment/{attachmentId}/version/{version}/{filename}?sid={sid}&phi_namespace={phi_namespace}

Parameters
  • engine_fqdn – Engine FQDN (Required).

  • namespace – Namespace (Required).

  • study_uid – Study uid (Required).

  • attachment_id – Attachment uid (Required).

  • version – version (Required).

  • phi_namespace – A string, set to the UUID of the namespace where the file was attached if it was attached to a shared instance of the study outside of the original storage namespace

  • file_name – filename

  • only_prepare – Get prepared request.

Returns

attachments response

attachment_image(engine_fqdn: str, namespace: str, study_uid: str, attachment_uid: str, version: str, static_ids: Optional[bool] = None, phi_namespace: Optional[str] = None, use_box: bool = True, only_prepare: bool = False) → Union[box.box.Box, requests.models.Response, ambra_sdk.storage.request.PreparedRequest][source]

Attachment image.

Adds a render of an attachment to a study.

URL: /study/{namespace}/{studyUid}/attachment/{attachmentUid}/version/{version}/image?sid={sid}&

Parameters
  • engine_fqdn – Engine FQDN (Required).

  • namespace – Namespace (Required).

  • study_uid – Study uid (Required).

  • attachment_uid – Attachment uid (Required).

  • version – version (Required)

  • static_ids – An integer of value 1 or 0. If 1, series and images rendered from PDF are assigned (u)uids based on a hash of the attachment; repeated requests to render the same PDF will not result in more images.

  • phi_namespace – A string, set to the UUID of the namespace where the file was attached if it was attached to a shared instance of the study outside of the original storage namespace

  • use_box – Use box for response.

  • only_prepare – Get prepared request.

Returns

202 Attachment succesfully rendered as an image and added to study. 500 (SERVER ERROR) if server error persisted.

attribute(engine_fqdn: str, namespace: str, study_uid: str, image_uid: str, image_version: str, phi_namespace: Optional[str] = None, groups: Optional[str] = None, include_tags: Optional[str] = None, exclude_unnamed: Optional[str] = None, use_box: bool = True, only_prepare: bool = False) → Union[box.box.Box, requests.models.Response, ambra_sdk.storage.request.PreparedRequest][source]

Gets study image attributes.

URL: /study/{namespace}/{studyUid}/image/{imageUid}/version/{imageVersion}/attribute?sid={sid}&phi_namespace={phi_namespace}

Parameters
  • engine_fqdn – Engine FQDN (Required).

  • namespace – Namespace (Required).

  • study_uid – Study uid (Required).

  • image_uid – Image uid (Required).

  • image_version – Image version (Required).

  • phi_namespace – A string, set to the UUID of the namespace where the file was attached if it was attached to a shared instance of the study outside of the original storage namespace

  • groups – The groups parameter will allow the client to filter tags to only those in a certain set of top-level DICOM groups. Comma-separated list of decimal values, or hex values preceeded with “0x”.

  • include_tags – Comma-separated list of top-level DICOM tags to include. Format: 00080018,00080020 Nested tags (00081111:00080550) only filter at the top level, everything is included within the sequence

  • exclude_unnamed – A string containing “1” or “0” (default 0). When “1”, private tags (with “name”: “?”) are not included

  • use_box – Use box for response.

  • only_prepare – Get prepared request.

Returns

study attributes

cache(engine_fqdn: str, namespace: str, study_uid: str, only_prepare: bool = False) → Union[requests.models.Response, ambra_sdk.storage.request.PreparedRequest][source]

Clears the image and metadata cache for the indicated study.

URL: /study/{namespace}/{studyUid}/cache

Parameters
  • engine_fqdn – Engine FQDN (Required).

  • namespace – Namespace (Required).

  • study_uid – Study uid (Required).

  • only_prepare – Get prepared request.

Returns

Cache study response

clone(engine_fqdn: str, namespace: str, study_uid: str, phi_namespace: Optional[str] = None, new_image_uids: Optional[bool] = None, new_series_uids: Optional[bool] = None, x_ambrahealth_job_id: Optional[str] = None, only_prepare: bool = False) → Union[requests.models.Response, ambra_sdk.storage.request.PreparedRequest][source]

Clone.

Clones the specified study into new study_uid into the same namespace and generates new series uid and image uids if it’s requested.

URL: /study/{namespace}/{studyUid}/clone?sid={sid}&phi_namespace={phi_namespace}&new_image_uids={true/false}&new_series_uids={true/false}

Parameters
  • engine_fqdn – Engine FQDN (Required).

  • namespace – Namespace (Required).

  • study_uid – Study uid (Required).

  • phi_namespace – A string, set to the UUID of the namespace where the file was attached if it was attached to a shared instance of the study outside of the original storage namespace

  • new_image_uids – true/false, whether to generate for study new image uids.

  • new_series_uids – true/false, whether to generate for study new series uids.

  • x_ambrahealth_job_id – X-AmbraHealth-Job-Id headers argument

  • only_prepare – Get prepared request.

Returns

new study uid

count(engine_fqdn: str, namespace: str, study_uid: str, images_only: Optional[bool] = None, attachments_only: Optional[bool] = None, count_files: Optional[bool] = None, use_box: bool = True, only_prepare: bool = False) → Union[box.box.Box, requests.models.Response, ambra_sdk.storage.request.PreparedRequest][source]

Gets study file count.

URL: /study/{namespace}/{studyUid}/count?sid={sid}&images_only={1,0}&attachments_only={1,0}&count_files={1,0}

Parameters
  • engine_fqdn – Engine FQDN (Required).

  • namespace – Namespace (Required).

  • study_uid – Study uid (Required).

  • images_only – an integer, zero or 1, returns the number of images in the study with superseded images by way of study update not counted.

  • attachments_only – an integer, zero or 1, returns the number of attachments which have been added to this study.

  • count_files – if present and set to 1 will count files stored on-disk for images and/or attachments, instead of counting from (possibly cached) meta data.

  • use_box – Use box for response.

  • only_prepare – Get prepared request.

Returns

count obj

create_rt(engine_fqdn: str, namespace: str, study_uid: str, body: str, phi_namespace: Optional[str] = None, use_box: bool = True, only_prepare: bool = False) → Union[box.box.Box, requests.models.Response, ambra_sdk.storage.request.PreparedRequest][source]

Create RT.

Generates RTSTRUCT DICOM file from the content sent by client

URL: /study/{namespace}/{studyUid}/rt?sid={sid}&phi_namespace={phi_namespace}

Parameters
  • engine_fqdn – Engine FQDN (Required).

  • namespace – Namespace (Required).

  • study_uid – Study uid (Required).

  • phi_namespace – A string, set to the UUID of the namespace where the file was attached if it was attached to a shared instance of the study outside of the original storage namespace

  • body – Body that represents fields of the RTSTRUCT DICOM

  • use_box – Use box for response.

  • only_prepare – Get prepared request.

Returns

Image attributes

crop(engine_fqdn: str, namespace: str, study_uid: str, region: Dict[str, Any], phi_namespace: Optional[str] = None, to_namespace: Optional[str] = None, new_study_uid: Optional[str] = None, keep_image_uids: Optional[str] = None, only_prepare: bool = False) → Union[requests.models.Response, ambra_sdk.storage.request.PreparedRequest][source]

Produce a new study that is a copy of the old, cropped to specified pixel region.

URL: /study/{namespace}/{studyUid}/crop

Parameters
  • engine_fqdn – Engine FQDN (Required).

  • namespace – Namespace (Required).

  • study_uid – Study uid (Required).

  • region – Region (Required).

  • phi_namespace – phi namespace

  • to_namespace – The storage namespace into which the new study should be placed (default: same as original).

  • new_study_uid – The Study Instance UID of the new study (default: randomly generated).

  • keep_image_uids – Should SOP Instance UIDs of modified copies be same as originals? 1/0 (default: 0/false)

  • only_prepare – Get prepared request.

Returns

Crop study response

The request entity is a JSON object specifying the region to be cropped. Region may be specified at study, series, or instance level; but only the highest matching level containing a region field will be used. Example: { “series”:{ “1.2.3.4.5”: {“region”:{“x”:10,”y”:10, “width”:30, “height”:40}}, “1.3.5.7.9”:{ “instances”:{ “1.3.5.7.9.101”:{“region”: {“x”:20,”y”:20, “width”:30, “height”:20} } } } }

delete(engine_fqdn: str, namespace: str, study_uid: str, keep_attachments: Optional[bool] = None, only_prepare: bool = False) → Union[requests.models.Response, ambra_sdk.storage.request.PreparedRequest][source]

Deletes a study.

URL: /study/{namespace}/{study_uid}?sid={sid}&keep_attachments={1,0}

Parameters
  • engine_fqdn – Engine FQDN (Required).

  • namespace – Namespace (Required).

  • study_uid – Study uid (Required).

  • keep_attachments – An integer value of 1 or 0.

  • only_prepare – Get prepared request.

Returns

Delete response

If the optional parameter keep_attachments is set to 1, then:

all DICOM images will be deleted. reports and attachments related to the study will be kept.

delete_attachment(engine_fqdn: str, namespace: str, study_uid: str, attachment_id: str, hash_arg: str, phi_namespace: Optional[str] = None, x_ambrahealth_job_id: Optional[str] = None, only_prepare: bool = False) → Union[requests.models.Response, ambra_sdk.storage.request.PreparedRequest][source]

Deletes a study attachment.

URL: /study/{namespace}/{studyUid}/attachment/{attachmentId}/version/{hash}?sid={sid}?phi_namespace={phi_namespace}

Note: Instead of hash in storage api this method accept hash_arg argument. Actually, hash_args is attachment version…

Parameters
  • engine_fqdn – Engine FQDN (Required).

  • namespace – Namespace (Required).

  • study_uid – Study uid (Required).

  • attachment_id – attachment id (Required).

  • hash_arg – hash (Required).

  • phi_namespace – A string, set to the UUID of the namespace where the file was attached if it was attached to a shared instance of the study outside of the original storage namespace

  • x_ambrahealth_job_id – X-AmbraHealth-Job-Id headers argument

  • only_prepare – Get prepared request.

Returns

Delete attachemnt response

delete_image(engine_fqdn: str, namespace: str, study_uid: str, image_uid: str, x_ambrahealth_job_id: Optional[str] = None, only_prepare: bool = False) → Union[requests.models.Response, ambra_sdk.storage.request.PreparedRequest][source]

Deletes a single image from a study.

To delete multiple images, study/delete/images/.

The HTTP method must be DELETE This method sends a STUDY_DELETE notification to Services after the image is deleted This method is synchronous - it doesn’t return until the image is deleted and Services notification is sent

URL: /study/{namespace}/{studyUid}/image/{imageUid}?sid={sid}

Parameters
  • engine_fqdn – Engine FQDN (Required).

  • namespace – Namespace (Required).

  • study_uid – Study uid (Required).

  • image_uid – Image uid (Required).

  • x_ambrahealth_job_id – X-AmbraHealth-Job-Id headers argument

  • only_prepare – Get prepared request.

Returns

Delete image response

delete_images(engine_fqdn: str, namespace: str, study_uid: str, request_body: str, only_prepare: bool = False) → Union[requests.models.Response, ambra_sdk.storage.request.PreparedRequest][source]

Delete multiple images from a study.

The HTTP method must be DELETE This method sends one STUDY_DELETE notification to Services after the images are deleted This method is synchronous - it doesn’t return until all images are deleted and Services notification is sent

URL: /study/{namespace}/{studyUid}/images?sid={sid}

Parameters
  • engine_fqdn – Engine FQDN (Required).

  • namespace – Namespace (Required).

  • study_uid – Study uid (Required).

  • request_body – Comma-separated list of multiple image UIDs (Required).

  • only_prepare – Get prepared request.

Returns

Delete images response

diagnostic(engine_fqdn: str, namespace: str, study_uid: str, image_uid: str, image_version: str, frame_number: int, phi_namespace: Optional[str] = None, depth: Optional[int] = None, size: Optional[str] = None, only_prepare: bool = False) → Union[requests.models.Response, ambra_sdk.storage.request.PreparedRequest][source]

Gets study diagnostic image.

URL: /study/{namespace}/{studyUid}/image/{imageUid}/version/{imageVersion}/frame/{frameNumber}/diagnostic?sid={sid}&phi_namespace={phi_namespace}&depth={8,16}&size=[max-edge-length|{width}x{height}]

Parameters
  • engine_fqdn – Engine FQDN (Required).

  • namespace – Namespace (Required).

  • study_uid – Study uid (Required).

  • image_uid – Image uid (Required).

  • image_version – Image version (Required).

  • frame_number – Frame number (Required).

  • phi_namespace – A string, set to the UUID of the namespace where the file was attached if it was attached to a shared instance of the study outside of the original storage namespace

  • depth – Set the bit depth of the JPEG output (8 or 16).

  • size – Specify size of output. Omitted or 0 indicates no change; one number sets the maximum edge length in pixels; wxh sets maximum width and height

  • only_prepare – Get prepared request.

Returns

Diagnostic image object

download(engine_fqdn: str, namespace: str, study_uid: str, bundle: str, phi_namespace: Optional[str] = None, series_uid: Optional[str] = None, image_uid: Optional[str] = None, include_wrapped_dicoms: Optional[bool] = None, stop_on_failure: Optional[bool] = None, exclude_viewer: Optional[bool] = None, v3: Optional[bool] = None, roche_directory: Optional[bool] = None, flat_directory: Optional[bool] = None, transfer_syntax: Optional[bool] = None, anonymize_tags: Optional[str] = None, only_prepare: bool = False) → Union[requests.models.Response, ambra_sdk.storage.request.PreparedRequest][source]

Downloads a study ZIP file.

URL: /study/{namespace}/{studyUid}/download?sid={sid}&phi_namespace={phi_namespace}&bundle={iso,dicom,osx,win}&include_wrapped_dicoms={0,1}&series_uid={series_uid[,series_uid…]}&image_uid={image_uid[,image_uid…]}

Parameters
  • engine_fqdn – Engine FQDN (Required).

  • namespace – Namespace (Required).

  • study_uid – Study uid (Required).

  • bundle – A string with value “dicom”, “iso”, “osx” or “win” (Required).

  • phi_namespace – The shared-to namespace UUID of a shared instance of a study (Optional)

  • include_wrapped_dicoms – When “1”, will also include the DICOM file of a wrapped DICOM. Default is to only include the unwrapped file.

  • series_uid – One or more Series Instance UIDs, comma-separated. Download will only include images from these series.

  • image_uid – One or more SOP Instance UIDs, comma-separated. Download will only include these images.

  • stop_on_failure – If “1”, will not include the viewer app if there are any errors generating the download.

  • exclude_viewer – If “1”, viewer app will not be included in the “iso”, “osx”, and “win” bundle. The viewer app can be retrieved separately via /download/viewer

  • v3 – If “1”, viewer app will be pro viewer, and format/content will support pro viewer.

  • roche_directory – If “1”, .dcm files will be organized into StudyDate-ClinicalTrialTimePointID/Modality/SeriesTime-SeriesDescription/ folders (instead of SER000X/ folders).

  • flat_directory – If “1”, .dcm files will be flatly named IMG0001-IMG{image count}, and not be organized into SER folder.

  • transfer_syntax – transfer syntax

  • anonymize_tags – The list of tag ids with overridden values separated by comma (,) that should be overridden. Example: anonymize_tags={{tag_id_int_1}}={{tag_value_1}},{{tag_id_int_2}}={{tag_value_2}}. To omit tag, provide special keyword that is being used in services overrides as value: __DELETE__

  • only_prepare – Get prepared request.

Returns

study zip file response

frame(engine_fqdn: str, namespace: str, study_uid: str, image_uid: str, image_version: str, frame_number: str, phi_namespace: Optional[str] = None, depth: Optional[int] = None, quality: Optional[float] = None, size: Optional[str] = None, only_prepare: bool = False) → Union[requests.models.Response, ambra_sdk.storage.request.PreparedRequest][source]

Gets study image frame.

URL: /study/{namespace}/{studyUid}/image/{imageUid}/version/{imageVersion}/frame/{frameNumber:[0-9][0-9]*|[0-9][0-9]*}?sid={sid}&phi_namespace={phi_namespace}&depth={8,16}&quality={0.0-1.0}&size=[max-edge-length|{width}x{height}]

Parameters
  • engine_fqdn – Engine FQDN (Required).

  • namespace – Namespace (Required).

  • study_uid – Study uid (Required).

  • image_uid – Image uid (Required).

  • image_version – Image version (Required).

  • frame_number – Frame number (Required).

  • phi_namespace – A string, set to the UUID of the namespace where the file was attached if it was attached to a shared instance of the study outside of the original storage namespace

  • depth – Set the bit depth of the JPEG output (8 or 16).

  • quality – Set the JPEG compression quality 0 < q ≤ 1.0 (default 0.9)

  • size – Specify size of output. Omitted or 0 indicates no change; one number sets the maximum edge length in pixels; wxh sets maximum width and height

  • only_prepare – Get prepared request.

Returns

study image frame response

frame_tiff(engine_fqdn: str, namespace: str, study_uid: str, image_uid: str, image_version: str, frame_number: str, phi_namespace: Optional[str] = None, depth: Optional[int] = None, size: Optional[str] = None, only_prepare: bool = False) → Union[requests.models.Response, ambra_sdk.storage.request.PreparedRequest][source]

Gets study image frame as TIFF.

URL: /study/{namespace}/{studyUid}/image/{imageUid}/version/{imageVersion}/frame/{frameNumber:[0-9]*}/tiff?sid={sid}&phi_namespace={phi_namespace}&depth={8,16}&size=[max-edge-length|{width}x{height}]

Parameters
  • engine_fqdn – Engine FQDN (Required).

  • namespace – Namespace (Required).

  • study_uid – Study uid (Required).

  • image_uid – Image uid (Required).

  • image_version – Image version (Required).

  • frame_number – Frame number (Required).

  • phi_namespace – A string, set to the UUID of the namespace where the file was attached if it was attached to a shared instance of the study outside of the original storage namespace

  • depth – Set the bit depth of the JPEG output (8 or 16).

  • size – Specify size of output. Omitted or 0 indicates no change; one number sets the maximum edge length in pixels; wxh sets maximum width and height

  • only_prepare – Get prepared request.

Returns

study image frame response

hl7_to_sr(engine_fqdn: str, namespace: str, study_uid: str, hl7uuid: str, phi_namespace: Optional[str] = None, only_prepare: bool = False) → Union[requests.models.Response, ambra_sdk.storage.request.PreparedRequest][source]

Hl7 to sr.

Gets the HL7 report from services, converts to the DICOM SR and uploads to the storage.

URL: /study/{namespace}/{studyUid}/hl7/{hl7Uuid}/sr?sid={sid}&phi_namespace={phi_namespace}

Parameters
  • engine_fqdn – Engine FQDN (Required).

  • namespace – Namespace (Required).

  • study_uid – Study uid (Required).

  • hl7uuid – hl7 report UUID from services to convert to DICOM SR.

  • phi_namespace – A string, set to the UUID of the namespace where the file was attached if it was attached to a shared instance of the study outside of the original storage namespace

  • only_prepare – Get prepared request.

Returns

hl7_to_sr result

image_dicomweb(engine_fqdn: str, namespace: str, study_uid: str, series_uid: str, image_uid: str, phi_namespace: Optional[str] = None, use_box: bool = True, only_prepare: bool = False) → Union[box.box.Box, requests.models.Response, ambra_sdk.storage.request.PreparedRequest][source]

Returns JSON representation of a single DICOM as defined by the DICOMWeb WADO-RS Metadata standard http://dicom.nema.org/medical/dicom/current/output/html/part18.html#table_10.4.1-2.

URL: dicomweb/{namespace}/studies/{studyUid}/series/{seriesUid}/instances/{imageUid}/metadata?sid={sid}&phi_namespace={phi_namespace}

Parameters
  • engine_fqdn – Engine FQDN (Required).

  • namespace – Namespace (Required).

  • study_uid – Study uid (Required).

  • series_uid – Series uid (Required).

  • image_uid – Image uid (Required).

  • phi_namespace – A string, set to the UUID of the namespace where the file was attached if it was attached to a shared instance of the study outside of the original storage namespace

  • use_box – Use box for response.

  • only_prepare – Get prepared request.

Returns

A JSON representation of a DICOM according to the DICOMWeb standard, omitting any bulkdata, pixeldata, or other binary fields.

image_json(engine_fqdn: str, namespace: str, study_uid: str, image_uid: str, image_version: str, phi_namespace: Optional[str] = None, exclude_unnamed: Optional[bool] = None, all_dicom_values: Optional[bool] = None, groups: Optional[str] = None, include_tags: Optional[str] = None, use_box: bool = True, only_prepare: bool = False) → Union[ambra_sdk.storage.study.base_study.ImageJsonBox, requests.models.Response, ambra_sdk.storage.request.PreparedRequest][source]

Gets all DICOM attributes for an individual image.

URL: /study/{namespace}/{studyUid}/image/{imageUid}/version/{imageVersion}/json?sid={sid}&phi_namespace={phi_namespace}

Parameters
  • engine_fqdn – Engine FQDN (Required).

  • namespace – Namespace (Required).

  • study_uid – Study uid (Required).

  • image_uid – Image uid (Required).

  • image_version – Image version (Required).

  • phi_namespace – A string, set to the UUID of the namespace where the file was attached if it was attached to a shared instance of the study outside of the original storage namespace

  • exclude_unnamed – When True, private tags (with “name”: “?”) are not included

  • all_dicom_values – When True all values from a multi-value DICOM tag will be returned, separated by “". Otherwise, only the first value is returned

  • groups – groups

  • include_tags – include_tags

  • use_box – Use box for response.

  • only_prepare – Get prepared request.

Returns

DICOM attributes object

image_phi(engine_fqdn: str, namespace: str, study_uid: str, image_uid: str, image_version: str, phi_namespace: Optional[str] = None, use_box: bool = True, only_prepare: bool = False) → Union[box.box.Box, requests.models.Response, ambra_sdk.storage.request.PreparedRequest][source]

Gets study image PHI.

URL: /study/{namespace}/{studyUid}/image/{imageUid}/version/{imageVersion}/phi?sid={sid}&phi_namespace={phi_namespace}

Parameters
  • engine_fqdn – Engine FQDN (Required).

  • namespace – Namespace (Required).

  • study_uid – Study uid (Required).

  • image_uid – Image uid (Required).

  • image_version – Image version (Required).

  • phi_namespace – A string, set to the UUID of the namespace where the file was attached if it was attached to a shared instance of the study outside of the original storage namespace

  • use_box – Use box for response.

  • only_prepare – Get prepared request.

Returns

image PHI object

json(engine_fqdn: str, namespace: str, study_uid: str, phi_namespace: Optional[str] = None, groups: Optional[str] = None, all_dicom_values: Optional[bool] = None, include_tags: Optional[str] = None, exclude_unnamed: Optional[bool] = None, series_uid: Optional[str] = None, use_box: bool = True, only_prepare: bool = False) → Union[ambra_sdk.storage.study.base_study.JsonBox, requests.models.Response, ambra_sdk.storage.request.PreparedRequest][source]

Gets DICOM attributes for all images in a study.

URL: /study/{namespace}/{studyUid}/json?sid={sid}&phi_namespace={phi_namespace}&groups={group ids}&include_tags={tags}

Parameters
  • engine_fqdn – Engine FQDN (Required).

  • namespace – Namespace (Required).

  • study_uid – Study uid (Required).

  • phi_namespace – A string, set to the UUID of the namespace where the file was attached if it was attached to a shared instance of the study outside of the original storage namespace

  • groups – The groups parameter will allow the client to filter tags to only those in a certain set of top-level DICOM groups. Comma-separated list of decimal values, or hex values preceeded with “0x”.

  • all_dicom_values – A string containing “1” or “0” (default 0). When “1”, all values from a multi-value DICOM tag will be returned, separated by “". Otherwise, only the first value is returned

  • include_tags – Comma-separated list of top-level DICOM tags to include. Format: 00080018,00080020 Nested tags (00081111:00080550) only filter at the top level, everything is included within the sequence

  • exclude_unnamed – If True private tags (with “name”: “?”) are not included

  • series_uid – A string containing a Series Instance UID. If specified, the results will only include DICOM tags from images from the specified series

  • use_box – Use box for response.

  • only_prepare – Get prepared request.

Returns

DICOM attributes object

latest(engine_fqdn: str, namespace: str, study_uid: str, file_name: Optional[str] = None, phi_namespace: Optional[str] = None, only_prepare: bool = False) → Union[requests.models.Response, ambra_sdk.storage.request.PreparedRequest][source]

Gets the latest attachment for a study.

URL: /study/{namespace}/{studyUid}/attachment/{filename:latest|latest}?sid={sid}&phi_namespace={phi_namespace}

Parameters
  • engine_fqdn – Engine FQDN (Required).

  • namespace – Namespace (Required).

  • study_uid – Study uid (Required).

  • file_name – filename or latest (Required).

  • phi_namespace – A string, set to the UUID of the namespace where the file was attached if it was attached to a shared instance of the study outside of the original storage namespace

  • only_prepare – Get prepared request.

Returns

latest attachment response

merge(engine_fqdn: str, namespace: str, study_uid: str, secondary_study_uid: str, delete_secondary_study: Optional[bool] = None, series_uids: Optional[str] = None, x_ambrahealth_job_id: Optional[str] = None, only_prepare: bool = False) → Union[requests.models.Response, ambra_sdk.storage.request.PreparedRequest][source]

Merge studies.

URL: /study/{namespace}/{studyUid}/merge?sid={sid}&secondary_study_uid={secondary_study_uid}&delete_secondary_study={0,1}

Parameters
  • engine_fqdn – Engine FQDN (Required).

  • namespace – Namespace (Required).

  • study_uid – Study uid (Required).

  • secondary_study_uid – A list of one or more comma-separated secondary Study UIDs to be merged into the studyUid(Required).

  • delete_secondary_study – An integer, when set to 1 the process will check that the sid provided has the required permission to delete the secondary study.

  • series_uids – A list of one or more comma-separated Series Instance UIDs, used to filter images merged from secondary study.

  • x_ambrahealth_job_id – X-AmbraHealth-Job-Id headers argument

  • only_prepare – Get prepared request.

Returns

Actually empty response

pdf(engine_fqdn: str, namespace: str, study_uid: str, image_uid: str, image_version: str, only_prepare: bool = False) → Union[requests.models.Response, ambra_sdk.storage.request.PreparedRequest][source]

Gets a study encapsulated pdf file.

URL: /study/{namespace}/{studyUid}/image/{imageUid}/version/{imageVersion}/pdf?sid={sid}

Parameters
  • engine_fqdn – Engine FQDN (Required).

  • namespace – Namespace (Required).

  • study_uid – Study uid (Required).

  • image_uid – Image uid (Required).

  • image_version – Image version (Required).

  • only_prepare – Get prepared request.

Returns

Pdf response object

phi(engine_fqdn: str, namespace: str, study_uid: str, phi_namespace: Optional[str] = None, use_box: bool = True, only_prepare: bool = False) → Union[box.box.Box, requests.models.Response, ambra_sdk.storage.request.PreparedRequest][source]

Gets study PHI data.

URL: /study/{namespace}/{studyUid}/phi?sid={sid}&phi_namespace={phi_namespace}

Parameters
  • engine_fqdn – Engine FQDN (Required).

  • namespace – Namespace (Required).

  • study_uid – Study uid (Required).

  • phi_namespace – A string, set to the UUID of the namespace where the file was attached if it was attached to a shared instance of the study outside of the original storage namespace

  • use_box – Use box for response.

  • only_prepare – Get prepared request.

Returns

study PHI data object

post_attachment(engine_fqdn: str, namespace: str, study_uid: str, opened_file: Union[_io.BufferedReader, Tuple[str, _io.BufferedReader], Tuple[str, _io.BufferedReader, str], Tuple[str, _io.BufferedReader, str, Dict[str, str]]], phi_namespace: Optional[str] = None, wrap_images: Optional[bool] = None, wrap_html_as_pdf: Optional[bool] = None, return_html: Optional[bool] = None, synchronous_wrap: Optional[bool] = None, static_ids: Optional[bool] = None, x_ambrahealth_job_id: Optional[str] = None, only_prepare: bool = False) → Union[requests.models.Response, ambra_sdk.storage.request.PreparedRequest][source]

Posts an attachment to a study.

URL: /study/{namespace}/{studyUid}/attachment?sid={sid}&phi_namespace={phi_namespace}&wrap_images={0,1}&return_html={0,1}&synchronous_wrap={0,1}&static_ids={0,1}

Parameters
  • engine_fqdn – Engine FQDN (Required).

  • namespace – Namespace (Required).

  • study_uid – Study uid (Required).

  • opened_file – Opened file (like in requests) (Required). File object, or may be 2-tuples (filename, fileobj), 3-tuples (filename, fileobj, contentype) or 4-tuples (filename, fileobj, contentype, custom_headers).

  • phi_namespace – A string, set to the UUID of the namespace where the file was attached if it was attached to a shared instance of the study outside of the original storage namespace

  • wrap_images – An integer of value 1 or 0. If 1, for attachments that are images, or can be rendered to an image, generate a new DICOM image in the study containing (a rendered image of) the attachment (also controlled by namespace setting auto_wrap_images).

  • wrap_html_as_pdf – An integer of value 1 or 0. If 1, for attachments that are html, generate a new pdf and attach that (instead of the original html).

  • synchronous_wrap – An integer of value 1 or 0. If 1, do all processing for image wrapping before returning, including Services notifications. Additionally triggers wrap_images functionality.

  • static_ids – An integer of value 1 or 0. If 1, the attachment, series and any images rendered from PDF are assigned (u)uids based on a hash of the attachment, which will be the same if the attachment is re-uploaded. The attachment is also allowed to be re-uploaded when set to 1.

  • return_html – An integer of value 1 or 0. Return results as Content Type text html, instead of application json (required for certain browsers)

  • x_ambrahealth_job_id – X-AmbraHealth-Job-Id headers argument

  • only_prepare – Get prepared request.

Returns

posts attachments response

The request entity must contain a single multipart/form-data element named data containing the content to be attached.

If the optional parameter wrap_images or synchronous_wrap is set to 1, or the uploading account has the setting auto_wrap_images set to 1, then: attachments of type image/jpeg or image/bmp are, asynchronously (unless synchronous_wrap=1) to the Store Attachment request, posted to the Wrap Attachment service, to be stored as a single DICOM image in a new series within the specified study. attachments of type application/pdf are, asynchronously (unless synchronous_wrap=1) to the Store Attachment request, rendered to DICOM images at a resolution of 200 ppi, one image per page of the original PDF. The resulting are stored in a new series within the specified study. UIDs assigned to the series and images will be random unless static_ids=1

schema(engine_fqdn: str, namespace: str, study_uid: str, extended: Optional[bool] = None, attachments_only: Optional[bool] = None, phi_namespace: Optional[str] = None, use_box: bool = True, only_prepare: bool = False) → Union[box.box.Box, requests.models.Response, ambra_sdk.storage.request.PreparedRequest][source]

Get the schema of study.

URL: /study/{namespace}/{studyUid}/schema?sid={sid}&phi_namespace={phi_namespace}&extended={1,0}&attachments_only={0,1} # NOQA E501

Parameters
  • engine_fqdn – Engine FQDN (Required).

  • namespace – Namespace (Required).

  • study_uid – Study uid (Required).

  • extended – is an bool, when set to 1 will include the optional phi_version and transfer_attributes name/value pairs in the response.

  • attachments_only – is an bool, when set to 1 will only include a list of the attachments in the study.

  • phi_namespace – A string, set to the UUID of the namespace where the file was attached if it was attached to a shared instance of the study outside of the original storage namespace

  • use_box – Use box for response.

  • only_prepare – Get prepared request.

Returns

study schema

series_dicomweb(engine_fqdn: str, namespace: str, study_uid: str, series_uid: str, phi_namespace: Optional[str] = None, use_box: bool = True, only_prepare: bool = False) → Union[box.box_list.BoxList, requests.models.Response, ambra_sdk.storage.request.PreparedRequest][source]

Returns JSON representation of a series of DICOM(s) as defined by the DICOMWeb WADO-RS Metadata standard http://dicom.nema.org/medical/dicom/current/output/html/part18.html#table_10.4.1-2.

URL: dicomweb/{namespace}/studies/{studyUid}/series/{seriesUid}/metadata?sid={sid}&phi_namespace={phi_namespace}

Parameters
  • engine_fqdn – Engine FQDN (Required).

  • namespace – Namespace (Required).

  • study_uid – Study uid (Required).

  • series_uid – Series uid (Required).

  • phi_namespace – A string, set to the UUID of the namespace where the file was attached if it was attached to a shared instance of the study outside of the original storage namespace

  • use_box – Use box for response.

  • only_prepare – Get prepared request.

Returns

A JSON representation of a series of DICOM(s) according to the DICOMWeb standard, omitting any bulkdata, pixeldata, or other binary fields.

split(engine_fqdn: str, namespace: str, study_uid: str, phi_namespace: Optional[str] = None, to_namespace: Optional[str] = None, series_uid: Optional[str] = None, delete_series_from_original: Optional[str] = None, only_prepare: bool = False) → Union[requests.models.Response, ambra_sdk.storage.request.PreparedRequest][source]

Split a study.

URL: /study/{namespace}/{studyUid}/split?sid={sid}&phi_namespace={namespace}&to_namespace={namespace}&series_uid={series_uid,series_uid…series_uid}&delete_series_from_original={0,1}

Parameters
  • engine_fqdn – Engine FQDN (Required).

  • namespace – Namespace (Required).

  • study_uid – Study uid (Required).

  • phi_namespace – An optional namespace UUID to burn-in PHI overrides to split study (defaults to no overrides)

  • to_namespace – An optional namespace UUID to create the split study (defaults to current namespace)

  • series_uid – An optional series instance uids list delimited by comas, only specified series will be split (defaults to split all image instances)

  • delete_series_from_original – An integer value of either 0 or 1. If 1 the series specified in the series_uid list will be deleted from the original study

  • only_prepare – Get prepared request.

Returns

Split study response

study_dicomweb(engine_fqdn: str, namespace: str, study_uid: str, phi_namespace: Optional[str] = None, use_box: bool = True, only_prepare: bool = False) → Union[box.box_list.BoxList, requests.models.Response, ambra_sdk.storage.request.PreparedRequest][source]

Returns JSON representation of an entire study of DICOMs as defined by the DICOMWeb WADO-RS Metadata standard http://dicom.nema.org/medical/dicom/current/output/html/part18.html#table_10.4.1-2.

URL: dicomweb/{namespace}/studies/{studyUid}/metadata?sid={sid}&phi_namespace={phi_namespace}

Parameters
  • engine_fqdn – Engine FQDN (Required).

  • namespace – Namespace (Required).

  • study_uid – Study uid (Required).

  • phi_namespace – A string, set to the UUID of the namespace where the file was attached if it was attached to a shared instance of the study outside of the original storage namespace

  • use_box – Use box for response.

  • only_prepare – Get prepared request.

Returns

A JSON representation of an entire study of DICOM(s) according to the DICOMWeb standard, omitting any bulkdata, pixeldata, or other binary fields.

tag(engine_fqdn: str, namespace: str, study_uid: str, phi_namespace: Optional[str] = None, use_box: bool = True, only_prepare: bool = False) → Union[box.box.Box, requests.models.Response, ambra_sdk.storage.request.PreparedRequest][source]

Gets study tags.

URL: /study/{namespace}/{studyUid}/tag?sid={sid}&phi_namespace={phi_namespace}

Parameters
  • engine_fqdn – Engine FQDN (Required).

  • namespace – Namespace (Required).

  • study_uid – Study uid (Required).

  • phi_namespace – A string, set to the UUID of the namespace where the file was attached if it was attached to a shared instance of the study outside of the original storage namespace

  • use_box – Use box for response.

  • only_prepare – Get prepared request.

Returns

study tag object

thumbnail(engine_fqdn: str, namespace: str, study_uid: str, image_uid: str, image_version: str, frame_number: int, depth: Optional[int] = None, phi_namespace: Optional[str] = None, only_prepare: bool = False) → Union[requests.models.Response, ambra_sdk.storage.request.PreparedRequest][source]

Gets study image thumbnail.

URL: /study/{namespace}/{studyUid}/image/{imageUid}/version/{imageVersion}/frame/{frameNumber}/thumbnail?sid={sid}&depth={8,16}&phi_namespace={phi_namespace}

Parameters
  • engine_fqdn – Engine FQDN (Required).

  • namespace – Namespace (Required).

  • study_uid – Study uid (Required).

  • image_uid – Image uid (Required).

  • image_version – Image version (Required).

  • frame_number – Frame number (Required).

  • depth – Set the bit depth of the JPEG output (8 or 16).

  • phi_namespace – A string, set to the UUID of the namespace where the file was attached if it was attached to a shared instance of the study outside of the original storage namespace

  • only_prepare – Get prepared request.

Returns

Thumbnail object

video(engine_fqdn: str, namespace: str, study_uid: str, image_uid: str, image_version: str, reencode_video: Optional[bool] = None, only_prepare: bool = False) → Union[requests.models.Response, ambra_sdk.storage.request.PreparedRequest][source]

Gets a study encapsulated video.

URL: /study/{namespace}/{studyUid}/image/{imageUid}/version/{imageVersion}/video?sid={sid}&reencode_video={0,1}

Parameters
  • engine_fqdn – Engine FQDN (Required).

  • namespace – Namespace (Required).

  • study_uid – Study uid (Required).

  • image_uid – Image uid (Required).

  • image_version – Image version (Required).

  • reencode_video – An integer of value 1 or 0.

  • only_prepare – Get prepared request.

Returns

Video response