Classes | Namespaces | Defines | Typedefs | Functions | Variables

cmtkSystem Library

This library provides system-related classes, such as command line parsing, memory allocation, threading, synchronization, and timing. More...

Collaboration diagram for cmtkSystem Library:

Classes

class  cmtk::CannotBeCopied
 Base class to prevent copying of derived classes. More...
class  cmtk::CommandLine
 Command line argument parser. More...
class  cmtk::CommandLineTypeTraitsBase< T >
class  cmtk::CommandLineTypeTraits< T >
 Template for traits to handle command line arguments of different types. More...
class  cmtk::CommandLineTypeTraits< const char * >
 Inherit generic template members. More...
class  cmtk::CommandLineTypeTraits< std::string >
 Inherit generic template members. More...
class  cmtk::CommandLineTypeTraits< std::vector< std::string > >
 Inherit generic template members. More...
class  cmtk::CommandLineTypeTraits< int >
 Inherit generic template members. More...
class  cmtk::CommandLineTypeTraits< unsigned int >
 Inherit generic template members. More...
class  cmtk::CommandLineTypeTraits< short >
 Inherit generic template members. More...
class  cmtk::CommandLineTypeTraits< unsigned short >
 Inherit generic template members. More...
class  cmtk::CommandLineTypeTraits< signed char >
 Inherit generic template members. More...
class  cmtk::CommandLineTypeTraits< unsigned char >
class  cmtk::CommandLineTypeTraits< float >
 Inherit generic template members. More...
class  cmtk::CommandLineTypeTraits< double >
 Inherit generic template members. More...
class  cmtk::CommandLineTypeTraits< bool >
 Inherit generic template members. More...
class  cmtk::CompressedStream
 Stream with on-the-fly decompression. More...
class  cmtk::ConditionVariable
 Condition variable for thread synchronization. More...
class  cmtk::Console
 Standard error output console for library. More...
class  cmtk::Exception
 Exception class. More...
class  cmtk::ExitException
 Program exit exception class. More...
class  cmtk::LockingPtr< T >
 Class for mutually exclusive access to objects. More...
class  cmtk::MountPoints
 Directory translation. More...
class  cmtk::MutexLock
 Generic mutex lock. More...
class  cmtk::Progress
 Generic class for progress indication. More...
class  cmtk::SafeCounter
 Thread-safe counter. More...
class  cmtk::SmartConstPointer< T >
 Smart pointer with reference counting. More...
class  cmtk::SmartPointer< T >
 Smart pointer with reference counting. More...
class  cmtk::StackBacktrace
 Class for printing stack backtrace in the event of a crash. More...
class  cmtk::TestFunctionMap
 Map from test name to test function. More...
class  cmtk::ThreadParameterArray< TClass, TParam >
 Array of thread parameters. More...
class  cmtk::ThreadParameters< T >
 Base class for thread parameter blocks. More...
class  cmtk::ThreadPool
 Class that provides a pool of continuously running threads that can be used for reducing overhead in SMP computations. More...
class  cmtk::ThreadPool::ThreadPoolArg
 Thread function arguments: identify pool and index of thread in it. More...
class  cmtk::ThreadSemaphore
 Semaphore for thread synchronization. More...

Namespaces

namespace  cmtk::FileUtils
 

Utility functions for file and directory access.


namespace  cmtk::Memory
 

Memory-related helper functions.


namespace  cmtk
namespace  cmtk::Threads
 

Thread-related utility functions and global configuration variables.


namespace  cmtk::Timers
 

Namespace that contains functions and variables for CPU time measurements.


Defines

#define CMTK_MAX_THREADS   256
 Maximum number of threads supported.

Typedefs

typedef SmartPointer< Self > cmtk::ThreadPool::SmartPtr
 Smart pointer.
typedef void(* cmtk::ThreadPool::TaskFunction )(void *const args, const size_t taskIdx, const size_t taskCnt, const size_t threadIdx, const size_t threadCont)
 Task function: this is the interface for the functions called by the pooled threads to do the actual work.
typedef int cmtk::ThreadIDType
 Dummy definition for non-threading builds.
typedef CMTK_THREAD_RETURN_TYPE(* cmtk::ThreadFunction )(CMTK_THREAD_ARG_TYPE)
 Type of thread function.

Functions

 cmtk::CannotBeCopied::~CannotBeCopied ()
 Default destructor.
 cmtk::CannotBeCopied::CannotBeCopied (const CannotBeCopied &)
 Undefined copy constructor.
CannotBeCopied & cmtk::CannotBeCopied::operator= (const CannotBeCopied &)
 Undefined assignment operator.
Console & cmtk::operator<< (Console &console, CommandLine::Exception e)
 Output of command line exception.
template<>
std::vector< std::string > cmtk::CommandLine::Item::Convert< std::vector< std::string > > (const char *str)
 Convert string to vector.
static std::string cmtk::CommandLineTypeTraitsBase::ValueToStringMinimal (const T *value)
 Convert a value of this type to string with minimal added markup (for XML output).
static std::string cmtk::CommandLineTypeTraits< const char * >::ValueToString (const char *const *value)
 Convert a value of this type to string.
static std::string cmtk::CommandLineTypeTraits< const char * >::ValueToStringMinimal (const char *const *value)
 Convert a value of this type to string with minimal added markup (for XML output).
static std::string cmtk::CommandLineTypeTraits< std::vector< std::string > >::ValueToString (const std::vector< std::string > *value)
 Convert a value of this type to string.
static std::string cmtk::CommandLineTypeTraits< std::vector< std::string > >::ValueToStringMinimal (const std::vector< std::string > *value)
 Convert a value of this type to string with minimal added markup (for XML output).
const char * cmtk::cmtkWhitespaceWriteMiniXML (mxml_node_t *, int where)
int cmtk::FileUtils::RecursiveMkPrefixDir (const char *filename, const int permissions=0755)
 Recursively create all directories on a full filename's prefix.
char * cmtk::FileUtils::GetAbsolutePath (char *absPath, const char *relPath)
 Make an absolute path name from a (possibly) relative path.
int cmtk::StrCmp (const char *s1, const char *s2)
 Safe string comparison.
void cmtk::StrReplace (char *&s1, const char *s2)
 Replace a string.
void cmtk::StrFree (char *const s)
 Safe deallocation of strings.
int cmtk::StrPrefixCmp (const char *s, const char *prefix)
 Compare string prefix.
const char * cmtk::StrDir (const char *path)
 Extract directory component from a complete filesystem path.
const char * cmtk::StrFName (const char *path)
 Extract filename component from a complete filesystem path.
std::string cmtk::StrReplace (const std::string &str, const std::map< std::string, std::string > &rules, const bool multiple=false)
 Replace string components.
 cmtk::ThreadPool::ThreadPool (const size_t nThreads=0)
 Constructor: create a pool of nThreads running threads.
 cmtk::ThreadPool::~ThreadPool ()
 Destructor: stop all running threads.
size_t cmtk::ThreadPool::GetNumberOfThreads () const
 Return number of threads in the pool.
template<class TParam >
void cmtk::ThreadPool::Run (TaskFunction taskFunction, std::vector< TParam > &taskParameters, const size_t numberOfTasksOverride=0)
 Run actual worker functions through running threads.
void cmtk::ThreadPool::ThreadFunction (const size_t threadIdx)
 This function is run as a thread.
static Self & cmtk::ThreadPool::GetGlobalThreadPool ()
 Get reference to global thread pool.
void cmtk::ThreadPool::StartThreads ()
 Start threads for this pool.
void cmtk::ThreadPool::EndThreads ()
 End threads for this pool.
 cmtk::CommandLine::CommandLine (const int properties=PROPS_NOXML)
 Constructor using const inputs.
 cmtk::CommandLine::~CommandLine ()
 Destructor: spit out a warning if there are unused extra arguments on the command line.
void cmtk::CommandLine::SetDefaultInfo ()
 Set default values for meta information.
KeyActionGroupType::SmartPtr & cmtk::CommandLine::BeginGroup (const char *name, const char *description)
 Begin parameter group.
void cmtk::CommandLine::EndGroup ()
 End last parameter group.
bool cmtk::CommandLine::Parse (const int argc, const char *argv[]) throw ( ExitException, Self::Exception )
 Parse command line.
void cmtk::CommandLine::PrintHelp () const
 Print help text.
void cmtk::CommandLine::PrintWiki () const
 Print help text.
template<class T >
cmtk::CommandLine::Item::Convert (const char *str)
 Convert function.
mxml_node_t * cmtk::CommandLine::AddProgramInfoXML (mxml_node_t *const parent, const ProgramProperties key, const char *name) const
 Add program info item to XML tree.
void cmtk::CommandLine::WriteXML () const
 Write XML self description according to Slice3 execution model.
 cmtk::CompressedStream::CompressedStream (const char *filename)
 Create stream from filename.
 cmtk::CompressedStream::~CompressedStream ()
 Dispose stream object.
bool cmtk::CompressedStream::Open (const char *filename)
 Open new stream from filename.
void cmtk::CompressedStream::Close ()
 Close current file stream.
bool cmtk::CompressedStream::OpenDecompressionPipe (const char *filename, const char *suffix, const char *command, const char *compressedSuffix)
 Open decompressing pipe.
static std::string cmtk::CompressedStream::GetBaseName (const std::string &path)
 Return base name of a path without compression suffix.
static int cmtk::CompressedStream::Stat (const char *path, struct stat *const buf=NULL)
 Do stat() on compressed file.
 cmtk::CompressedStream::File::File (const char *filename)
 Open new stream from filename.
virtual void cmtk::CompressedStream::File::Close ()
 Close current file stream.
virtual void cmtk::CompressedStream::File::Rewind ()
 Reset read pointer to beginning of stream.
virtual int cmtk::CompressedStream::File::Seek (const long int offset, int whence)
 Set filepointer.
virtual size_t cmtk::CompressedStream::File::Read (void *data, size_t size, size_t count)
 Read block of data.
virtual bool cmtk::CompressedStream::File::Get (char &c)
 Read a single character from the stream.
virtual int cmtk::CompressedStream::File::Tell () const
 Return number of bytes read from stream.
virtual bool cmtk::CompressedStream::File::Feof () const
 Return 1 if and only if end of file reached.
 cmtk::CompressedStream::Pipe::Pipe (const char *filename, const char *command)
 Open new pipe from filename.
virtual void cmtk::CompressedStream::Pipe::Close ()
 Close current file stream.
virtual void cmtk::CompressedStream::Pipe::Rewind ()
 Reset read pointer to beginning of stream.
virtual size_t cmtk::CompressedStream::Pipe::Read (void *data, size_t size, size_t count)
 Read block of data.
virtual bool cmtk::CompressedStream::Pipe::Get (char &c)
 Read a single character from the stream.
virtual int cmtk::CompressedStream::Pipe::Tell () const
 Return number of bytes read from stream.
virtual bool cmtk::CompressedStream::Pipe::Feof () const
 Return 1 if and only if end of file reached.
 cmtk::CompressedStream::Zlib::Zlib (const char *filename)
 Open new stream from filename.
virtual void cmtk::CompressedStream::Zlib::Close ()
 Close current file stream.
virtual void cmtk::CompressedStream::Zlib::Rewind ()
 Reset read pointer to beginning of stream.
virtual int cmtk::CompressedStream::Zlib::Seek (const long int offset, int whence)
 Set filepointer.
virtual size_t cmtk::CompressedStream::Zlib::Read (void *data, size_t size, size_t count)
 Read block of data.
virtual bool cmtk::CompressedStream::Zlib::Get (char &c)
 Read a single character from the stream.
virtual int cmtk::CompressedStream::Zlib::Tell () const
 Return number of bytes read from stream.
virtual bool cmtk::CompressedStream::Zlib::Feof () const
 Return 1 if and only if end of file reached.
size_t cmtk::Console::GetLineWidth () const
 Get terminal line width, if possible.
Console & cmtk::Console::FormatText (const std::string &text, const size_t margin=0, const size_t width=0, const int firstLine=0)
 Format text with line breaks etc.
void cmtk::Console::printf (const char *format,...)
 Formatted output.
void cmtk::Console::Indent (size_t level=0)
 Perform indentation.
static const char * cmtk::MountPoints::Translate (const char *path)
 Perform directory substitutions.
static void cmtk::Progress::Begin (const double start, const double end, const double increment, const std::string &taskName=std::string(""))
 Set total number of steps to complete.
virtual void cmtk::Progress::BeginVirtual (const double start, const double end, const double increment, const std::string &taskName=std::string(""))
 Set total number of steps to complete.
void cmtk::Progress::SetProgressCurrent (const double progress)
 Set number of tasks completed.
static ResultEnum cmtk::Progress::SetProgress (const double progress)
 Set number of tasks completed.
static void cmtk::Progress::Done ()
 Done with progress indicator.
virtual void cmtk::Progress::DoneVirtual ()
 Clean up progress output.
double cmtk::Progress::Range::GetFractionComplete (const double nestedFraction=0) const
 Get complete fraction for this range.
double cmtk::Progress::GetFractionComplete () const
 Compute current completion fraction from range stack.
const std::string cmtk::Progress::GetCurrentTaskName () const
 Return the name of the current task (at the lowest level of nested ranges).
 cmtk::ProgressConsole::ProgressConsole (const std::string &programName=std::string(""))
 Default constructor: connect to progress indicator.
virtual cmtk::ProgressConsole::~ProgressConsole ()
 Destructor: finish things up.
virtual ResultEnum cmtk::ProgressConsole::UpdateProgress ()
 Output progress to console.
virtual void cmtk::ProgressConsole::BeginVirtual (const double start, const double end, const double increment, const std::string &taskName)
 Begin a new level of progress reporting.
 cmtk::StackBacktrace::StackBacktrace ()
 Constructor: register signal handler.
static void cmtk::StackBacktrace::PrintBacktrace (const int levels=0)
 Print current stack backtrace.
void cmtk::ThreadParameterArray::RunInParallelAsynchronous (ThreadFunction threadCall)
 Run thread function in parallel without joining.
void cmtk::ThreadParameterArray::JoinAsynchronousThreads ()
 Collect (join) threads previously started by RunInParallelAsynchronous.
void cmtk::ThreadParameterArray::CancelAsynchronousThreads ()
 Cancel (terminate) threads previously started by RunInParallelAsynchronous.
void cmtk::ThreadParameterArray::RunInParallelFIFO (ThreadFunction threadCall, const size_t numberOfThreadsTotal, const size_t firstThreadIdx=0)
 Run thread functions using a static FIFO scheduler.
int cmtk::Threads::GetNumberOfThreads ()
 Number of threads to run in parallel.
bool cmtk::Threads::Available ()
 Check whether this system supports threads.
int cmtk::Threads::SetNumberOfThreads (const int numberOfThreads=0, const bool force=false)
 Set the number of threads to run in parallel.
int cmtk::Threads::GetMaxThreads ()
 Return number of threads allowed per process on this system.
int cmtk::Threads::GetNumberOfProcessors ()
 Return number of processors currently online.
void cmtk::Threads::RunThreads (ThreadFunction threadCall, const unsigned numberOfThreads, void *const parameters, const size_t parameterSize)
 Specialized but more hands-on thread scheduling function.
void cmtk::Threads::CheckEnvironment ()
 Check environment variables that control thread creation.

Variables

Console cmtk::StdErr (std::cerr)
 Standard error output for the library.
Console cmtk::StdOut (std::cout)
 Standard output for the library.
const char *const cmtk::CMTK_MOUNTPOINTSVAR = "CMTK_MOUNTPOINTS"
 Name of the shell variable defining the directory translation.
const char *const cmtk::IGS_MOUNTPOINTSVAR = "IGS_MOUNTPOINTS"
 Legacy environment variable.
static char cmtk::StrBuffer [PATH_MAX]
size_t cmtk::ThreadPool::ThreadPoolArg::m_Index
 Index of thread in pool.
ThreadSemaphore cmtk::ThreadPool::m_TaskWaitingSemaphore
 Semaphore to signal running threads when tasks are waiting.
ThreadSemaphore cmtk::ThreadPool::m_ThreadWaitingSemaphore
 Semaphore that threads use to signal when tasks they are ready for the next task.
size_t cmtk::ThreadPool::m_NumberOfTasks
 Total number of tasks to execute.
size_t cmtk::ThreadPool::m_NextTaskIndex
 Index of next available task.
MutexLock cmtk::ThreadPool::m_NextTaskIndexLock
 Lock to ensure exclusive access to the task index counter.
TaskFunction cmtk::ThreadPool::m_TaskFunction
 The current task function.
std::vector< void * > cmtk::ThreadPool::m_TaskParameters
 Task function parameter pointers.
std::vector< Self::ThreadPoolArg > cmtk::ThreadPool::m_ThreadArgs
 Thread function parameters.
size_t cmtk::ThreadPool::m_NumberOfThreads
 Number of running threads.
bool cmtk::ThreadPool::m_ThreadsRunning
 Flag whether threads for this pool are running.
bool cmtk::ThreadPool::m_ContinueThreads
 Flag whether threads should continue or terminate.
static const ArchiveLookupEntry cmtk::CompressedStream::ArchiveLookup []
 The suffix-to-archiver assignment table.
static char cmtk::MountPoints::Buffer [PATH_MAX]
 Static buffer holding paths after pattern substitution.
static Self * cmtk::Progress::ProgressInstance = 0
 Instance of a derived class that handles GUI interaction etc.
static Self cmtk::SmartConstPointer::Null
 Null object.
static Self cmtk::SmartPointer::Null
 Null object.
static int cmtk::StackBacktrace::ExitCode = 1
 Exit code.
int cmtk::Threads::NumberOfThreads = 0
 (Maximum) number of threads to run in parallel.

Detailed Description

This library provides system-related classes, such as command line parsing, memory allocation, threading, synchronization, and timing.


Define Documentation

#define CMTK_MAX_THREADS   256

Maximum number of threads supported.

This value determines the size of the statically allocated array of thread IDs. If you need more than 256 parallel threads (default), you may use -DCMTK_MAX_THREADS=

as a preprocessor switch when compiling this library.

Definition at line 81 of file cmtkThreadSystemTypes.h.

Referenced by cmtk::Threads::GetMaxThreads(), cmtk::Threads::GetNumberOfProcessors(), and cmtk::Threads::RunThreads().


Typedef Documentation

typedef SmartPointer<Self> cmtk::ThreadPool::SmartPtr [inherited]

Smart pointer.

Definition at line 114 of file cmtkThreadPool.h.

typedef void(* cmtk::ThreadPool::TaskFunction)(void *const args,const size_t taskIdx,const size_t taskCnt,const size_t threadIdx,const size_t threadCont) [inherited]

Task function: this is the interface for the functions called by the pooled threads to do the actual work.

The task function receives five parameters: a) a pointer to its parameter black, b) the index of the task, c) the number of tasks, d) the index of the thread within the pool that is calling the task, and e) the number of threads in the pool. Whereas the function should use b) and c) to determine what portion of work it needs to do, d) and e) must be used to determine, for example, what local memory should be used, if temporary storage has been allocated for each thread. Because the number of tasks typically exceeds the number of threads, this is more efficient than allocating temporary storage for each task.

Definition at line 124 of file cmtkThreadPool.h.

typedef CMTK_THREAD_RETURN_TYPE(* cmtk::ThreadFunction)(CMTK_THREAD_ARG_TYPE)

Type of thread function.

Definition at line 72 of file cmtkThreadSystemTypes.h.

typedef int cmtk::ThreadIDType

Dummy definition for non-threading builds.

Definition at line 65 of file cmtkThreadSystemTypes.h.


Function Documentation

mxml_node_t * cmtk::CommandLine::AddProgramInfoXML ( mxml_node_t *const   parent,
const ProgramProperties  key,
const char *  name 
) const [private, inherited]

Add program info item to XML tree.

Parameters:
parentParent node for new entry in XML tree.
keyKey code for program property.
nameName of XML tag for this property.

Definition at line 47 of file cmtkCommandLineXML.cxx.

References NULL.

bool cmtk::Threads::Available (  )

Check whether this system supports threads.

Definition at line 93 of file cmtkThreads.cxx.

void cmtk::Progress::Begin ( const double  start,
const double  end,
const double  increment,
const std::string &  taskName = std::string("") 
) [static, inherited]
CommandLine::KeyActionGroupType::SmartPtr & cmtk::CommandLine::BeginGroup ( const char *  name,
const char *  description 
) [inherited]
void cmtk::Progress::BeginVirtual ( const double  start,
const double  end,
const double  increment,
const std::string &  taskName = std::string("") 
) [protected, virtual, inherited]

Set total number of steps to complete.

Reimplemented in cmtk::QtProgress, and cmtk::ProgressConsole.

Definition at line 56 of file cmtkProgress.cxx.

void cmtk::ProgressConsole::BeginVirtual ( const double  start,
const double  end,
const double  increment,
const std::string &  taskName 
) [protected, virtual, inherited]

Begin a new level of progress reporting.

Reimplemented from cmtk::Progress.

Definition at line 102 of file cmtkProgressConsole.cxx.

References cmtk::Timers::GetTimeProcess().

template<class TClass , class TParam >
void cmtk::ThreadParameterArray< TClass, TParam >::CancelAsynchronousThreads (  ) [inherited]

Cancel (terminate) threads previously started by RunInParallelAsynchronous.

Definition at line 126 of file cmtkThreadParameterArray.txx.

References cmtk::Threads::GetNumberOfThreads(), NULL, and cmtk::StdErr.

cmtk::CannotBeCopied::CannotBeCopied ( const CannotBeCopied  ) [private, inherited]

Undefined copy constructor.

void cmtk::Threads::CheckEnvironment (  )

Check environment variables that control thread creation.

Definition at line 284 of file cmtkThreads.cxx.

References cmtk::Threads::SetNumberOfThreads().

Referenced by cmtk::Threads::GetNumberOfThreads().

void cmtk::CompressedStream::Close (  ) [inherited]
void cmtk::CompressedStream::File::Close (  ) [virtual, inherited]

Close current file stream.

Implements cmtk::CompressedStream::ReaderBase.

Definition at line 56 of file cmtkCompressedStreamFile.cxx.

void cmtk::CompressedStream::Pipe::Close (  ) [virtual, inherited]

Close current file stream.

Implements cmtk::CompressedStream::ReaderBase.

Definition at line 95 of file cmtkCompressedStreamPipe.cxx.

void cmtk::CompressedStream::Zlib::Close (  ) [virtual, inherited]

Close current file stream.

Implements cmtk::CompressedStream::ReaderBase.

Definition at line 54 of file cmtkCompressedStreamZlib.cxx.

const char* cmtk::cmtkWhitespaceWriteMiniXML ( mxml_node_t *  ,
int  where 
)

Definition at line 60 of file cmtkCommandLineXML.cxx.

References NULL.

Referenced by cmtk::CommandLine::WriteXML().

cmtk::CommandLine::CommandLine ( const int  properties = PROPS_NOXML ) [inherited]

Constructor using const inputs.

Definition at line 48 of file cmtkCommandLine.cxx.

References cmtk::CommandLine::BeginGroup(), cmtk::CommandLine::m_Properties, and cmtk::CommandLine::SetDefaultInfo().

template<>
std::vector<std::string> cmtk::CommandLine::Item::Convert< std::vector< std::string > > ( const char *  str ) [inline]

Convert string to vector.

Definition at line 139 of file cmtkCommandLineConvert.txx.

cmtk::CompressedStream::CompressedStream ( const char *  filename ) [inherited]

Create stream from filename.

Definition at line 79 of file cmtkCompressedStream.cxx.

References cmtk::CompressedStream::Open().

const char * cmtk::CommandLine::Item::Convert< const char * > ( const char *  str ) [inline, protected, inherited]

Convert function.

Convert string to string.

Convert string to signed char.

Convert string to unsigned char.

Convert string to char.

Convert string to unsigned long.

Convert string to unsigned int.

Convert string to int.

Convert string to long int.

Convert string to double.

Convert string to float.

Convert string to bool.

Definition at line 41 of file cmtkCommandLineConvert.txx.

void cmtk::Progress::Done (  ) [static, inherited]
void cmtk::Progress::DoneVirtual (  ) [protected, virtual, inherited]

Clean up progress output.

This member function can be overriden by derived classes.

Reimplemented in cmtk::QtProgress.

Definition at line 92 of file cmtkProgress.cxx.

void cmtk::CommandLine::EndGroup (  ) [inherited]
void cmtk::ThreadPool::EndThreads (  ) [private, inherited]
bool cmtk::CompressedStream::Zlib::Feof (  ) const [virtual, inherited]

Return 1 if and only if end of file reached.

Implements cmtk::CompressedStream::ReaderBase.

Definition at line 101 of file cmtkCompressedStreamZlib.cxx.

bool cmtk::CompressedStream::File::Feof (  ) const [virtual, inherited]

Return 1 if and only if end of file reached.

Implements cmtk::CompressedStream::ReaderBase.

Definition at line 103 of file cmtkCompressedStreamFile.cxx.

bool cmtk::CompressedStream::Pipe::Feof (  ) const [virtual, inherited]

Return 1 if and only if end of file reached.

Implements cmtk::CompressedStream::ReaderBase.

Definition at line 140 of file cmtkCompressedStreamPipe.cxx.

cmtk::CompressedStream::File::File ( const char *  filename ) [inherited]

Open new stream from filename.

Definition at line 46 of file cmtkCompressedStreamFile.cxx.

References CMTK_FILE_MODE.

Console & cmtk::Console::FormatText ( const std::string &  text,
const size_t  margin = 0,
const size_t  width = 0,
const int  firstLine = 0 
) [inherited]

Format text with line breaks etc.

Parameters:
textThe text to format with line breaks.
marginLeft margin: this many space characters are printed at the beginning of each line.
firstLineRelative indent of first line, i.e., firstLine = -margin means no indentation of first line.

Definition at line 73 of file cmtkConsole.cxx.

Referenced by cmtk::CommandLine::KeyToActionSingle::PrintHelp(), cmtk::CommandLine::KeyToActionEnum::PrintHelp(), and cmtk::CommandLine::PrintHelp().

bool cmtk::CompressedStream::Zlib::Get ( char &  c ) [virtual, inherited]

Read a single character from the stream.

Implements cmtk::CompressedStream::ReaderBase.

Definition at line 81 of file cmtkCompressedStreamZlib.cxx.

bool cmtk::CompressedStream::File::Get ( char &  c ) [virtual, inherited]

Read a single character from the stream.

Implements cmtk::CompressedStream::ReaderBase.

Definition at line 83 of file cmtkCompressedStreamFile.cxx.

bool cmtk::CompressedStream::Pipe::Get ( char &  c ) [virtual, inherited]

Read a single character from the stream.

Implements cmtk::CompressedStream::ReaderBase.

Definition at line 120 of file cmtkCompressedStreamPipe.cxx.

char * cmtk::FileUtils::GetAbsolutePath ( char *  absPath,
const char *  relPath 
)

Make an absolute path name from a (possibly) relative path.

Definition at line 105 of file cmtkFileUtils.cxx.

Referenced by cmtk::XformIO::Write(), and cmtk::VolumeIO::Write().

std::string cmtk::CompressedStream::GetBaseName ( const std::string &  path ) [static, inherited]
const std::string cmtk::Progress::GetCurrentTaskName (  ) const [protected, inherited]

Return the name of the current task (at the lowest level of nested ranges).

Definition at line 117 of file cmtkProgress.cxx.

Referenced by cmtk::ProgressConsole::UpdateProgress().

double cmtk::Progress::Range::GetFractionComplete ( const double  nestedFraction = 0 ) const [inherited]

Get complete fraction for this range.

Parameters:
nestedFractionFor nexted ranges, this is the fraction achieved in he next level down.

Definition at line 99 of file cmtkProgress.cxx.

double cmtk::Progress::GetFractionComplete (  ) const [protected, inherited]

Compute current completion fraction from range stack.

Definition at line 105 of file cmtkProgress.cxx.

Referenced by cmtk::ProgressConsole::UpdateProgress().

ThreadPool & cmtk::ThreadPool::GetGlobalThreadPool (  ) [static, inherited]

Get reference to global thread pool.

This is shared by all functions in the process and allows re-use of the same "physical" threads for all types of computations. The thread pool itself is a local static instance within this function, thus making sure it is initialized properly (see Effective C++, 3rd, Item 4).

Definition at line 188 of file cmtkThreadPool.cxx.

Referenced by cmtk::CongealingFunctional< TXform >::Evaluate(), cmtk::EntropyMinimizationIntensityCorrectionFunctionalBase::UpdateOutputImage(), and cmtk::CongealingFunctional< TXform >::UpdateStandardDeviationByPixel().

size_t cmtk::Console::GetLineWidth (  ) const [inherited]
int cmtk::Threads::GetMaxThreads (  )

Return number of threads allowed per process on this system.

Definition at line 146 of file cmtkThreads.cxx.

References CMTK_MAX_THREADS.

Referenced by cmtk::Threads::GetNumberOfThreads(), and cmtk::Threads::SetNumberOfThreads().

int cmtk::Threads::GetNumberOfProcessors (  )
size_t cmtk::ThreadPool::GetNumberOfThreads (  ) const [inline, inherited]
int cmtk::Threads::GetNumberOfThreads (  )
void cmtk::Console::Indent ( size_t  level = 0 ) [private, inherited]

Perform indentation.

Definition at line 147 of file cmtkConsole.cxx.

template<class TClass , class TParam >
void cmtk::ThreadParameterArray< TClass, TParam >::JoinAsynchronousThreads (  ) [inherited]

Collect (join) threads previously started by RunInParallelAsynchronous.

Definition at line 96 of file cmtkThreadParameterArray.txx.

References cmtk::Threads::GetNumberOfThreads(), and cmtk::StdErr.

bool cmtk::CompressedStream::Open ( const char *  filename ) [inherited]
bool cmtk::CompressedStream::OpenDecompressionPipe ( const char *  filename,
const char *  suffix,
const char *  command,
const char *  compressedSuffix 
) [private, inherited]

Open decompressing pipe.

A suffix is appended to the desired filename, unless the name has has already been given this suffix. Afterwards, a pipe through a user-defined command is opened.

Parameters:
filenameThe name of the file to read through the pipe.
suffixActual suffix of the file to be read through the pipe.
commandThe command to pipe the file through. This should be the name of a program that reads the file with the given name (referenced by "%s" in the command string) and writes its output to stdout.
compressedSuffixThe file suffix corresponding to input files for the given pipe command, e.g. ".gz" for gzip.

Definition at line 150 of file cmtkCompressedStream.cxx.

Referenced by cmtk::CompressedStream::Open().

Console & cmtk::operator<< ( Console &  console,
CommandLine::Exception  e 
)

Output of command line exception.

Definition at line 401 of file cmtkCommandLine.cxx.

References cmtk::CommandLine::Exception::Index, and cmtk::CommandLine::Exception::Message.

CannotBeCopied& cmtk::CannotBeCopied::operator= ( const CannotBeCopied  ) [private, inherited]

Undefined assignment operator.

bool cmtk::CommandLine::Parse ( const int  argc,
const char *  argv[] 
) throw ( ExitException, Self::Exception ) [inherited]
cmtk::CompressedStream::Pipe::Pipe ( const char *  filename,
const char *  command 
) [inherited]

Open new pipe from filename.

Definition at line 50 of file cmtkCompressedStreamPipe.cxx.

References CMTK_FILE_MODE, and cmtk::StdErr.

void cmtk::StackBacktrace::PrintBacktrace ( const int  levels = 0 ) [static, inherited]

Print current stack backtrace.

Parameters:
levelsMaximum number of levels to display (default: 0 = no limit).

Definition at line 67 of file cmtkStackBacktrace.cxx.

Referenced by cmtkStackBacktraceSignalHandler().

void cmtk::Console::printf ( const char *  format,
  ... 
) [inherited]
void cmtk::CommandLine::PrintHelp (  ) const [inherited]

Print help text.

Definition at line 220 of file cmtkCommandLine.cxx.

References cmtk::Console::FormatText(), cmtk::Console::GetLineWidth(), and cmtk::StdErr.

void cmtk::CommandLine::PrintWiki (  ) const [inherited]

Print help text.

Definition at line 326 of file cmtkCommandLine.cxx.

References cmtk::StdOut.

cmtk::ProgressConsole::ProgressConsole ( const std::string &  programName = std::string("") ) [inherited]

Default constructor: connect to progress indicator.

Definition at line 47 of file cmtkProgressConsole.cxx.

References cmtk::ProgressConsole::m_InsideSlicer3, cmtk::ProgressConsole::m_ProgramName, and NULL.

size_t cmtk::CompressedStream::Zlib::Read ( void *  data,
size_t  size,
size_t  count 
) [virtual, inherited]

Read block of data.

Implements cmtk::CompressedStream::ReaderBase.

Definition at line 73 of file cmtkCompressedStreamZlib.cxx.

size_t cmtk::CompressedStream::File::Read ( void *  data,
size_t  size,
size_t  count 
) [virtual, inherited]

Read block of data.

Implements cmtk::CompressedStream::ReaderBase.

Definition at line 75 of file cmtkCompressedStreamFile.cxx.

size_t cmtk::CompressedStream::Pipe::Read ( void *  data,
size_t  size,
size_t  count 
) [virtual, inherited]

Read block of data.

Implements cmtk::CompressedStream::ReaderBase.

Definition at line 112 of file cmtkCompressedStreamPipe.cxx.

int cmtk::FileUtils::RecursiveMkPrefixDir ( const char *  filename,
const int  permissions = 0755 
)

Recursively create all directories on a full filename's prefix.

Returns:
Zero if operation was successful, mkdir() error code otherwise.

Definition at line 80 of file cmtkFileUtils.cxx.

Referenced by cmtk::TypedStream::Open(), cmtk::FileUtils::RecursiveMkDir(), and cmtk::VolumeIO::Write().

void cmtk::CompressedStream::Zlib::Rewind (  ) [virtual, inherited]

Reset read pointer to beginning of stream.

Reimplemented from cmtk::CompressedStream::ReaderBase.

Definition at line 60 of file cmtkCompressedStreamZlib.cxx.

void cmtk::CompressedStream::File::Rewind (  ) [virtual, inherited]

Reset read pointer to beginning of stream.

Reimplemented from cmtk::CompressedStream::ReaderBase.

Definition at line 62 of file cmtkCompressedStreamFile.cxx.

void cmtk::CompressedStream::Pipe::Rewind (  ) [virtual, inherited]

Reset read pointer to beginning of stream.

Reimplemented from cmtk::CompressedStream::ReaderBase.

Definition at line 105 of file cmtkCompressedStreamPipe.cxx.

References cmtk::StdErr.

template<class TParam >
void cmtk::ThreadPool::Run ( TaskFunction  taskFunction,
std::vector< TParam > &  taskParameters,
const size_t  numberOfTasksOverride = 0 
) [inherited]

Run actual worker functions through running threads.

Parameters:
taskFunctionPointer to task function.
taskParametersVector of task parameter blocks, one per task.
numberOfTasksOverrideThis can be used to run a smaller number of tasks than taskParameters.size(), which is useful to allow re-use of larger, allocated vector.

Definition at line 42 of file cmtkThreadPool.txx.

References cmtk::Threads::GetNumberOfThreads(), and cmtk::StdErr.

Referenced by cmtk::UniformDistanceMap< TDistanceDataType >::ComputeEDT(), cmtk::SplineWarpMultiChannelRegistrationFunctional< TMetricFunctional >::Evaluate(), cmtk::SplineWarpCongealingFunctional::Evaluate(), cmtk::GroupwiseRegistrationRMIFunctional< TXform >::Evaluate(), cmtk::CongealingFunctional< TXform >::Evaluate(), cmtk::SplineWarpMultiChannelRegistrationFunctional< TMetricFunctional >::EvaluateWithGradient(), cmtk::ParallelElasticFunctional< VM >::EvaluateWithGradient(), cmtk::SplineWarpXform::GetJacobianConstraint(), cmtk::SplineWarpXform::GetJacobianFoldingConstraint(), cmtk::GroupwiseRegistrationFunctionalXformTemplate< SplineWarpXform >::InterpolateImage(), cmtk::GroupwiseRegistrationFunctionalXformTemplate< AffineXform >::InterpolateImage(), cmtk::GroupwiseRegistrationFunctionalXformTemplate< TXform >::InterpolateImage(), cmtk::UniformVolume::Resample(), cmtk::EntropyMinimizationIntensityCorrectionFunctional< NOrderAdd, NOrderMul >::UpdateBiasFieldAdd(), cmtk::EntropyMinimizationIntensityCorrectionFunctional< NOrderAdd, NOrderMul >::UpdateBiasFieldMul(), cmtk::EntropyMinimizationIntensityCorrectionFunctional< NOrderAdd, NOrderMul >::UpdateBiasFields(), cmtk::EntropyMinimizationIntensityCorrectionFunctionalBase::UpdateOutputImage(), and cmtk::CongealingFunctional< TXform >::UpdateStandardDeviationByPixel().

template<class TClass , class TParam >
void cmtk::ThreadParameterArray< TClass, TParam >::RunInParallelAsynchronous ( ThreadFunction  threadCall ) [inherited]

Run thread function in parallel without joining.

Definition at line 45 of file cmtkThreadParameterArray.txx.

References cmtk::Threads::GetNumberOfThreads(), NULL, and cmtk::StdErr.

template<class TClass , class TParam >
void cmtk::ThreadParameterArray< TClass, TParam >::RunInParallelFIFO ( ThreadFunction  threadCall,
const size_t  numberOfThreadsTotal,
const size_t  firstThreadIdx = 0 
) [inherited]

Run thread functions using a static FIFO scheduler.

Definition at line 158 of file cmtkThreadParameterArray.txx.

References cmtk::Threads::GetNumberOfThreads(), and NULL.

Referenced by cmtk::SplineWarpGroupwiseRegistrationRMIFunctional::EvaluateWithGradient().

void cmtk::Threads::RunThreads ( ThreadFunction  threadCall,
const unsigned  numberOfThreads,
void *const   parameters,
const size_t  parameterSize 
)

Specialized but more hands-on thread scheduling function.

Parameters:
threadCallThread function to be called.
numberOfThreadsNumber of parallel threads. This parameter must not exceed the number of threads set using and returned by SetNumberOfThreads.
parametersPointer to an array of parameter blocks for all parallel threads.
parameterSizeSize in bytes of each thread parameter block in the array pointed to by the previous parameter.

Definition at line 193 of file cmtkThreads.cxx.

References CMTK_MAX_THREADS, cmtk::Threads::GetNumberOfThreads(), and NULL.

Referenced by cmtk::ReformatVolume::GetTransformedReference(), cmtk::ReformatVolume::GetTransformedReferenceJacobianAvg(), cmtk::ThreadParameterArray< TClass, TParam >::RunInParallel(), and cmtk::Threads::RunThreads().

int cmtk::CompressedStream::Zlib::Seek ( const long int  offset,
int  whence 
) [virtual, inherited]

Set filepointer.

If the object represents a pipe with on-the-fly decompression, only the set mode "SEEK_CUR" is supported and will be simulated by successive reading of 8kB data blocks from the pipe.

Parameters:
offsetOffset the file pointer is set to, depending on the value of whence.
whenceFile pointer set mode as defined for fseek.

Reimplemented from cmtk::CompressedStream::ReaderBase.

Definition at line 67 of file cmtkCompressedStreamZlib.cxx.

int cmtk::CompressedStream::File::Seek ( const long int  offset,
int  whence 
) [virtual, inherited]

Set filepointer.

If the object represents a pipe with on-the-fly decompression, only the set mode "SEEK_CUR" is supported and will be simulated by successive reading of 8kB data blocks from the pipe.

Parameters:
offsetOffset the file pointer is set to, depending on the value of whence.
whenceFile pointer set mode as defined for fseek.

Reimplemented from cmtk::CompressedStream::ReaderBase.

Definition at line 69 of file cmtkCompressedStreamFile.cxx.

void cmtk::CommandLine::SetDefaultInfo (  ) [private, inherited]
int cmtk::Threads::SetNumberOfThreads ( const int  numberOfThreads = 0,
const bool  force = false 
)

Set the number of threads to run in parallel.

If the given parameter is less than or equal to zero, the number of threads is set to equal the number of currently available CPUs. This also applies when this function is called without any parameter.

Parameters:
numberOfThreadsNumber of parallel threads to run. This is a maximum value. Particular tasks may execute with less parallel threads than this value.
forceIf this flag is off (default), then the number of parallel threads is limited by the number of available CPUs on the current host. If the flag is true, the limitation is not entirely lifted, but the number of threads is limited by the maximum number of threads that can be created by a process on the current operating system.
Returns:
The actual number of threads that the library was set to.

Definition at line 122 of file cmtkThreads.cxx.

References cmtk::Threads::GetMaxThreads(), cmtk::Threads::GetNumberOfProcessors(), and cmtk::Threads::NumberOfThreads.

Referenced by cmtk::Threads::CheckEnvironment().

Progress::ResultEnum cmtk::Progress::SetProgress ( const double  progress ) [static, inherited]
void cmtk::Progress::SetProgressCurrent ( const double  progress ) [inherited]

Set number of tasks completed.

Definition at line 62 of file cmtkProgress.cxx.

cmtk::StackBacktrace::StackBacktrace (  ) [inherited]

Constructor: register signal handler.

Definition at line 50 of file cmtkStackBacktrace.cxx.

References cmtkStackBacktraceSignalHandler(), and NULL.

void cmtk::ThreadPool::StartThreads (  ) [private, inherited]
int cmtk::CompressedStream::Stat ( const char *  path,
struct stat *const  buf = NULL 
) [static, inherited]

Do stat() on compressed file.

Returns:
-1 if the file does not exist; 0 if the file exists under the given name; 1 if the file exists with an additional suffix corresponding to one of the supported compression schemes, e.g., ".gz"; 2 if the file exists with both its plain name AND at least one compressed suffix. The last case indicates a potential consistency problem because it is not clear, which file should be read.

Definition at line 210 of file cmtkCompressedStream.cxx.

References cmtk::CompressedStream::ArchiveLookup, cmtk::CompressedStream::GetBaseName(), and cmtk::CompressedStream::ArchiveLookupEntry::suffix.

Referenced by cmtk::CompressedStream::Open().

int cmtk::StrCmp ( const char *  s1,
const char *  s2 
)

Safe string comparison.

This function is a wrapper for the standard library's "strcmp" function. This wrapper is safe in that it accepts any combination of NULL and non-NULL pointers to both arguments.

Returns:
0 if the strings pointed to by "s1" and "s2" are equal, a value greater than zero if s1 is greater than s2, and a value smaller than zero if s1 is smaller than s2. NULL pointers are considered smaller than any other string except the NULL pointer itself.

Definition at line 51 of file cmtkStrUtility.cxx.

References NULL.

Referenced by cmtk::TypedStreamStudylist::Read().

const char * cmtk::StrDir ( const char *  path )

Extract directory component from a complete filesystem path.

Parameters:
pathA complete filesystem path.
Returns:
A pointer to a buffer containing the directory component of 'path' as a null-terminated string. This is a static buffer that is only guaranteed to remain unchanged until the next call to one of the functions in the library.

Definition at line 88 of file cmtkStrUtility.cxx.

References cmtk::StrBuffer.

const char * cmtk::StrFName ( const char *  path )

Extract filename component from a complete filesystem path.

Parameters:
pathA complete filesystem path.
Returns:
A pointer to a buffer containing the filename component of 'path' as a null-terminated string. This is a static buffer that is only guaranteed to remain unchanged until the next call to one of the functions in the library.

Definition at line 108 of file cmtkStrUtility.cxx.

References cmtk::StrBuffer.

void cmtk::StrFree ( char *const   s )

Safe deallocation of strings.

The memory pointed to by "s" is freed if "s" is non-NULL. Otherwise, nothing is done.

Definition at line 75 of file cmtkStrUtility.cxx.

Referenced by cmtk::StrReplace().

int cmtk::StrPrefixCmp ( const char *  s,
const char *  prefix 
)

Compare string prefix.

This function tests whether a given string contains another string as its intial character sequence.

Parameters:
sThe string.
prefixThe initial sequence to be tested.
Returns:
A non-zero value is returned if and only if the string 's' starts with the string 'prefix'.

Definition at line 80 of file cmtkStrUtility.cxx.

std::string cmtk::StrReplace ( const std::string &  str,
const std::map< std::string, std::string > &  rules,
const bool  multiple = false 
)

Replace string components.

Todo:
This is highly unsafe, since we're not checking for infinite loops and the likes. We should really work on this sometimes... or be REALLY carefull.

Definition at line 124 of file cmtkStrUtility.cxx.

void cmtk::StrReplace ( char *&  s1,
const char *  s2 
)

Replace a string.

The null-terminated string "s2" is duplicated and replaces the string "s1". If "s1" is non-NULL when this function is called, the memory pointed to by it is freed first. If "s2" is NULL, "s1" is set to NULL, too.

Definition at line 66 of file cmtkStrUtility.cxx.

References NULL, and cmtk::StrFree().

int cmtk::CompressedStream::Zlib::Tell (  ) const [virtual, inherited]

Return number of bytes read from stream.

Implements cmtk::CompressedStream::ReaderBase.

Definition at line 95 of file cmtkCompressedStreamZlib.cxx.

int cmtk::CompressedStream::File::Tell (  ) const [virtual, inherited]

Return number of bytes read from stream.

Implements cmtk::CompressedStream::ReaderBase.

Definition at line 97 of file cmtkCompressedStreamFile.cxx.

int cmtk::CompressedStream::Pipe::Tell (  ) const [virtual, inherited]

Return number of bytes read from stream.

Implements cmtk::CompressedStream::ReaderBase.

Definition at line 134 of file cmtkCompressedStreamPipe.cxx.

void cmtk::ThreadPool::ThreadFunction ( const size_t  threadIdx ) [inherited]
cmtk::ThreadPool::ThreadPool ( const size_t  nThreads = 0 ) [inherited]

Constructor: create a pool of nThreads running threads.

Parameters:
nThreadsNumber of threads to create for this pool. By default, the number of threads created is the current number of available threads, i.e., typically the number of CPUs minus the number of currently running threads, if any.

Definition at line 43 of file cmtkThreadPool.cxx.

References cmtk::ThreadPool::GetNumberOfThreads(), cmtk::ThreadPool::m_NumberOfThreads, and cmtk::ThreadPool::m_ThreadArgs.

const char * cmtk::MountPoints::Translate ( const char *  path ) [static, inherited]

Perform directory substitutions.

Parameters:
pathThe original path before substitions.
Returns:
A pointer to a static buffer holding the path after all substitions have been done. The buffer is guaranteed to remain unchanged until and only until the next time Translate() is called.
See also:
CMTK_MOUNTPOINTSVAR

Definition at line 49 of file cmtkMountPoints.cxx.

References cmtk::CMTK_MOUNTPOINTSVAR, cmtk::IGS_MOUNTPOINTSVAR, and NULL.

Referenced by cmtk::AffineRegistrationCommandLine::AffineRegistrationCommandLine(), and cmtk::ImagePairAffineRegistrationCommandLine::ImagePairAffineRegistrationCommandLine().

Progress::ResultEnum cmtk::ProgressConsole::UpdateProgress (  ) [virtual, inherited]
static std::string cmtk::CommandLineTypeTraits< std::vector< std::string > >::ValueToString ( const std::vector< std::string > *  value ) [inline, static, inherited]

Convert a value of this type to string.

Reimplemented from cmtk::CommandLineTypeTraitsBase< std::vector< std::string > >.

Definition at line 135 of file cmtkCommandLineTypeTraits.h.

static std::string cmtk::CommandLineTypeTraits< const char * >::ValueToString ( const char *const *  value ) [inline, static, inherited]

Convert a value of this type to string.

Reimplemented from cmtk::CommandLineTypeTraitsBase< const char * >.

Definition at line 91 of file cmtkCommandLineTypeTraits.h.

static std::string cmtk::CommandLineTypeTraits< std::vector< std::string > >::ValueToStringMinimal ( const std::vector< std::string > *  value ) [inline, static, inherited]

Convert a value of this type to string with minimal added markup (for XML output).

Reimplemented from cmtk::CommandLineTypeTraitsBase< std::vector< std::string > >.

Definition at line 144 of file cmtkCommandLineTypeTraits.h.

static std::string cmtk::CommandLineTypeTraits< const char * >::ValueToStringMinimal ( const char *const *  value ) [inline, static, inherited]

Convert a value of this type to string with minimal added markup (for XML output).

Reimplemented from cmtk::CommandLineTypeTraitsBase< const char * >.

Definition at line 101 of file cmtkCommandLineTypeTraits.h.

template<class T>
static std::string cmtk::CommandLineTypeTraitsBase< T >::ValueToStringMinimal ( const T *  value ) [inline, static, inherited]

Convert a value of this type to string with minimal added markup (for XML output).

Reimplemented in cmtk::CommandLineTypeTraits< const char * >, and cmtk::CommandLineTypeTraits< std::vector< std::string > >.

Definition at line 56 of file cmtkCommandLineTypeTraits.h.

void cmtk::CommandLine::WriteXML (  ) const [inherited]

Write XML self description according to Slice3 execution model.

See also:

Definition at line 78 of file cmtkCommandLineXML.cxx.

References cmtk::cmtkWhitespaceWriteMiniXML().

cmtk::CompressedStream::Zlib::Zlib ( const char *  filename ) [inherited]

Open new stream from filename.

Definition at line 44 of file cmtkCompressedStreamZlib.cxx.

References CMTK_FILE_MODE.

cmtk::CannotBeCopied::~CannotBeCopied (  ) [inline, protected, inherited]

Default destructor.

Definition at line 55 of file cmtkCannotBeCopied.h.

cmtk::CommandLine::~CommandLine (  ) [inherited]

Destructor: spit out a warning if there are unused extra arguments on the command line.

Definition at line 58 of file cmtkCommandLine.cxx.

References cmtk::CommandLine::ArgC, cmtk::CommandLine::ArgV, cmtk::CommandLine::Index, and cmtk::StdErr.

cmtk::CompressedStream::~CompressedStream (  ) [inherited]

Dispose stream object.

Definition at line 86 of file cmtkCompressedStream.cxx.

References cmtk::CompressedStream::Close().

cmtk::ProgressConsole::~ProgressConsole (  ) [virtual, inherited]
cmtk::ThreadPool::~ThreadPool (  ) [inherited]

Destructor: stop all running threads.

Definition at line 122 of file cmtkThreadPool.cxx.

References cmtk::ThreadPool::EndThreads().


Variable Documentation

const CompressedStream::ArchiveLookupEntry cmtk::CompressedStream::ArchiveLookup [static, private, inherited]
Initial value:
 {








  {".Z",    "gunzip -c %s"},
  {".gz",   "gzip -cd %s"},
  {".bz",   "bzip -Q -cd %s"},
  {".bz2",  "bzip2 -cd %s"},
  {".lzma", "lzma -cd %s"},
  {".xz",   "xz -cd %s"},

  { NULL,   NULL} 
}

The suffix-to-archiver assignment table.

Definition at line 197 of file cmtkCompressedStream.h.

Referenced by cmtk::CompressedStream::GetBaseName(), cmtk::CompressedStream::Open(), and cmtk::CompressedStream::Stat().

char cmtk::MountPoints::Buffer [static, private, inherited]

Static buffer holding paths after pattern substitution.

Definition at line 89 of file cmtkMountPoints.h.

const char* const cmtk::CMTK_MOUNTPOINTSVAR = "CMTK_MOUNTPOINTS"

Name of the shell variable defining the directory translation.

This variable can be set to contain a list of substitution rules. Every ruls has the form "target=source", where all appearances of "source" are to be replaced by "target" in all filesystem paths. Several of these rules may be concatenated by "," -- an example is "j:=/cdrom,k:=/home". This results in all paths relative to "/cdrom" being relative to "j:" after substituion. The same holds for "k:" and "/home". This example could be used to read data on a PC mounting Unix filesystems to network drives. Conversely, the Unix box would define "/cdrom=j:,/home=k:" in order to be able to read data written by this PC.

See also:
MountPoints

Definition at line 59 of file cmtkMountPoints.h.

Referenced by cmtk::MountPoints::Translate().

int cmtk::StackBacktrace::ExitCode = 1 [static, inherited]

Exit code.

This defaults to "1" but can be set to "0" for CTest testing.

Definition at line 70 of file cmtkStackBacktrace.h.

Referenced by cmtkStackBacktraceSignalHandler().

const char* const cmtk::IGS_MOUNTPOINTSVAR = "IGS_MOUNTPOINTS"

Legacy environment variable.

This is what CMTK_MOUNTPOINTS used to be called in an earlier life. We continue to check for it so we don't break older scripts.

Definition at line 65 of file cmtkMountPoints.h.

Referenced by cmtk::MountPoints::Translate().

bool cmtk::ThreadPool::m_ContinueThreads [private, inherited]

Flag whether threads should continue or terminate.

When the thread pool is destructed, this is set to "true" to wind down all running threads gracefully.

Definition at line 220 of file cmtkThreadPool.h.

Referenced by cmtk::ThreadPool::EndThreads(), and cmtk::ThreadPool::ThreadFunction().

Index of thread in pool.

Definition at line 172 of file cmtkThreadPool.h.

size_t cmtk::ThreadPool::m_NextTaskIndex [private, inherited]

Index of next available task.

Definition at line 186 of file cmtkThreadPool.h.

Referenced by cmtk::ThreadPool::ThreadFunction().

MutexLock cmtk::ThreadPool::m_NextTaskIndexLock [private, inherited]

Lock to ensure exclusive access to the task index counter.

Definition at line 189 of file cmtkThreadPool.h.

Referenced by cmtk::ThreadPool::ThreadFunction().

size_t cmtk::ThreadPool::m_NumberOfTasks [private, inherited]

Total number of tasks to execute.

Definition at line 183 of file cmtkThreadPool.h.

Referenced by cmtk::ThreadPool::ThreadFunction().

size_t cmtk::ThreadPool::m_NumberOfThreads [private, inherited]
TaskFunction cmtk::ThreadPool::m_TaskFunction [private, inherited]

The current task function.

Definition at line 192 of file cmtkThreadPool.h.

Referenced by cmtk::ThreadPool::ThreadFunction().

std::vector<void*> cmtk::ThreadPool::m_TaskParameters [private, inherited]

Task function parameter pointers.

Definition at line 195 of file cmtkThreadPool.h.

Referenced by cmtk::ThreadPool::ThreadFunction().

ThreadSemaphore cmtk::ThreadPool::m_TaskWaitingSemaphore [private, inherited]

Semaphore to signal running threads when tasks are waiting.

Definition at line 177 of file cmtkThreadPool.h.

Referenced by cmtk::ThreadPool::EndThreads(), and cmtk::ThreadPool::ThreadFunction().

std::vector<Self::ThreadPoolArg> cmtk::ThreadPool::m_ThreadArgs [private, inherited]

Thread function parameters.

Definition at line 198 of file cmtkThreadPool.h.

Referenced by cmtk::ThreadPool::StartThreads(), and cmtk::ThreadPool::ThreadPool().

bool cmtk::ThreadPool::m_ThreadsRunning [private, inherited]

Flag whether threads for this pool are running.

Definition at line 214 of file cmtkThreadPool.h.

Referenced by cmtk::ThreadPool::EndThreads(), and cmtk::ThreadPool::StartThreads().

ThreadSemaphore cmtk::ThreadPool::m_ThreadWaitingSemaphore [private, inherited]

Semaphore that threads use to signal when tasks they are ready for the next task.

Definition at line 180 of file cmtkThreadPool.h.

Referenced by cmtk::ThreadPool::ThreadFunction().

template<class T>
SmartConstPointer< T > cmtk::SmartConstPointer< T >::Null [static, inherited]
template<class T>
SmartPointer< T > cmtk::SmartPointer< T >::Null [static, inherited]

Null object.

Reimplemented from cmtk::SmartConstPointer< T >.

Definition at line 77 of file cmtkSmartPtr.h.

Progress * cmtk::Progress::ProgressInstance = 0 [static, private, inherited]

Instance of a derived class that handles GUI interaction etc.

Definition at line 121 of file cmtkProgress.h.

Console cmtk::StdErr

Standard error output for the library.

Definition at line 137 of file cmtkConsole.h.

Referenced by cmtk::ActiveDeformationModel< W >::ActiveDeformationModel(), cmtk::MultiChannelHistogramRegistrationFunctional< TDataType, TInterpolator, THashKeyType, NBitsPerChannel >::AddFloatingChannel(), cmtk::ImageXformDB::AddImagePairXform(), cmtk::MultiChannelHistogramRegistrationFunctional< TDataType, TInterpolator, THashKeyType, NBitsPerChannel >::AddReferenceChannel(), cmtk::ImageXformDB::AddRefinedXform(), cmtk::AffineRegistrationCommandLine::AffineRegistrationCommandLine(), cmtk::MakeInitialAffineTransformation::AlignDirectionVectors(), cmtk::GroupwiseRegistrationFunctionalBase::AllocateStorage(), cmtk::ImageOperationApplyMask::Apply(), cmtk::VolumeFromStudy::AssembleVolume(), cmtk::ThreadParameterArray< TClass, TParam >::CancelAsynchronousThreads(), cmtk::VolumeFromSlices::CheckImage(), cmtkRegistrationCallbackDispatchSIGINT(), cmtk::MathUtil::ComputeEigensystem(), cmtk::MathUtil::ComputeEigenvalues(), cmtk::ActiveShapeModel::Construct(), cmtk::VolumeFromSlices::ConstructVolume(), cmtk::CreateEntropyMinimizationIntensityCorrectionFunctional(), cmtk::CreateEntropyMinimizationIntensityCorrectionFunctionalDevice(), cmtk::Matrix4x4< T >::Decompose(), cmtk::Matrix3x3< T >::Decompose(), cmtk::ElasticRegistrationCommandLine::ElasticRegistrationCommandLine(), cmtk::ImagePairNonrigidRegistration::EnterResolution(), cmtk::ElasticRegistration::EnterResolution(), cmtk::SQLite::Exec(), cmtk::DataGrid::GetDataMirrored(), cmtk::AnatomicalOrientation::GetOrientationFromDirections(), cmtk::Functional::GetParamVector(), cmtk::VoxelRegistration::ImagePreprocessor::GetProcessedImage(), cmtk::ImagePairRegistration::ImagePreprocessor::GetProcessedImage(), cmtk::ReformatVolume::GetTransformedReference(), cmtk::ReformatVolume::GetTransformedReferenceJacobianAvg(), cmtk::ImagePairAffineRegistrationCommandLine::ImagePairAffineRegistrationCommandLine(), cmtk::ImagePairNonrigidRegistrationCommandLine::ImagePairNonrigidRegistrationCommandLine(), cmtk::SimpleLevelsetCommandLineBase::Init(), cmtk::SplineWarpMultiChannelRegistrationFunctional< TMetricFunctional >::InitTransformation(), cmtk::AffineMultiChannelRegistrationFunctional< TMultiChannelMetricFunctional >::InitTransformation(), cmtk::ThreadParameterArray< TClass, TParam >::JoinAsynchronousThreads(), cmtk::XformListIO::MakeFromStringList(), cmtk::ImagePairNonrigidRegistration::MakeFunctional(), cmtk::ImagePairAffineRegistration::MakeFunctional(), cmtk::ImageOperationMedianFilter::New(), cmtk::ImageOperationDownsample::New(), cmtk::CompressedStream::Open(), cmtk::TypedStream::Open(), cmtk::operator>>(), cmtk::BestDirectionOptimizer::Optimize(), cmtk::InverseInterpolationVolumeReconstructionBase::Optimize(), cmtk::ImagePairAffineRegistrationCommandLine::OutputResult(), cmtk::ElasticRegistrationCommandLine::OutputResult(), cmtk::AffineRegistrationCommandLine::OutputResult(), cmtk::ImageSymmetryPlaneCommandLineBase::ParseCommandLine(), cmtk::CompressedStream::Pipe::Pipe(), cmtk::ImagePairSimilarityJointHistogram::PrescaleData(), cmtk::ScalarImage::Print(), cmtk::DataGrid::Print(), cmtk::AffineXform::Print(), cmtk::CommandLine::KeyToActionSingle::PrintHelp(), cmtk::CommandLine::KeyToActionEnum::PrintHelp(), cmtk::CommandLine::PrintHelp(), cmtk::SQLite::Query(), cmtk::XformIO::Read(), cmtk::VolumeIO::Read(), cmtk::TypedStreamStudylist::Read(), cmtk::ResourceFile::Read(), cmtk::PGM::Read(), cmtk::DICOM::Read(), cmtk::ScalarImageIO::ReadAnalyze(), cmtk::VolumeFromFile::ReadAnalyzeHdr(), cmtk::VolumeFromFile::ReadBioRad(), cmtk::VolumeIO::ReadGrid(), cmtk::VolumeIO::ReadGridOriented(), cmtk::ImageOperationApplyMask::ReadMaskFile(), cmtk::VolumeFromFile::ReadNifti(), cmtk::VolumeIO::ReadOriented(), cmtk::AtlasSegmentation::RegisterAffine(), cmtk::AtlasSegmentation::RegisterSpline(), cmtk::CompressedStream::Pipe::Rewind(), cmtk::ThreadPool::Run(), cmtk::ImageSymmetryPlaneCommandLineBase::Run(), cmtk::ThreadParameterArray< TClass, TParam >::RunInParallelAsynchronous(), cmtk::Functional::SetParamVector(), cmtk::QtTriplanarWindow::slotSwitchToStudy(), cmtk::ThreadPool::StartThreads(), cmtk::SplineWarpGroupwiseRegistrationRMIFunctional::UpdateActiveControlPoints(), cmtk::SplineWarpCongealingFunctional::UpdateActiveControlPoints(), cmtk::RegistrationDatabaseUpdater::UpdateDB(), cmtk::ProgressConsole::UpdateProgress(), cmtk::SplineWarpMultiChannelRegistrationFunctional< TMetricFunctional >::UpdateTransformationFixedControlPoints(), cmtk::XformIO::Write(), cmtk::VolumeIO::Write(), cmtk::ResourceFile::Write(), cmtk::ScalarImageIO::WriteAnalyze(), cmtk::VolumeFromFile::WriteAnalyzeHdr(), cmtk::GroupwiseRegistrationOutput::WriteAverageImage(), cmtk::VolumeFromFile::WriteMetaImage(), cmtk::VolumeFromFile::WriteNifti(), and cmtk::CommandLine::~CommandLine().

Console cmtk::StdOut
char cmtk::StrBuffer[PATH_MAX] [static]

Definition at line 85 of file cmtkStrUtility.cxx.

Referenced by cmtk::StrDir(), and cmtk::StrFName().

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines