HistogramMatching.h
1 /*
2  * Medical Image Registration ToolKit (MIRTK)
3  *
4  * Copyright 2013-2017 Imperial College London
5  *
6  * Licensed under the Apache License, Version 2.0 (the "License");
7  * you may not use this file except in compliance with the License.
8  * You may obtain a copy of the License at
9  *
10  * http://www.apache.org/licenses/LICENSE-2.0
11  *
12  * Unless required by applicable law or agreed to in writing, software
13  * distributed under the License is distributed on an "AS IS" BASIS,
14  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15  * See the License for the specific language governing permissions and
16  * limitations under the License.
17  */
18 
19 #ifndef MIRTK_HistogramMatching_H
20 #define MIRTK_HistogramMatching_H
21 
22 #include "mirtk/ImageToImage.h"
23 
24 
25 namespace mirtk {
26 
27 
28 /**
29  * Match histogram of image to match distribution of reference image
30  *
31  * Nyul, L.G., Udupa, J.K., Xuan Zhang, "New variants of a method of MRI scale standardization",
32  * IEEE TMI, vol.19, no.2, pp.143-150, Feb. 2000 (http://dx.doi.org/10.1109/42.836373)
33  *
34  * \note Source code adapted from an implementation by Vladimir Fonov in EZminc (https://github.com/vfonov/EZminc)
35  * \note Only the foreground intensities of the input images are considered.
36  */
37 template <class TVoxel>
38 class HistogramMatching : public ImageToImage<TVoxel>
39 {
40  mirtkInPlaceImageFilterMacro(HistogramMatching, TVoxel);
41 
42  /// Reference image
43  mirtkPublicAggregateMacro(const ImageType, Reference);
44 
45  /// Number of histogram bins
46  mirtkPublicAttributeMacro(int, NumberOfBins);
47 
48  /// Number of linear histogram rescaling intervals
49  mirtkPublicAttributeMacro(int, NumberOfSteps);
50 
51  /// Cut off value
52  mirtkPublicAttributeMacro(double, CutOff);
53 
54 public:
55 
56  /// Constructor
58 
59  /// Run filter on entire image
60  virtual void Run();
61 
62 protected:
63 
64  /// Initialize the filter. This function must be called by any derived
65  /// filter class to perform some initialize tasks.
66  virtual void Initialize();
67 };
68 
69 
70 } // namespace mirtk
71 
72 #endif // MIRTK_HistogramMatching_H
HistogramMatching()
Constructor.
Definition: IOConfig.h:41
virtual void Initialize()
virtual void Run()
Run filter on entire image.