Menu

#29 Generate unique SOP Instance UID for each slice generate by gdcmtar for Siemens Mosiac output

open
None
9
2015-02-12
2014-06-23
Todd Jensen
No

The DICOM image files generated by gdcmtar with the --mosaic option from a Siemens Mosaic file all re-use the same SOP Instance UID found in the original file. When these files are imported or sent to a DICOM PACS, many will only keep the first or last file due to the repeated SOP Instance UID.

Therefore, this request is to add code to gdcmtar.cxx to allow new SOP Instance UIDs to be generated for each new slice file. The following patch does this:

984a985,988

gdcm::File &file = reader.GetFile();
gdcm::DataSet &ds = file.GetDataSet();
gdcm::DataElement sopinstanceuid = ds.GetDataElement( IB_gdcm_2_4_2::Tag(0x0008,0x0018) );
1018a1023,1024
gdcm::UIDGenerator uid;

1027a1034,1037

const char* newsopinstanceuid = uid.Generate();
sopinstanceuid.SetByteValue( newsopinstanceuid, (uint32_t)strlen( newsopinstanceuid ) );
ds.Replace( sopinstanceuid );

The complete modified source is also attached to this request.

1 Attachments

Discussion

  • Mathieu Malaterre

    • assigned_to: Mathieu Malaterre
    • Priority: 5 --> 9
     
  • Mathieu Malaterre

    Hum, that really is a bug instead of a feature request. Will fix asap. thx

     

Log in to post a comment.

MongoDB Logo MongoDB