ITK  4.13.0
Insight Segmentation and Registration Toolkit
itkImageToRectilinearFEMObjectFilter.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 itkImageToRectilinearFEMObjectFilter_h
20 #define itkImageToRectilinearFEMObjectFilter_h
21 
22 #include "vnl/vnl_vector.h"
23 #include "itkFEMObject.h"
24 #include "itkProcessObject.h"
25 
26 namespace itk
27 {
28 namespace fem
29 {
42 template <typename TInputImage>
43 class ITK_TEMPLATE_EXPORT ImageToRectilinearFEMObjectFilter : public ProcessObject
44 {
45 public:
51 
53  itkNewMacro(Self);
54 
57 
58  itkStaticConstMacro(NDimensions, unsigned int, TInputImage::ImageDimension);
59 
61  typedef TInputImage InputImageType;
62  typedef typename InputImageType::Pointer ImagePointer;
63  typedef typename InputImageType::ConstPointer ImageConstPointer;
64  typedef typename InputImageType::RegionType ImageRegionType;
68 
74 
78  // typedef itk::fem::Element2DC0LinearQuadrilateral QuadElementBaseType;
79  // typedef itk::fem::Element3DC0LinearHexahedron HexElementBaseType;
82 
83 #ifdef ITK_USE_CONCEPT_CHECKING
84  // Begin concept checking
85 // itkConceptMacro(SameDimensionOrMinusOne,
86 // (Concept::SameDimensionOrMinusOne<NDimensions, 3>));
87 // End concept checking
88 #endif
89 
93  itkGetMacro(PixelsPerElement, vnl_vector<unsigned int> );
94  itkSetMacro(PixelsPerElement, vnl_vector<unsigned int> );
95  void SetPixelsPerElement( unsigned int numPixels )
96  {
97  this->m_PixelsPerElement.fill( numPixels );
98  }
100 
102  itkGetMacro(NumberOfElements, vnl_vector<unsigned int> );
103 
105  itkGetMacro(Material, MaterialPointerType);
106  itkSetMacro(Material, MaterialPointerType);
108 
110  itkGetMacro(Element, ElementBasePointerType);
111  itkSetMacro(Element, ElementBasePointerType);
113 
115  using Superclass::SetInput;
116  void SetInput( InputImageType *image);
117 
118  void SetInput( unsigned int, InputImageType *image);
119 
120  InputImageType * GetInput();
121 
122  InputImageType * GetInput(unsigned int idx);
123 
127  using Superclass::MakeOutput;
128  virtual DataObjectPointer MakeOutput(DataObjectPointerArraySizeType idx) ITK_OVERRIDE;
129 
143  FEMObjectType * GetOutput();
144 
145  FEMObjectType * GetOutput(unsigned int idx);
146 
147 protected:
149  virtual ~ImageToRectilinearFEMObjectFilter() ITK_OVERRIDE {}
150  virtual void PrintSelf(std::ostream& os, Indent indent) const ITK_OVERRIDE;
151 
153  virtual void GenerateData() ITK_OVERRIDE;
154 
155  void Generate2DRectilinearMesh();
156 
157  void Generate3DRectilinearMesh();
158 
159 private:
160  ITK_DISALLOW_COPY_AND_ASSIGN(ImageToRectilinearFEMObjectFilter);
161 
162  vnl_vector<unsigned int> m_NumberOfElements;
163  vnl_vector<unsigned int> m_PixelsPerElement;
166 };
167 
168 }
169 } // end namespace itk::fem
170 
171 #ifndef ITK_MANUAL_INSTANTIATION
172 #include "itkImageToRectilinearFEMObjectFilter.hxx"
173 #endif
174 
175 #endif // #ifndef itkImageToRectilinearFEMObjectFilter_h
Light weight base class for most itk classes.
Implements N-dimensional Finite element (FE) models including elements, materials, and loads.
Definition: itkFEMObject.h:75
The base class for all process objects (source, filters, mappers) in the Insight data processing pipe...
Generate a rectilinar mesh from an image. The result is stored in a FEMObject.
ProcessObject::DataObjectPointerArraySizeType DataObjectPointerArraySizeType
Linear elasticity material class.
Base class for storing all the implicit material and other properties required to fully define the el...
DataObjectPointerArray::size_type DataObjectPointerArraySizeType
Abstract base element class.
Control indentation during Print() invocation.
Definition: itkIndent.h:49