29 mCores = this->createCores(algo, par, createBModeWhenAngio);
31 std::vector<bool> angio;
32 for (
unsigned i=0; i<mCores.size(); ++i)
33 angio.push_back(mCores[i]->getInputParams().mAngio);
35 std::vector<cx::ProcessedUSInputDataPtr> processedInput = preprocessor->createProcessedInput(angio);
37 for (
unsigned i=0; i<mCores.size(); ++i)
39 mCores[i]->initialize(processedInput[i], preprocessor->getOutputVolumeParams());
41 for (
unsigned i=0; i<mCores.size(); ++i)
43 mCores[i]->reconstruct();
51 reportError(
"Reconstruct Executer can only be run once. Ignoring start.");
60 createBModeWhenAngio =
false;
62 mCores = this->createCores(algo, par, createBModeWhenAngio);
67 this->launch(algorithm);
72 std::vector<cx::ImagePtr> retval;
73 if (mPipeline && !mPipeline->isFinished())
76 for (
unsigned i=0; i<mCores.size(); ++i)
77 retval.push_back(mCores[i]->getOutput());
99 if(this->canCoresRunInParallel(cores) && cores.size()>1)
102 pipeline->append(parallel);
104 reportDebug(
"Running reconstruction cores in parallel.");
107 for (
unsigned i=0; i<cores.size(); ++i)
113 bool ReconstructionExecuter::canCoresRunInParallel(std::vector<ReconstructCorePtr> cores)
115 bool parallelizable =
true;
117 std::vector<ReconstructCorePtr>::iterator it;
118 for(it = cores.begin(); it != cores.end(); ++it)
119 parallelizable = parallelizable && (it->get()->getInputParams().mAlgorithmUid ==
"pnn");
121 return parallelizable;
127 retval->initialize(par, fileData);
134 std::vector<ReconstructCorePtr> retval;
136 if (createBModeWhenAngio && par.
mAngio)
140 retval.push_back(core);
141 core = this->createCore(par, algo);
143 retval.push_back(core);
150 retval.push_back(core);
159 retval->initialize(par, algo);
168 retval->initialize(par, algo);
boost::shared_ptr< class CompositeTimedAlgorithm > CompositeTimedAlgorithmPtr
void reportError(QString msg)
Abstract interface for reconstruction algorithm.
void startReconstruction(ReconstructionMethodService *algo, ReconstructCore::InputParams par, USReconstructInputData fileData, bool createBModeWhenAngio)
void reconstructAboutToStart()
emitted before reconstruction threads are fired
static ThreadedTimedReconstructCorePtr create(PatientModelServicePtr patientModelService, ViewServicePtr viewService, ReconstructCorePtr reconstructer)
boost::shared_ptr< class TimedBaseAlgorithm > TimedAlgorithmPtr
static ThreadedTimedReconstructPreprocessorPtr create(PatientModelServicePtr patientModelService, ReconstructPreprocessorPtr input, std::vector< ReconstructCorePtr > cores)
std::vector< cx::ImagePtr > getResult()
void reportWarning(QString msg)
boost::shared_ptr< class ReconstructPreprocessor > ReconstructPreprocessorPtr
Algorithm part of reconstruction - no dependencies on parameter classes.
void startNonThreadedReconstruction(ReconstructionMethodService *algo, ReconstructCore::InputParams par, USReconstructInputData fileData, bool createBModeWhenAngio)
boost::shared_ptr< CompositeParallelTimedAlgorithm > CompositeParallelTimedAlgorithmPtr
void reconstructFinished()
cx::TimedAlgorithmPtr getThread()
Return the currently reconstructing thread object.
Algorithm part of reconstruction - no dependencies on parameter classes.
boost::shared_ptr< CompositeSerialTimedAlgorithm > CompositeSerialTimedAlgorithmPtr
boost::shared_ptr< class ReconstructCore > ReconstructCorePtr
void reportDebug(QString msg)
void reconstructStarted()
Namespace for all CustusX production code.