DICOMDIR updating directory does not update extsing record

All other questions regarding DCMTK

Moderator: Moderator Team

Post Reply
Message
Author
himanshu.mistri
Posts: 18
Joined: Tue, 2018-06-05, 10:21

DICOMDIR updating directory does not update extsing record

#1 Post by himanshu.mistri » Fri, 2021-03-26, 14:19

Hello Forum,

Please help me to understand the following behavior.

Let's say I am created DICOMDIR, During that, i have added PATIENT1 STUDY.

Now I am again using the same DICOMDIR to adding PATIENT2 Study and same time I have added PATIENT1 STUDY again.

During my above steps, output DICOMDIR has a duplicate reference of the ReferencedFileID even if their names are the same.

Please see my DICOMDIR dump:-

Code: Select all

dcmdump DICOMDIR

# Dicom-File-Format

# Dicom-Meta-Information-Header
# Used TransferSyntax: Little Endian Explicit
(0002,0000) UL 194                                      #   4, 1 FileMetaInformationGroupLength
(0002,0001) OB 00\01                                    #   2, 1 FileMetaInformationVersion
(0002,0002) UI =MediaStorageDirectoryStorage            #  20, 1 MediaStorageSOPClassUID
(0002,0003) UI [1.2.276.0.7230010.3.1.4.16777343.3354.1616761902.820548] #  56, 1 MediaStorageSOPInstanceUID
(0002,0010) UI =LittleEndianExplicit                    #  20, 1 TransferSyntaxUID
(0002,0012) UI [1.2.276.0.7230010.3.0.3.6.5]            #  28, 1 ImplementationClassUID
(0002,0013) SH [OFFIS_DCMTK_365]                        #  16, 1 ImplementationVersionName

# Dicom-Data-Set
# Used TransferSyntax: Little Endian Explicit
(0004,1130) CS [DCMTK_MEDIA_DEMO]                       #  16, 1 FileSetID
(0004,1200) up 408                                      #   4, 1 OffsetOfTheFirstDirectoryRecordOfTheRootDirectoryEntity
(0004,1202) up 2598                                     #   4, 1 OffsetOfTheLastDirectoryRecordOfTheRootDirectoryEntity
(0004,1212) US 0                                        #   2, 1 FileSetConsistencyFlag
(0004,1220) SQ (Sequence with explicit length #=14)     # 3278, 1 DirectoryRecordSequence
  (fffe,e000) na "Directory Record" PATIENT #=7           # 102, 1 Item
  #  offset=$408
    (0004,1400) up 2598                                     #   4, 1 OffsetOfTheNextDirectoryRecord
    (0004,1410) US 65535                                    #   2, 1 RecordInUseFlag
    (0004,1420) up 518                                      #   4, 1 OffsetOfReferencedLowerLevelDirectoryEntity
    (0004,1430) CS [PATIENT]                                #   8, 1 DirectoryRecordType
    (0008,0005) CS [ISO_IR 100]                             #  10, 1 SpecificCharacterSet
    (0010,0010) PN [123^My]                                 #   6, 1 PatientName
    (0010,0020) LO [TESTID]                                 #  12, 1 PatientID
  (fffe,e00d) na "ItemDelimitationItem for re-encoding"   #   0, 0 ItemDelimitationItem
  (fffe,e000) na "Directory Record" STUDY #=11            # 206, 1 Item
  #  offset=$518
    (0004,1400) up 0                                        #   4, 1 OffsetOfTheNextDirectoryRecord
    (0004,1410) US 65535                                    #   2, 1 RecordInUseFlag
    (0004,1420) up 732                                      #   4, 1 OffsetOfReferencedLowerLevelDirectoryEntity
    (0004,1430) CS [STUDY]                                  #   6, 1 DirectoryRecordType
    (0008,0005) CS [ISO_IR 100]                             #  10, 1 SpecificCharacterSet
    (0008,0020) DA [20210324]                               #   8, 1 StudyDate
    (0008,0030) TM [005245.62900]                           #  12, 1 StudyTime
    (0008,0050) SH (no value available)                     #   0, 0 AccessionNumber
    (0008,1030) LO (no value available)                     #   0, 0 StudyDescription
    (0020,000d) UI [1.2.276.0.7230010.3.1.2.16777343.5255.1616572405.693406] #  56, 1 StudyInstanceUID
    (0020,0010) SH [52C0ZCZ8GZ46TQ36]                       #  16, 1 StudyID
  (fffe,e00d) na "ItemDelimitationItem for re-encoding"   #   0, 0 ItemDelimitationItem
  (fffe,e000) na "Directory Record" SERIES #=9            # 166, 1 Item
  #  offset=$732
    (0004,1400) up 0                                        #   4, 1 OffsetOfTheNextDirectoryRecord
    (0004,1410) US 65535                                    #   2, 1 RecordInUseFlag
    (0004,1420) up 906                                      #   4, 1 OffsetOfReferencedLowerLevelDirectoryEntity
    (0004,1430) CS [SERIES]                                 #   6, 1 DirectoryRecordType
    (0008,0005) CS [ISO_IR 100]                             #  10, 1 SpecificCharacterSet
    (0008,0060) CS [US]                                     #   2, 1 Modality
    (0008,0080) LO [Unknown]                                #   8, 1 InstitutionName
    (0020,000e) UI [1.2.276.0.7230010.3.1.3.16777343.5255.1616572405.693407] #  56, 1 SeriesInstanceUID
    (0020,0011) IS [1]                                      #   2, 1 SeriesNumber
  (fffe,e00d) na "ItemDelimitationItem for re-encoding"   #   0, 0 ItemDelimitationItem
  (fffe,e000) na "Directory Record" IMAGE #=12            # 266, 1 Item
  #  offset=$906  refFileID="DICOM\1Q1O\1Q1O_1"
    (0004,1400) up 1180                                     #   4, 1 OffsetOfTheNextDirectoryRecord
    (0004,1410) US 65535                                    #   2, 1 RecordInUseFlag
    (0004,1420) up 0                                        #   4, 1 OffsetOfReferencedLowerLevelDirectoryEntity
    (0004,1430) CS [IMAGE]                                  #   6, 1 DirectoryRecordType
    (0004,1500) CS [DICOM\1Q1O\1Q1O_1]                      #  18, 3 ReferencedFileID
    (0004,1510) UI =UltrasoundImageStorage                  #  28, 1 ReferencedSOPClassUIDInFile
    (0004,1511) UI [1.2.276.0.7230010.3.1.4.16777343.3354.1616761902.820547] #  56, 1 ReferencedSOPInstanceUIDInFile
    (0004,1512) UI =JPEGBaseline                            #  22, 1 ReferencedTransferSyntaxUIDInFile
    (0008,0008) CS [DERIVED\PRIMARY\CARDIAC]                #  24, 3 ImageType
    (0020,0013) IS [1]                                      #   2, 1 InstanceNumber
    (0028,0010) US 720                                      #   2, 1 Rows
    (0028,0011) US 1280                                     #   2, 1 Columns
  (fffe,e00d) na "ItemDelimitationItem for re-encoding"   #   0, 0 ItemDelimitationItem
  (fffe,e000) na "Directory Record" IMAGE #=12            # 266, 1 Item
  #  offset=$1180  refFileID="DICOM\1Q1O\1Q1O_1"
    (0004,1400) up 1454                                     #   4, 1 OffsetOfTheNextDirectoryRecord
    (0004,1410) US 65535                                    #   2, 1 RecordInUseFlag
    (0004,1420) up 0                                        #   4, 1 OffsetOfReferencedLowerLevelDirectoryEntity
    (0004,1430) CS [IMAGE]                                  #   6, 1 DirectoryRecordType
    (0004,1500) CS [DICOM\1Q1O\1Q1O_1]                      #  18, 3 ReferencedFileID
    (0004,1510) UI =UltrasoundImageStorage                  #  28, 1 ReferencedSOPClassUIDInFile
    (0004,1511) UI [1.2.276.0.7230010.3.1.4.16777343.3354.1616761990.820564] #  56, 1 ReferencedSOPInstanceUIDInFile
    (0004,1512) UI =JPEGBaseline                            #  22, 1 ReferencedTransferSyntaxUIDInFile
    (0008,0008) CS [DERIVED\PRIMARY\CARDIAC]                #  24, 3 ImageType
    (0020,0013) IS [1]                                      #   2, 1 InstanceNumber
    (0028,0010) US 720                                      #   2, 1 Rows
    (0028,0011) US 1280                                     #   2, 1 Columns
  (fffe,e00d) na "ItemDelimitationItem for re-encoding"   #   0, 0 ItemDelimitationItem
  (fffe,e000) na "Directory Record" IMAGE #=14            # 290, 1 Item
  #  offset=$1454  refFileID="DICOM\1Q1O\1Q1O_2"
    (0004,1400) up 1752                                     #   4, 1 OffsetOfTheNextDirectoryRecord
    (0004,1410) US 65535                                    #   2, 1 RecordInUseFlag
    (0004,1420) up 0                                        #   4, 1 OffsetOfReferencedLowerLevelDirectoryEntity
    (0004,1430) CS [IMAGE]                                  #   6, 1 DirectoryRecordType
    (0004,1500) CS [DICOM\1Q1O\1Q1O_2]                      #  18, 3 ReferencedFileID
    (0004,1510) UI =UltrasoundMultiframeImageStorage        #  28, 1 ReferencedSOPClassUIDInFile
    (0004,1511) UI [1.2.276.0.7230010.3.1.4.16777343.3354.1616761904.820549] #  56, 1 ReferencedSOPInstanceUIDInFile
    (0004,1512) UI =JPEGBaseline                            #  22, 1 ReferencedTransferSyntaxUIDInFile
    (0008,0008) CS [DERIVED\PRIMARY\CARDIAC]                #  24, 3 ImageType
    (0020,0013) IS [2]                                      #   2, 1 InstanceNumber
    (0028,0008) IS [26]                                     #   2, 1 NumberOfFrames
    (0028,0010) US 720                                      #   2, 1 Rows
    (0028,0011) US 1280                                     #   2, 1 Columns
    (0028,2112) DS [31.528]                                 #   6, 1 LossyImageCompressionRatio
  (fffe,e00d) na "ItemDelimitationItem for re-encoding"   #   0, 0 ItemDelimitationItem
  (fffe,e000) na "Directory Record" IMAGE #=14            # 290, 1 Item
  #  offset=$1752  refFileID="DICOM\1Q1O\1Q1O_2"
    (0004,1400) up 2050                                     #   4, 1 OffsetOfTheNextDirectoryRecord
    (0004,1410) US 65535                                    #   2, 1 RecordInUseFlag
    (0004,1420) up 0                                        #   4, 1 OffsetOfReferencedLowerLevelDirectoryEntity
    (0004,1430) CS [IMAGE]                                  #   6, 1 DirectoryRecordType
    (0004,1500) CS [DICOM\1Q1O\1Q1O_2]                      #  18, 3 ReferencedFileID
    (0004,1510) UI =UltrasoundMultiframeImageStorage        #  28, 1 ReferencedSOPClassUIDInFile
    (0004,1511) UI [1.2.276.0.7230010.3.1.4.16777343.3354.1616761991.820565] #  56, 1 ReferencedSOPInstanceUIDInFile
    (0004,1512) UI =JPEGBaseline                            #  22, 1 ReferencedTransferSyntaxUIDInFile
    (0008,0008) CS [DERIVED\PRIMARY\CARDIAC]                #  24, 3 ImageType
    (0020,0013) IS [2]                                      #   2, 1 InstanceNumber
    (0028,0008) IS [26]                                     #   2, 1 NumberOfFrames
    (0028,0010) US 720                                      #   2, 1 Rows
    (0028,0011) US 1280                                     #   2, 1 Columns
    (0028,2112) DS [31.528]                                 #   6, 1 LossyImageCompressionRatio
  (fffe,e00d) na "ItemDelimitationItem for re-encoding"   #   0, 0 ItemDelimitationItem
  (fffe,e000) na "Directory Record" IMAGE #=12            # 266, 1 Item
  #  offset=$2050  refFileID="DICOM\1Q1O\1Q1O_3"
    (0004,1400) up 2324                                     #   4, 1 OffsetOfTheNextDirectoryRecord
    (0004,1410) US 65535                                    #   2, 1 RecordInUseFlag
    (0004,1420) up 0                                        #   4, 1 OffsetOfReferencedLowerLevelDirectoryEntity
    (0004,1430) CS [IMAGE]                                  #   6, 1 DirectoryRecordType
    (0004,1500) CS [DICOM\1Q1O\1Q1O_3]                      #  18, 3 ReferencedFileID
    (0004,1510) UI =UltrasoundImageStorage                  #  28, 1 ReferencedSOPClassUIDInFile
    (0004,1511) UI [1.2.276.0.7230010.3.1.4.16777343.3354.1616761906.820554] #  56, 1 ReferencedSOPInstanceUIDInFile
    (0004,1512) UI =JPEGBaseline                            #  22, 1 ReferencedTransferSyntaxUIDInFile
    (0008,0008) CS [DERIVED\PRIMARY\CARDIAC]                #  24, 3 ImageType
    (0020,0013) IS [3]                                      #   2, 1 InstanceNumber
    (0028,0010) US 720                                      #   2, 1 Rows
    (0028,0011) US 1280                                     #   2, 1 Columns
  (fffe,e00d) na "ItemDelimitationItem for re-encoding"   #   0, 0 ItemDelimitationItem
  (fffe,e000) na "Directory Record" IMAGE #=12            # 266, 1 Item
  #  offset=$2324  refFileID="DICOM\1Q1O\1Q1O_3"
    (0004,1400) up 0                                        #   4, 1 OffsetOfTheNextDirectoryRecord
    (0004,1410) US 65535                                    #   2, 1 RecordInUseFlag
    (0004,1420) up 0                                        #   4, 1 OffsetOfReferencedLowerLevelDirectoryEntity
    (0004,1430) CS [IMAGE]                                  #   6, 1 DirectoryRecordType
    (0004,1500) CS [DICOM\1Q1O\1Q1O_3]                      #  18, 3 ReferencedFileID
    (0004,1510) UI =UltrasoundImageStorage                  #  28, 1 ReferencedSOPClassUIDInFile
    (0004,1511) UI [1.2.276.0.7230010.3.1.4.16777343.3354.1616761993.820570] #  56, 1 ReferencedSOPInstanceUIDInFile
    (0004,1512) UI =JPEGBaseline                            #  22, 1 ReferencedTransferSyntaxUIDInFile
    (0008,0008) CS [DERIVED\PRIMARY\CARDIAC]                #  24, 3 ImageType
    (0020,0013) IS [3]                                      #   2, 1 InstanceNumber
    (0028,0010) US 720                                      #   2, 1 Rows
    (0028,0011) US 1280                                     #   2, 1 Columns
  (fffe,e00d) na "ItemDelimitationItem for re-encoding"   #   0, 0 ItemDelimitationItem
  (fffe,e000) na "Directory Record" PATIENT #=7           # 112, 1 Item
  #  offset=$2598
    (0004,1400) up 0                                        #   4, 1 OffsetOfTheNextDirectoryRecord
    (0004,1410) US 65535                                    #   2, 1 RecordInUseFlag
    (0004,1420) up 2718                                     #   4, 1 OffsetOfReferencedLowerLevelDirectoryEntity
    (0004,1430) CS [PATIENT]                                #   8, 1 DirectoryRecordType
    (0008,0005) CS [ISO_IR 100]                             #  10, 1 SpecificCharacterSet
    (0010,0010) PN [Test^Himanshu]                        #  16, 1 PatientName
    (0010,0020) LO [TMP_SFRJL373]                           #  12, 1 PatientID
  (fffe,e00d) na "ItemDelimitationItem for re-encoding"   #   0, 0 ItemDelimitationItem
  (fffe,e000) na "Directory Record" STUDY #=11            # 214, 1 Item
  #  offset=$2718
    (0004,1400) up 0                                        #   4, 1 OffsetOfTheNextDirectoryRecord
    (0004,1410) US 65535                                    #   2, 1 RecordInUseFlag
    (0004,1420) up 2940                                     #   4, 1 OffsetOfReferencedLowerLevelDirectoryEntity
    (0004,1430) CS [STUDY]                                  #   6, 1 DirectoryRecordType
    (0008,0005) CS [ISO_IR 100]                             #  10, 1 SpecificCharacterSet
    (0008,0020) DA [20210324]                               #   8, 1 StudyDate
    (0008,0030) TM [052405.46900]                           #  12, 1 StudyTime
    (0008,0050) SH [A1234567]                               #   8, 1 AccessionNumber
    (0008,1030) LO (no value available)                     #   0, 0 StudyDescription
    (0020,000d) UI [1.2.276.0.7230010.3.1.2.16777343.5617.1616588662.620400] #  56, 1 StudyInstanceUID
    (0020,0010) SH [R9FEYI_FBJKUFWHK]                       #  16, 1 StudyID
  (fffe,e00d) na "ItemDelimitationItem for re-encoding"   #   0, 0 ItemDelimitationItem
  (fffe,e000) na "Directory Record" SERIES #=9            # 166, 1 Item
  #  offset=$2940
    (0004,1400) up 0                                        #   4, 1 OffsetOfTheNextDirectoryRecord
    (0004,1410) US 65535                                    #   2, 1 RecordInUseFlag
    (0004,1420) up 3114                                     #   4, 1 OffsetOfReferencedLowerLevelDirectoryEntity
    (0004,1430) CS [SERIES]                                 #   6, 1 DirectoryRecordType
    (0008,0005) CS [ISO_IR 100]                             #  10, 1 SpecificCharacterSet
    (0008,0060) CS [US]                                     #   2, 1 Modality
    (0008,0080) LO [Unknown]                                #   8, 1 InstitutionName
    (0020,000e) UI [1.2.276.0.7230010.3.1.3.16777343.5617.1616588662.620401] #  56, 1 SeriesInstanceUID
    (0020,0011) IS [1]                                      #   2, 1 SeriesNumber
  (fffe,e00d) na "ItemDelimitationItem for re-encoding"   #   0, 0 ItemDelimitationItem
  (fffe,e000) na "Directory Record" IMAGE #=12            # 266, 1 Item
  #  offset=$3114  refFileID="DICOM\MHIM\MHIM_1"
    (0004,1400) up 3388                                     #   4, 1 OffsetOfTheNextDirectoryRecord
    (0004,1410) US 65535                                    #   2, 1 RecordInUseFlag
    (0004,1420) up 0                                        #   4, 1 OffsetOfReferencedLowerLevelDirectoryEntity
    (0004,1430) CS [IMAGE]                                  #   6, 1 DirectoryRecordType
    (0004,1500) CS [DICOM\MHIM\MHIM_1]                      #  18, 3 ReferencedFileID
    (0004,1510) UI =UltrasoundImageStorage                  #  28, 1 ReferencedSOPClassUIDInFile
    (0004,1511) UI [1.2.276.0.7230010.3.1.4.16777343.3354.1616761987.820558] #  56, 1 ReferencedSOPInstanceUIDInFile
    (0004,1512) UI =JPEGBaseline                            #  22, 1 ReferencedTransferSyntaxUIDInFile
    (0008,0008) CS [DERIVED\PRIMARY\CARDIAC]                #  24, 3 ImageType
    (0020,0013) IS [1]                                      #   2, 1 InstanceNumber
    (0028,0010) US 720                                      #   2, 1 Rows
    (0028,0011) US 1280                                     #   2, 1 Columns
  (fffe,e00d) na "ItemDelimitationItem for re-encoding"   #   0, 0 ItemDelimitationItem
  (fffe,e000) na "Directory Record" IMAGE #=14            # 290, 1 Item
  #  offset=$3388  refFileID="DICOM\MHIM\MHIM_2"
    (0004,1400) up 0                                        #   4, 1 OffsetOfTheNextDirectoryRecord
    (0004,1410) US 65535                                    #   2, 1 RecordInUseFlag
    (0004,1420) up 0                                        #   4, 1 OffsetOfReferencedLowerLevelDirectoryEntity
    (0004,1430) CS [IMAGE]                                  #   6, 1 DirectoryRecordType
    (0004,1500) CS [DICOM\MHIM\MHIM_2]                      #  18, 3 ReferencedFileID
    (0004,1510) UI =UltrasoundMultiframeImageStorage        #  28, 1 ReferencedSOPClassUIDInFile
    (0004,1511) UI [1.2.276.0.7230010.3.1.4.16777343.3354.1616761988.820559] #  56, 1 ReferencedSOPInstanceUIDInFile
    (0004,1512) UI =JPEGBaseline                            #  22, 1 ReferencedTransferSyntaxUIDInFile
    (0008,0008) CS [DERIVED\PRIMARY\CARDIAC]                #  24, 3 ImageType
    (0020,0013) IS [2]                                      #   2, 1 InstanceNumber
    (0028,0008) IS [22]                                     #   2, 1 NumberOfFrames
    (0028,0010) US 720                                      #   2, 1 Rows
    (0028,0011) US 1280                                     #   2, 1 Columns
    (0028,2112) DS [30.992]                                 #   6, 1 LossyImageCompressionRatio
  (fffe,e00d) na "ItemDelimitationItem for re-encoding"   #   0, 0 ItemDelimitationItem
(fffe,e0dd) na (SequenceDelimitationItem for re-encod.) #   0, 0 SequenceDelimitationItem
What I am expecting is this ReferencedFileID DICOM\1Q1O\1Q1O_1 should not have multiple time as it needs to update not added again.

Below is my code Snippet.

Code: Select all

 DicomDirImageImplementation imagePlugin;
    ddir.addImageSupport(&imagePlugin);

    OFCondition result;

    /* create new general purpose DICOMDIR, append to or update existing one */
    if (opt_append)
    {
        action = "appending";
        result = ddir.updateDicomDir(opt_profile, opt_output);//ddir.appendToDicomDir(opt_profile, opt_output);
        LOGIDIR("GOOD:: DICOMDIR:: Append %s", result.text());
    }
    else {
        action = "creating";
        result = ddir.createNewDicomDir(opt_profile, opt_output, opt_fileset);
        LOGIDIR("GOOD:: DICOMDIR:: Create %s", result.text());
    }


    if (result.good())
    {
        /* set fileset descriptor and character set */
        result = ddir.setFilesetDescriptor(opt_descriptor, opt_charset);

        if (result.good()) {
            /* collect 'bad' files */
            OFList<OFFilename> badFiles;
            unsigned int goodFiles = 0;
            auto iter = fileNames.begin();
            auto last = fileNames.end();
            /* iterate over all input filenames */
            while ((iter != last) && result.good())
            {
                LOGIDIR("GOOD:: Add dicom file name is %s", iter->getCharPointer());
                /* add files to the DICOMDIR */
                 const char *fileName= iter->getCharPointer();

                string mFinalString("DICOM/");
                 mFinalString.append(fileName);
                 LOGIDIR("GOOD:: Add dicom filename is %s", mFinalString.c_str());

                //(*iter).set("",OFFalse);
                OFFilename dicomFile(mFinalString);

                result = ddir.addDicomFile(dicomFile, inputRoot);
                if (result.bad())
                {
                    LOGIDIR("ERROR:: DICOM add file %s", result.text());
                    badFiles.push_back(*iter);
                    if (!ddir.abortMode())
                    {
                        /* ignore inconsistent file, just warn (already done inside "ddir") */
                        result = EC_Normal;
                    }
                } else
                    ++goodFiles;
                ++iter;
            }

            /* evaluate result of file checking/adding procedure */
            if (goodFiles == 0)
            {
                LOGIDIR("ERROR:: no good files: DICOMDIR not created");
                result = EC_IllegalCall;
            }
            else if (!badFiles.empty())
            {
                LOGIDIR("ERROR:: file(s) cannot be added to DICOMDIR:");

                OFOStringStream oss;
                oss << badFiles.size() << " file(s) cannot be added to DICOMDIR: ";
                iter = badFiles.begin();
                last = badFiles.end();
                while (iter != last)
                {
                    oss << OFendl << "  " << (*iter);
                    ++iter;
                }
                oss << OFStringStream_ends;
                OFSTRINGSTREAM_GETSTR(oss, tmpString)
                    OFLOG_WARN(dcmgpdirLogger, tmpString);
                OFSTRINGSTREAM_FREESTR(tmpString)
            }

            /* write DICOMDIR file */
            if (result.good() && opt_write)
            {
                LOGIDIR("GOOD::  DICOMDIR  created");
                action = "writing";
                result = ddir.writeDicomDir(opt_enctype, opt_glenc);
            }
        }

    }
Let me know what I am missing.

Appreciate any solution to resolve this issue,
Last edited by himanshu.mistri on Sat, 2021-03-27, 18:49, edited 1 time in total.

J. Riesmeier
DCMTK Developer
Posts: 2291
Joined: Tue, 2011-05-03, 14:38
Location: Oldenburg, Germany
Contact:

Re: DICOMDIR updating directory does not update extsing record

#2 Post by J. Riesmeier » Fri, 2021-03-26, 21:10

Short question: did you change the SOP Instance UID of the DICOM file before the second addition?
Below is my code Snippet.
Where?

himanshu.mistri
Posts: 18
Joined: Tue, 2018-06-05, 10:21

Re: DICOMDIR updating directory does not update extsing record

#3 Post by himanshu.mistri » Sat, 2021-03-27, 19:00

Hi @ J. Riesmeier,

Yes, Unfortunately in the current system design, It will have a different DCM_SOPInstanceUID generated every time when the system generates the Dicom file.

Only following UID will remain same..DCM_StudyInstanceUID and DCM_SeriesInstanceUID.

Now it looks like you are suggesting that, the system needs to manitain the same DCM_SOPInstanceUID for the same IMAGE/CLIP data of the ultrasound.

Thanks for the hint, I will try that.

J. Riesmeier
DCMTK Developer
Posts: 2291
Joined: Tue, 2011-05-03, 14:38
Location: Oldenburg, Germany
Contact:

Re: DICOMDIR updating directory does not update extsing record

#4 Post by J. Riesmeier » Sat, 2021-03-27, 19:55

The DICOM standard says with regard to the SOP Instance UID: same value means same DICOM object, different value means different DICOM object. In your case, the filename (Referenced File ID) is not relevant but the value of SOP Instance UID.

Post Reply

Who is online

Users browsing this forum: Bing [Bot], Google [Bot] and 1 guest