ITK  6.0.0
Insight Toolkit
itkFastMarchingImageToNodePairContainerAdaptor.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 
19 #ifndef itkFastMarchingImageToNodePairContainerAdaptor_h
20 #define itkFastMarchingImageToNodePairContainerAdaptor_h
21 
22 #include "itkObject.h"
23 #include "itkFastMarchingTraits.h"
24 
25 namespace itk
26 {
49 template <typename TInput, typename TOutput, typename TImage>
50 class ITK_TEMPLATE_EXPORT FastMarchingImageToNodePairContainerAdaptor : public Object
51 {
52 public:
53  ITK_DISALLOW_COPY_AND_MOVE(FastMarchingImageToNodePairContainerAdaptor);
54 
56  using Superclass = Object;
59 
60 
62  itkNewMacro(Self);
63 
65  itkOverrideGetNameOfClassMacro(FastMarchingImageToNodePairContainerAdaptor);
66 
68  using NodePairType = typename Traits::NodePairType;
69  using NodePairContainerType = typename Traits::NodePairContainerType;
70  using NodePairContainerPointer = typename Traits::NodePairContainerPointer;
71  using LabelType = typename Traits::LabelType;
72  using OutputPixelType = typename Traits::OutputPixelType;
73 
74  using ImageType = TImage;
75  using ImagePointer = typename ImageType::Pointer;
77  using ImagePixelType = typename ImageType::PixelType;
78 
79  static constexpr unsigned int ImageDimension = Traits::ImageDimension;
80 
84  void
85  SetAliveImage(const ImageType * iImage);
86  itkGetConstObjectMacro(AliveImage, ImageType);
87 
91  void
92  SetTrialImage(const ImageType * iImage);
93  itkGetConstObjectMacro(TrialImage, ImageType);
94 
105  void
106  SetForbiddenImage(const ImageType * iImage);
107  itkGetConstObjectMacro(ForbiddenImage, ImageType);
108 
109  itkSetMacro(IsForbiddenImageBinaryMask, bool);
110  itkGetConstMacro(IsForbiddenImageBinaryMask, bool);
111  itkBooleanMacro(IsForbiddenImageBinaryMask);
112 
115  GetAlivePoints();
116 
119  GetTrialPoints();
120 
123  GetForbiddenPoints();
124 
125  itkSetMacro(AliveValue, OutputPixelType);
126  itkGetConstMacro(AliveValue, OutputPixelType);
127 
128  itkSetMacro(TrialValue, OutputPixelType);
129  itkGetConstMacro(TrialValue, OutputPixelType);
130 
132  void
133  Update();
134 
135 protected:
138 
140  ~FastMarchingImageToNodePairContainerAdaptor() override = default;
141 
142  ImageConstPointer m_AliveImage{};
143  ImageConstPointer m_TrialImage{};
144  ImageConstPointer m_ForbiddenImage{};
145 
146  NodePairContainerPointer m_AlivePoints{};
147  NodePairContainerPointer m_TrialPoints{};
148  NodePairContainerPointer m_ForbiddenPoints{};
149 
150  OutputPixelType m_AliveValue{};
151  OutputPixelType m_TrialValue{};
152 
153  bool m_IsForbiddenImageBinaryMask{ false };
154 
155  virtual void
156  GenerateData();
157 
159  void
160  SetPointsFromImage(const ImageType * image, const LabelType & iLabel, const OutputPixelType & iValue);
161 };
162 } // namespace itk
163 
164 #ifndef ITK_MANUAL_INSTANTIATION
165 # include "itkFastMarchingImageToNodePairContainerAdaptor.hxx"
166 #endif
167 
168 #endif // itkFastMarchingImageToNodePairContainerAdaptor_h
itk::FastMarchingImageToNodePairContainerAdaptor::ImageConstPointer
typename ImageType::ConstPointer ImageConstPointer
Definition: itkFastMarchingImageToNodePairContainerAdaptor.h:76
Pointer
SmartPointer< Self > Pointer
Definition: itkAddImageFilter.h:93
itk::FastMarchingImageToNodePairContainerAdaptor::OutputPixelType
typename Traits::OutputPixelType OutputPixelType
Definition: itkFastMarchingImageToNodePairContainerAdaptor.h:72
itk::FastMarchingImageToNodePairContainerAdaptor::NodePairContainerPointer
typename Traits::NodePairContainerPointer NodePairContainerPointer
Definition: itkFastMarchingImageToNodePairContainerAdaptor.h:70
itk::FastMarchingImageToNodePairContainerAdaptor::NodePairType
typename Traits::NodePairType NodePairType
Definition: itkFastMarchingImageToNodePairContainerAdaptor.h:68
ConstPointer
SmartPointer< const Self > ConstPointer
Definition: itkAddImageFilter.h:94
itk::FastMarchingImageToNodePairContainerAdaptor
Convenient adaptor class which converts Image into FastMarching::NodePairContainerType used for initi...
Definition: itkFastMarchingImageToNodePairContainerAdaptor.h:50
itk::SmartPointer< Self >
itkFastMarchingTraits.h
itk::FastMarchingImageToNodePairContainerAdaptor::ImageType
TImage ImageType
Definition: itkFastMarchingImageToNodePairContainerAdaptor.h:74
itk::FastMarchingImageToNodePairContainerAdaptor::LabelType
typename Traits::LabelType LabelType
Definition: itkFastMarchingImageToNodePairContainerAdaptor.h:71
itk::LightObject
Light weight base class for most itk classes.
Definition: itkLightObject.h:55
itk::FastMarchingTraits
Base class traits to be used by the FastMarchingBase.
Definition: itkFastMarchingTraits.h:110
itk::FastMarchingImageToNodePairContainerAdaptor::ImagePixelType
typename ImageType::PixelType ImagePixelType
Definition: itkFastMarchingImageToNodePairContainerAdaptor.h:77
itk::FastMarchingImageToNodePairContainerAdaptor::ImagePointer
typename ImageType::Pointer ImagePointer
Definition: itkFastMarchingImageToNodePairContainerAdaptor.h:75
itkObject.h
itk
The "itk" namespace contains all Insight Segmentation and Registration Toolkit (ITK) classes....
Definition: itkAnatomicalOrientation.h:29
itk::Object
Base class for most ITK classes.
Definition: itkObject.h:61
itk::FastMarchingImageToNodePairContainerAdaptor::NodePairContainerType
typename Traits::NodePairContainerType NodePairContainerType
Definition: itkFastMarchingImageToNodePairContainerAdaptor.h:69