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;