DeformableSurfaceDebugger.h
1 /*
2  * Medical Image Registration ToolKit (MIRTK)
3  *
4  * Copyright 2013-2015 Imperial College London
5  * Copyright 2013-2015 Andreas Schuh
6  *
7  * Licensed under the Apache License, Version 2.0 (the "License");
8  * you may not use this file except in compliance with the License.
9  * You may obtain a copy of the License at
10  *
11  * http://www.apache.org/licenses/LICENSE-2.0
12  *
13  * Unless required by applicable law or agreed to in writing, software
14  * distributed under the License is distributed on an "AS IS" BASIS,
15  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16  * See the License for the specific language governing permissions and
17  * limitations under the License.
18  */
19 
20 #ifndef MIRTK_DeformableSurfaceDebugger_H
21 #define MIRTK_DeformableSurfaceDebugger_H
22 
23 #include "mirtk/Observer.h"
24 
25 
26 namespace mirtk {
27 
28 
29 // Forward declaration of observed object
30 class DeformableSurfaceModel;
31 
32 
33 /**
34  * Writes intermediate surfaces to the current working directory
35  *
36  * This object observes the optimizer of the deformable surface model and must
37  * therefore be attached to the respective LocalOptimizer instance
38  * (typically EulerMethod or a subclass of it).
39  */
41 {
42  mirtkObjectMacro(DeformableSurfaceDebugger);
43 
44  // ---------------------------------------------------------------------------
45  // Attributes
46 
47  /// Prefix for output file names
48  mirtkPublicAttributeMacro(string, Prefix);
49 
50  /// Iteration counter
51  mirtkPublicAttributeMacro(int, Iteration);
52 
53  /// Reference to the deformable surface model
54  mirtkPublicAggregateMacro(const DeformableSurfaceModel, Model);
55 
56  /// Write intermediate results only every n gradient steps
57  mirtkPublicAttributeMacro(int, Interval);
58 
59  // ---------------------------------------------------------------------------
60  // Construction/Destruction
61 private:
62 
63  /// Copy construction
64  /// \note Intentionally not implemented.
66 
67  /// Assignment operator
68  /// \note Intentionally not implemented.
70 
71 public:
72 
73  /// Constructor
74  DeformableSurfaceDebugger(const DeformableSurfaceModel * = NULL, const char * = "");
75 
76  /// Destructor
78 
79  /// Handle event and print message to output stream
80  void HandleEvent(Observable *, Event, const void *);
81 
82 };
83 
84 
85 } // namespace mirtk
86 
87 #endif // MIRTK_DeformableSurfaceDebugger_H
void HandleEvent(Observable *, Event, const void *)
Handle event and print message to output stream.
Definition: IOConfig.h:41
Event
Events that can be observed.
Definition: Event.h:32
~DeformableSurfaceDebugger()
Destructor.