def create_general_dicom_image_scaffold
      # Some tags are created/updated only if no DICOM object already exists:
      unless @dcm
        @dcm = DICOM::DObject.new
        # Group 0008:
        @dcm.add_element(SPECIFIC_CHARACTER_SET, 'ISO_IR 100')
        @dcm.add_element(IMAGE_TYPE, 'DERIVED\SECONDARY\DRR')
        @dcm.add_element(ACCESSION_NUMBER, '')
        @dcm.add_element(MODALITY, @series.modality)
        @dcm.add_element(CONVERSION_TYPE, 'SYN') # or WSD?
        @dcm.add_element(MANUFACTURER, 'RTKIT')
        @dcm.add_element(TIMEZONE_OFFSET_FROM_UTC, Time.now.strftime('%z'))
        @dcm.add_element(MANUFACTURERS_MODEL_NAME, "RTKIT_#{VERSION}")
        # Group 0018:
        @dcm.add_element(SOFTWARE_VERSION, "RTKIT_#{VERSION}")
        # Group 0020:
        # FIXME: We're missing Instance Number (0020,0013) at the moment.
        # Group 0028:
        @dcm.add_element(SAMPLES_PER_PIXEL, '1')
        @dcm.add_element(PHOTOMETRIC_INTERPRETATION, 'MONOCHROME2')
        @dcm.add_element(BITS_ALLOCATED, 16)
        @dcm.add_element(BITS_STORED, 16)
        @dcm.add_element(HIGH_BIT, 15)
        @dcm.add_element(PIXEL_REPRESENTATION, 0)
        @dcm.add_element(WINDOW_CENTER, '2048')
        @dcm.add_element(WINDOW_WIDTH, '4096')
      end
    end
def create_general_dicom_image_scaffold
      # Some tags are created/updated only if no DICOM object already exists:
      unless @dcm
        @dcm = DICOM::DObject.new
        # Group 0008:
        @dcm.add_element(SPECIFIC_CHARACTER_SET, 'ISO_IR 100')
        @dcm.add_element(IMAGE_TYPE, 'DERIVED\SECONDARY\DRR')
        @dcm.add_element(ACCESSION_NUMBER, '')
        @dcm.add_element(MODALITY, @series.modality)
        @dcm.add_element(CONVERSION_TYPE, 'SYN') # or WSD?
        @dcm.add_element(MANUFACTURER, 'RTKIT')
        @dcm.add_element(TIMEZONE_OFFSET_FROM_UTC, Time.now.strftime('%z'))
        @dcm.add_element(MANUFACTURERS_MODEL_NAME, "RTKIT_#{VERSION}")
        # Group 0018:
        @dcm.add_element(SOFTWARE_VERSION, "RTKIT_#{VERSION}")
        # Group 0020:
        # FIXME: We're missing Instance Number (0020,0013) at the moment.
        # Group 0028:
        @dcm.add_element(SAMPLES_PER_PIXEL, '1')
        @dcm.add_element(PHOTOMETRIC_INTERPRETATION, 'MONOCHROME2')
        @dcm.add_element(BITS_ALLOCATED, 16)
        @dcm.add_element(BITS_STORED, 16)
        @dcm.add_element(HIGH_BIT, 15)
        @dcm.add_element(PIXEL_REPRESENTATION, 0)
        @dcm.add_element(WINDOW_CENTER, '2048')
        @dcm.add_element(WINDOW_WIDTH, '4096')
      end
    end
Creates a new DICOM object with a set of basic attributes needed
 for a valid DICOM image file.