vtk-dicom
0.8.17
|
Utility functions for use with DICOM classes. More...
#include <vtkDICOMUtilities.h>
Public Types | |
typedef vtkObject | Superclass |
VTK dynamic type information macro. | |
Public Member Functions | |
virtual vtkTypeBool | IsA (const char *type) |
vtkDICOMUtilities * | NewInstance () const |
void | PrintSelf (ostream &os, vtkIndent indent) VTK_DICOM_OVERRIDE |
Print a summary of the contents of this object. | |
unsigned short | GetCIDFromUID (const char *uid) |
Get the CID from the UID. | |
Public Member Functions inherited from vtkObject | |
vtkBaseTypeMacro (vtkObject, vtkObjectBase) | |
virtual void | DebugOn () |
virtual void | DebugOff () |
bool | GetDebug () |
void | SetDebug (bool debugFlag) |
virtual void | Modified () |
virtual vtkMTimeType | GetMTime () |
void | PrintSelf (ostream &os, vtkIndent indent) VTK_OVERRIDE |
unsigned long | AddObserver (unsigned long event, vtkCommand *, float priority=0.0f) |
unsigned long | AddObserver (const char *event, vtkCommand *, float priority=0.0f) |
vtkCommand * | GetCommand (unsigned long tag) |
void | RemoveObserver (vtkCommand *) |
void | RemoveObservers (unsigned long event, vtkCommand *) |
void | RemoveObservers (const char *event, vtkCommand *) |
int | HasObserver (unsigned long event, vtkCommand *) |
int | HasObserver (const char *event, vtkCommand *) |
void | RemoveObserver (unsigned long tag) |
void | RemoveObservers (unsigned long event) |
void | RemoveObservers (const char *event) |
void | RemoveAllObservers () |
int | HasObserver (unsigned long event) |
int | HasObserver (const char *event) |
template<class U , class T > | |
unsigned long | AddObserver (unsigned long event, U observer, void(T::*callback)(), float priority=0.0f) |
template<class U , class T > | |
unsigned long | AddObserver (unsigned long event, U observer, void(T::*callback)(vtkObject *, unsigned long, void *), float priority=0.0f) |
template<class U , class T > | |
unsigned long | AddObserver (unsigned long event, U observer, bool(T::*callback)(vtkObject *, unsigned long, void *), float priority=0.0f) |
int | InvokeEvent (unsigned long event, void *callData) |
int | InvokeEvent (const char *event, void *callData) |
int | InvokeEvent (unsigned long event) |
int | InvokeEvent (const char *event) |
Public Member Functions inherited from vtkObjectBase | |
const char * | GetClassName () const |
virtual void | Delete () |
virtual void | FastDelete () |
void | InitializeObjectBase () |
void | Print (ostream &os) |
virtual void | PrintHeader (ostream &os, vtkIndent indent) |
virtual void | PrintTrailer (ostream &os, vtkIndent indent) |
virtual void | Register (vtkObjectBase *o) |
virtual void | UnRegister (vtkObjectBase *o) |
int | GetReferenceCount () |
void | SetReferenceCount (int) |
void | PrintRevisions (ostream &) |
Static Public Member Functions | |
static vtkDICOMUtilities * | New () |
VTK new method (for Java and Tcl wrappers) | |
static vtkTypeBool | IsTypeOf (const char *type) |
static vtkDICOMUtilities * | SafeDownCast (vtkObjectBase *o) |
static void | SetUIDPrefix (const char *prefix) |
Set a UID prefix to use when generating UIDs. More... | |
static const char * | GetUIDPrefix () |
static std::string | GenerateUID (vtkDICOMTag tag) |
Generate a UID for the provided tag. | |
static void | GenerateUIDs (vtkDICOMTag tag, vtkStringArray *uids) |
Generate a series of UIDs, sorted from low to high. More... | |
static int | CompareUIDs (const char *u1, const char *u2) |
Numerically compare two UIDs, returns -1, 0, or +1. | |
static std::string | GenerateDateTime (const char *zone) |
Generate a DICOM date time string in the given timezone. More... | |
static std::string | GenerateDateTime (long long microsecs, const char *zone) |
Generate a DICOM date time string from long integer. More... | |
static long long | ConvertDateTime (const char *datetime) |
Convert a DICOM data time string into a long integer. More... | |
static long long | GetUniversalTime () |
Get the current time in microseconds. More... | |
static long long | GetUTC (long long *offset) |
Deprecated method, do not use. | |
static bool | IsDICOMFile (const char *filename) |
Check if the specified file is a DICOM file. More... | |
static const char * | GetImplementationClassUID () |
Get the UID for this DICOM implementation. | |
static void | SetImplementationClassUID (const char *uid) |
Set the UID for this DICOM implementation. More... | |
static const char * | GetImplementationVersionName () |
Get the versioned name for this DICOM implementation. | |
static void | SetImplementationVersionName (const char *name) |
Set the versioned name for this DICOM implementation. More... | |
static unsigned int | UnpackUnsignedInt (const unsigned char *cp) |
Unpack one little-endian int from a stream of bytes. More... | |
static void | PackUnsignedInt (unsigned int i, unsigned char *cp) |
Pack one little-endian int into a stream of bytes. More... | |
static bool | PatternMatches (const char *pattern, const char *val) |
Return true if the pattern matches the given string (utf-8). More... | |
static bool | PatternMatches (const char *pattern, size_t pl, const char *val, size_t vl) |
Match patterns on non-terminated strings. | |
static bool | IsValidUTF8 (const char *text, size_t l) |
Check that a string is valid utf-8. More... | |
static const char * | GetUIDName (const char *uid) |
Get the name associated with the given UID. | |
Static Public Member Functions inherited from vtkObject | |
static vtkObject * | New () |
static void | BreakOnError () |
static void | SetGlobalWarningDisplay (int val) |
static void | GlobalWarningDisplayOn () |
static void | GlobalWarningDisplayOff () |
static int | GetGlobalWarningDisplay () |
Static Public Member Functions inherited from vtkObjectBase | |
static vtkTypeBool | IsTypeOf (const char *name) |
static vtkObjectBase * | New () |
Protected Member Functions | |
virtual vtkObjectBase * | NewInstanceInternal () const |
Protected Member Functions inherited from vtkObject | |
void | RegisterInternal (vtkObjectBase *, vtkTypeBool check) VTK_OVERRIDE |
void | UnRegisterInternal (vtkObjectBase *, vtkTypeBool check) VTK_OVERRIDE |
void | InternalGrabFocus (vtkCommand *mouseEvents, vtkCommand *keypressEvents=NULL) |
void | InternalReleaseFocus () |
Protected Member Functions inherited from vtkObjectBase | |
virtual void | CollectRevisions (ostream &) |
virtual void | ReportReferences (vtkGarbageCollector *) |
vtkObjectBase (const vtkObjectBase &) | |
void | operator= (const vtkObjectBase &) |
Static Protected Member Functions | |
static long long | GetLocalOffset (long long t) |
Static Protected Attributes | |
static char | UIDPrefix [64] |
static char | ImplementationClassUID [65] |
static char | ImplementationVersionName [17] |
Additional Inherited Members | |
Protected Attributes inherited from vtkObject | |
bool | Debug |
vtkTimeStamp | MTime |
vtkSubjectHelper * | SubjectHelper |
Protected Attributes inherited from vtkObjectBase | |
vtkAtomicInt32 | ReferenceCount |
vtkWeakPointerBase ** | WeakPointers |
Utility functions for use with DICOM classes.
|
static |
Convert a DICOM data time string into a long integer.
Given a DICOM date time string, generate a long integer that counts microseconds since the UNIX epoch (00:00:00 UTC on 1 Jan 1970). If the datetime string contains a timezone offset, then that timezone is used to convert the time to UTC. Otherwise, the local timezone (according to the computer's timezone preferences) is used to convert the time to UTC. The return value is always intended to be interpreted as a UTC time.
|
static |
Generate a DICOM date time string in the given timezone.
The time zone is to be given in the DICOM format of +HHMM or -HHMM where HH is the hour offset and MM is the minute offset. If no time zone is given, then local time is used (according to the computer's time zone preferences).
|
static |
Generate a DICOM date time string from long integer.
Given an integer number of microseconds since the UNIX epoch (00:00:00 UTC on 1 Jan 1970), return a DICOM date time string for the given time zone. The time zone should be given in the format +HHMM or -HHMM. If no time zone is given, then the local zone is used (according to the computer's time zone preferences).
|
static |
Generate a series of UIDs, sorted from low to high.
Before passing the string array, call SetNumberOfValues() on the array to specify the number of UIDs that you want to be stored in it. The stored UIDs will be sorted, low to high. Generating a batch of UIDs is more efficient than calling GenerateUID() repeatedly.
|
static |
Get the current time in microseconds.
The time is in microseconds since the UNIX epoch (00:00:00 UTC on 1 Jan 1970).
|
virtual |
Return 1 if this class is the same type of (or a subclass of) the named class. Returns 0 otherwise. This method works in combination with vtkTypeMacro found in vtkSetGet.h.
Reimplemented from vtkObjectBase.
|
static |
Check if the specified file is a DICOM file.
This will return true if the file exists, is readable, and if it has the DICM magic number or if the first few bytes of the file look like DICOM data elements.
|
static |
Check that a string is valid utf-8.
The string is valid if it contains no NULL bytes and if it contains only valid 1-byte, 2-byte, 3-byte, or 4-byte utf-8 sequences. Any overlength sequences or sequences that encode values above U+10FFFF or between U+D800 and U+DFFF are considered invalid.
|
inlinestatic |
Pack one little-endian int into a stream of bytes.
This is a very common operation that is required in many different classes, so the code is centralized here.
|
static |
Return true if the pattern matches the given string (utf-8).
This performs simple matching with "*" and "?" as the only wildcard. The input must either be ASCII or utf-8, and if it is utf-8, then matching will be done codepoint by codepoint.
|
static |
Set the UID for this DICOM implementation.
The supplied UID will be copied into a static storage area, and used for all future calls to GetImplementationClassUID. The ImplementationClassUID appears in the DICOM meta header.
|
static |
Set the versioned name for this DICOM implementation.
The supplied name will be copied into a static storage area, and used for all future calls to GetImplementationVersionName. The ImplementationVersionName appears in the DICOM meta header.
|
static |
Set a UID prefix to use when generating UIDs.
This is optional, if you do not own a UID prefix then the publicly available 2.25 prefix will be used.
|
inlinestatic |
Unpack one little-endian int from a stream of bytes.
This is a very common operation that is required in many different classes, so the code is centralized here.