go home Home | Main Page | Modules | Namespace List | Class Hierarchy | Alphabetical List | Data Structures | File List | Namespace Members | Data Fields | Globals | Related Pages
elxProgressCommand.h
Go to the documentation of this file.
1 /*======================================================================
2 
3  This file is part of the elastix software.
4 
5  Copyright (c) University Medical Center Utrecht. All rights reserved.
6  See src/CopyrightElastix.txt or http://elastix.isi.uu.nl/legal.php for
7  details.
8 
9  This software is distributed WITHOUT ANY WARRANTY; without even
10  the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
11  PURPOSE. See the above copyright notices for more information.
12 
13 ======================================================================*/
14 
15 #ifndef __elxProgressCommand_h
16 #define __elxProgressCommand_h
17 
18 #include "itkProcessObject.h"
19 #include "itkCommand.h"
20 
21 namespace elastix
22 {
23  using namespace itk;
24 
87 class ProgressCommand : public Command
88 {
89 public:
90 
93  typedef Command Superclass;
94  typedef itk::SmartPointer<Self> Pointer;
95  typedef itk::SmartPointer<const Self> ConstPointer;
96 
98  itkTypeMacro( ProgressCommand, Command );
99  itkNewMacro( Self );
100 
102  typedef ProcessObject ProcessObjectType;
103  typedef ProcessObjectType::Pointer ProcessObjectPointer;
104 
106  virtual void SetUpdateFrequency(
107  const unsigned long numberOfVoxels,
108  const unsigned long numberOfUpdates );
109 
111  virtual void ConnectObserver( ProcessObject * filter );
112 
114  virtual void DisconnectObserver( ProcessObject * filter );
115 
117  virtual void Execute( Object *caller, const EventObject &event );
118  virtual void Execute( const Object *caller, const EventObject &event );
119 
123  virtual void PrintProgress( const float & progress ) const;
124 
130  virtual void UpdateAndPrintProgress( const unsigned long & currentVoxelNumber ) const;
131 
133  itkSetStringMacro( StartString );
134  itkGetStringMacro( StartString );
135 
137  itkSetStringMacro( EndString );
138  itkGetStringMacro( EndString );
139 
141  itkGetConstReferenceMacro( StreamOutputIsConsole, bool );
142 
143 protected:
144 
146  ProgressCommand();
147 
149  virtual ~ProgressCommand();
150 
151 private:
152 
154  std::string m_StartString;
155  std::string m_EndString;
156 
159  unsigned long m_Tag;
162 
164  unsigned long m_NumberOfVoxels;
165  unsigned long m_NumberOfUpdates;
166 
167 }; // end class ProgressCommand
168 
169 } // end namespace elastix
170 
171 #endif // end #ifndef __elxProgressCommand_h
itk::SmartPointer< const Self > ConstPointer
itk::SmartPointer< Self > Pointer
ProcessObjectPointer m_ObservedProcessObject
A specialized Command object for updating the progress of a filter.
ProcessObjectType::Pointer ProcessObjectPointer


Generated on 05-12-2013 for elastix by doxygen 1.8.5 elastix logo