ITK  4.3.0
Insight Segmentation and Registration Toolkit
itkBioCellularAggregate.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 __itkBioCellularAggregate_h
19 #define __itkBioCellularAggregate_h
20 
22 #include "itkMesh.h"
23 #include "itkImage.h"
24 #include "itkBioCell.h"
25 #include "itkPolygonCell.h"
26 
27 #include <iostream>
28 #include <vector>
29 
30 namespace itk
31 {
32 namespace bio
33 {
42 template< unsigned int NSpaceDimension = 3 >
44 {
45 public:
51 
52 /*** Run-time type information (and related methods). */
53  itkTypeMacro(BioCellularAggregate, CellularAggregateBase);
54 
56  itkNewMacro(Self);
57 
58  itkStaticConstMacro(SpaceDimension, unsigned int, NSpaceDimension);
59 
60 /*** Type to be used for data associated with each point in the mesh. */
63  typedef double CellPixelType;
64 
67  PointPixelType, // PixelType
68  NSpaceDimension, // Points Dimension
69  NSpaceDimension, // Max.Topological Dimension
70  double, // Type for coordinates
71  double, // Type for interpolation
72  CellPixelType // Type for values in the cells
74 
76  typedef Mesh< PointPixelType,
77  NSpaceDimension,
79 
81  typedef typename MeshType::Pointer MeshPointer;
83  typedef typename MeshType::PointType PointType;
85 
89  typedef typename PointsContainer::Iterator PointsIterator;
90  typedef typename PointDataContainer::Iterator CellsIterator;
91  typedef typename VoronoiRegionsContainer::Iterator VoronoiIterator;
92  typedef typename PointsContainer::ConstIterator PointsConstIterator;
93  typedef typename PointDataContainer::ConstIterator CellsConstIterator;
94  typedef typename VoronoiRegionsContainer::ConstIterator VoronoiConstIterator;
96 
98  typedef CellInterface<
99  typename MeshType::CellPixelType,
101 
103  typedef typename VoronoiRegionType::SelfAutoPointer VoronoiRegionAutoPointer;
104 
106  typedef float ImagePixelType;
110  typedef std::vector< SubstratePointer > SubstratesVector;
111 
112 public:
113  unsigned int GetNumberOfCells(void) const;
114 
115  static unsigned int GetDimension() { return SpaceDimension; }
116 
117  void SetGrowthRadiusLimit(double value);
118 
119  void SetGrowthRadiusIncrement(double value);
120 
121  itkGetObjectMacro(Mesh, MeshType);
122  itkGetConstObjectMacro(Mesh, MeshType);
123 
124  virtual void AdvanceTimeStep(void);
125 
126  virtual void SetEgg(BioCellType *cell, const PointType & position);
127 
128  virtual void Add(CellBase *cell);
129 
130  virtual void Add(CellBase *cell, const VectorType & perturbation);
131 
132  virtual void Add(CellBase *cellA, CellBase *cellB, double perturbationLength);
133 
134  virtual void Remove(CellBase *cell);
135 
136  virtual void GetVoronoi(IdentifierType cellId, VoronoiRegionAutoPointer &) const;
137 
138  void DumpContent(std::ostream & os) const;
139 
140  virtual void AddSubstrate(SubstrateType *substrate);
141 
142  virtual SubstratesVector & GetSubstrates(void);
143 
144  virtual SubstrateValueType GetSubstrateValue(IdentifierType cellId,
145  unsigned int substrateId) const;
146 
147  virtual void KillAll(void);
148 
149 protected:
151  virtual ~CellularAggregate();
152  CellularAggregate(const Self &);
153  void operator=(const Self &);
154 
155  void PrintSelf(std::ostream & os, Indent indent) const;
156 
157  virtual void ComputeForces(void);
158 
159  virtual void UpdatePositions(void);
160 
161  virtual void ComputeClosestPoints(void);
162 
163  virtual void ClearForces(void);
164 
165 private:
166 
172 };
173 } // end namespace bio
174 } // end namespace itk
175 
176 #ifndef ITK_MANUAL_INSTANTIATION
177 #include "itkBioCellularAggregate.hxx"
178 #endif
179 
180 #endif
181