StartNewStep("Search for the trachea");
SearchForTrachea();
PrintMemory(GetVerboseMemoryFlag(), "After SearchForTrachea");
+ if (m_Seeds.empty()) {
+ clitkExceptionMacro("No seeds for trachea... Aborting.");
+ }
//--------------------------------------------------------------------
//--------------------------------------------------------------------
prev_e_centre= max_e_centre;
}
+ else {
+ if (GetVerboseRegionGrowingFlag()) {
+ cout << "No shapes found at slice " << index[2] << std::endl;
+ }
+ }
}
size_t longest = 0;
}
}
- if (GetVerboseRegionGrowingFlag())
- std::cout << "seed at: " << trachea_centre << std::endl;
- m_Seeds.push_back(trachea_centre);
+ if (longest > 0) {
+ if (GetVerboseRegionGrowingFlag())
+ std::cout << "seed at: " << trachea_centre << std::endl;
+ m_Seeds.push_back(trachea_centre);
+ }
}
return (m_Seeds.size() != 0);
std::cout << "\t Found trachea with volume " << volume << " cc." << std::endl;
}
}
- else {
- if (GetVerboseStepFlag()) {
- std::cout << "\t The volume of the trachea (" << volume
- << " cc) seems not correct. I skip some slices (" << skip << ") and restart to find seeds."
- << std::endl;
- }
- skip += 5;
- stop = false;
- // empty the list of seed
- m_Seeds.clear();
+ else
+ if (GetTracheaSeedAlgorithm() == 0) {
+ if (GetVerboseStepFlag()) {
+ std::cout << "\t The volume of the trachea (" << volume
+ << " cc) seems not correct. I skip some slices (" << skip << ") and restart to find seeds."
+ << std::endl;
+ }
+ skip += 5;
+ stop = false;
+ // empty the list of seed
+ m_Seeds.clear();
}
if (skip > 0.5 * working_input->GetLargestPossibleRegion().GetSize()[2]) {
// we want to skip more than a half of the image, it is probably a bug