ScalarFunctionToImage.h
1 /*
2  * Medical Image Registration ToolKit (MIRTK)
3  *
4  * Copyright 2008-2015 Imperial College London
5  * Copyright 2008-2015 Daniel Rueckert, Julia Schnabel
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_ScalarFunctionToImage_H
21 #define MIRTK_ScalarFunctionToImage_H
22 
23 #include "mirtk/Object.h"
24 #include "mirtk/GenericImage.h"
25 #include "mirtk/ScalarFunction.h"
26 
27 
28 namespace mirtk {
29 
30 
31 /**
32  * Scalar function to image filter.
33  *
34  * This class uses a scalar function to produce an image as output. The
35  * filter loops through each voxel of the output image and calculates its
36  * intensity as the value of the scalar function as a function of spatial
37  * location.
38  */
39 template <class VoxelType>
41 {
42  mirtkObjectMacro(ScalarFunctionToImage);
43 
44  // ---------------------------------------------------------------------------
45  // Attributes
46 
47  /// Input for the filter
48  mirtkPublicAggregateMacro(ScalarFunction, Input);
49 
50  /// Output for the filter
51  mirtkPublicAggregateMacro(GenericImage<VoxelType>, Output);
52 
53  /// Whether to print debug information
54  mirtkPublicAttributeMacro(bool, DebugFlag);
55 
56  /// Flag to use world or image coordinates for scalar function evaluation
57  mirtkPublicAttributeMacro(bool, UseWorldCoordinates);
58 
59  // ---------------------------------------------------------------------------
60  // Construction/Destruction
61 
62 public:
63 
64  /// Constructor (using world coordinates by default)
65  ScalarFunctionToImage(bool = true);
66 
67  /// Deconstuctor
68  virtual ~ScalarFunctionToImage();
69 
70  /// Run the filter on entire image
71  virtual void Run();
72 
73 };
74 
75 
76 } // namespace mirtk
77 
78 #endif // MIRTK_ScalarFunctionToImage_H
virtual void Run()
Run the filter on entire image.
Definition: IOConfig.h:41
ScalarFunctionToImage(bool=true)
Constructor (using world coordinates by default)
virtual ~ScalarFunctionToImage()
Deconstuctor.