-
Notifications
You must be signed in to change notification settings - Fork 19
/
itkMedialThicknessImageFilter3D.h
105 lines (87 loc) · 3.85 KB
/
itkMedialThicknessImageFilter3D.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
/*=========================================================================
*
* Copyright NumFOCUS
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0.txt
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*=========================================================================*/
#ifndef itkMedialThicknessImageFilter3D_h
#define itkMedialThicknessImageFilter3D_h
#include "itkImageToImageFilter.h"
#include "itkBinaryThinningImageFilter3D.h"
#include "itkSignedMaurerDistanceMapImageFilter.h"
#include "itkMaskImageFilter.h"
#include "itkMultiplyImageFilter.h"
namespace itk
{
/** \class MedialThicknessImageFilter3D
*
* \brief This filter computes the medial thickness of a 3D input image.
*
* The input is assumed to be a binary image. All non-zero valued voxels
* are set to 1 internally to simplify the computation. The filter will
* extract a one-pixel-wide skeleton of the object and compute the distance
* to the object edge. This distance multiplied by 2 is considered the
* local thickness of the object (thickness = center-to-boundary x 2).
*
* \ingroup MathematicalMorphologyImageFilters Thickness3D
*/
template <typename TInputImage, typename TOutputImage>
class MedialThicknessImageFilter3D : public ImageToImageFilter<TInputImage, TOutputImage>
{
public:
ITK_DISALLOW_COPY_AND_MOVE(MedialThicknessImageFilter3D);
static constexpr unsigned int InputImageDimension = TInputImage::ImageDimension;
static constexpr unsigned int OutputImageDimension = TOutputImage::ImageDimension;
using InputImageType = TInputImage;
using OutputImageType = TOutputImage;
using InputPixelType = typename InputImageType::PixelType;
using OutputPixelType = typename OutputImageType::PixelType;
/** Standard class typedefs. */
using Self = MedialThicknessImageFilter3D<InputImageType, OutputImageType>;
using Superclass = ImageToImageFilter<InputImageType, OutputImageType>;
using Pointer = SmartPointer<Self>;
using ConstPointer = SmartPointer<const Self>;
/** Run-time type information. */
itkTypeMacro(MedialThicknessImageFilter3D, ImageToImageFilter);
/** Standard New macro. */
itkNewMacro(Self);
protected:
/** Composite sub-filters typedefs. */
using DistanceImageFilterType = SignedMaurerDistanceMapImageFilter<TInputImage, TOutputImage>;
using ThinningImageFilterType = BinaryThinningImageFilter3D<TInputImage, TInputImage>;
using MaskImageFilterType = MaskImageFilter<TOutputImage, TInputImage, TOutputImage>;
using MultiplyImageFilterType = MultiplyImageFilter<TOutputImage, TOutputImage, TOutputImage>;
/** Composite sub-filters members. */
typename DistanceImageFilterType::Pointer m_DistanceFilter;
typename ThinningImageFilterType::Pointer m_ThinningFilter;
typename MaskImageFilterType::Pointer m_MaskFilter;
typename MultiplyImageFilterType::Pointer m_MultiplyFilter;
MedialThicknessImageFilter3D();
~MedialThicknessImageFilter3D() override = default;
void
PrintSelf(std::ostream & os, Indent indent) const override;
using OutputRegionType = typename OutputImageType::RegionType;
void
GenerateData() override;
private:
#ifdef ITK_USE_CONCEPT_CHECKING
// Add concept checking such as
// itkConceptMacro( FloatingPointPixel, ( itk::Concept::IsFloatingPoint< typename InputImageType::PixelType > ) );
#endif
};
} // namespace itk
#ifndef ITK_MANUAL_INSTANTIATION
# include "itkMedialThicknessImageFilter3D.hxx"
#endif
#endif // itkMedialThicknessImageFilter3D