Creating Frame-Specific DICOM Presentation State using DicomObjects
Sometimes we are asked about how to create frame-specific DICOM presentation state files for multiframe images. This is not difficult in DicomObjects and can by done in a slightly awkward way. Instead of adding the entire “Referenced Series Sequence” to the top level of the presentation state file, all you need to do is adding the “Referenced Frame Number” item into “Referenced Image Sequence” under “Graphic Annotation Sequence”, as shown in the following picture:
A Presentation State is an independent DICOM SOP Instance that contains information on how a particular image should be displayed. The Presentation State may contain label information(types of Label and Positions), windowing values, zoom value, scrolling (panning) values, rotations or any other visual display element that is defined within the DICOM standard.
However Presentation States contain no Pixel Data as they are intended for use with an existing Dicom Image.
Store PresentationState into a DicomImage
PresentationStates are normally saved as external files but sometimes people may want to store them within the associated DicomImage. Following vb code shows how to do it.
DimpsAsDicomDataSet DimsqAsNewDicomDataSets Setps=DicomImage.PresentationState sq.Addps DicomImage.Attributes.AddExplicitgroup,element,"SQ",sq And to pull out PresentationState out of DicomImage:
DimpsAsDicomDataSet DimsqAsNewDicomDataSets Setsq=DicomImage.Attributes(group,element).valueSetps=sq(1)DicomImage.PresentationState=ps
Plase NOTE there is NO standard DICOM data element where you can store Presentation State data, so a good practice is to use Private Data Element. It is of course extremely unlikely that any other application will find/use your presentation state if handlied this way, so this really is a “hack” which is not recommended and should be avoided if possible