Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 2 additions & 13 deletions Modules/ThirdParty/GDCM/src/gdcm/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ endif()
#----------------------------------------------------------------------------

project(GDCM
VERSION 3.0.9
VERSION 3.0.10
LANGUAGES CXX C
)
## NOTE: the "DESCRIPTION" feature of project() was introduced in cmake 3.10.0
Expand Down Expand Up @@ -180,23 +180,12 @@ macro(CHECK_INCLUDE_FILE_CONCAT FILE VARIABLE)
endif()
endmacro()

CHECK_INCLUDE_FILE("stdint.h" GDCM_HAVE_STDINT_H)
if(UNIX) #Avoid polluting Win32 cmakecache
CHECK_INCLUDE_FILE("inttypes.h" GDCM_HAVE_INTTYPES_H)
endif()

#include(${GDCM_SOURCE_DIR}/CMake/gdcmPlatformCxxTests.cmake)
#
#GDCM_PLATFORM_CXX_TEST(GDCM_CXX_HAS_FUNCTION
# "Checking whether compiler has __FUNCTION__" DIRECT)


#-----------------------------------------------------------------------------
# Build the main lib...
if(NOT GDCM_HAVE_STDINT_H)
message(FATAL_ERROR "You system does not have stdint.h")
endif()

# --------------------------------------------------------------------------
# Configure the export configuration

Expand Down Expand Up @@ -800,7 +789,7 @@ if(GDCM_STANDALONE) # disabled for ITK distribution of gdcm
set(CPACK_NUGET_PACKAGE_DESCRIPTION "Grassroots DiCoM is a C++ library for DICOM medical files. It is accessible from Python, C#, Java and PHP. It supports RAW, JPEG, JPEG 2000, JPEG-LS, RLE and deflated transfer syntax.
It comes with a super fast scanner implementation to quickly scan hundreds of DICOM files.
It supports SCU network operations (C-ECHO, C-FIND, C-STORE, C-MOVE). PS 3.3 & 3.6 are distributed as XML files.
It also provides PS 3.15 certificates and password based mecanism to anonymize and de-identify DICOM datasets.")
It also provides PS 3.15 certificates and password based mechanism to anonymize and de-identify DICOM datasets.")
set(CPACK_NUGET_PACKAGE_LICENSEURL "http://gdcm.sourceforge.net/Copyright.html")
set(CPACK_NUGET_PACKAGE_HOMEPAGE_URL "http://gdcm.sourceforge.net")
set(CPACK_NUGET_PACKAGE_TAGS "dicom" "medical")
Expand Down
13 changes: 6 additions & 7 deletions Modules/ThirdParty/GDCM/src/gdcm/Source/Common/gdcmBase64.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,6 @@ static std::string base64_encode(unsigned char const* bytes_to_encode, size_t in
{
std::string ret;
size_t i = 0;
size_t j = 0;
unsigned char char_array_3[3];
unsigned char char_array_4[4];

Expand All @@ -79,15 +78,15 @@ static std::string base64_encode(unsigned char const* bytes_to_encode, size_t in

if (i)
{
for(j = i; j < 3; j++)
for(size_t j = i; j < 3; j++)
char_array_3[j] = '\0';

char_array_4[0] = (unsigned char)((char_array_3[0] & 0xfc) >> 2);
char_array_4[1] = (unsigned char)(((char_array_3[0] & 0x03) << 4) + ((char_array_3[1] & 0xf0) >> 4));
char_array_4[2] = (unsigned char)(((char_array_3[1] & 0x0f) << 2) + ((char_array_3[2] & 0xc0) >> 6));
char_array_4[3] = (unsigned char)(char_array_3[2] & 0x3f);

for (j = 0; j < i + 1; j++)
for (size_t j = 0; j < i + 1; j++)
ret += base64_chars[char_array_4[j]];

while((i++ < 3))
Expand All @@ -102,7 +101,6 @@ static std::string base64_decode(std::string const& encoded_string)
{
size_t in_len = encoded_string.size();
size_t i = 0;
size_t j = 0;
size_t in_ = 0;
unsigned char char_array_4[4], char_array_3[3];
std::string ret;
Expand All @@ -124,17 +122,18 @@ static std::string base64_decode(std::string const& encoded_string)
}

if (i) {
for (j = i; j <4; j++)
for (size_t j = i; j <4; j++)
char_array_4[j] = 0;

for (j = 0; j <4; j++)
for (size_t j = 0; j <4; j++)
char_array_4[j] = (unsigned char)base64_chars.find(char_array_4[j]);

char_array_3[0] = (unsigned char)((char_array_4[0] << 2) + ((char_array_4[1] & 0x30) >> 4));
char_array_3[1] = (unsigned char)(((char_array_4[1] & 0xf) << 4) + ((char_array_4[2] & 0x3c) >> 2));
char_array_3[2] = (unsigned char)(((char_array_4[2] & 0x3) << 6) + char_array_4[3]);

for (j = 0; (j < i - 1); j++) ret += char_array_3[j];
for (size_t j = 0; (j < i - 1); j++)
ret += char_array_3[j];
}

return ret;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ namespace gdcm

/**
* \brief ByteSwap
* \details Perform machine dependent byte swaping (Little Endian,
* \details Perform machine dependent byte swapping (Little Endian,
* Big Endian, Bad Little Endian, Bad Big Endian).
* TODO: bswap_32 / bswap_64 ...
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,13 +32,10 @@
# define GDCM_WORDS_BIGENDIAN
#endif

/* Allow access to UINT32_MAX , cf gdcmCommon.h */
#define __STDC_LIMIT_MACROS

/* Hard code the path to the public dictionary */
#define PUB_DICT_PATH "@GDCM_PUB_DICT_PATH@"

/* Usefull in particular for loadshared where the full path
/* Useful in particular for loadshared where the full path
* to the lib is needed */
#define GDCM_SOURCE_DIR "@GDCM_SOURCE_DIR@"
#define GDCM_EXECUTABLE_OUTPUT_PATH "@EXECUTABLE_OUTPUT_PATH@"
Expand Down Expand Up @@ -78,10 +75,6 @@

#cmakedefine GDCM_AUTOLOAD_GDCMJNI

/* I guess something important */
#cmakedefine GDCM_HAVE_STDINT_H
#cmakedefine GDCM_HAVE_INTTYPES_H

/* This variable allows you to have helpful debug statement */
/* That are in between #ifdef / endif in the gdcm code */
/* That means if GDCM_DEBUG is OFF there shouldn't be any 'cout' at all ! */
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ namespace gdcm

/**
* \brief Class to do handle the crypto factory
* \details GDCM needs to access in a platform independant way
* \details GDCM needs to access in a platform independent way
* the user specified crypto engine. It can be:
* \li CAPI (windows only)
* \li OPENSSL (portable)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ unsigned int Directory::Explore(FilenameType const &name, bool recursive)
}

// According to POSIX, the dirent structure contains a field char d_name[]
// of unspecified size, with at most NAME_MAX characters preceeding the
// of unspecified size, with at most NAME_MAX characters preceding the
// terminating null character. Use of other fields will harm the porta-
// bility of your programs.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ namespace gdcm
* \brief Class for manipulation directories
*
* \note This implementation provide a cross platform implementation
* for manipulating directores: basically traversing directories
* for manipulating directories: basically traversing directories
* and harvesting files
*
* \note
Expand Down
6 changes: 3 additions & 3 deletions Modules/ThirdParty/GDCM/src/gdcm/Source/Common/gdcmFilename.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ namespace gdcm
{
/**
* \brief Class to manipulate file name's
* \note OS independant representation of a filename (to query path, name and extension from a filename)
* \note OS independent representation of a filename (to query path, name and extension from a filename)
*/
class GDCM_EXPORT Filename
{
Expand Down Expand Up @@ -55,9 +55,9 @@ class GDCM_EXPORT Filename
operator const char * () const { return GetFileName(); }

// FIXME: I don't like this function
// It hides the realpath call (maybe usefull)
// It hides the realpath call (maybe useful)
// and it forces file to exist on the disk whereas Filename
// should be independant from file existence.
// should be independent from file existence.
bool IsIdentical(Filename const &fn) const;

/// Does the filename ends with a particular string ?
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ bool FilenameGenerator::Generate()
if ( num_percent != 1 )
{
// Bug: what if someone wants to output file such as %%%02 ... oh well
gdcmDebugMacro( "No more than one % in string formating please" );
gdcmDebugMacro( "No more than one % in string formatting please" );
return false;
}
bool success = true;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ namespace gdcm
{
// Don't ask why, but this is EXTREMELY important on Win32
// Apparently the compiler is doing something special the first time it compiles
// this instanciation unit
// this instantiation unit
// If this fake file is not present I get an unresolved symbol for each function
// of the gdcm::Object class

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ bool OpenSSLCryptographicMessageSyntax::Encrypt(char *output, size_t &outlen, co
cms = CMS_encrypt(recips, in, internalCipherType, flags);
if (!cms)
{
gdcmErrorMacro( "Error at creating the CMS strucutre." );
gdcmErrorMacro( "Error at creating the CMS structure." );
goto err;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ public :
/// compute the area
virtual size_t Area() const = 0;

// implementation detail of heterogenous container in C++
// implementation detail of heterogeneous container in C++
virtual Region *Clone() const = 0;

/// Return the Axis-Aligned minimum bounding box for all regions
Expand Down
4 changes: 2 additions & 2 deletions Modules/ThirdParty/GDCM/src/gdcm/Source/Common/gdcmString.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ namespace gdcm
* \brief String
*
* \note TDelimiter template parameter is used to separate multiple String (VM1 >)
* TMaxLength is only a hint. Noone actually respect the max length
* TMaxLength is only a hint. No one actually respect the max length
* TPadChar is the string padding (0 or space)
*/
template <char TDelimiter = '\\', unsigned int TMaxLength = 64, char TPadChar = ' '>
Expand Down Expand Up @@ -57,7 +57,7 @@ class /*GDCM_EXPORT*/ String : public std::string /* PLEASE do not export me */
}
String(const value_type* s, size_type n): std::string(s, n)
{
// We are being passed a const char* pointer, so s[n] == 0 (garanteed!)
// We are being passed a const char* pointer, so s[n] == 0 (guaranteed!)
if( n % 2 )
{
push_back( TPadChar );
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ class GDCM_EXPORT Subject : public Object
unsigned long AddObserver(const Event & event, Command *) const;

/** Get the command associated with the given tag. NOTE: This returns
* a pointer to a Command, but it is safe to asign this to a
* a pointer to a Command, but it is safe to assign this to a
* Command::Pointer. Since Command inherits from LightObject, at this
* point in the code, only a pointer or a reference to the Command can
* be used. */
Expand Down
16 changes: 12 additions & 4 deletions Modules/ThirdParty/GDCM/src/gdcm/Source/Common/gdcmSwapper.txx
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,9 @@ namespace gdcm
}
template <> inline float SwapperNoOp::Swap<float>(float val)
{
return Swap((uint32_t)val);
uint32_t temp;
memcpy(&temp, &val, sizeof(uint32_t));
return static_cast<float>(Swap(temp));
Comment thread
seanm marked this conversation as resolved.
}
template <> inline uint64_t SwapperNoOp::Swap<uint64_t>(uint64_t val)
{
Expand All @@ -118,7 +120,9 @@ namespace gdcm
}
template <> inline double SwapperNoOp::Swap<double>(double val)
{
return Swap((uint64_t)val);
uint64_t temp;
memcpy(&temp, &val, sizeof(uint64_t));
return static_cast<double>(Swap(temp));
}

template <> inline Tag SwapperNoOp::Swap<Tag>(Tag val)
Expand Down Expand Up @@ -172,7 +176,9 @@ namespace gdcm
}
template <> inline float SwapperDoOp::Swap<float>(float val)
{
return static_cast<float>(Swap((uint32_t)val));
uint32_t temp;
memcpy(&temp, &val, sizeof(uint32_t));
Comment thread
seanm marked this conversation as resolved.
return static_cast<float>(Swap(temp));
}
template <> inline uint64_t SwapperDoOp::Swap<uint64_t>(uint64_t val)
{
Expand All @@ -184,7 +190,9 @@ namespace gdcm
}
template <> inline double SwapperDoOp::Swap<double>(double val)
{
return static_cast<double>(Swap((uint64_t)val));
uint64_t temp;
memcpy(&temp, &val, sizeof(uint64_t));
return static_cast<double>(Swap(temp));
}

template <> inline Tag SwapperDoOp::Swap<Tag>(Tag val)
Expand Down
4 changes: 2 additions & 2 deletions Modules/ThirdParty/GDCM/src/gdcm/Source/Common/gdcmSystem.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ class GDCM_EXPORT System
public:
/// Create a directory name path
static bool MakeDirectory(const char *path);
/// Check whether the specified file exist on the sytem
/// Check whether the specified file exist on the system
static bool FileExists(const char* filename);
/// Check whether the file specified is a directory:
static bool FileIsDirectory(const char* name);
Expand Down Expand Up @@ -73,7 +73,7 @@ class GDCM_EXPORT System
// Chdir
// copy a file

/// Retrieve the hostname, only the first 255 byte are copyied.
/// Retrieve the hostname, only the first 255 byte are copied.
/// This may come handy to specify the Station Name
static bool GetHostName(char hostname[255]);

Expand Down
34 changes: 1 addition & 33 deletions Modules/ThirdParty/GDCM/src/gdcm/Source/Common/gdcmTypes.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,39 +19,7 @@
#include "gdcmLegacyMacro.h"

//-----------------------------------------------------------------------------
#ifdef GDCM_HAVE_STDINT_H
#ifndef __STDC_LIMIT_MACROS
#define __STDC_LIMIT_MACROS
#endif // __STDC_LIMIT_MACROS
#include <stdint.h>
//#undef __STDC_LIMIT_MACROS
#else
#ifdef GDCM_HAVE_INTTYPES_H
// Old system only have this
#include <inttypes.h> // For uint8_t uint16_t and uint32_t
#else
// Broken plateforms do not respect C99 and do not provide those typedef
// Special case for recent Borland compiler, comes with stdint.h
#if defined(__BORLANDC__) && (__BORLANDC__ < 0x0560) || defined(__MINGW32__)
typedef signed char int8_t;
typedef signed short int16_t;
typedef signed int int32_t;
typedef unsigned char uint8_t;
typedef unsigned short uint16_t;
typedef unsigned int uint32_t;
typedef unsigned __int64 uint64_t;
#elif defined(_MSC_VER)
#include "stdint.h"
#else
#error "Sorry, your platform is not supported"
#endif // defined(_MSC_VER) || defined(__BORLANDC__) && (__BORLANDC__ < 0x0560) || defined(__MINGW32__)
#endif // GDCM_HAVE_INTTYPES_H
#endif // GDCM_HAVE_STDINT_H

// Basically for VS6 and bcc 5.5.1:
#ifndef UINT32_MAX
#define UINT32_MAX (4294967295U)
#endif
#include <cstdint>

//-----------------------------------------------------------------------------
#endif //GDCMTYPES_H
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ std::streamsize basic_zip_streambuf<charT, traits>::flush()
{
written_byte_size = static_cast<std::streamsize>(_output_buffer.size()) - _zip_stream.avail_out;
total_written_byte_size += written_byte_size;
// ouput buffer is full, dumping to ostream
// output buffer is full, dumping to ostream
_ostream.write( (const char_type*) &(_output_buffer[0]),
static_cast<std::streamsize>(written_byte_size/sizeof(char_type)*sizeof(char)));

Expand Down Expand Up @@ -263,7 +263,7 @@ bool basic_zip_streambuf<charT, traits>::zip_to_stream(
written_byte_size= static_cast<std::streamsize>(_output_buffer.size()) -
_zip_stream.avail_out;
total_written_byte_size += written_byte_size;
// ouput buffer is full, dumping to ostream
// output buffer is full, dumping to ostream

_ostream.write((const char_type*) &_output_buffer[0],
static_cast<std::streamsize>(written_byte_size / sizeof(char_type)));
Expand Down Expand Up @@ -711,7 +711,7 @@ basic_zip_istream<charT, traits>::is_gzip() const
* This must be called after the reading of compressed data is finished! This
* method compares it to the crc of the uncompressed data.
*
* \return true if crc check is succesful
* \return true if crc check is successful
*/
template <class charT, class traits> inline
bool
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ generating group length for arbitrary even group number seems to get my xsltproc
</xsl:if>
</xsl:for-each>
<xsl:text>
{0,0,VR::INVALID,VM::VM0,0 } // Gard
{0,0,VR::INVALID,VM::VM0,0 } // Guard
};

void CSAHeaderDict::LoadDefault()
Expand Down
Loading