本文整理汇总了C++中ZSwcTree::setType方法的典型用法代码示例。如果您正苦于以下问题:C++ ZSwcTree::setType方法的具体用法?C++ ZSwcTree::setType怎么用?C++ ZSwcTree::setType使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ZSwcTree
的用法示例。
在下文中一共展示了ZSwcTree::setType方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1:
void FlyEm::ZSubstackRoi::exportSwc(const string &filePath)
{
if (!m_cuboidArray.empty()) {
ZSwcTree *tree = new ZSwcTree;
int index = 0;
for (ZIntCuboidArray::const_iterator iter = m_cuboidArray.begin();
iter != m_cuboidArray.end(); ++iter, ++index) {
ZCuboid cuboid;
cuboid.set(iter->cb[0], iter->cb[1], iter->cb[2], iter->ce[0], iter->ce[1],
iter->ce[2]);
ZSwcTree *subtree = ZSwcTree::CreateCuboidSwc(cuboid);
if (!m_idArray.empty()) {
subtree->setType(m_idArray[index]);
} else {
subtree->setType(index);
}
tree->merge(subtree, true);
}
tree->resortId();
tree->save(filePath);
delete tree;
}
}
示例2: createRangeCompareSwc
ZSwcTree* ZSwcGenerator::createRangeCompareSwc(
const ZFlyEmNeuronRange &range, const ZFlyEmNeuronRange &reference)
{
if (range.isEmpty()) {
return NULL;
}
double minZ = range.getMinZ();
double maxZ = range.getMaxZ();
double dz = (maxZ - minZ) / 50.0;
if (dz == 0.0) { //Avoid dead loop
dz = 1.0;
}
ZSwcTree *tree = createVirtualRootSwc();
double minReferenceZ = reference.getMinZ();
double maxReferenceZ = reference.getMaxZ();
for (double z = minReferenceZ; z < minZ; z += dz) {
ZSwcTree *subtree = createCircleSwc(0, 0, z, reference.getRadius(z));
subtree->setType(5);
tree->merge(subtree, true);
}
for (double z = maxZ + dz; z <= maxReferenceZ; z += dz) {
ZSwcTree *subtree = createCircleSwc(0, 0, z, reference.getRadius(z));
subtree->setType(5);
tree->merge(subtree, true);
}
for (double z = minZ; z <= maxZ; z += dz) {
double r = range.getRadius(z);
ZSwcTree *subtree = createCircleSwc(0, 0, z, r);
ZFlyEmNeuronRangeCompare comp;
ZFlyEmNeuronRangeCompare::EMatchStatus status =
comp.compare(range, reference, z);
switch (status) {
case ZFlyEmNeuronRangeCompare::MISSING_BRANCH:
subtree->setType(2);
break;
case ZFlyEmNeuronRangeCompare::EXTRA_BRANCH:
subtree->setType(3);
break;
case ZFlyEmNeuronRangeCompare::GOOD_MATCH:
subtree->setType(0);
break;
default:
subtree->setType(0);
}
tree->merge(subtree, true);
}
tree->resortId();
return tree;
}
示例3: exportSwc
void ZIntCuboidArray::exportSwc(const string &filePath) const
{
if (!empty()) {
ZSwcTree *tree = new ZSwcTree;
int index = 0;
for (ZIntCuboidArray::const_iterator iter = begin(); iter != end();
++iter, ++index) {
ZCuboid cuboid;
cuboid.set(iter->cb[0], iter->cb[1], iter->cb[2], iter->ce[0], iter->ce[1],
iter->ce[2]);
ZSwcTree *subtree = ZSwcTree::CreateCuboidSwc(cuboid);
subtree->setType(index);
tree->merge(subtree, true);
}
tree->resortId();
tree->save(filePath);
delete tree;
}
}
示例4: toSwc
ZSwcTree* ZIntCuboidArray::toSwc() const
{
ZSwcTree *tree = NULL;
if (!empty()) {
tree = new ZSwcTree;
int index = 0;
for (ZIntCuboidArray::const_iterator iter = begin(); iter != end();
++iter, ++index) {
ZCuboid cuboid;
cuboid.set(iter->cb[0], iter->cb[1], iter->cb[2], iter->ce[0], iter->ce[1],
iter->ce[2]);
ZSwcTree *subtree = ZSwcTree::CreateCuboidSwc(cuboid);
subtree->setType(index);
tree->merge(subtree, true);
}
tree->resortId();
}
return tree;
}