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
25namespace elastix
26{
27
90class ProgressCommand : public itk::Command
91{
92public:
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 void Execute( itk::Object * caller, const itk::EventObject & event ) override;
121
122 void Execute( const itk::Object * caller, const itk::EventObject & event ) override;
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 static Pointer CreateAndSetUpdateFrequency(unsigned long numberOfVoxels);
148
149 static Pointer CreateAndConnect(itk::ProcessObject&);
150
151protected:
152
155
158
159private:
160
162 std::string m_StartString;
163 std::string m_EndString;
164
167 unsigned long m_Tag;
170
172 unsigned long m_NumberOfVoxels;
173 unsigned long m_NumberOfUpdates;
174
175};
176
177} // end namespace elastix
178
179#endif // end #ifndef __elxProgressCommand_h
A specialized Command object for updating the progress of a filter.
virtual void UpdateAndPrintProgress(const unsigned long &currentVoxelNumber) const
itk::ProcessObject ProcessObjectType
itk::SmartPointer< const Self > ConstPointer
virtual void SetUpdateFrequency(const unsigned long numberOfVoxels, const unsigned long numberOfUpdates)
void Execute(itk::Object *caller, const itk::EventObject &event) override
virtual void PrintProgress(const float &progress) const
void Execute(const itk::Object *caller, const itk::EventObject &event) override
static Pointer CreateAndSetUpdateFrequency(unsigned long numberOfVoxels)
itk::SmartPointer< Self > Pointer
static Pointer CreateAndConnect(itk::ProcessObject &)
virtual void DisconnectObserver(itk::ProcessObject *filter)
ProcessObjectPointer m_ObservedProcessObject
ProcessObjectType::Pointer ProcessObjectPointer
virtual void ConnectObserver(itk::ProcessObject *filter)


Generated on 1667476801 for elastix by doxygen 1.9.4 elastix logo