MeVisLab Toolbox Reference
DCMTree_Utils Namespace Reference

dictionary class to provide dicom-meta information More...

Classes

class  LoadLibraryDelegate
 the delegate who is responsible for loading the specific DICOM library used in initialization, if the library is not loaded statically (via the DEF file) More...
 
class  thread_scoped_criticalsection
 Class to manage thread specific critical sections. More...
 
class  UIDGenerator
 Class to generate unique ids, valid to be used in a DICOM environment. More...
 

Typedefs

typedef voidthread_parameter
 System dependent types and definitions.
 
typedef unsigned int thread_result
 
typedef HANDLE thread_id
 
typedef thread_result(thread_modifierthread_function) (thread_parameter)
 
typedef CRITICAL_SECTION thread_criticalsection
 
typedef std::list< std::string > StringList
 a list of strings
 
typedef void(* LoggingHandler) (std::string, int)
 

Functions

thread_id DCMTREE_EXPORT thread_start (thread_function func, thread_parameter param)
 Start func as a new thread, param as parameter (void-pointer :) )
 
void DCMTREE_EXPORT thread_await (thread_id id)
 Wait for a thread to complete its work.
 
bool DCMTREE_EXPORT thread_running (thread_id id)
 Test if a thread is running.
 
void DCMTREE_EXPORT thread_initcriticalsection (thread_criticalsection &cs)
 Prepare a critical section for further usage.
 
void DCMTREE_EXPORT thread_entercriticalsection (thread_criticalsection &cs)
 Enter a critical section.
 
void DCMTREE_EXPORT thread_leavecriticalsection (thread_criticalsection &cs)
 Leave a critical section.
 
void DCMTREE_EXPORT thread_destroycriticalsection (thread_criticalsection &cs)
 Destroy a critical section.
 
const std::string configInstallPath ()
 get path where the current application is installed
 
const std::list< std::string > configLibraryPathList (const std::string &installPath)
 get list of paths where to search for dynamic libraries
 
bool configLoadDll (std::string dllPath)
 load a dynamic library from the specified path returns true on success else false
 
DCMTREE_EXPORT void configLoadLibraries (LoadLibraryDelegate *delegate=nullptr)
 load dynamic libraries, search in file DCMTree.cfg for their names
 
DCMTREE_EXPORT StringList split (const std::string &tosplit, char c, bool skipempties=false)
 split the given string at each c if skipempties is true, all empty results would be removed
 
DCMTREE_EXPORT std::string toString (const DCMTree::Date &date)
 convert a date to a string
 
DCMTREE_EXPORT std::string toString (const DCMTree::Time &time)
 convert a time to a string
 
DCMTREE_EXPORT std::string toString (const DCMTree::DateTime &datetime)
 convert a datetime to a string
 
DCMTREE_EXPORT std::string toString (int val)
 convert a int to a string
 
DCMTREE_EXPORT std::string toString (unsigned int val)
 convert a unsigned int to a string
 
DCMTREE_EXPORT std::string toString (float val)
 convert a float to a string
 
DCMTREE_EXPORT std::string toString (double val)
 convert a double to a string
 
DCMTREE_EXPORT DCMTree::Date toDate (const std::string &str)
 convert a string to date
 
DCMTREE_EXPORT DCMTree::Time toTime (const std::string &str)
 convert a string to time
 
DCMTREE_EXPORT DCMTree::DateTime toDateTime (const std::string &str)
 convert a string to datetime
 
DCMTREE_EXPORT std::string digitsOnly (const std::string &str, bool allowhex=false)
 remove all non-digits from the given strings if allowhex is true 'a'-'f','A'-'F' are preserved too
 
DCMTREE_EXPORT std::string afterFractionPart (const std::string &str)
 get the part of the string after the right-most dot if there is no dot in the string the result is empty
 
DCMTREE_EXPORT std::string beforeFractionPart (const std::string &str)
 get the part of the string before the right-most dot if there is no dot in the string the result is the given string
 
DCMTREE_EXPORT int hexToInt (const std::string &str)
 convert a hex-string to int
 
DCMTREE_EXPORT unsigned int hexToUInt (const std::string &str)
 convert a hex-string to unsigned int
 
DCMTREE_EXPORT int toInt (const std::string &str)
 convert a string to int
 
DCMTREE_EXPORT unsigned int toUInt (const std::string &str)
 convert a string to unsigned int
 
DCMTREE_EXPORT double toDouble (const std::string &str)
 convert a string to double
 
DCMTREE_EXPORT std::string toString (const DCMTree::Vr vr)
 convert a vr into a string
 
DCMTREE_EXPORT DCMTree::Vr toVr (const std::string &vrString)
 convert a string into vr.
 
DCMTREE_EXPORT void toStream (std::ostream &out, const std::string &val)
 helpers to put data into a stream
 
DCMTREE_EXPORT void toStream (std::ostream &out, const int &val)
 
DCMTREE_EXPORT void toStream (std::ostream &out, const unsigned int &val)
 
DCMTREE_EXPORT void toStream (std::ostream &out, const bool &val)
 
DCMTREE_EXPORT void toStream (std::ostream &out, const unsigned char *ptr, unsigned int size)
 
DCMTREE_EXPORT void fromStream (std::istream &in, std::string &val, size_t maxSize=0)
 helpers to get data out of a stream
 
DCMTREE_EXPORT void fromStream (std::istream &in, int &val)
 
DCMTREE_EXPORT void fromStream (std::istream &in, unsigned int &val)
 
DCMTREE_EXPORT void fromStream (std::istream &in, bool &val)
 
DCMTREE_EXPORT void fromStream (std::istream &in, unsigned char *ptr, unsigned int size)
 
DCMTREE_EXPORT void setLoggingHandler (LoggingHandler handler)
 Set a callback for logging purposes.
 
DCMTREE_EXPORT LoggingHandler getLoggingHandler ()
 Get the currently set logging callback.
 
DCMTREE_EXPORT void logMessage (std::string message, int errorCode=0)
 Log a message using the provided callback, if any.
 
DCMTREE_EXPORT std::string condGetNameForTag (DCMTree::TagId tag, const std::string &defaultName)
 

Detailed Description

dictionary class to provide dicom-meta information

utility-functions for DCMTree uses its own namespace to avoid name-mangling problems with alias types (toString(unsigned int) vs.

Author: Sascha Bohnenkamp devel.nosp@m.opme.nosp@m.nt@me.nosp@m.visb.nosp@m.reast.nosp@m.care.nosp@m..de
Copyright 2006 All Rights Reserved MeVis BreastCare GmbH & Co.KG Universitaetsallee 29 D-28359 Bremen phone +49 (0)421 330 74 0 fax +49 (0)421 330 74 50

Change history: 20060519 : SB initial version

toString(Tagid) for example)

Author: Sascha Bohnenkamp devel.nosp@m.opme.nosp@m.nt@me.nosp@m.visb.nosp@m.reast.nosp@m.care.nosp@m..de
Copyright 2006 All Rights Reserved MeVis BreastCare GmbH & Co.KG Universitaetsallee 29 D-28359 Bremen phone +49 (0)421 330 74 0 fax +49 (0)421 330 74 50

Change history: 20060531 : SB initial version

Typedef Documentation

◆ LoggingHandler

typedef void(* DCMTree_Utils::LoggingHandler) (std::string, int)

Definition at line 218 of file DCMTree_Utils.h.

◆ StringList

typedef std::list<std::string> DCMTree_Utils::StringList

a list of strings

Definition at line 92 of file DCMTree_Utils.h.

◆ thread_criticalsection

◆ thread_function

typedef thread_result(thread_modifier * DCMTree_Utils::thread_function) (thread_parameter)

Definition at line 41 of file DCMTree_ThreadSupport.h.

◆ thread_id

◆ thread_parameter

System dependent types and definitions.

Definition at line 35 of file DCMTree_ThreadSupport.h.

◆ thread_result

Function Documentation

◆ afterFractionPart()

DCMTREE_EXPORT std::string DCMTree_Utils::afterFractionPart ( const std::string & str)

get the part of the string after the right-most dot if there is no dot in the string the result is empty

◆ beforeFractionPart()

DCMTREE_EXPORT std::string DCMTree_Utils::beforeFractionPart ( const std::string & str)

get the part of the string before the right-most dot if there is no dot in the string the result is the given string

◆ condGetNameForTag()

DCMTREE_EXPORT std::string DCMTree_Utils::condGetNameForTag ( DCMTree::TagId tag,
const std::string & defaultName )

◆ configInstallPath()

const std::string DCMTree_Utils::configInstallPath ( )

get path where the current application is installed

◆ configLibraryPathList()

const std::list< std::string > DCMTree_Utils::configLibraryPathList ( const std::string & installPath)

get list of paths where to search for dynamic libraries

◆ configLoadDll()

bool DCMTree_Utils::configLoadDll ( std::string dllPath)

load a dynamic library from the specified path returns true on success else false

◆ configLoadLibraries()

DCMTREE_EXPORT void DCMTree_Utils::configLoadLibraries ( LoadLibraryDelegate * delegate = nullptr)

load dynamic libraries, search in file DCMTree.cfg for their names

◆ digitsOnly()

DCMTREE_EXPORT std::string DCMTree_Utils::digitsOnly ( const std::string & str,
bool allowhex = false )

remove all non-digits from the given strings if allowhex is true 'a'-'f','A'-'F' are preserved too

◆ fromStream() [1/5]

DCMTREE_EXPORT void DCMTree_Utils::fromStream ( std::istream & in,
bool & val )

◆ fromStream() [2/5]

DCMTREE_EXPORT void DCMTree_Utils::fromStream ( std::istream & in,
int & val )

◆ fromStream() [3/5]

DCMTREE_EXPORT void DCMTree_Utils::fromStream ( std::istream & in,
std::string & val,
size_t maxSize = 0 )

helpers to get data out of a stream

◆ fromStream() [4/5]

DCMTREE_EXPORT void DCMTree_Utils::fromStream ( std::istream & in,
unsigned char * ptr,
unsigned int size )

◆ fromStream() [5/5]

DCMTREE_EXPORT void DCMTree_Utils::fromStream ( std::istream & in,
unsigned int & val )

◆ getLoggingHandler()

DCMTREE_EXPORT LoggingHandler DCMTree_Utils::getLoggingHandler ( )

Get the currently set logging callback.

◆ hexToInt()

DCMTREE_EXPORT int DCMTree_Utils::hexToInt ( const std::string & str)

convert a hex-string to int

◆ hexToUInt()

DCMTREE_EXPORT unsigned int DCMTree_Utils::hexToUInt ( const std::string & str)

convert a hex-string to unsigned int

◆ logMessage()

DCMTREE_EXPORT void DCMTree_Utils::logMessage ( std::string message,
int errorCode = 0 )

Log a message using the provided callback, if any.

◆ setLoggingHandler()

DCMTREE_EXPORT void DCMTree_Utils::setLoggingHandler ( LoggingHandler handler)

Set a callback for logging purposes.

◆ split()

DCMTREE_EXPORT StringList DCMTree_Utils::split ( const std::string & tosplit,
char c,
bool skipempties = false )

split the given string at each c if skipempties is true, all empty results would be removed

◆ thread_await()

void DCMTREE_EXPORT DCMTree_Utils::thread_await ( thread_id id)

Wait for a thread to complete its work.

Parameters
idThe thread to wait for

◆ thread_destroycriticalsection()

void DCMTREE_EXPORT DCMTree_Utils::thread_destroycriticalsection ( thread_criticalsection & cs)

Destroy a critical section.

Parameters
&csThe lock variable

◆ thread_entercriticalsection()

void DCMTREE_EXPORT DCMTree_Utils::thread_entercriticalsection ( thread_criticalsection & cs)

Enter a critical section.

Parameters
&csThe lock variable

Referenced by DCMTree_Utils::thread_scoped_criticalsection::thread_scoped_criticalsection().

◆ thread_initcriticalsection()

void DCMTREE_EXPORT DCMTree_Utils::thread_initcriticalsection ( thread_criticalsection & cs)

Prepare a critical section for further usage.

Parameters
&csThe variable to protect the critical section

◆ thread_leavecriticalsection()

void DCMTREE_EXPORT DCMTree_Utils::thread_leavecriticalsection ( thread_criticalsection & cs)

Leave a critical section.

Parameters
&csThe lock variable

Referenced by DCMTree_Utils::thread_scoped_criticalsection::~thread_scoped_criticalsection().

◆ thread_running()

bool DCMTREE_EXPORT DCMTree_Utils::thread_running ( thread_id id)

Test if a thread is running.

Parameters
idThe thread to test

◆ thread_start()

thread_id DCMTREE_EXPORT DCMTree_Utils::thread_start ( thread_function func,
thread_parameter param )

Start func as a new thread, param as parameter (void-pointer :) )

Parameters
funcThe function to call
paramThe parameter to pass to func

◆ toDate()

DCMTREE_EXPORT DCMTree::Date DCMTree_Utils::toDate ( const std::string & str)

convert a string to date

◆ toDateTime()

DCMTREE_EXPORT DCMTree::DateTime DCMTree_Utils::toDateTime ( const std::string & str)

convert a string to datetime

◆ toDouble()

DCMTREE_EXPORT double DCMTree_Utils::toDouble ( const std::string & str)

convert a string to double

◆ toInt()

DCMTREE_EXPORT int DCMTree_Utils::toInt ( const std::string & str)

convert a string to int

◆ toStream() [1/5]

DCMTREE_EXPORT void DCMTree_Utils::toStream ( std::ostream & out,
const bool & val )

◆ toStream() [2/5]

DCMTREE_EXPORT void DCMTree_Utils::toStream ( std::ostream & out,
const int & val )

◆ toStream() [3/5]

DCMTREE_EXPORT void DCMTree_Utils::toStream ( std::ostream & out,
const std::string & val )

helpers to put data into a stream

◆ toStream() [4/5]

DCMTREE_EXPORT void DCMTree_Utils::toStream ( std::ostream & out,
const unsigned char * ptr,
unsigned int size )

◆ toStream() [5/5]

DCMTREE_EXPORT void DCMTree_Utils::toStream ( std::ostream & out,
const unsigned int & val )

◆ toString() [1/8]

DCMTREE_EXPORT std::string DCMTree_Utils::toString ( const DCMTree::Date & date)

convert a date to a string

◆ toString() [2/8]

DCMTREE_EXPORT std::string DCMTree_Utils::toString ( const DCMTree::DateTime & datetime)

convert a datetime to a string

◆ toString() [3/8]

DCMTREE_EXPORT std::string DCMTree_Utils::toString ( const DCMTree::Time & time)

convert a time to a string

◆ toString() [4/8]

DCMTREE_EXPORT std::string DCMTree_Utils::toString ( const DCMTree::Vr vr)

convert a vr into a string

◆ toString() [5/8]

DCMTREE_EXPORT std::string DCMTree_Utils::toString ( double val)

convert a double to a string

◆ toString() [6/8]

DCMTREE_EXPORT std::string DCMTree_Utils::toString ( float val)

convert a float to a string

◆ toString() [7/8]

DCMTREE_EXPORT std::string DCMTree_Utils::toString ( int val)

convert a int to a string

◆ toString() [8/8]

DCMTREE_EXPORT std::string DCMTree_Utils::toString ( unsigned int val)

convert a unsigned int to a string

◆ toTime()

DCMTREE_EXPORT DCMTree::Time DCMTree_Utils::toTime ( const std::string & str)

convert a string to time

◆ toUInt()

DCMTREE_EXPORT unsigned int DCMTree_Utils::toUInt ( const std::string & str)

convert a string to unsigned int

◆ toVr()

DCMTREE_EXPORT DCMTree::Vr DCMTree_Utils::toVr ( const std::string & vrString)

convert a string into vr.

If the conversion fails, vr will be UN.