ITK  5.0.0
Insight Segmentation and Registration Toolkit
itkFastMarchingImageToNodePairContainerAdaptor.h
Go to the documentation of this file.
1 /*=========================================================================
2  *
3  * Copyright Insight Software Consortium
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  * http://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 >
51  public Object
52  {
53 public:
54  ITK_DISALLOW_COPY_AND_ASSIGN(FastMarchingImageToNodePairContainerAdaptor);
55 
60 
61 
63  itkNewMacro(Self);
64 
67 
69  using NodePairType = typename Traits::NodePairType;
70  using NodePairContainerType = typename Traits::NodePairContainerType;
71  using NodePairContainerPointer = typename Traits::NodePairContainerPointer;
72  using LabelType = typename Traits::LabelType;
73  using OutputPixelType = typename Traits::OutputPixelType;
74 
75  using ImageType = TImage;
76  using ImagePointer = typename ImageType::Pointer;
77  using ImageConstPointer = typename ImageType::ConstPointer;
78  using ImagePixelType = typename ImageType::PixelType;
79 
80  static constexpr unsigned int ImageDimension = Traits::ImageDimension;
81 
85  void SetAliveImage( const ImageType* iImage );
86 
90  void SetTrialImage( const ImageType* iImage );
91 
102  void SetForbiddenImage( const ImageType* iImage );
103 
104  itkSetMacro( IsForbiddenImageBinaryMask, bool );
105  itkBooleanMacro( IsForbiddenImageBinaryMask );
106 
108  NodePairContainerType* GetAlivePoints();
109 
111  NodePairContainerType* GetTrialPoints();
112 
114  NodePairContainerType* GetForbiddenPoints();
115 
116  itkSetMacro( AliveValue, OutputPixelType );
117  itkSetMacro( TrialValue, OutputPixelType );
118 
120  void Update();
121 
122 protected:
123 
126 
128  ~FastMarchingImageToNodePairContainerAdaptor() override = default;
129 
133 
137 
140 
141  bool m_IsForbiddenImageBinaryMask{ false };
142 
143  virtual void GenerateData();
144 
146  void
147  SetPointsFromImage( const ImageType* image, const LabelType& iLabel,
148  const OutputPixelType& iValue );
149  };
150 }
151 
152 #ifndef ITK_MANUAL_INSTANTIATION
153 #include "itkFastMarchingImageToNodePairContainerAdaptor.hxx"
154 #endif
155 
156 #endif // itkFastMarchingImageToNodePairContainerAdaptor_h
Light weight base class for most itk classes.
Convenient adaptor class which converts Image into FastMarching::NodePairContainerType used for initi...
Base class traits to be used by the FastMarchingBase.
Base class for most ITK classes.
Definition: itkObject.h:60