DICOMDIR problem

All other questions regarding DCMTK

Moderator: Moderator Team

Post Reply
Message
Author
paolom
Posts: 169
Joined: Tue, 2008-09-16, 15:02

DICOMDIR problem

#1 Post by paolom »

Hi,

When I try to read the DICOMDIR the code exit on the first nextSub() level. I think that some tag missing on the DICOMDIR ( like the FileSetID ) or any other.

This is a part of the code that I use to read the DICOMDIR. The code exit
on the first nextSub().

Code: Select all

 DcmDirectoryRecord * Dir = &(DicomDir.getRootRecord());

      DcmDirectoryRecord *   FirstLevel = NULL;
    DcmDirectoryRecord *   SecondLevel = NULL;
    DcmDirectoryRecord *   ThirdLevel = NULL;
    DcmDirectoryRecord *   FourthLevel = NULL;
    DcmDirectoryRecord *   FifthLevel = NULL;
 
    int stdNbm = 0;


    if(Dir != NULL)
    {
        while (((FirstLevel = Dir->nextSub(FirstLevel)) != NULL))
        {
            /* Not enter */
         }


This is the DICOMDIR ( the first part )

Code: Select all

# Dicom-File-Format

# Dicom-Meta-Information-Header
# Used TransferSyntax: Little Endian Explicit
(0002,0000) UL 212                                      #   4, 1 FileMetaInformationGroupLength
(0002,0001) OB 00\01                                    #   2, 1 FileMetaInformationVersion
(0002,0002) UI =MediaStorageDirectoryStorage            #  20, 1 MediaStorageSOPClassUID
(0002,0003) UI [1.3.6.1.4.1.35671.3.6.1.1302192974.1379119823.1508705435] #  56, 1 MediaStorageSOPInstanceUID
(0002,0010) UI =LittleEndianExplicit                    #  20, 1 TransferSyntaxUID
(0002,0012) UI [1.2.826.0.1.3680043.2.120.20000624]     #  34, 1 ImplementationClassUID
(0002,0013) SH [G2/W32/1.6.9]                           #  12, 1 ImplementationVersionName
(0002,0016) AE (no value available)                     #   0, 0 SourceApplicationEntityTitle
(0004,1200) up 394                                      #   4, 1 OffsetOfTheFirstDirectoryRecordOfTheRootDirectoryEntity

# Dicom-Data-Set
# Used TransferSyntax: Little Endian Explicit
(0004,1202) up 58196                                    #   4, 1 OffsetOfTheLastDirectoryRecordOfTheRootDirectoryEntity
(0004,1212) US 0                                        #   2, 1 FileSetConsistencyFlag
(0004,1220) SQ (Sequence with undefined length #=254)   # u/l, 1 DirectoryRecordSequence
  (fffe,e000) na "Directory Record" PATIENT #=9           # u/l, 1 Item
  #  offset=$394
    (0004,1400) up 2454                                     #   4, 1 OffsetOfTheNextDirectoryRecord
    (0004,1410) US 65535                                    #   2, 1 RecordInUseFlag
    (0004,1420) up 538                                      #   4, 1 OffsetOfReferencedLowerLevelDirectoryEntity
    (0004,1430) CS [PATIENT]                                #   8, 1 DirectoryRecordType
    (0008,0005) CS [ISO_IR 100]                             #  10, 1 SpecificCharacterSet
    (0010,0010) PN [MODALITY^211]                           #  12, 1 PatientName
    (0010,0020) LO [MM211]                                  #   6, 1 PatientID
    (0010,0030) DA [xxxxx]                               #   8, 1 PatientBirthDate
    (0010,0040) CS [M]                                      #   2, 1 PatientSex
  (fffe,e00d) na "ItemDelimitationItem"                   #   0, 0 ItemDelimitationItem
  (fffe,e000) na "Directory Record" STUDY #=11            # u/l, 1 Item
  #  offset=$538
    (0004,1400) up 0                                        #   4, 1 OffsetOfTheNextDirectoryRecord
    (0004,1410) US 65535                                    #   2, 1 RecordInUseFlag
    (0004,1420) up 714                                      #   4, 1 OffsetOfReferencedLowerLevelDirectoryEntity
    (0004,1430) CS [STUDY]                                  #   6, 1 DirectoryRecordType
    (0008,0005) CS [ISO_IR 100]                             #  10, 1 SpecificCharacterSet
    (0008,0020) DA [20091203]                               #   8, 1 StudyDate
    (0008,0030) TM [161215]                                 #   6, 1 StudyTime
    (0008,0050) SH [MOF5048]                                #   8, 1 AccessionNumber
    (0008,1030) LO (no value available)                     #   0, 0 StudyDescription
    (0020,000d) UI [1.113654.3.13.1048]                     #  18, 1 StudyInstanceUID
    (0020,0010) SH [RP1048]                                 #   6, 1 StudyID
  (fffe,e00d) na "ItemDelimitationItem"                   #   0, 0 ItemDelimitationItem
  (fffe,e000) na "Directory Record" SERIES #=8            # u/l, 1 Item
  #  offset=$714
    (0004,1400) up 1584                                     #   4, 1 OffsetOfTheNextDirectoryRecord
    (0004,1410) US 65535                                    #   2, 1 RecordInUseFlag
    (0004,1420) up 858                                      #   4, 1 OffsetOfReferencedLowerLevelDirectoryEntity
    (0004,1430) CS [SERIES]                                 #   6, 1 DirectoryRecordType
    (0008,0005) CS [ISO_IR 100]                             #  10, 1 SpecificCharacterSet
    (0008,0060) CS [MR]                                     #   2, 1 Modality
    (0020,000e) UI [1.3.76.2.1.1.4.1.3.5001.348509544]      #  34, 1 SeriesInstanceUID
    (0020,0011) IS [1]                                      #   2, 1 SeriesNumber
  (fffe,e00d) na "ItemDelimitationItem"                   #   0, 0 ItemDelimitationItem
  (fffe,e000) na "Directory Record" IMAGE #=10            # u/l, 1 Item
  #  offset=$858  refFileID="P0000001\S0000001\S0000001\I0000000"
    (0004,1400) up 1100                                     #   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 [P0000001\S0000001\S0000001\I0000000]    #  36, 4 ReferencedFileID
    (0004,1510) UI =MRImageStorage                          #  26, 1 ReferencedSOPClassUIDInFile
Any ideas

Jörg Riesmeier
ICSMED DICOM Services
ICSMED DICOM Services
Posts: 2217
Joined: Fri, 2004-10-29, 21:38
Location: Oldenburg, Germany

#2 Post by Jörg Riesmeier »

Looking at the textual dump, it seems that the value of FileMetaInformationGroupLength is incorrect. (0004,1200) OffsetOfTheFirstDirectoryRecordOfTheRootDirectoryEntity belongs to the dataset and not to the file-meta information header.

You could e.g. use dcmconv 3.6.0 with option --ignore-meta-length to fix the incorrect length value.

Post Reply

Who is online

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