18#ifndef sitkProcessObject_h
19#define sitkProcessObject_h
36template <
typename T,
unsigned int NVectorDimension>
357 virtual unsigned long
385 template <
class TImageType>
386 static typename TImageType::ConstPointer
389 typename TImageType::ConstPointer itkImage =
dynamic_cast<const TImageType *
>(img.
GetITKBase());
391 if (itkImage.IsNull())
395 <<
"\" to ITK image of dimension: " << TImageType::GetImageDimension() <<
" and pixel type: \""
401 template <
class TImageType>
409 template <
class TPixelType,
410 unsigned int VImageDimension,
411 unsigned int VLength,
412 template <
typename,
unsigned int>
class TVector>
420 return Image(out.GetPointer());
423 template <
unsigned int VImageDimension,
unsigned int VLength,
template <
unsigned int>
class TVector>
431 return Image(out.GetPointer());
443 template <
typename T>
444 static std::ostream &
450 static std::ostream &
452 static std::ostream &
454 static std::ostream &
An implementation of the Command design pattern for callback.
The Image class for SimpleITK.
unsigned int GetDimension() const
itk::DataObject * GetITKBase()
std::string GetPixelIDTypeAsString() const
unsigned long AddObserverToActiveProcessObject(EventCommand &e)
static void GlobalWarningDisplayOn()
virtual unsigned int GetNumberOfWorkUnits() const
static void SetGlobalDefaultDebug(bool debugFlag)
virtual int AddCommand(itk::simple::EventEnum event, itk::simple::Command &cmd)
Add a Command Object to observer the event.
static unsigned int GetGlobalDefaultNumberOfThreads()
Set/Get the default threader used for process objects.
virtual void PreUpdate(itk::ProcessObject *p)
static Image CastITKToImage(itk::Image< TVector< VLength >, VImageDimension > *img)
static void SetGlobalDefaultNumberOfThreads(unsigned int n)
virtual void RemoveITKObserver(EventCommand &e)
static std::ostream & ToStringHelper(std::ostream &os, const unsigned char &v)
virtual float GetProgress() const
An Active Measurement of the progress of execution.
static std::ostream & ToStringHelper(std::ostream &os, const char &v)
static void GlobalDefaultDebugOn()
static std::ostream & ToStringHelper(std::ostream &os, const signed char &v)
static double GetGlobalDefaultDirectionTolerance()
Access the global tolerance to determine congruent spaces.
virtual int AddCommand(itk::simple::EventEnum event, const std::function< void()> &func)
Directly add a callback to observe an event.
void RemoveObserverFromActiveProcessObject(EventCommand &e)
std::list< EventCommand > m_Commands
static void SetGlobalDefaultCoordinateTolerance(double)
Access the global tolerance to determine congruent spaces.
static TImageType::ConstPointer CastImageToITK(const Image &img)
static std::ostream & ToStringHelper(std::ostream &os, const T &v)
static bool SetGlobalDefaultThreader(const std::string &threader)
Set/Get the default threader used for process objects.
itk::ProcessObject * m_ActiveProcess
float m_ProgressMeasurement
static bool GetGlobalDefaultDebug()
virtual bool HasCommand(itk::simple::EventEnum event) const
Query of this object has any registered commands for event.
unsigned int m_NumberOfWorkUnits
virtual void OnActiveProcessDelete()
virtual void SetDebug(bool debugFlag)
static bool GetGlobalWarningDisplay()
virtual unsigned int GetNumberOfThreads() const
static void SetGlobalWarningDisplay(bool flag)
virtual void onCommandDelete(const itk::simple::Command *cmd) noexcept
virtual void SetNumberOfThreads(unsigned int n)
static void GlobalWarningDisplayOff()
virtual std::string ToString() const
virtual void SetNumberOfWorkUnits(unsigned int n)
friend class itk::simple::Command
virtual void RemoveAllCommands()
Remove all registered commands.
static const itk::EventObject & GetITKEventObject(EventEnum e)
virtual unsigned long AddITKObserver(const itk::EventObject &, itk::Command *)
virtual std::string GetName() const =0
static void SetGlobalDefaultDirectionTolerance(double)
Access the global tolerance to determine congruent spaces.
virtual bool GetDebug() const
static void GlobalDefaultDebugOff()
static Image CastITKToImage(TImageType *img)
virtual itk::ProcessObject * GetActiveProcess()
static double GetGlobalDefaultCoordinateTolerance()
Access the global tolerance to determine congruent spaces.
static std::string GetGlobalDefaultThreader()
Set/Get the default threader used for process objects.
static Image CastITKToImage(itk::Image< TVector< TPixelType, VLength >, VImageDimension > *img)
unsigned int m_NumberOfThreads
const std::string SITKCommon_EXPORT GetPixelIDValueAsString(PixelIDValueType type)
SITKCommon_HIDDEN itk::VectorImage< TPixelType, NImageDimension >::Pointer GetVectorImageFromImage(itk::Image< itk::Vector< TPixelType, NLength >, NImageDimension > *img, bool transferOwnership=false)
Utility methods to convert between itk image types efficiently by sharing the buffer between the inpu...
EventEnum
Events which can be observed from ProcessObject.
#define SITKCommon_EXPORT
#define sitkExceptionMacro(x)
bool operator==(const EventCommand &o) const
bool operator<(const EventCommand &o) const
EventCommand(EventEnum e, Command *c)