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)
160 mBendingDirection = bendingDirection;
165 return mBendingDirection;
170 mBronchoscopeRotation = rotation;
175 return mBronchoscopeRotation;
182 bool resizeOrientations =
false;
183 if (positions.cols() == orientations.cols())
184 resizeOrientations =
true;
186 for (
int i = positions.cols() - 1; i > 0; i--)
188 if (
similar( (positions.col(i)-positions.col(i-1)).cwiseAbs().sum(), 0))
190 positions.block(0 , i , positions.rows() , positions.cols() - i - 1) = positions.rightCols(positions.cols() - i - 1);
191 positions.conservativeResize(Eigen::NoChange, positions.cols() - 1);
192 if (resizeOrientations)
193 orientations.conservativeResize(Eigen::NoChange, orientations.cols() - 1);
197 mPositions = positions;
198 if (resizeOrientations)
199 mOrientations = orientations;