Skip to main content

EnsLib.DICOM.File

class EnsLib.DICOM.File extends %Library.RegisteredObject

This class represents a DICOM file. A dicom file consists of two constituent parsts, MetaData and the DataSet. The MetaData contains DICOM elements which contain details about the characteristics of the DataSet

Property Inventory

Method Inventory

Properties

property TransferSyntax as %String;
This holds the transfer syntax
Property methods: TransferSyntaxDisplayToLogical(), TransferSyntaxIsValid(), TransferSyntaxLogicalToDisplay(), TransferSyntaxLogicalToOdbc(), TransferSyntaxNormalize()

Methods

classmethod CreateFromDataSetFile(pFileName As %String, pTransferSyntax As %String, Output pDicomFile As EnsLib.DICOM.File) as %Status
Create an instance of a DataSet file by loading it's data from the specified file. The file MUST contain a DICOM dataset ( without the DICOM header ). The Transfer Syntax MUST be known to guarantee data integrity
classmethod CreateFromDicomFile(pFileName As %String, Output pDicomFile As EnsLib.DICOM.File) as %Status
Create an instance of a DICOM file by loading it's data from the specified file. The file MUST contain data in the DICOM File Format (See PS 3.10 - Media Storage and File Format for Media Interchange). If the file doesn't have the DICM header then we can't load the dataset as we donot know for sure what the transfer syntax is !
classmethod CreateFromDicomFileStream(pFileStream As %FileBinaryStream, Output pDicomFile As EnsLib.DICOM.File) as %Status
Create an instance of a DICOM file by loading it's data from the specified file binary stream. The file should contain data in the DICOM File Format (See PS 3.10 - Media Storage and File Format for Media Interchange). If the file doesn't have the DICM header then we can't load the dataset as we donot know for sure what the transfer syntax is !
classmethod CreateFromDocument(pDocument As EnsLib.DICOM.Document, Output pDicomFile As EnsLib.DICOM.File) as %String
Create an instance of a file by loading its data from a document. Note that this will create a file with meta data which contains OUR implementation version and id. These can be overwritten if required
method GetVRAt(pPropertyReference As %String, Output pVR As %String) as %Status
Retrieve the ValueRepresentation of the specified property
method GetValueAt(pPropertyPath As %String, pFormat As %String, Output pStatus As %Status) as %String
This VDOC Compliant method gets the value of the given property.
This is implemented by the document class.
pPropertyPath contains the property path.
For this class it is only applicable to the CommandSet and DataSet properties.
pFormat can be defined or not. If defined it can take the values "",0 or 1.
pFormat of "" is the same as not defined.
pFormat of 0 means return an empty string and not an error if the value does not exist.
pFormat of 1 means force an error if a value does not exist.
method OutputHtmlToDevice() as %Status
This methods dumps an html representation of the datastructure to the current device.
method OutputToDevice() as %Status
This methods dumps a VDOC text representation of the datastructure to the current device.
method OutputXmlToDevice() as %Status
This methods dumps an xml representation of the datastructure to the current device. Elements have their tag, name, value representation value multiplicity and length represented as attributes of the xml tag. The data is the CACHE representation of the data value. Note that the length attribute specifies the length of the data item's binary DICOM representation. Sequences and items within sequences additionally specify their cardinality, ie. now many members there are in the collection
method Save(pFilename As %String, pFormat As %Integer = $$$FORMATFILE) as %Status
This method composes the file data and saves it to the specified file. The Format argument determines how the file is written. By default the file is written as a DICOM file including header data and file metadata. If the format arguments is set to $$$FORMATDATA, then just the dataset is written to the file
method SetVRAt(pPropertyReference As %String, pVR As %String) as %Status
Set the ValueRepresentation of the specified property
method SetValueAt(pValue As %String, pPropertyReference As %String, pAction As %String = "set", pKey As %String = "") as %Status
This VDOC Compliant method sets the value of the given property.
This is implemented by the document class.
pPropertyReference contains the property name.
pAction contains an action code: "set", etc..
pKey contains an optional key value.
For this class it is only applicable to the CommandSet and DataSet properties
classmethod TestCreateFromDicomFile(pInputFilename As %String, pOutputFilename As %String)
Load an instance of dicom file from the specified file and save to the specified output file
method TransferSyntaxGet() as %String
method TransferSyntaxSet(pTransferSyntax As %String) as %Status
Accessors for TransferSyntax

Inherited Members

Inherited Methods

FeedbackOpens in a new tab