本文整理汇总了C++中ZSwcTree::save方法的典型用法代码示例。如果您正苦于以下问题:C++ ZSwcTree::save方法的具体用法?C++ ZSwcTree::save怎么用?C++ ZSwcTree::save使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ZSwcTree
的用法示例。
在下文中一共展示了ZSwcTree::save方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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: extractSeedSkel
Geo3d_Scalar_Field* ZNeuronTracer::extractSeedSkel(const Stack *mask)
{
Stack *skel = Stack_Bwthin(mask, NULL);
/* alloc <dist> */
Stack *dist = Stack_Bwdist_L_U16(mask, NULL, 0);
ZStackProcessor::RemoveBranchPoint(skel, 26);
Stack *skel_proc = C_Stack::clone(skel);
Geo3d_Scalar_Field *field1 = extractLineSeed(skel_proc, dist);
C_Stack::kill(skel_proc);
for (int i = 0; i <field1->size; ++i) {
int x = field1->points[i][0];
int y = field1->points[i][1];
int z = field1->points[i][2];
Set_Stack_Pixel(skel, x, y, z, 0, 0);
}
#ifdef _DEBUG_2
C_Stack::write(GET_TEST_DATA_DIR + "/test.tif", skel);
#endif
Geo3d_Scalar_Field *field2 = extractLineSeed(skel, dist, 0);
Geo3d_Scalar_Field *field = Geo3d_Scalar_Field_Merge(field1, field2, NULL);
Kill_Geo3d_Scalar_Field(field1);
Kill_Geo3d_Scalar_Field(field2);
#ifdef _DEBUG_2
ZSwcTree tree;
tree.forceVirtualRoot();
for (int i = 0; i <field->size; ++i) {
int x = field->points[i][0];
int y = field->points[i][1];
int z = field->points[i][2];
double radius = field->values[i];
SwcTreeNode::setFirstChild(
tree.root(), SwcTreeNode::makePointer(x, y, z, radius));
}
tree.save(GET_TEST_DATA_DIR + "/test.swc");
#endif
/* free <dist> */
C_Stack::kill(dist);
C_Stack::kill(skel);
return field;
}
示例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;
}
}