34 mCores = this->createCores(algo, par, createBModeWhenAngio);
36 std::vector<bool> angio;
37 for (
unsigned i=0; i<mCores.size(); ++i)
38 angio.push_back(mCores[i]->getInputParams().mAngio);
40 std::vector<cx::ProcessedUSInputDataPtr> processedInput = preprocessor->createProcessedInput(angio);
42 for (
unsigned i=0; i<mCores.size(); ++i)
44 mCores[i]->initialize(processedInput[i], preprocessor->getOutputVolumeParams());
46 for (
unsigned i=0; i<mCores.size(); ++i)
48 mCores[i]->reconstruct();
57 reportError(
"Reconstruct Executer can only be run once. Ignoring start.");
69 createBModeWhenAngio =
false;
71 mCores = this->createCores(algo, par, createBModeWhenAngio);
76 this->launch(algorithm);
82 std::vector<cx::ImagePtr> retval;
83 if (mPipeline && !mPipeline->isFinished())
86 for (
unsigned i=0; i<mCores.size(); ++i)
87 retval.push_back(mCores[i]->getOutput());
109 if(this->canCoresRunInParallel(cores) && cores.size()>1)
112 pipeline->append(parallel);
114 reportDebug(
"Running reconstruction cores in parallel.");
117 for (
unsigned i=0; i<cores.size(); ++i)
123 bool ReconstructionExecuter::canCoresRunInParallel(std::vector<ReconstructCorePtr> cores)
125 bool parallelizable =
true;
127 std::vector<ReconstructCorePtr>::iterator it;
128 for(it = cores.begin(); it != cores.end(); ++it)
129 parallelizable = parallelizable && (it->get()->getInputParams().mAlgorithmUid ==
"pnn");
131 return parallelizable;
138 retval->initialize(par, fileData);
145 std::vector<ReconstructCorePtr> retval;
147 if (createBModeWhenAngio && par.
mAngio)
151 retval.push_back(core);
152 core = this->createCore(par, algo);
154 retval.push_back(core);
161 retval.push_back(core);
170 retval->initialize(par, algo);
179 retval->initialize(par, algo);
boost::shared_ptr< class CompositeTimedAlgorithm > CompositeTimedAlgorithmPtr
void reportError(QString msg)
Abstract interface for reconstruction algorithm.
bool startNonThreadedReconstruction(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.
boost::shared_ptr< CompositeParallelTimedAlgorithm > CompositeParallelTimedAlgorithmPtr
void reconstructFinished()
cx::TimedAlgorithmPtr getThread()
Return the currently reconstructing thread object.
bool startReconstruction(ReconstructionMethodService *algo, ReconstructCore::InputParams par, USReconstructInputData fileData, bool createBModeWhenAngio)
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.