ITK  5.0.0
Insight Segmentation and Registration Toolkit
itkImageToMeshFilter.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 #ifndef itkImageToMeshFilter_h
19 #define itkImageToMeshFilter_h
20 
21 #include "itkMeshSource.h"
22 
23 namespace itk
24 {
35 template< typename TInputImage, typename TOutputMesh >
36 class ITK_TEMPLATE_EXPORT ImageToMeshFilter:public MeshSource< TOutputMesh >
37 {
38 public:
39  ITK_DISALLOW_COPY_AND_ASSIGN(ImageToMeshFilter);
40 
46 
48  itkTypeMacro(ImageToMeshFilter, MeshSource);
49 
52  using Superclass::MakeOutput;
53  DataObject::Pointer MakeOutput(DataObjectPointerArraySizeType idx) override;
54 
56  using InputImageType = TInputImage;
57  using InputImagePointer = typename InputImageType::Pointer;
58  using InputImageConstPointer = typename InputImageType::ConstPointer;
60  using InputImagePixelType = typename InputImageType::PixelType;
61 
63  using OutputMeshType = TOutputMesh;
64  using OutputMeshPointer = typename OutputMeshType::Pointer;
65 
67  using Superclass::SetInput;
68  void SetInput(unsigned int idx, const InputImageType *input);
69  void SetInput(const InputImageType *input)
70  {
71  this->SetInput(0, input);
72  }
74 
76  const InputImageType * GetInput(unsigned int idx);
78  {
79  return this->GetInput(0);
80  }
82 
84  OutputMeshType * GetOutput();
85 
87  void GenerateOutputInformation() override;
88 
89 protected:
91  ~ImageToMeshFilter() override = default;
92 };
93 } // end namespace itk
94 
95 #ifndef ITK_MANUAL_INSTANTIATION
96 #include "itkImageToMeshFilter.hxx"
97 #endif
98 
99 #endif
Light weight base class for most itk classes.
DataObjectPointerArray::size_type DataObjectPointerArraySizeType
void SetInput(const InputImageType *input)
typename InputImageType::RegionType InputImageRegionType
typename OutputMeshType::Pointer OutputMeshPointer
const InputImageType * GetInput()
typename InputImageType::PixelType InputImagePixelType
Base class for all process objects that output mesh data.
Definition: itkMeshSource.h:49
ImageToMeshFilter is the base class for all process objects that output Mesh data and require image d...
typename InputImageType::Pointer InputImagePointer
typename InputImageType::ConstPointer InputImageConstPointer