I am trying to create a new DICOM file from an existing DICOM file. So, the scenario is that I have a DICOM file and I do some image processing on it and produce a transformed/processed file and I would like to save it using the original file as a template.
The only things that change are
1: The pixel data
2: The rescale and offset tags.
Does anyone know how I can achieve this with DCMTK? I looked at various examples but most of them show how to save a JPG or BMP image into a new DICOM file.
If you modify the image data (Pixel Data), you should save the new dataset with new Series Instance UID and SOP Instance UID. In addition, you should also update the first value of Image Type (0008, 0008) to “DERIVED” to reflect that image is not the original image. The second value Image Type tag can be “PRIMARY” or “SECONDARY” depending on the patient examination characteristics. You can also use Derivation Description (0008, 2111) and Derivation Code Sequence (0008,9215) to describe the way in which the image was derived. In addition, you can also reference the source image(s) used to create the Derived image by adding optional Source Image Sequence (0008,2112) which can hold a list of Referenced SOP Class UID (0008,1150)/ Referenced SOP Instance UID (0008,1150) pair(s).