Loading ...
Sorry, an error occurred while loading the content.

working with unsupported Transfer Syntax UIDs

Expand Messages
  • mmilchen
    Hi, I need to be modifying several demographic attributes (patient name & ID, Study & Series Instance UID s) in DICOM file and re-save it. Below is the
    Message 1 of 1 , Apr 7 9:15 AM
    View Source
    • 0 Attachment
      Hi, I need to be modifying several demographic attributes (patient name & ID, Study & Series Instance UID's) in DICOM file and re-save it. Below is the function that I use to do that. All attributes to modify are in the 'request' parameter. Also I need to keep transfer syntax intact and save pixel data with the same transfer syntax, verbatim as it was read from original source. In case when transfer syntax is not supported, I get a message "Unrecognized Transfer Syntax" and pixel data is not saved - is there a simple way to bypass pixel decoding/encoding during read/write of DICOM object? Or at least what would be a workaround to write to make this happen? Thanks for your help.

      private String SaveDicomFile(InputStream is, AttributeList request)
      throws IOException, DicomException
      {
      AttributeList fal=new AttributeList();
      String fname=(m_StoreFolder+"/"+PseudoUID()).replace('\\', '/').replace("//", "/");
      fal.read(new DicomInputStream(is));
      fal.putAll(request);
      fal.removeGroupLengthAttributes();
      Attribute ts=fal.get(TagFromName.TransferSyntaxUID);
      fal.removeMetaInformationHeaderAttributes();
      fal.remove(TagFromName.DataSetTrailingPadding);
      // fal.correctDecompressedImagePixelModule();
      String sts=ts.getSingleStringValueOrDefault(TransferSyntax.ExplicitVRLittleEndian);
      FileMetaInformation.addFileMetaInformation(fal,sts,m_AETitle);
      fal.write(fname,sts,true,true);
      new File(fname).deleteOnExit();
      return fname;
      }
    Your message has been successfully submitted and would be delivered to recipients shortly.