Chaste  Build::
VesselNetworkGenerator.hpp
1 /*
2 
3 Copyright (c) 2005-2016, University of Oxford.
4  All rights reserved.
5 
6  University of Oxford means the Chancellor, Masters and Scholars of the
7  University of Oxford, having an administrative office at Wellington
8  Square, Oxford OX1 2JD, UK.
9 
10  This file is part of Chaste.
11 
12  Redistribution and use in source and binary forms, with or without
13  modification, are permitted provided that the following conditions are met:
14  * Redistributions of source code must retain the above copyright notice,
15  this list of conditions and the following disclaimer.
16  * Redistributions in binary form must reproduce the above copyright notice,
17  this list of conditions and the following disclaimer in the documentation
18  and/or other materials provided with the distribution.
19  * Neither the name of the University of Oxford nor the names of its
20  contributors may be used to endorse or promote products derived from this
21  software without specific prior written permission.
22 
23  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
24  AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
25  IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
26  ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
27  LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
28  CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
29  GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
30  HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
31  LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
32  OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
33 
34  */
35 
36 #ifndef VESSELNETWORKGENERATOR_HPP_
37 #define VESSELNETWORKGENERATOR_HPP_
38 
39 #include <vector>
40 #include <string>
41 #include "VesselNetwork.hpp"
42 #include "Vessel.hpp"
43 #include "VesselNode.hpp"
44 #include "Part.hpp"
45 #include "UblasVectorInclude.hpp"
46 #include "UnitCollection.hpp"
47 #include "DimensionalChastePoint.hpp"
48 
58 {
62  enum Value
63  {
64  REGULAR, UNIFORM, TWO_LAYER, CUSTOM
65  };
66 };
67 
68 
69 template<unsigned DIM>
71 {
72 
76  units::quantity<unit::length> mReferenceLength;
77 
78 public:
79 
84 
89 
90  /*
91  * Create a vessel network with all vessels parallel. Vessels are aligned in the 'Z' direction in 3D
92  * @param domain A part representing the extents of the spatial domain
93  * @param targetDensity The desired vessel length per unit volume, this will be only satisfied approximately
94  * @param distrbutionType The way to disperse initial seeds for the vessel distribution
95  * @param useBbox Whether to use the domain bounding box or the exact shape, the former is faster
96  * @param seeds User provided seed locations for the vessel locations, used with CUSTOM distribution type
97  */
98  boost::shared_ptr<VesselNetwork<DIM> > GenerateParrallelNetwork(boost::shared_ptr<Part<DIM> > domain,
99  units::quantity<unit::per_area> targetDensity,
100  VesselDistribution::Value distrbutionType,
101  units::quantity<unit::length> exclusionDistance = 0.0*unit::metres,
102  bool useBbox = false,
103  std::vector<boost::shared_ptr<DimensionalChastePoint<DIM> > > seeds =
104  std::vector<boost::shared_ptr<DimensionalChastePoint<DIM> > >());
105 
106  /*
107  * Create a 3d vessel network
108  * @param domain A part representing the extents of the spatial domain
109  * @param targetDensity The desired vessel length per unit volume, this will be only satisfied approximately
110  * @param distrbutionType The way to disperse initial seeds for the vessel distribution
111  * @param useBbox Whether to use the domain bounding box or the exact shape, the former is faster
112  * @param seeds User provided seed locations for the vessel locations, used with CUSTOM distribution type
113  */
114  boost::shared_ptr<VesselNetwork<DIM> > Generate3dNetwork(boost::shared_ptr<Part<DIM> > domain,
115  std::vector<units::quantity<unit::per_area> > targetDensity,
116  VesselDistribution::Value distrbutionType,
117  units::quantity<unit::length> exclusionDistance = 0.0*unit::metres,
118  bool useBbox = false,
119  std::vector<boost::shared_ptr<DimensionalChastePoint<DIM> > > seeds =
120  std::vector<boost::shared_ptr<DimensionalChastePoint<DIM> > >());
121 
122  /*
123  * Creates a hexagonal network corresponding to that of Alarcon et al. (2006)
124  */
125  boost::shared_ptr<VesselNetwork<DIM> > GenerateHexagonalNetwork(units::quantity<unit::length> width,
126  units::quantity<unit::length> height,
127  units::quantity<unit::length> vesselLength);
128  /*
129  * Creates a hexagonal repeating unit
130  */
131  boost::shared_ptr<VesselNetwork<DIM> > GenerateHexagonalUnit(units::quantity<unit::length> vesselLength);
132 
133  /*
134  * Creates a bifurcation repeating unit
135  */
136  boost::shared_ptr<VesselNetwork<DIM> > GenerateBifurcationUnit(units::quantity<unit::length> vesselLength,
137  DimensionalChastePoint<DIM> startPosition);
138 
139  /*
140  * Creates a single vessel
141  */
142  boost::shared_ptr<VesselNetwork<DIM> > GenerateSingleVessel(units::quantity<unit::length> vesselLength,
143  DimensionalChastePoint<DIM> startPosition,
144  unsigned divisions = 0, unsigned axis = 2);
145 
146  /*
147  * Creates an oval shaped network with one inlet and one outlet
148  */
149  boost::shared_ptr<VesselNetwork<DIM> > GenerateOvalNetwork(units::quantity<unit::length> scaleFactor,
150  unsigned num_increments = 40,
151  double a_param = 0.5,
152  double b_param = 1.0);
153  /*
154  * Generate a network on the edges of a Part
155  */
156  boost::shared_ptr<VesselNetwork<DIM> > GenerateFromPart(boost::shared_ptr<Part<DIM> > part);
157 
158  /*
159  * Creates a vessel network based on a voronoi tesselation in the provided cube.
160  */
161  boost::shared_ptr<VesselNetwork<DIM> > GenerateVoronoiNetwork(units::quantity<unit::length> cubeX,
162  units::quantity<unit::length> cubeY,
163  units::quantity<unit::length> cubeZ, unsigned numPoints = 400);
164 
165  /*
166  * Pattern Unit. Coincident nodes are automatically merged in this method.
167  */
168  void PatternUnitByTranslation(boost::shared_ptr<VesselNetwork<DIM> > pInputUnit, std::vector<unsigned> numberOfUnits);
169 
170  void MapToSphere(boost::shared_ptr<VesselNetwork<DIM> > pInputUnit,
171  units::quantity<unit::length> radius,
172  units::quantity<unit::length> thickess,
173  double azimuthExtent,
174  double polarExtent);
175 
181  void SetReferenceLengthScale(units::quantity<unit::length> rReferenceLength);
182 
183 };
184 
185 #endif /* VESSELNETWORKGENERATOR_HPP_ */
units::quantity< unit::length > mReferenceLength
Definition: Part.hpp:60