DICOM Dataset serialization

In cases when you get a study from a MWL broker, you need to send the whole original Dataset back to PACS with the C-STORE command in order to include all the DICOM ID’s (see my other post on that topic), otherwise the C-STORE will fail on most of the PACS systems. In order to do that you need to either traverse through the dataset and keep all the tags or what I found much easier is to serialize the dataset into a byte array and store it.

It is not directly possible to serialize easily the fo-dicom Dataset, however there is a Save() method on the fo-dicom DicomFile class which is basically a wrapper around the Dataset. Therefore you can serialize the dataset into to a memory byte stream like this:


Send a Comment

Your email address will not be published.