Skip to content

Store

Classes:

Name Description
DicomStatus

DICOM status.

Settings

Store settings.

StorePacs

Store images in PACS.

Functions:

Name Description
get_files

List all files from a list of base folders, recursively if required.

DicomStatus

Bases: Enum

DICOM status.

Settings

Settings(
    calling_aet: str = "STORESCU",
    called_aet: str = "ANY-SCP",
    acse_timeout: int = 30,
    dimse_timeout: int = 30,
    network_timeout: int = 30,
    max_pdu: int = 16382,
)

Store settings.

Attributes:

Name Type Description
acse_timeout int

Association Control Service Element (ACSE) timeout in seconds

called_aet str

Called Application Entity Title (AET)

calling_aet str

Calling Application Entity Title (AET)

dimse_timeout int

DICOM Message Service Element (DIMSE) timeout in seconds for receiving data.

max_pdu int

The maximum Protocol Data Units (PDU) size accepted by the AE

network_timeout int

The maximum amount of time (in seconds) to wait for network messages.

acse_timeout

acse_timeout: int = 30

Association Control Service Element (ACSE) timeout in seconds used for message timeouts during association negotiation

called_aet

called_aet: str = 'ANY-SCP'

Called Application Entity Title (AET)

calling_aet

calling_aet: str = 'STORESCU'

Calling Application Entity Title (AET)

dimse_timeout

dimse_timeout: int = 30

DICOM Message Service Element (DIMSE) timeout in seconds for receiving data. The SCU will try to read data from the incoming socket stream for the number of seconds configured.

max_pdu

max_pdu: int = 16382

The maximum Protocol Data Units (PDU) size accepted by the AE

network_timeout

network_timeout: int = 30

The maximum amount of time (in seconds) to wait for network messages.

StorePacs

StorePacs(
    addr: str, port: int, settings: Settings = Settings()
)

Store images in PACS. Based on pynetdicom

Methods:

Name Description
store

Store a dataset in PACS.

store

store(
    dataset: Path | Dataset, index: int
) -> DicomStatus | None

Store a dataset in PACS.

Parameters:

Name Type Description Default

dataset

Path | Dataset

dataset to store

required

index

int

message index

required

Returns:

Type Description
DicomStatus | None

DicomStatus or None

get_files

get_files(
    folders: Iterable[str], recurse: bool = False
) -> list[Path]

List all files from a list of base folders, recursively if required.

Parameters:

Name Type Description Default

folders

Iterable[str]

base folders

required

recurse

bool

scan recursively

False

Returns:

Type Description
list[Path]

list of files