ITK 6.0.0
Insight Toolkit
 
Loading...
Searching...
No Matches
itkSegmentBonesInMicroCTFilter.h
Go to the documentation of this file.
1/*=========================================================================
2 *
3 * Copyright NumFOCUS
4 *
5 * Licensed under the Apache License, Version 2.0 (the "License");
6 * you may not use this file except in compliance with the License.
7 * You may obtain a copy of the License at
8 *
9 * https://www.apache.org/licenses/LICENSE-2.0.txt
10 *
11 * Unless required by applicable law or agreed to in writing, software
12 * distributed under the License is distributed on an "AS IS" BASIS,
13 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 * See the License for the specific language governing permissions and
15 * limitations under the License.
16 *
17 *=========================================================================*/
18#ifndef itkSegmentBonesInMicroCTFilter_h
19#define itkSegmentBonesInMicroCTFilter_h
20
23
24
25namespace itk
26{
27
41template <typename TInputImage, typename TOutputImage>
42class SegmentBonesInMicroCTFilter : public ImageToImageFilter<TInputImage, TOutputImage>
43{
44public:
45 ITK_DISALLOW_COPY_AND_MOVE(SegmentBonesInMicroCTFilter);
46
47 using InputImageType = TInputImage;
48 using OutputImageType = TOutputImage;
49 using InputPixelType = typename InputImageType::PixelType;
50 using OutputPixelType = typename OutputImageType::PixelType;
51
57
59 itkOverrideGetNameOfClassMacro(SegmentBonesInMicroCTFilter);
60
62 itkNewMacro(Self);
63
66 itkGetConstMacro(CorticalBoneThickness, float);
67 itkSetMacro(CorticalBoneThickness, float);
68
74 itkGetConstMacro(WholeBones, bool);
75 itkSetMacro(WholeBones, bool);
76
77protected:
79 ~SegmentBonesInMicroCTFilter() override = default;
80
81 void
82 PrintSelf(std::ostream & os, Indent indent) const override;
83
84 static constexpr unsigned int Dimension = TInputImage::ImageDimension;
86 using RegionType = typename TOutputImage::RegionType;
87 using IndexType = typename TOutputImage::IndexType;
88 using SizeType = typename TOutputImage::SizeType;
90
91 // split the binary mask into components and remove the small islands
92 typename TOutputImage::Pointer
93 ConnectedComponentAnalysis(typename TOutputImage::Pointer labelImage, IdentifierType & numberOfLabels);
94
95 // compute Signed Distance Field of a binary image
97 SDF(typename TOutputImage::Pointer labelImage);
98
99 // morphological dilation by thresholding the distance field
100 typename TOutputImage::Pointer
101 SDFDilate(typename TOutputImage::Pointer labelImage, double radius);
102
103 // morphological erosion by thresholding the distance field
104 typename TOutputImage::Pointer
105 SDFErode(typename TOutputImage::Pointer labelImage, double radius);
106
107 // zero-pad an image
108 typename TOutputImage::Pointer
109 ZeroPad(typename TOutputImage::Pointer labelImage, Size<Dimension> padSize);
110
111 void
112 GenerateData() override;
113
114private:
116 bool m_WholeBones = true;
117
118#ifdef ITK_USE_CONCEPT_CHECKING
120 itkConceptMacro(InputAndOutputMustHaveSameDimension,
122#endif
123};
124} // namespace itk
125
126#ifndef ITK_MANUAL_INSTANTIATION
127# include "itkSegmentBonesInMicroCTFilter.hxx"
128#endif
129
130#endif // itkSegmentBonesInMicroCTFilter
Binarize an input image by thresholding.
Templated n-dimensional image class.
Definition itkImage.h:89
SmartPointer< Self > Pointer
Definition itkImage.h:96
Control indentation during Print() invocation.
Definition itkIndent.h:53
void PrintSelf(std::ostream &os, Indent indent) const override
SegmentBonesInMicroCTFilter< InputImageType, OutputImageType > Self
BinaryThresholdImageFilter< RealImageType, OutputImageType > FloatThresholdType
~SegmentBonesInMicroCTFilter() override=default
TOutputImage::Pointer ConnectedComponentAnalysis(typename TOutputImage::Pointer labelImage, IdentifierType &numberOfLabels)
TOutputImage::Pointer SDFErode(typename TOutputImage::Pointer labelImage, double radius)
TOutputImage::Pointer SDFDilate(typename TOutputImage::Pointer labelImage, double radius)
TOutputImage::Pointer ZeroPad(typename TOutputImage::Pointer labelImage, Size< Dimension > padSize)
RealImageType::Pointer SDF(typename TOutputImage::Pointer labelImage)
typename InputImageType::PixelType InputPixelType
typename OutputImageType::PixelType OutputPixelType
Implements transparent reference counting.
#define itkConceptMacro(name, conceptType)
Compile-time check that a template argument satisfies an itk::Concept.
The "itk" namespace contains all Insight Segmentation and Registration Toolkit (ITK) classes....
SizeValueType IdentifierType
Definition itkIntTypes.h:95
#define itkSetMacro(name, type)
Represent a n-dimensional size (bounds) of a n-dimensional image.
Definition itkSize.h:70