pydicom.fileset.FileInstance

class pydicom.fileset.FileInstance(node: RecordNode)[source]

Representation of a File in the File-set.

node

The leaf record that references this instance.

Type:

pydicom.fileset.RecordNode

__init__(node: RecordNode) None[source]

Create a new FileInstance.

Parameters:

node (pydicom.fileset.RecordNode) – The record that references this instance.

Methods

__init__(node)

Create a new FileInstance.

load()

Return the referenced instance as a Dataset.

Attributes

FileID

Return the File ID of the referenced instance.

SOPClassUID

Return the SOP Class UID of the referenced instance.

SOPInstanceUID

Return the SOP Instance UID of the referenced instance.

TransferSyntaxUID

Return the Transfer Syntax UID of the referenced instance.

file_set

Return the FileSet this instance belongs to.

for_addition

Return True if the instance has been staged for addition to the File-set.

for_moving

Return True if the instance will be moved to a new location within the File-set.

for_removal

Return True if the instance has been staged for removal from the File-set.

is_private

Return True if the instance is privately defined.

is_staged

Return True if the instance is staged for moving, addition or removal

path

Return the path to the corresponding instance as str.

property FileID: str

Return the File ID of the referenced instance.

property SOPClassUID: UID

Return the SOP Class UID of the referenced instance.

property SOPInstanceUID: UID

Return the SOP Instance UID of the referenced instance.

property TransferSyntaxUID: UID

Return the Transfer Syntax UID of the referenced instance.

property file_set: FileSet

Return the FileSet this instance belongs to.

property for_addition: bool

Return True if the instance has been staged for addition to the File-set.

property for_moving: bool

Return True if the instance will be moved to a new location within the File-set.

property for_removal: bool

Return True if the instance has been staged for removal from the File-set.

property is_private: bool

Return True if the instance is privately defined.

property is_staged: bool

Return True if the instance is staged for moving, addition or removal

load() Dataset[source]

Return the referenced instance as a Dataset.

property path: str

Return the path to the corresponding instance as str.

Returns:

The absolute path to the corresponding instance. If the instance is staged for addition to the File-set this will be a path to the staged file in the temporary staging directory.

Return type:

str