Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015 #ifndef __elxProgressCommand_h
00016 #define __elxProgressCommand_h
00017
00018 #include "itkProcessObject.h"
00019 #include "itkCommand.h"
00020
00021 namespace elastix
00022 {
00023 using namespace itk;
00024
00087 class ProgressCommand : public Command
00088 {
00089 public:
00090
00092 typedef ProgressCommand Self;
00093 typedef Command Superclass;
00094 typedef itk::SmartPointer<Self> Pointer;
00095 typedef itk::SmartPointer<const Self> ConstPointer;
00096
00098 itkTypeMacro( ProgressCommand, Command );
00099 itkNewMacro( Self );
00100
00102 typedef ProcessObject ProcessObjectType;
00103 typedef ProcessObjectType::Pointer ProcessObjectPointer;
00104
00106 virtual void SetUpdateFrequency(
00107 const unsigned long numberOfVoxels,
00108 const unsigned long numberOfUpdates );
00109
00111 virtual void ConnectObserver( ProcessObject * filter );
00112
00114 virtual void DisconnectObserver( ProcessObject * filter );
00115
00117 virtual void Execute( Object *caller, const EventObject &event );
00118 virtual void Execute( const Object *caller, const EventObject &event );
00119
00123 virtual void PrintProgress( const float & progress ) const;
00124
00130 virtual void UpdateAndPrintProgress( const unsigned long & currentVoxelNumber ) const;
00131
00133 itkSetStringMacro( StartString );
00134 itkGetStringMacro( StartString );
00135
00137 itkSetStringMacro( EndString );
00138 itkGetStringMacro( EndString );
00139
00141 itkGetConstReferenceMacro( StreamOutputIsConsole, bool );
00142
00143 protected:
00144
00146 ProgressCommand();
00147
00149 virtual ~ProgressCommand();
00150
00151 private:
00152
00154 std::string m_StartString;
00155 std::string m_EndString;
00156
00158 bool m_StreamOutputIsConsole;
00159 unsigned long m_Tag;
00160 bool m_TagIsSet;
00161 ProcessObjectPointer m_ObservedProcessObject;
00162
00164 unsigned long m_NumberOfVoxels;
00165 unsigned long m_NumberOfUpdates;
00166
00167 };
00168
00169 }
00170
00171 #endif // end #ifndef __elxProgressCommand_h