本文整理汇总了C++中ZSwcTree::data方法的典型用法代码示例。如果您正苦于以下问题:C++ ZSwcTree::data方法的具体用法?C++ ZSwcTree::data怎么用?C++ ZSwcTree::data使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ZSwcTree
的用法示例。
在下文中一共展示了ZSwcTree::data方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: trace
//.........这里部分代码省略.........
if (binarizer.binarize(mask2) == false) {
std::cout << "Thresholding failed" << std::endl;
C_Stack::kill(mask2);
mask2 = NULL;
}
}
/* <mask2> freed */
if (mask2 != NULL) {
C_Stack::translate(mask2, GREY, 1);
Stack_Or(mask, mask2, mask);
C_Stack::kill(mask2);
mask2 = NULL;
}
advanceProgress(0.05);
//Trace each seed
std::cout << "Extracting seed points ..." << std::endl;
/* <seedPointArray> allocated */
Geo3d_Scalar_Field *seedPointArray = extractSeed(mask);
m_mask = mask;
advanceProgress(0.05);
std::cout << "Sorting seeds ..." << std::endl;
ZNeuronTraceSeeder seeder;
setTraceScoreThreshold(TRACING_SEED);
m_baseMask = seeder.sortSeed(seedPointArray, stack, m_traceWorkspace);
#ifdef _DEBUG_2
C_Stack::write(GET_TEST_DATA_DIR + "/test.tif", m_baseMask);
#endif
advanceProgress(0.1);
/* <seedPointArray> freed */
Kill_Geo3d_Scalar_Field(seedPointArray);
std::vector<Local_Neuroseg>& locsegArray = seeder.getSeedArray();
std::vector<double>& scoreArray = seeder.getScoreArray();
std::cout << "Tracing ..." << std::endl;
/* <chainArray> allocated */
std::vector<Locseg_Chain*> chainArray = trace(stack, locsegArray, scoreArray);
if (m_recover > 0) {
std::vector<Locseg_Chain*> newChainArray = recover(stack);
chainArray.insert(
chainArray.end(), newChainArray.begin(), newChainArray.end());
}
advanceProgress(0.1);
chainArray = screenChain(stack, chainArray);
advanceProgress(0.3);
/* <mask2> freed */
// C_Stack::kill(mask);
std::cout << "Reconstructing ..." << std::endl;
ZNeuronConstructor constructor;
constructor.setWorkspace(m_connWorkspace);
constructor.setSignal(stack);
//Create neuron structure
BOOL oldSpTest = m_connWorkspace->sp_test;
if (chainArray.size() > 1000) {
std::cout << "Too many chains: " << chainArray.size() << std::endl;
std::cout << "Turn off shortest path test" << std::endl;
m_connWorkspace->sp_test = FALSE;
}
/* free <chainArray> */
tree = constructor.reconstruct(chainArray);
m_connWorkspace->sp_test = oldSpTest;
advanceProgress(0.1);
//Post process
Swc_Tree_Remove_Zigzag(tree->data());
Swc_Tree_Tune_Branch(tree->data());
Swc_Tree_Remove_Spur(tree->data());
Swc_Tree_Merge_Close_Node(tree->data(), 0.01);
Swc_Tree_Remove_Overshoot(tree->data());
if (doResampleAfterTracing) {
ZSwcResampler resampler;
resampler.optimalDownsample(tree);
}
advanceProgress(0.1);
std::cout << "Done!" << std::endl;
endProgress();
return tree;
}