DICOMDIR Transfer Syntax

All other questions regarding DCMTK

Moderator: Moderator Team

Post Reply
Message
Author
prakash
Posts: 50
Joined: Mon, 2008-05-19, 10:34
Contact:

DICOMDIR Transfer Syntax

#1 Post by prakash »

Hi,

The Transfer Syntax UID in the DICOMDIR differs from the Transfer Syntax of the Image on Medium.
For EG:
(0004,1512) UI =JPEGLossless:Non-hierarchical-1stOrderPrediction # 22, 1 ReferencedTransferSyntaxUIDInFile
(0002,0010) UI =LittleEndianExplicit # 20, 1 TransferSyntaxUID

How can i create a DICOMDIR with same transfer syntax.

Please help

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 »

When using DCMTK's DICOMDIR tools, the value for ReferencedTransferSyntaxUIDInFile is copied directly from the TransferSyntaxUID of the referenced DICOM file.

What exactly did you do?

prakash
Posts: 50
Joined: Mon, 2008-05-19, 10:34
Contact:

#3 Post by prakash »

Hi jorg,

I am using following code to create a DICOM DIR, other than that i am not doing anything. Please find the below code.
//Create New DicomDirInterface
_Dcmdicomdirinterface=new DicomDirInterface();

//Set Some Image Support
_Dcmdicomdirinterface->addImageSupport(&_Dcmimageplugin);
_Dcmdicomdirinterface->enableAbortMode(OFFalse);
//If NewDicomDir is True
if(_DcmNewDicomDir)
{
//Create NewDicomDir with current Application Profile
_DcmStatus = _Dcmdicomdirinterface->createNewDicomDir( _DcmApplicationProfile,ConvertBSTRToChar(_DcmDicomDirFilePath)+"DICOMDIR",DEFAULT_FILESETID);
}
else
{
//Append To Existing DicomDir with updated Application Profile
_DcmStatus = _Dcmdicomdirinterface->appendToDicomDir( _DcmApplicationProfile ,ConvertBSTRToChar(_DcmDicomDirFilePath)+"DICOMDIR");
}
//Set DicomDirInterface Properties
_Dcmdicomdirinterface->setFilesetDescriptor("DICOMDIR");
_Dcmdicomdirinterface->disableBackupMode();
_Dcmdicomdirinterface->disableConsistencyCheck();
_Dcmdicomdirinterface->enableMapFilenamesMode(OFFalse);
_Dcmdicomdirinterface->enableIconImageMode();
_Dcmdicomdirinterface->disableEncodingCheck();
_Dcmdicomdirinterface->disableResolutionCheck();
_Dcmdicomdirinterface->disableTransferSyntaxCheck();
_Dcmdicomdirinterface->setIconSize(ICONIMAGESIZE);
_Dcmdicomdirinterface->setLogStream(&(OFConsole::instance()));

//Add the DicomFile
_DcmStatus = _Dcmdicomdirinterface->addDicomFile((const char*)DicomFilePath,ConvertBSTRToChar(_DcmDicomDirFilePath));
if (_DcmStatus.bad())
{
DeleteSelectedFile = ConvertBSTRToChar(_DcmDicomDirFilePath)+"\\"+DicomFilePath;
DeleteFile((LPCTSTR) DeleteSelectedFile);
_DcmErrorCode=DXSDCC_ADDDICOMFILE_ERROR;
_DcmErrorString=_DcmStatus.text();
return FALSE;
}

//Write DICOMDIR
_DcmStatus = _Dcmdicomdirinterface->writeDicomDir(EET_ExplicitLength, EGL_withoutGL);
if (_DcmStatus.bad())
{
DeleteSelectedFile = ConvertBSTRToChar(_DcmDicomDirFilePath)+"\\"+DicomFilePath;
DeleteFile((LPCTSTR) DeleteSelectedFile);
_DcmErrorCode=DXSDCC_WRITEDICOMDIR_ERROR;
_DcmErrorString=_DcmStatus.text();
return FALSE;
}

//Delete DicomDirInterface
if(_Dcmdicomdirinterface!=NULL)
{
_Dcmdicomdirinterface->cleanup();
///*delete _Dcmdicomdirinterface;*/
_Dcmdicomdirinterface=NULL;
}

Please help

prakash
Posts: 50
Joined: Mon, 2008-05-19, 10:34
Contact:

#4 Post by prakash »

Hi Jorg,

When i checked Write DICOMDIR Function, it is internally taking DICOMDIR_DEFAULT_TRANSFERSYNTAX = EXS_LittleEndianExplicit; Can you please help us

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

#5 Post by Jörg Riesmeier »

First of all, you should not use disableEncodingCheck(), disableResolutionCheck(), disableTransferSyntaxCheck() and the like because this might create invalid (non standard conformant) DICOMDIR files.
When i checked Write DICOMDIR Function, it is internally taking DICOMDIR_DEFAULT_TRANSFERSYNTAX = EXS_LittleEndianExplicit; Can you please help us
The DICOMDIR file always has to be written with this transfer syntax (according to the application profiles defined in the standard).

prakash
Posts: 50
Joined: Mon, 2008-05-19, 10:34
Contact:

#6 Post by prakash »

Hi Jorg,

I removed the disable functionalities as follows:

//Set DicomDirInterface Properties
_Dcmdicomdirinterface->setFilesetDescriptor("DICOMDIR");
//_Dcmdicomdirinterface->disableBackupMode();
//_Dcmdicomdirinterface->disableConsistencyCheck();
_Dcmdicomdirinterface->enableMapFilenamesMode(OFFalse);
_Dcmdicomdirinterface->enableIconImageMode();
//_Dcmdicomdirinterface->disableEncodingCheck();
//_Dcmdicomdirinterface->disableResolutionCheck();
//_Dcmdicomdirinterface->disableTransferSyntaxCheck();
_Dcmdicomdirinterface->setIconSize(ICONIMAGESIZE);
_Dcmdicomdirinterface->setLogStream(&(OFConsole::instance()));

after doing above changes also there is difference in Transfer syntaxes.

Please help

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

#7 Post by Jörg Riesmeier »

Have you already tried to use dcmgpdir or dcmmkdir from the command line with the same set of DICOM files?

prakash
Posts: 50
Joined: Mon, 2008-05-19, 10:34
Contact:

#8 Post by prakash »

Hi Jorg,

I tried with dcmmkdir.exe as you suggested with following options

D:\Backup\dcmmkdir.exe -v -d -Pdv +id C: +r +D C:\DICOMDIR +X -Xs 128 PAT_1\IMG_1 PAT_1\IMG_002

i got the same result. Difference in transfer syntaxes

prakash
Posts: 50
Joined: Mon, 2008-05-19, 10:34
Contact:

#9 Post by prakash »

This is output i got from dcmmkdir.exe,

Output:

determining input files ...
creating DICOMDIR file using STD-GEN-DVD-JPEG/J2K profile: C:\DICOMDIR
checking file: C:\PAT_1\IMG_1
adding file: C:\PAT_1\IMG_1
checking file: C:\PAT_1\IMG_002
adding file: C:\PAT_1\IMG_002
writing file: C:\DICOMDIR

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

#10 Post by Jörg Riesmeier »

Could you please send the DICOM files by email to dicom/at/offis/dot/de. If the package is too large, please offer a download address.

prakash
Posts: 50
Joined: Mon, 2008-05-19, 10:34
Contact:

#11 Post by prakash »

Hi Jorg,

Sent DICOM Files to the mentioned address from my GMAIL account

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

#12 Post by Jörg Riesmeier »

I created a DICOMDIR with dcmmkdir 3.6.0 in the same way as described on your previous posting. Here's the result:

Code: Select all

# Dicom-File-Format

# Dicom-Meta-Information-Header
# Used TransferSyntax: Little Endian Explicit
(0002,0000) UL 196                                      #   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.1787205428.12771.1294762622.249374] #  58, 1 MediaStorageSOPInstanceUID
(0002,0010) UI =LittleEndianExplicit                    #  20, 1 TransferSyntaxUID
(0002,0012) UI [1.2.276.0.7230010.3.0.3.6.0]            #  28, 1 ImplementationClassUID
(0002,0013) SH [OFFIS_DCMTK_360]                        #  16, 1 ImplementationVersionName

# Dicom-Data-Set
# Used TransferSyntax: Little Endian Explicit
(0004,1130) CS [DCMTK_MEDIA_DEMO]                       #  16, 1 FileSetID
(0004,1200) up 410                                      #   4, 1 OffsetOfTheFirstDirectoryRecordOfTheRootDirectoryEntity
(0004,1202) up 410                                      #   4, 1 OffsetOfTheLastDirectoryRecordOfTheRootDirectoryEntity
(0004,1212) US 0                                        #   2, 1 FileSetConsistencyFlag
(0004,1220) SQ (Sequence with explicit length #=5)      # 34046, 1 DirectoryRecordSequence
  (fffe,e000) na "Directory Record" PATIENT #=9           # 120, 1 Item
  #  offset=$410
    (0004,1400) up 0                                        #   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 [df  df||]                               #   8, 1 PatientName
    (0010,0020) LO [E]                                      #   2, 1 PatientID
    (0010,0030) DA [20101221]                               #   8, 1 PatientBirthDate
    (0010,0040) CS [M]                                      #   2, 1 PatientSex
  (fffe,e00d) na "ItemDelimitationItem for re-encoding"   #   0, 0 ItemDelimitationItem
  (fffe,e000) na "Directory Record" STUDY #=11            # 176, 1 Item
  #  offset=$538
    (0004,1400) up 0                                        #   4, 1 OffsetOfTheNextDirectoryRecord
    (0004,1410) US 65535                                    #   2, 1 RecordInUseFlag
    (0004,1420) up 722                                      #   4, 1 OffsetOfReferencedLowerLevelDirectoryEntity
    (0004,1430) CS [STUDY]                                  #   6, 1 DirectoryRecordType
    (0008,0005) CS [ISO_IR 100]                             #  10, 1 SpecificCharacterSet
    (0008,0020) DA [20101221]                               #   8, 1 StudyDate
    (0008,0030) TM [1237]                                   #   4, 1 StudyTime
    (0008,0050) SH [1]                                      #   2, 1 AccessionNumber
    (0008,1030) LO (no value available)                     #   0, 0 StudyDescription
    (0020,000d) UI [1.2.756.777.20100805.20101221123749.77] #  38, 1 StudyInstanceUID
    (0020,0010) SH [STUDY_002]                              #  10, 1 StudyID
  (fffe,e00d) na "ItemDelimitationItem for re-encoding"   #   0, 0 ItemDelimitationItem
  (fffe,e000) na "Directory Record" SERIES #=10           # 212, 1 Item
  #  offset=$722
    (0004,1400) up 0                                        #   4, 1 OffsetOfTheNextDirectoryRecord
    (0004,1410) US 65535                                    #   2, 1 RecordInUseFlag
    (0004,1420) up 942                                      #   4, 1 OffsetOfReferencedLowerLevelDirectoryEntity
    (0004,1430) CS [SERIES]                                 #   6, 1 DirectoryRecordType
    (0008,0005) CS [ISO_IR 100]                             #  10, 1 SpecificCharacterSet
    (0008,0060) CS [XA]                                     #   2, 1 Modality
    (0008,0080) LO [DUMMY HOSPITAL1]                        #  16, 1 InstitutionName
    (0008,0081) ST [Philips-Alpha Campus, Panvel, Maharashtra] #  42, 1 InstitutionAddress
    (0020,000e) UI [1.2.756.777.20100805.20101221123749.88] #  38, 1 SeriesInstanceUID
    (0020,0011) IS [21121237]                               #   8, 1 SeriesNumber
  (fffe,e00d) na "ItemDelimitationItem for re-encoding"   #   0, 0 ItemDelimitationItem
  (fffe,e000) na "Directory Record" IMAGE #=15            # 16748, 1 Item
  #  offset=$942  refFileID="PAT_1\IMG_1"
    (0004,1400) up 17698                                    #   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 [PAT_1\IMG_1]                            #  12, 2 ReferencedFileID
    (0004,1510) UI =XRayAngiographicImageStorage            #  28, 1 ReferencedSOPClassUIDInFile
    (0004,1511) UI [1.2.756.777.20100805.20101221123828]    #  36, 1 ReferencedSOPInstanceUIDInFile
    (0004,1512) UI =JPEGLossless:Non-hierarchical-1stOrderPrediction #  22, 1 ReferencedTransferSyntaxUIDInFile
    (0008,0008) CS [NORMAL]                                 #   6, 1 ImageType
    (0020,0013) IS [1]                                      #   2, 1 InstanceNumber
    (0028,0008) IS [5]                                      #   2, 1 NumberOfFrames
    (0028,0010) US 1000                                     #   2, 1 Rows
    (0028,0011) US 1000                                     #   2, 1 Columns
    (0028,0030) DS [1]                                      #   2, 1 PixelSpacing
    (0088,0200) SQ (Sequence with explicit length #=1)      # 16494, 1 IconImageSequence
      (fffe,e000) na (Item with explicit length #=9)          # 16486, 1 Item
        (0028,0002) US 1                                        #   2, 1 SamplesPerPixel
        (0028,0004) CS [MONOCHROME2]                            #  12, 1 PhotometricInterpretation
        (0028,0010) US 128                                      #   2, 1 Rows
        (0028,0011) US 128                                      #   2, 1 Columns
        (0028,0100) US 8                                        #   2, 1 BitsAllocated
        (0028,0101) US 8                                        #   2, 1 BitsStored
        (0028,0102) US 7                                        #   2, 1 HighBit
        (0028,0103) US 0                                        #   2, 1 PixelRepresentation
        (7fe0,0010) OB 00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00... # 16384, 1 PixelData
      (fffe,e00d) na (ItemDelimitationItem for re-encoding)   #   0, 0 ItemDelimitationItem
    (fffe,e0dd) na (SequenceDelimitationItem for re-encod.) #   0, 0 SequenceDelimitationItem
  (fffe,e00d) na "ItemDelimitationItem for re-encoding"   #   0, 0 ItemDelimitationItem
  (fffe,e000) na "Directory Record" IMAGE #=15            # 16750, 1 Item
  #  offset=$17698  refFileID="PAT_1\IMG_002"
    (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 [PAT_1\IMG_002]                          #  14, 2 ReferencedFileID
    (0004,1510) UI =XRayAngiographicImageStorage            #  28, 1 ReferencedSOPClassUIDInFile
    (0004,1511) UI [1.2.756.777.20100805.20110106192749]    #  36, 1 ReferencedSOPInstanceUIDInFile
    (0004,1512) UI =JPEGLossless:Non-hierarchical-1stOrderPrediction #  22, 1 ReferencedTransferSyntaxUIDInFile
    (0008,0008) CS [NORMAL]                                 #   6, 1 ImageType
    (0020,0013) IS [1]                                      #   2, 1 InstanceNumber
    (0028,0008) IS [1]                                      #   2, 1 NumberOfFrames
    (0028,0010) US 1000                                     #   2, 1 Rows
    (0028,0011) US 1000                                     #   2, 1 Columns
    (0028,0030) DS [1]                                      #   2, 1 PixelSpacing
    (0088,0200) SQ (Sequence with explicit length #=1)      # 16494, 1 IconImageSequence
      (fffe,e000) na (Item with explicit length #=9)          # 16486, 1 Item
        (0028,0002) US 1                                        #   2, 1 SamplesPerPixel
        (0028,0004) CS [MONOCHROME2]                            #  12, 1 PhotometricInterpretation
        (0028,0010) US 128                                      #   2, 1 Rows
        (0028,0011) US 128                                      #   2, 1 Columns
        (0028,0100) US 8                                        #   2, 1 BitsAllocated
        (0028,0101) US 8                                        #   2, 1 BitsStored
        (0028,0102) US 7                                        #   2, 1 HighBit
        (0028,0103) US 0                                        #   2, 1 PixelRepresentation
        (7fe0,0010) OB 00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00... # 16384, 1 PixelData
      (fffe,e00d) na (ItemDelimitationItem for re-encoding)   #   0, 0 ItemDelimitationItem
    (fffe,e0dd) na (SequenceDelimitationItem for re-encod.) #   0, 0 SequenceDelimitationItem
  (fffe,e00d) na "ItemDelimitationItem for re-encoding"   #   0, 0 ItemDelimitationItem
(fffe,e0dd) na (SequenceDelimitationItem for re-encod.) #   0, 0 SequenceDelimitationItem
... which looks ok to me.

prakash
Posts: 50
Joined: Mon, 2008-05-19, 10:34
Contact:

#13 Post by prakash »

Hi Jorg,

I want
# Dicom-Meta-Information-Header
# Used TransferSyntax: Little Endian Explicit
(0002,0010) UI =LittleEndianExplicit # 20, 1 TransferSyntaxUID

and
(0004,1512) UI =JPEGLossless:Non-hierarchical-1stOrderPrediction # 22, 1 ReferencedTransferSyntaxUIDInFile

this to be same, how can i do this.

Help me

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

#14 Post by Jörg Riesmeier »

It seems that you haven't understood my previous posting: The DICOMDIR file always has to be written with "Little Endian Explicit" transfer syntax. This is a requirement by the DICOM standard.

Post Reply

Who is online

Users browsing this forum: Baidu [Spider] and 1 guest