GenericRegistrationDebugger.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_GenericRegistrationDebugger_H
21 #define MIRTK_GenericRegistrationDebugger_H
22 
23 #include "mirtk/Observer.h"
24 
25 #include "mirtk/Array.h"
26 
27 
28 namespace mirtk {
29 
30 
31 class ImageSimilarity;
32 class GenericRegistrationFilter;
33 
34 
35 /**
36  * Writes intermediate registration data to the current working directory
37  *
38  * Usage:
39  * \code
40  * GenericRegistrationFilter registration;
41  * GenericRegistrationDebugger debugger;
42  * registration.AddObserver(debugger);
43  * \endcode
44  */
46 {
47  mirtkObjectMacro(GenericRegistrationDebugger);
48 
49  // ---------------------------------------------------------------------------
50  // Attributes
51 
52  /// Prefix for output file names
53  mirtkPublicAttributeMacro(string, Prefix);
54 
55  /// Whether to use level specific file name prefix
56  mirtkPublicAttributeMacro(bool, LevelPrefix);
57 
58  /// Current level
59  mirtkAttributeMacro(int, Level);
60 
61  /// Current iteration
62  mirtkAttributeMacro(int, Iteration);
63 
64  /// Current line iteration
65  mirtkAttributeMacro(int, LineIteration);
66 
67  /// Similarity terms
68  mirtkAttributeMacro(Array<ImageSimilarity *>, Similarity);
69 
70  /// Reference to the registration filter object
71  mirtkAggregateMacro(GenericRegistrationFilter, Registration);
72 
73  // ---------------------------------------------------------------------------
74  // Construction/Destruction
75 private:
76 
77  /// Copy construction
78  /// \note Intentionally not implemented.
80 
81  /// Assignment operator
82  /// \note Intentionally not implemented.
84 
85 public:
86 
87  /// Constructor
88  GenericRegistrationDebugger(const char * = "");
89 
90  /// Destructor
92 
93  /// Handle event and print message to output stream
94  void HandleEvent(Observable *, Event, const void *);
95 
96 };
97 
98 
99 } // namespace mirtk
100 
101 #endif // MIRTK_GenericRegistrationDebugger_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