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  * Copyright UMC Utrecht and contributors
4  *
5  * Licensed under the Apache License, Version 2.0 (the "License");
6  * you may not use this file except in compliance with the License.
7  * You may obtain a copy of the License at
8  *
9  * http://www.apache.org/licenses/LICENSE-2.0.txt
10  *
11  * Unless required by applicable law or agreed to in writing, software
12  * distributed under the License is distributed on an "AS IS" BASIS,
13  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14  * See the License for the specific language governing permissions and
15  * limitations under the License.
16  *
17  *=========================================================================*/
18 
19 #ifndef __elxProgressCommand_h
20 #define __elxProgressCommand_h
21 
22 #include "itkProcessObject.h"
23 #include "itkCommand.h"
24 
25 namespace elastix
26 {
27 
90 class ProgressCommand : public itk::Command
91 {
92 public:
93 
96  typedef itk::Command Superclass;
97  typedef itk::SmartPointer< Self > Pointer;
98  typedef itk::SmartPointer< const Self > ConstPointer;
99 
101  itkTypeMacro( ProgressCommand, Command );
102  itkNewMacro( Self );
103 
105  typedef itk::ProcessObject ProcessObjectType;
106  typedef ProcessObjectType::Pointer ProcessObjectPointer;
107 
109  virtual void SetUpdateFrequency(
110  const unsigned long numberOfVoxels,
111  const unsigned long numberOfUpdates );
112 
114  virtual void ConnectObserver( itk::ProcessObject * filter );
115 
117  virtual void DisconnectObserver( itk::ProcessObject * filter );
118 
120  virtual void Execute( itk::Object * caller, const itk::EventObject & event );
121 
122  virtual void Execute( const itk::Object * caller, const itk::EventObject & event );
123 
127  virtual void PrintProgress( const float & progress ) const;
128 
134  virtual void UpdateAndPrintProgress( const unsigned long & currentVoxelNumber ) const;
135 
137  itkSetStringMacro( StartString );
138  itkGetStringMacro( StartString );
139 
141  itkSetStringMacro( EndString );
142  itkGetStringMacro( EndString );
143 
145  itkGetConstReferenceMacro( StreamOutputIsConsole, bool );
146 
147 protected:
148 
150  ProgressCommand();
151 
153  virtual ~ProgressCommand();
154 
155 private:
156 
158  std::string m_StartString;
159  std::string m_EndString;
160 
163  unsigned long m_Tag;
165  ProcessObjectPointer m_ObservedProcessObject;
166 
168  unsigned long m_NumberOfVoxels;
169  unsigned long m_NumberOfUpdates;
170 
171 };
172 
173 } // end namespace elastix
174 
175 #endif // end #ifndef __elxProgressCommand_h
virtual void UpdateAndPrintProgress(const unsigned long &currentVoxelNumber) const
itk::ProcessObject ProcessObjectType
virtual void Execute(itk::Object *caller, const itk::EventObject &event)
virtual void SetUpdateFrequency(const unsigned long numberOfVoxels, const unsigned long numberOfUpdates)
virtual void DisconnectObserver(itk::ProcessObject *filter)
virtual void PrintProgress(const float &progress) const
virtual void ConnectObserver(itk::ProcessObject *filter)
ProcessObjectPointer m_ObservedProcessObject
itk::SmartPointer< Self > Pointer
A specialized Command object for updating the progress of a filter.
ProcessObjectType::Pointer ProcessObjectPointer
itk::SmartPointer< const Self > ConstPointer


Generated on 04-09-2015 for elastix by doxygen 1.8.9.1 elastix logo