37 mOrientations = orient;
57 return mRadius.mean();
62 mChildBranches.push_back(child);
67 mChildBranches = children;
72 mChildBranches.clear();
77 return mChildBranches;
82 mParentBranch = parent;
92 Eigen::MatrixXd diff = positions.rightCols(positions.cols() - 1) - positions.leftCols(positions.cols() - 1);
93 Eigen::MatrixXd orientations(positions.rows(),positions.cols());
94 orientations.leftCols(orientations.cols() - 1) = diff / diff.norm();
95 orientations.rightCols(1) = orientations.col(orientations.cols() - 1);
111 for(
size_t i = 0; i < bv.size(); ++i)
113 if(bv[i] == mParentBranch)
114 return static_cast<int>(i);
122 int generationNumber = 1;
125 while (parentBranchPtr)
127 if (parentBranchPtr->getChildBranches().size() > 1)
128 generationNumber = generationNumber + 1;
130 parentBranchPtr = parentBranchPtr->getParentBranch();
132 if (generationNumber > 23)
136 return generationNumber;
143 if (generationNumber == 1)
145 if (generationNumber == 2)
147 if (generationNumber == 3)
149 if (generationNumber == 4)
151 if (generationNumber == 5)
159 mBronchoscopeRotation = rotation;
164 return mBronchoscopeRotation;
171 bool resizeOrientations =
false;
172 if (positions.cols() == orientations.cols())
173 resizeOrientations =
true;
175 for (
int i = positions.cols() - 1; i > 0; i--)
177 if (
similar( (positions.col(i)-positions.col(i-1)).cwiseAbs().sum(), 0))
179 positions.block(0 , i , positions.rows() , positions.cols() - i - 1) = positions.rightCols(positions.cols() - i - 1);
180 positions.conservativeResize(Eigen::NoChange, positions.cols() - 1);
181 if (resizeOrientations)
182 orientations.conservativeResize(Eigen::NoChange, orientations.cols() - 1);
186 mPositions = positions;
187 if (resizeOrientations)
188 mOrientations = orientations;
void deleteChildBranches()
void addChildBranch(BranchPtr child)
void setPositions(Eigen::MatrixXd pos)
void setRadius(Eigen::VectorXd r)
branchVector getChildBranches()
double findBranchRadius()
int findGenerationNumber()
void removeEqualPositions()
double getAverageRadius()
boost::shared_ptr< class Branch > BranchPtr
Eigen::MatrixXd getOrientations()
int findParentIndex(branchVector bv) const
Branch::findParentIndex Given a vector of branches, find this branch's parent branch in that vector...
BranchPtr getParentBranch()
void setOrientations(Eigen::MatrixXd orient)
Eigen::VectorXd getRadius()
Eigen::MatrixXd getPositions()
bool similar(const CameraInfo &lhs, const CameraInfo &rhs, double tol)
void calculateOrientations()
double getBronchoscopeRotation()
void setBronchoscopeRotation(double rotation)
void setChildBranches(branchVector children)
void setParentBranch(BranchPtr parent)
std::vector< BranchPtr > branchVector
Namespace for all CustusX production code.