Store PresentationState into 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.

Dim ps As DicomDataSet
Dim sq As New DicomDataSets
Set ps = DicomImage.PresentationState
sq.Add ps
DicomImage.Attributes.AddExplicit group, element, "SQ", sq

And to pull out PrensetationState out of DicomImage:

Dim ps As DicomDataSet
Dim sq As New DicomDataSets
Set sq = DicomImage.Attributes(group, element).value 
Set ps = 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.

Relevance: