14 #ifndef vtkDICOMUtilities_h
15 #define vtkDICOMUtilities_h
17 #include "vtkObject.h"
18 #include "vtkStdString.h"
19 #include "vtkDICOMModule.h"
20 #include "vtkDICOMConfig.h"
21 #include "vtkDICOMTag.h"
24 #if defined(VTK_ABI_NAMESPACE_BEGIN)
25 VTK_ABI_NAMESPACE_BEGIN
30 #if defined(VTK_ABI_NAMESPACE_BEGIN)
46 void PrintSelf(ostream& os, vtkIndent indent) VTK_DICOM_OVERRIDE;
56 static const char *GetUIDPrefix();
118 static long long GetUTC(
long long *offset);
131 static const char *GetImplementationClassUID();
161 return cp[0] + (cp[1] << 8) + (cp[2] << 16) + (cp[3] << 24); }
169 cp[0] =
static_cast<unsigned char>(i);
170 cp[1] =
static_cast<unsigned char>(i >> 8);
171 cp[2] =
static_cast<unsigned char>(i >> 16);
172 cp[3] =
static_cast<unsigned char>(i >> 24); }
186 const char *pattern,
size_t pl,
const char *val,
size_t vl);
201 static const char *GetUIDName(
const char *uid);
212 static long long GetLocalOffset(
long long t);
214 static char UIDPrefix[64];
215 static char ImplementationClassUID[65];
216 static char ImplementationVersionName[17];
219 #ifdef VTK_DICOM_DELETE
A (group,element) identifier tag for DICOM attributes.
Definition: vtkDICOMTag.h:23
Utility functions for use with DICOM classes.
Definition: vtkDICOMUtilities.h:36
static long long ConvertDateTime(const char *datetime)
Convert a DICOM data time string into a long integer.
static bool IsValidUTF8(const char *text, size_t l)
Check that a string is valid utf-8.
static std::string GenerateDateTime(const char *zone)
Generate a DICOM date time string in the given timezone.
static std::string GenerateDateTime(long long microsecs, const char *zone)
Generate a DICOM date time string from long integer.
static const char * GetImplementationVersionName()
Get the versioned name for this DICOM implementation.
unsigned short GetCIDFromUID(const char *uid)
Get the CID from the UID.
static void PackUnsignedInt(unsigned int i, unsigned char *cp)
Pack one little-endian int into a stream of bytes.
Definition: vtkDICOMUtilities.h:168
static bool IsDICOMFile(const char *filename)
Check if the specified file is a DICOM file.
static int CompareUIDs(const char *u1, const char *u2)
Numerically compare two UIDs, returns -1, 0, or +1.
static void SetUIDPrefix(const char *prefix)
Set a UID prefix to use when generating UIDs.
static void SetImplementationVersionName(const char *name)
Set the versioned name for this DICOM implementation.
static long long GetUniversalTime()
Get the current time in microseconds.
static bool PatternMatches(const char *pattern, size_t pl, const char *val, size_t vl)
Match patterns on non-terminated strings.
static void GenerateUIDs(vtkDICOMTag tag, vtkStringArray *uids)
Generate a series of UIDs, sorted from low to high.
static bool PatternMatches(const char *pattern, const char *val)
Return true if the pattern matches the given string (utf-8).
static long long GetUTC(long long *offset)
Deprecated method, do not use.
static unsigned int UnpackUnsignedInt(const unsigned char *cp)
Unpack one little-endian int from a stream of bytes.
Definition: vtkDICOMUtilities.h:160
static void SetImplementationClassUID(const char *uid)
Set the UID for this DICOM implementation.
void PrintSelf(ostream &os, vtkIndent indent) VTK_DICOM_OVERRIDE
Print a summary of the contents of this object.
abstract base class for most VTK objects
Definition: vtkObject.h:54