ITK 6.0.0
Insight Toolkit
 
Loading...
Searching...
No Matches
itkLandmarkAtlasSegmentationFilter.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 itkLandmarkAtlasSegmentationFilter_h
19#define itkLandmarkAtlasSegmentationFilter_h
20
23#include "itkAffineTransform.h"
25
26
27namespace itk
28{
29
40template <typename TInputImage, typename TOutputImage>
41class LandmarkAtlasSegmentationFilter : public ImageToImageFilter<TInputImage, TOutputImage>
42{
43public:
44 ITK_DISALLOW_COPY_AND_MOVE(LandmarkAtlasSegmentationFilter);
45
46 static constexpr unsigned Dimension = TInputImage::ImageDimension;
47
48 using InputImageType = TInputImage;
49 using OutputImageType = TOutputImage;
50 using InputPixelType = typename InputImageType::PixelType;
51 using OutputPixelType = typename OutputImageType::PixelType;
52
58
60 itkOverrideGetNameOfClassMacro(LandmarkAtlasSegmentationFilter);
61
63 itkNewMacro(Self);
64
65
69 itkSetObjectMacro(InputLabels, TOutputImage);
70 itkGetModifiableObjectMacro(InputLabels, TOutputImage);
71
73 itkSetObjectMacro(AtlasLabels, TOutputImage);
74 itkGetModifiableObjectMacro(AtlasLabels, TOutputImage);
75
76 using PointType = typename TOutputImage::PointType;
77 using LandmarksType = std::vector<PointType>;
78
80 virtual void
82 {
83 if (this->m_InputLandmarks != landmarks)
84 {
85 this->m_InputLandmarks = landmarks;
86 this->Modified();
87 }
88 }
89 itkGetConstReferenceMacro(InputLandmarks, LandmarksType);
90
92 virtual void
94 {
95 if (this->m_AtlasLandmarks != landmarks)
96 {
97 this->m_AtlasLandmarks = landmarks;
98 this->Modified();
99 }
100 }
101 itkGetConstReferenceMacro(AtlasLandmarks, LandmarksType);
102
104
106 itkGetConstObjectMacro(LandmarksTransform, RigidTransformType);
107
108
109protected:
111 {
113 Self::SetPrimaryInputName("InputImage");
114 Self::AddRequiredInputName("AtlasImage", 1);
115 }
117
118 void
119 PrintSelf(std::ostream & os, Indent indent) const override;
120
121 // we need to override this in order to allow
122 // the inputs to cover different physical space
123 void
124 VerifyInputInformation() const override
125 {}
126
128 using RegionType = typename TOutputImage::RegionType;
129 using IndexType = typename TOutputImage::IndexType;
130 using SizeType = typename TOutputImage::SizeType;
131
132 void
133 GenerateData() override;
134
135private:
136 typename TOutputImage::Pointer m_InputLabels = nullptr;
137 typename TOutputImage::Pointer m_AtlasLabels = nullptr;
138
141
143
144#ifdef ITK_USE_CONCEPT_CHECKING
145 itkConceptMacro(InputAndOutputMustHaveSameDimension,
147#endif
148};
149} // namespace itk
150
151#ifndef ITK_MANUAL_INSTANTIATION
152# include "itkLandmarkAtlasSegmentationFilter.hxx"
153#endif
154
155#endif // itkLandmarkAtlasSegmentationFilter
Templated n-dimensional image class.
Definition itkImage.h:89
Control indentation during Print() invocation.
Definition itkIndent.h:53
void PrintSelf(std::ostream &os, Indent indent) const override
typename OutputImageType::PixelType OutputPixelType
virtual void SetAtlasLandmarks(const LandmarksType landmarks)
~LandmarkAtlasSegmentationFilter() override=default
virtual void SetInputLandmarks(const LandmarksType landmarks)
void VerifyInputInformation() const override
Verifies that the input images occupy the same physical space and the each index is at the same physi...
LandmarkAtlasSegmentationFilter< InputImageType, OutputImageType > Self
virtual void Modified() const
virtual void SetPrimaryInputName(const DataObjectIdentifierType &key)
bool AddRequiredInputName(const DataObjectIdentifierType &)
Define a required named input and optionally associate it with a numbered index.
virtual void SetNumberOfRequiredInputs(DataObjectPointerArraySizeType)
Set the number of required indexed inputs.
Implements transparent reference counting.
VersorRigid3DTransform of a vector space (e.g. space coordinates)
#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....