Creating Secondary Capture Images

Any ‘valid’ Dicom Image is a conglomeration of Pixel data and several mandatory data attributes. To generate a Secondary Capture (SC) Image from existing non-Dicom image then all that is required is to load the required image into a DicomImage using the import function and then adding on the appropriate attributes. Dicom Objects will automatically take care of all the attributes relating to the pixel data (Group 0x0028).

Part 3 of the Dicom Standard Contains Table A.8-1”SC Image IOD Modules”. which gives the mandatory modules required to create a Valid DicomImage from a Secondary Capture. The Mandatory Modules are:

If the image is being created from scratch (rather than by using the import method on an existing image) then Image Pixel attributes must be added explicitly as must the pixel data.

The code fragment bellow will add arbitrary values onto an existing image file (gif, jpg, bmp, etc) and turn it into a Secondary capture Dicom image file.


DicomImage im = new DicomImage(new Bitmap(fileToImport));
// Add Patient Module
im.Name = "test patient";
im.PatientID = "123456";
im.DateOfBirth = DateTime.Now;
im.Sex = "O";
// Add General Study Module
im.StudyUID = DicomGlobal.NewUID();
im.DataSet.Add(Keyword.StudyDate, DateTime.Now);
im.DataSet.Add(Keyword.StudyTime, DateTime.Now);
im.DataSet.Add(Keyword.ReferringPhysicianName, "Doctor A");
im.DataSet.Add(Keyword.StudyID, "1");
im.AccessionNumber = "";
// Add General Series Module
im.DataSet.Add(Keyword.Modality, "OT");
im.SeriesUID = DicomGlobal.NewUID();
im.DataSet.Add(Keyword.SeriesNumber, "");
// Add SC Equipment Module
im.DataSet.Add(Keyword.ConversionType, "SI");
// Add General Image Module
im.DataSet.Add(Keyword.InstanceNumber, "");
im.DataSet.Add(Keyword.PatientOrientation, "");
// Add SOP Common Module
im.SOPClass = SOPClasses.SecondaryCapture;
im.InstanceUID = DicomGlobal.NewUID();
// Save File onto Disk
im.Write("c:\\SecondaryCaptured.dcm", TransferSyntaxes.ImplicitVRLittleEndian);


  Dim g As New DicomGlobal
  fileToImport = "D:\Users\qian.MEDCONNECT\Desktop\Sample Images\CT.JPEG"
  Dim im As New DicomImage
   ' Import image file
  im.FileImport fileToImport
' Add Patient Module
   im.Name = "test patient"
   im.PatientID = "123456"
   im.DateOfBirth = Now
   im.Sex = "O"
' Add General Study Module
   im.StudyUID = g.NewUID
   im.Attributes.Add &H8, &H20, Now
   im.Attributes.Add &H8, &H30, Now
   im.Attributes.Add &H8, &H90, "foo"
   im.Attributes.Add &H20, &H10, "1"
   im.AccessionNumber = ""
' Add General Series Module
   im.Attributes.Add &H8, &H60, "OT"
   im.SeriesUID = g.NewUID
   im.Attributes.Add &H20, &H11, ""
' Add SC Equipment Module
   im.Attributes.Add &H8, &H64, "SI"
' Add General Image Module
   im.Attributes.Add &H20, &H13, ""
   im.Attributes.Add &H20, &H20, ""
' Add SOP Common Module
   im.SOPClass = "1.2.840.10008."
   im.InstanceUID = g.NewUID
' Save File onto Disk
   im.WriteFile "c:\SecondaryCaptured.dcm", True, "1.2.840.10008.1.2.1"

We use cookies to give you the best possible experience on our website. By continuing to use this website, you agree with our use of cookies. for more information please click HERE