Skip to content

Commit 2fbfa6a

Browse files
GDCM Upstreamblowekamp
authored andcommitted
GDCM 2026-02-24 (bdbaa7db)
Code extracted from: https://github.com/malaterre/GDCM.git at commit bdbaa7dbe0e4b5d25961ce027488d26c58c5c08f (bdbaa7dbe0e4b5d25961ce027488d26c58c5c08f).
1 parent 176b72c commit 2fbfa6a

18 files changed

+274
-127
lines changed

CMakeLists.txt

Lines changed: 30 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -118,20 +118,39 @@ if(BUILD_SHARED_LIBS)
118118
endif()
119119

120120
#-----------------------------------------------------------------------------
121-
if(NOT EXECUTABLE_OUTPUT_PATH)
122-
set(EXECUTABLE_OUTPUT_PATH ${GDCM_BINARY_DIR}/bin CACHE PATH "Single output directory for building all executables.")
123-
mark_as_advanced(EXECUTABLE_OUTPUT_PATH)
121+
# Compatibility with older usage of EXECUTABLE_OUTPUT_PATH and LIBRARY_OUTPUT_PATH.
122+
# This should be removed in the future.
123+
if(EXECUTABLE_OUTPUT_PATH)
124+
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${EXECUTABLE_OUTPUT_PATH})
125+
message(WARNING "EXECUTABLE_OUTPUT_PATH is deprecated. Use CMAKE_RUNTIME_OUTPUT_DIRECTORY instead.")
124126
endif()
125-
if(NOT LIBRARY_OUTPUT_PATH)
126-
set(LIBRARY_OUTPUT_PATH ${GDCM_BINARY_DIR}/bin CACHE PATH "Single output directory for building all libraries.")
127-
mark_as_advanced(LIBRARY_OUTPUT_PATH)
127+
if(LIBRARY_OUTPUT_PATH)
128+
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${LIBRARY_OUTPUT_PATH})
129+
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${LIBRARY_OUTPUT_PATH})
130+
message(WARNING "LIBRARY_OUTPUT_PATH is deprecated. Use CMAKE_LIBRARY_OUTPUT_DIRECTORY and CMAKE_ARCHIVE_OUTPUT_DIRECTORY instead.")
128131
endif()
129132

130-
# TODO: The following should be used for CMake 3 and beyond,
131-
# EXECUTABLE_OUTPUT_PATH and LIBRARY_OUTPUT_PATH are deprecated
132-
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${EXECUTABLE_OUTPUT_PATH})
133-
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${LIBRARY_OUTPUT_PATH})
134-
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${LIBRARY_OUTPUT_PATH})
133+
if(NOT CMAKE_RUNTIME_OUTPUT_DIRECTORY)
134+
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/bin)
135+
endif()
136+
if(NOT CMAKE_LIBRARY_OUTPUT_DIRECTORY)
137+
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/bin)
138+
endif()
139+
if(NOT CMAKE_ARCHIVE_OUTPUT_DIRECTORY)
140+
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/bin)
141+
endif()
142+
143+
# Set for legacy internal usage of EXECUTABLE_OUTPUT_PATH and LIBRARY_OUTPUT_PATH
144+
if (NOT EXECUTABLE_OUTPUT_PATH)
145+
set(EXECUTABLE_OUTPUT_PATH ${CMAKE_RUNTIME_OUTPUT_DIRECTORY})
146+
endif()
147+
if (NOT LIBRARY_OUTPUT_PATH)
148+
if (BUILD_SHARED_LIBS)
149+
set(LIBRARY_OUTPUT_PATH ${CMAKE_LIBRARY_OUTPUT_DIRECTORY})
150+
else()
151+
set(LIBRARY_OUTPUT_PATH ${CMAKE_ARCHIVE_OUTPUT_DIRECTORY})
152+
endif()
153+
endif()
135154

136155
#-----------------------------------------------------------------------------
137156
# Adding GDCM_DATA_ROOT

Source/DataDictionary/gdcmPrivateDefaultDicts.cxx

Lines changed: 25 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1159,9 +1159,12 @@ static const DICT_ENTRY DICOMV3DataDict [] = {
11591159
{0x2013,0x0007,"BioClinicaImagingSegmentGroup",VR::OB,VM::VM1,"Custom Storage Segment Blob #7",false},
11601160
{0x2013,0x0008,"BioClinicaImagingSegmentGroup",VR::OB,VM::VM1,"Custom Storage Segment Blob #8",false},
11611161
{0x2013,0x0009,"BioClinicaImagingSegmentGroup",VR::OB,VM::VM1,"Custom Storage Segment Blob #9",false},
1162-
{0x7fe1,0x0001,"Bioclinica",VR::UT,VM::VM1,"??",false},
1163-
{0x7fe1,0x0002,"Bioclinica",VR::LO,VM::VM1,"??",false},
1164-
{0x7fe1,0x0003,"Bioclinica",VR::LO,VM::VM1,"??",false},
1162+
{0x2213,0x0001,"Clario",VR::UT,VM::VM1,"AES tag",false},
1163+
{0x2213,0x0002,"Clario",VR::LO,VM::VM1,"PX version",false},
1164+
{0x2213,0x0003,"Clario",VR::LO,VM::VM1,"Mask Name",false},
1165+
{0x7fe1,0x0001,"Bioclinica",VR::UT,VM::VM1,"AES tag",false},
1166+
{0x7fe1,0x0002,"Bioclinica",VR::LO,VM::VM1,"PX version",false},
1167+
{0x7fe1,0x0003,"Bioclinica",VR::LO,VM::VM1,"Mask Name",false},
11651168
{0x5533,0x0033,"Visus Change",VR::SQ,VM::VM1,"Visus Data Save Sequence",false},
11661169
{0x5533,0x0035,"Visus Change",VR::DA,VM::VM1,"Visus Data Save Date",false},
11671170
{0x5533,0x0037,"Visus Change",VR::LO,VM::VM1,"Visus Data Save Originator",false},
@@ -5876,25 +5879,25 @@ static const DICT_ENTRY DICOMV3DataDict [] = {
58765879
{0x0033,0x0008,"MITRA OBJECT ATTRIBUTES 1.0",VR::LO,VM::VM1,"?",false },
58775880
{0x0033,0x000a,"MITRA OBJECT ATTRIBUTES 1.0",VR::LO,VM::VM1,"?",false },
58785881
// {0x0029,0x0000,"MITRA OBJECT DOCUMENT 1.0",VR::OB,VM::VM1,"?",false },
5879-
{0x0033,0x0002,"MITRA OBJECT UTF8 ATTRIBUTES 1.0",VR::PN,VM::VM1,"Patient's Name",false },
5880-
{0x0033,0x0004,"MITRA OBJECT UTF8 ATTRIBUTES 1.0",VR::CS,VM::VM1,"Study Description",false },
5881-
{0x0033,0x0006,"MITRA OBJECT UTF8 ATTRIBUTES 1.0",VR::PN,VM::VM1,"Referring Physician's Name",false },
5882-
{0x0033,0x0008,"MITRA OBJECT UTF8 ATTRIBUTES 1.0",VR::PN,VM::VM1,"Requesting Physician's Name",false },
5883-
{0x0033,0x000a,"MITRA OBJECT UTF8 ATTRIBUTES 1.0",VR::PN,VM::VM1,"Performing Physician's Name",false },
5884-
{0x0033,0x000c,"MITRA OBJECT UTF8 ATTRIBUTES 1.0",VR::LO,VM::VM1,"Reason for Study",false },
5885-
{0x0033,0x000e,"MITRA OBJECT UTF8 ATTRIBUTES 1.0",VR::LT,VM::VM1,"Study Comments",false },
5886-
{0x0033,0x0013,"MITRA OBJECT UTF8 ATTRIBUTES 1.0",VR::PN,VM::VM1,"Patient's Name Single Byte",false },
5887-
{0x0033,0x0014,"MITRA OBJECT UTF8 ATTRIBUTES 1.0",VR::PN,VM::VM1,"Patient's Name Ideographic",false },
5888-
{0x0033,0x0015,"MITRA OBJECT UTF8 ATTRIBUTES 1.0",VR::PN,VM::VM1,"Patient's Name Phonetic",false },
5889-
{0x0033,0x0016,"MITRA OBJECT UTF8 ATTRIBUTES 1.0",VR::PN,VM::VM1,"Referring Physician's Name Single Byte",false },
5890-
{0x0033,0x0017,"MITRA OBJECT UTF8 ATTRIBUTES 1.0",VR::PN,VM::VM1,"Referring Physician's Name Ideographic",false },
5891-
{0x0033,0x0018,"MITRA OBJECT UTF8 ATTRIBUTES 1.0",VR::PN,VM::VM1,"Referring Physician's Name Phonetic",false },
5892-
{0x0033,0x0019,"MITRA OBJECT UTF8 ATTRIBUTES 1.0",VR::PN,VM::VM1,"Requesting Physician's Name Single Byte",false },
5893-
{0x0033,0x001a,"MITRA OBJECT UTF8 ATTRIBUTES 1.0",VR::PN,VM::VM1,"Requesting Physician's Name Ideographic",false },
5894-
{0x0033,0x001b,"MITRA OBJECT UTF8 ATTRIBUTES 1.0",VR::PN,VM::VM1,"Requesting Physician's Name Phonetic",false },
5895-
{0x0033,0x001c,"MITRA OBJECT UTF8 ATTRIBUTES 1.0",VR::PN,VM::VM1,"Performing Physician's Name Single Byte",false },
5896-
{0x0033,0x001d,"MITRA OBJECT UTF8 ATTRIBUTES 1.0",VR::PN,VM::VM1,"Performing Physician's Name Ideographic",false },
5897-
{0x0033,0x001e,"MITRA OBJECT UTF8 ATTRIBUTES 1.0",VR::PN,VM::VM1,"Performing Physician's Name Phonetic",false },
5882+
{0x0033,0x0002,"MITRA OBJECT UTF8 ATTRIBUTES 1.0",VR::UN,VM::VM1,"Patient's Name",false },
5883+
{0x0033,0x0004,"MITRA OBJECT UTF8 ATTRIBUTES 1.0",VR::UN,VM::VM1,"Study Description",false },
5884+
{0x0033,0x0006,"MITRA OBJECT UTF8 ATTRIBUTES 1.0",VR::UN,VM::VM1,"Referring Physician's Name",false },
5885+
{0x0033,0x0008,"MITRA OBJECT UTF8 ATTRIBUTES 1.0",VR::UN,VM::VM1,"Requesting Physician's Name",false },
5886+
{0x0033,0x000a,"MITRA OBJECT UTF8 ATTRIBUTES 1.0",VR::UN,VM::VM1,"Performing Physician's Name",false },
5887+
{0x0033,0x000c,"MITRA OBJECT UTF8 ATTRIBUTES 1.0",VR::UN,VM::VM1,"Reason for Study",false },
5888+
{0x0033,0x000e,"MITRA OBJECT UTF8 ATTRIBUTES 1.0",VR::UN,VM::VM1,"Study Comments",false },
5889+
{0x0033,0x0013,"MITRA OBJECT UTF8 ATTRIBUTES 1.0",VR::UN,VM::VM1,"Patient's Name Single Byte",false },
5890+
{0x0033,0x0014,"MITRA OBJECT UTF8 ATTRIBUTES 1.0",VR::UN,VM::VM1,"Patient's Name Ideographic",false },
5891+
{0x0033,0x0015,"MITRA OBJECT UTF8 ATTRIBUTES 1.0",VR::UN,VM::VM1,"Patient's Name Phonetic",false },
5892+
{0x0033,0x0016,"MITRA OBJECT UTF8 ATTRIBUTES 1.0",VR::UN,VM::VM1,"Referring Physician's Name Single Byte",false },
5893+
{0x0033,0x0017,"MITRA OBJECT UTF8 ATTRIBUTES 1.0",VR::UN,VM::VM1,"Referring Physician's Name Ideographic",false },
5894+
{0x0033,0x0018,"MITRA OBJECT UTF8 ATTRIBUTES 1.0",VR::UN,VM::VM1,"Referring Physician's Name Phonetic",false },
5895+
{0x0033,0x0019,"MITRA OBJECT UTF8 ATTRIBUTES 1.0",VR::UN,VM::VM1,"Requesting Physician's Name Single Byte",false },
5896+
{0x0033,0x001a,"MITRA OBJECT UTF8 ATTRIBUTES 1.0",VR::UN,VM::VM1,"Requesting Physician's Name Ideographic",false },
5897+
{0x0033,0x001b,"MITRA OBJECT UTF8 ATTRIBUTES 1.0",VR::UN,VM::VM1,"Requesting Physician's Name Phonetic",false },
5898+
{0x0033,0x001c,"MITRA OBJECT UTF8 ATTRIBUTES 1.0",VR::UN,VM::VM1,"Performing Physician's Name Single Byte",false },
5899+
{0x0033,0x001d,"MITRA OBJECT UTF8 ATTRIBUTES 1.0",VR::UN,VM::VM1,"Performing Physician's Name Ideographic",false },
5900+
{0x0033,0x001e,"MITRA OBJECT UTF8 ATTRIBUTES 1.0",VR::UN,VM::VM1,"Performing Physician's Name Phonetic",false },
58985901
{0x0029,0x0000,"MITRA PRESENTATION 1.0",VR::CS,VM::VM1,"Mitra Rotation",false },
58995902
{0x0029,0x0001,"MITRA PRESENTATION 1.0",VR::LO,VM::VM1,"Mitra Window Width",false },
59005903
{0x0029,0x0002,"MITRA PRESENTATION 1.0",VR::LO,VM::VM1,"Mitra Window Centre",false },

Source/DataDictionary/privatedicts.xml

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -5140,25 +5140,25 @@
51405140
<entry owner="MITRA OBJECT ATTRIBUTES 1.0" group="0033" element="xx08" vr="LO" vm="1" name="?"/>
51415141
<entry owner="MITRA OBJECT ATTRIBUTES 1.0" group="0033" element="xx0a" vr="LO" vm="1" name="?"/>
51425142
<entry owner="MITRA OBJECT DOCUMENT 1.0" group="0029" element="xx00" vr="OB" vm="1" name="?"/>
5143-
<entry owner="MITRA OBJECT UTF8 ATTRIBUTES 1.0" group="0033" element="xx02" vr="PN" vm="1" name="Patient's Name"/>
5144-
<entry owner="MITRA OBJECT UTF8 ATTRIBUTES 1.0" group="0033" element="xx04" vr="CS" vm="1" name="Study Description"/>
5145-
<entry owner="MITRA OBJECT UTF8 ATTRIBUTES 1.0" group="0033" element="xx06" vr="PN" vm="1" name="Referring Physician's Name"/>
5146-
<entry owner="MITRA OBJECT UTF8 ATTRIBUTES 1.0" group="0033" element="xx08" vr="PN" vm="1" name="Requesting Physician's Name"/>
5147-
<entry owner="MITRA OBJECT UTF8 ATTRIBUTES 1.0" group="0033" element="xx0a" vr="PN" vm="1" name="Performing Physician's Name"/>
5148-
<entry owner="MITRA OBJECT UTF8 ATTRIBUTES 1.0" group="0033" element="xx0c" vr="LO" vm="1" name="Reason for Study"/>
5149-
<entry owner="MITRA OBJECT UTF8 ATTRIBUTES 1.0" group="0033" element="xx0e" vr="LT" vm="1" name="Study Comments"/>
5150-
<entry owner="MITRA OBJECT UTF8 ATTRIBUTES 1.0" group="0033" element="xx13" vr="PN" vm="1" name="Patient's Name Single Byte"/>
5151-
<entry owner="MITRA OBJECT UTF8 ATTRIBUTES 1.0" group="0033" element="xx14" vr="PN" vm="1" name="Patient's Name Ideographic"/>
5152-
<entry owner="MITRA OBJECT UTF8 ATTRIBUTES 1.0" group="0033" element="xx15" vr="PN" vm="1" name="Patient's Name Phonetic"/>
5153-
<entry owner="MITRA OBJECT UTF8 ATTRIBUTES 1.0" group="0033" element="xx16" vr="PN" vm="1" name="Referring Physician's Name Single Byte"/>
5154-
<entry owner="MITRA OBJECT UTF8 ATTRIBUTES 1.0" group="0033" element="xx17" vr="PN" vm="1" name="Referring Physician's Name Ideographic"/>
5155-
<entry owner="MITRA OBJECT UTF8 ATTRIBUTES 1.0" group="0033" element="xx18" vr="PN" vm="1" name="Referring Physician's Name Phonetic"/>
5156-
<entry owner="MITRA OBJECT UTF8 ATTRIBUTES 1.0" group="0033" element="xx19" vr="PN" vm="1" name="Requesting Physician's Name Single Byte"/>
5157-
<entry owner="MITRA OBJECT UTF8 ATTRIBUTES 1.0" group="0033" element="xx1a" vr="PN" vm="1" name="Requesting Physician's Name Ideographic"/>
5158-
<entry owner="MITRA OBJECT UTF8 ATTRIBUTES 1.0" group="0033" element="xx1b" vr="PN" vm="1" name="Requesting Physician's Name Phonetic"/>
5159-
<entry owner="MITRA OBJECT UTF8 ATTRIBUTES 1.0" group="0033" element="xx1c" vr="PN" vm="1" name="Performing Physician's Name Single Byte"/>
5160-
<entry owner="MITRA OBJECT UTF8 ATTRIBUTES 1.0" group="0033" element="xx1d" vr="PN" vm="1" name="Performing Physician's Name Ideographic"/>
5161-
<entry owner="MITRA OBJECT UTF8 ATTRIBUTES 1.0" group="0033" element="xx1e" vr="PN" vm="1" name="Performing Physician's Name Phonetic"/>
5143+
<entry owner="MITRA OBJECT UTF8 ATTRIBUTES 1.0" group="0033" element="xx02" vr="UN" vm="1" name="Patient's Name"/>
5144+
<entry owner="MITRA OBJECT UTF8 ATTRIBUTES 1.0" group="0033" element="xx04" vr="UN" vm="1" name="Study Description"/>
5145+
<entry owner="MITRA OBJECT UTF8 ATTRIBUTES 1.0" group="0033" element="xx06" vr="UN" vm="1" name="Referring Physician's Name"/>
5146+
<entry owner="MITRA OBJECT UTF8 ATTRIBUTES 1.0" group="0033" element="xx08" vr="UN" vm="1" name="Requesting Physician's Name"/>
5147+
<entry owner="MITRA OBJECT UTF8 ATTRIBUTES 1.0" group="0033" element="xx0a" vr="UN" vm="1" name="Performing Physician's Name"/>
5148+
<entry owner="MITRA OBJECT UTF8 ATTRIBUTES 1.0" group="0033" element="xx0c" vr="UN" vm="1" name="Reason for Study"/>
5149+
<entry owner="MITRA OBJECT UTF8 ATTRIBUTES 1.0" group="0033" element="xx0e" vr="UN" vm="1" name="Study Comments"/>
5150+
<entry owner="MITRA OBJECT UTF8 ATTRIBUTES 1.0" group="0033" element="xx13" vr="UN" vm="1" name="Patient's Name Single Byte"/>
5151+
<entry owner="MITRA OBJECT UTF8 ATTRIBUTES 1.0" group="0033" element="xx14" vr="UN" vm="1" name="Patient's Name Ideographic"/>
5152+
<entry owner="MITRA OBJECT UTF8 ATTRIBUTES 1.0" group="0033" element="xx15" vr="UN" vm="1" name="Patient's Name Phonetic"/>
5153+
<entry owner="MITRA OBJECT UTF8 ATTRIBUTES 1.0" group="0033" element="xx16" vr="UN" vm="1" name="Referring Physician's Name Single Byte"/>
5154+
<entry owner="MITRA OBJECT UTF8 ATTRIBUTES 1.0" group="0033" element="xx17" vr="UN" vm="1" name="Referring Physician's Name Ideographic"/>
5155+
<entry owner="MITRA OBJECT UTF8 ATTRIBUTES 1.0" group="0033" element="xx18" vr="UN" vm="1" name="Referring Physician's Name Phonetic"/>
5156+
<entry owner="MITRA OBJECT UTF8 ATTRIBUTES 1.0" group="0033" element="xx19" vr="UN" vm="1" name="Requesting Physician's Name Single Byte"/>
5157+
<entry owner="MITRA OBJECT UTF8 ATTRIBUTES 1.0" group="0033" element="xx1a" vr="UN" vm="1" name="Requesting Physician's Name Ideographic"/>
5158+
<entry owner="MITRA OBJECT UTF8 ATTRIBUTES 1.0" group="0033" element="xx1b" vr="UN" vm="1" name="Requesting Physician's Name Phonetic"/>
5159+
<entry owner="MITRA OBJECT UTF8 ATTRIBUTES 1.0" group="0033" element="xx1c" vr="UN" vm="1" name="Performing Physician's Name Single Byte"/>
5160+
<entry owner="MITRA OBJECT UTF8 ATTRIBUTES 1.0" group="0033" element="xx1d" vr="UN" vm="1" name="Performing Physician's Name Ideographic"/>
5161+
<entry owner="MITRA OBJECT UTF8 ATTRIBUTES 1.0" group="0033" element="xx1e" vr="UN" vm="1" name="Performing Physician's Name Phonetic"/>
51625162
<entry owner="MITRA PRESENTATION 1.0" group="0029" element="xx00" vr="CS" vm="1" name="Mitra Rotation"/>
51635163
<entry owner="MITRA PRESENTATION 1.0" group="0029" element="xx01" vr="LO" vm="1" name="Mitra Window Width"/>
51645164
<entry owner="MITRA PRESENTATION 1.0" group="0029" element="xx02" vr="LO" vm="1" name="Mitra Window Centre"/>

Source/DataStructureAndEncodingDefinition/gdcmDataElement.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ class GDCM_EXPORT DataElement
108108
/// Make Data Element empty (no Value)
109109
void Empty() { ValueField = nullptr; ValueLengthField = 0; }
110110

111-
/// Clear Data Element (make Value empty and invalidate Tag & VR)
111+
/// Clear Data Element (make Value empty and invalidate Tag + VR)
112112
void Clear()
113113
{
114114
TagField = 0;

Source/DataStructureAndEncodingDefinition/gdcmExplicitDataElement.txx

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -203,6 +203,11 @@ std::istream &ExplicitDataElement::ReadValue(std::istream &is, bool readvalues)
203203
gdcm_assert( VRField & VR::OB_OW || VRField == VR::UN );
204204
ValueField = new SequenceOfFragments;
205205
}
206+
else if( TagField == Tag(0x7fe1,0x1060) && VRField == VR::OB )
207+
{
208+
gdcmWarningMacro( "IllegalPrivatePixelSequence (7fe1,1060)" );
209+
ValueField = new SequenceOfFragments;
210+
}
206211
else
207212
{
208213
// Support cp246 conforming file:

Source/DataStructureAndEncodingDefinition/gdcmFileMetaInformation.cxx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -835,7 +835,7 @@ void FileMetaInformation::ComputeDataSetTransferSyntax()
835835
const ByteValue *bv = de.GetByteValue();
836836
if( !bv )
837837
{
838-
throw Exception( "Unknown Transfer syntax" );
838+
throw Exception( "NULL Transfer syntax" );
839839
}
840840
// Pad string with a \0
841841
ts = std::string(bv->GetPointer(), bv->GetLength());

Source/DataStructureAndEncodingDefinition/gdcmTransferSyntax.cxx

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,8 @@ static const char *TSStrings[] = {
8787
"1.2.840.10008.1.2.4.202",
8888
// High-Throughput JPEG 2000 Image Compression
8989
"1.2.840.10008.1.2.4.203",
90+
// Deflated Image Frame Compression
91+
"1.2.840.10008.1.2.8.1",
9092
// Unknown
9193
"Unknown Transfer Syntax", // Pretty sure we never use this case... until a new transfer syntax is added
9294
nullptr // Compilers have no obligation to finish by NULL, do it ourselves
@@ -195,6 +197,7 @@ bool TransferSyntax::CanStoreLossy() const
195197
TSField == JPEGLSLossless ||
196198
TSField == JPEG2000Lossless ||
197199
TSField == JPEG2000Part2Lossless ||
200+
TSField == DeflatedImageFrameCompression ||
198201
TSField == RLELossless
199202
)
200203
{
@@ -311,6 +314,7 @@ bool TransferSyntax::IsEncapsulated() const
311314
case HTJ2KLossless:
312315
case HTJ2KRPCLLossless:
313316
case HTJ2K:
317+
case DeflatedImageFrameCompression:
314318

315319
ret = true;
316320
break;

Source/DataStructureAndEncodingDefinition/gdcmTransferSyntax.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,7 @@ class GDCM_EXPORT TransferSyntax
8989
HTJ2KLossless,
9090
HTJ2KRPCLLossless,
9191
HTJ2K,
92+
DeflatedImageFrameCompression,
9293
TS_END
9394
} TSType;
9495

Source/MediaStorageAndFileFormat/gdcmBitmap.cxx

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -375,6 +375,17 @@ bool Bitmap::TryRAWCodec(char *buffer, bool &lossyflag) const
375375
Bitmap *i = (Bitmap*)this;
376376
i->SetPixelFormat( codec.GetPixelFormat() );
377377
}
378+
#else
379+
const PixelFormat pf = GetPixelFormat(); // PixelFormat::UINT8;
380+
const PixelFormat & cpf = codec.GetPixelFormat();
381+
if( cpf.GetBitsAllocated() == 16 && pf.GetBitsAllocated() == 12 )
382+
{
383+
Bitmap *i = const_cast<Bitmap*>(this);
384+
gdcmWarningMacro( "Mismatch Bits Allocated. correcting." );
385+
i->GetPixelFormat().SetBitsAllocated( cpf.GetBitsAllocated() );
386+
i->GetPixelFormat().SetBitsStored( pf.GetBitsStored() );
387+
i->GetPixelFormat().SetHighBit( pf.GetHighBit() );
388+
}
378389
#endif
379390

380391
unsigned long check; // = outbv->GetLength(); // FIXME

Source/MediaStorageAndFileFormat/gdcmJPEG2000Codec.cxx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1423,6 +1423,8 @@ bool JPEG2000Codec::GetHeaderInfo(const char * dummy_buffer, size_t buf_size, Tr
14231423
opj_stream_t *cio = nullptr;
14241424
opj_image_t *image = nullptr;
14251425
const unsigned char *src = (const unsigned char*)dummy_buffer;
1426+
if(!src)
1427+
return false ;
14261428
size_t file_length = buf_size;
14271429

14281430
/* set decoding parameters to default values */

0 commit comments

Comments
 (0)