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:
95 using Superclass = itk::Command;
96 using Pointer = itk::SmartPointer<Self>;
97 using ConstPointer = itk::SmartPointer<const Self>;
98
100 itkTypeMacro(ProgressCommand, Command);
101 itkNewMacro(Self);
102
104 using ProcessObjectType = itk::ProcessObject;
105 using ProcessObjectPointer = ProcessObjectType::Pointer;
106
108 virtual void
109 SetUpdateFrequency(const unsigned long numberOfVoxels, const unsigned long numberOfUpdates);
110
112 virtual void
113 ConnectObserver(itk::ProcessObject * filter);
114
116 void
117 DisconnectObserver(itk::ProcessObject * filter);
118
120 void
121 Execute(itk::Object * caller, const itk::EventObject & event) override;
122
123 void
124 Execute(const itk::Object * caller, const itk::EventObject & event) override;
125
129 void
130 PrintProgress(const float progress) const;
131
137 void
138 UpdateAndPrintProgress(const unsigned long currentVoxelNumber) const;
139
141 itkSetStringMacro(StartString);
142 itkGetStringMacro(StartString);
143
145 itkSetStringMacro(EndString);
146 itkGetStringMacro(EndString);
147
149 itkGetConstReferenceMacro(StreamOutputIsConsole, bool);
150
151 static Pointer
152 CreateAndSetUpdateFrequency(unsigned long numberOfVoxels);
153
154 static Pointer
155 CreateAndConnect(itk::ProcessObject &);
156
157protected:
160
163
164private:
166 std::string m_StartString;
167 std::string m_EndString;
168
171 unsigned long m_Tag;
174
176 unsigned long m_NumberOfVoxels;
177 unsigned long m_NumberOfUpdates;
178};
179
180} // end namespace elastix
181
182#endif // end #ifndef elxProgressCommand_h
A specialized Command object for updating the progress of a filter.
void PrintProgress(const float progress) const
itk::ProcessObject ProcessObjectType
virtual void SetUpdateFrequency(const unsigned long numberOfVoxels, const unsigned long numberOfUpdates)
itk::SmartPointer< Self > Pointer
void Execute(itk::Object *caller, const itk::EventObject &event) override
void Execute(const itk::Object *caller, const itk::EventObject &event) override
static Pointer CreateAndSetUpdateFrequency(unsigned long numberOfVoxels)
ProcessObjectType::Pointer ProcessObjectPointer
itk::SmartPointer< const Self > ConstPointer
void UpdateAndPrintProgress(const unsigned long currentVoxelNumber) const
static Pointer CreateAndConnect(itk::ProcessObject &)
ProcessObjectPointer m_ObservedProcessObject
void DisconnectObserver(itk::ProcessObject *filter)
virtual void ConnectObserver(itk::ProcessObject *filter)


Generated on 2023-01-13 for elastix by doxygen 1.9.6 elastix logo