ITK  4.2.0
Insight Segmentation and Registration Toolkit
itkFEMScatteredDataPointSetToImageFilter.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 __itkFEMScatteredDataPointSetToImageFilter_h
20 #define __itkFEMScatteredDataPointSetToImageFilter_h
21 
23 #include "itkVectorContainer.h"
24 #include "vnl/vnl_matrix.h"
25 
26 #include "itkMesh.h"
27 #include "itkFEMObject.h"
33 #include "itkFEMRobustSolver.h"
36 #include "itkTriangleCell.h"
37 #include "itkTetrahedronCell.h"
38 #include "itkQuadrilateralCell.h"
39 #include "itkHexahedronCell.h"
40 
41 namespace itk
42 {
43 namespace fem
44 {
126 template<class TInputPointSet, class TInputMesh, class TOutputImage, class TInputConfidencePointSet, class TInputTensorPointSet>
128  public PointSetToImageFilter< TInputPointSet, TOutputImage >
129 {
130 public:
135 
137  itkNewMacro( Self );
138 
140  itkStaticConstMacro( ImageDimension, unsigned int, TOutputImage::ImageDimension );
141 
143  typedef TInputPointSet PointSetType;
144  typedef typename PointSetType::PointType PointType;
145  typedef typename PointSetType::PointsContainer PointsContainer;
146  typedef typename PointsContainer::ConstIterator PointsIterator;
147  typedef typename PointSetType::PixelType PointDataType;
148  typedef typename PointSetType::PointDataContainer PointDataContainerType;
149  typedef typename PointDataContainerType::ConstIterator PointDataIterator;
150 
152  typedef TInputConfidencePointSet ConfidencePointSetType;
153  typedef typename ConfidencePointSetType::PointsContainer::ConstIterator ConfidencePointsIterator;
154  typedef typename ConfidencePointSetType::PixelType ConfidencePointDataType;
155  typedef typename ConfidencePointSetType::PointDataContainer ConfidencePointDataContainerType;
156 
158  typedef TInputTensorPointSet TensorPointSetType;
159  typedef typename TensorPointSetType::PointsContainer::ConstIterator TensorPointsIterator;
160  typedef typename TensorPointSetType::PixelType TensorPointDataType;
161  typedef typename TensorPointSetType::PointDataContainer TensorPointDataContainerType;
162  typedef typename TensorPointDataContainerType::Iterator TensorPointDataIterator;
163 
165  typedef TInputMesh MeshType;
166  typedef typename MeshType::CellType CellType;
167  typedef typename CellType::CellAutoPointer CellAutoPointer;
168  typedef typename MeshType::CellsContainer CellsContainer;
169  typedef typename CellsContainer::ConstIterator CellIterator;
170 
175  typedef typename CellType::PointIdIterator PointIdIterator;
176 
178  typedef TOutputImage ImageType;
179  typedef typename ImageType::PixelType PixelType;
180  typedef typename ImageType::RegionType RegionType;
181  typedef typename ImageType::SizeType SizeType;
182  typedef typename ImageType::IndexType IndexType;
183  typedef typename ImageType::SpacingType SpacingType;
185 
187 
190 
193 
199 
202 
205 
209 
213 
219 
221  itkSetConstObjectMacro(ConfidencePointSet, ConfidencePointSetType);
222  itkGetConstObjectMacro(ConfidencePointSet, ConfidencePointSetType);
224 
225  itkSetConstObjectMacro(TensorPointSet, TensorPointSetType);
226  itkGetConstObjectMacro(TensorPointSet, TensorPointSetType);
227 
228  itkSetObjectMacro(Mesh, MeshType);
229  itkGetObjectMacro(Mesh, MeshType);
230 
231  itkSetObjectMacro(FEMSolver, FEMSolverType);
232  itkGetObjectMacro(FEMSolver, FEMSolverType);
233 
235  itkGetConstReferenceMacro(PixelsPerElement, ContinuousIndexType);
236  itkSetMacro(PixelsPerElement, ContinuousIndexType);
238 
240  void SetElementSpacing(const SpacingType & elementSpacing);
241  itkGetConstReferenceMacro(SpacingPerElement, SpacingType);
243 
245  itkGetConstReferenceMacro(NumberOfElements, SizeType);
246 
247 protected:
248 
251 
254 
257 
260 
262  void InitializeFEMObject(FEMObjectType * femObject);
263 
265  void InitializeMaterials(FEMObjectType * femObject);
266 
268  void InitializeNodes(FEMObjectType * femObject);
269 
271  void InitializeElements(FEMObjectType * femObject);
272 
274  void InitializeLoads(FEMObjectType * femObject);
275 
277  void GenerateData();
278 
280 
281  void PrintSelf(std::ostream & os, Indent indent) const;
282 
283 private:
284 
285  FEMScatteredDataPointSetToImageFilter( const Self & ); // purposely not implemented.
286  void operator=( const Self & ); // purposely not implemented
287 
291  typename MeshType::Pointer m_Mesh;
292 
293  typename ConfidencePointSetType::ConstPointer m_ConfidencePointSet;
294  typename TensorPointSetType::ConstPointer m_TensorPointSet;
295 
300 
303 };
304 
305 }// end namespace fem
306 }// end namespace itk
307 
308 #ifndef ITK_MANUAL_INSTANTIATION
309 #include "itkFEMScatteredDataPointSetToImageFilter.hxx"
310 #endif
311 
312 #endif
313