18 #ifndef RECOCONTROLLER_H
19 #define RECOCONTROLLER_H
21 #include <tjutils/tjthread.h>
22 #include <tjutils/tjfeedback.h>
24 #include <odinreco/odinreco.h>
25 #include <odinreco/blackboard.h>
26 #include <odinreco/step.h>
36 #define ODINRECO_THREAD_STACKSIZE 8*1024*1024
162 friend class RecoThread;
193 bool execute_pipeline();
194 bool prepare_pipeline();
195 bool finalize_pipeline();
197 bool feed_pipeline();
199 bool dump_raw()
const;
202 static int controlthread;
204 template<recoDim Dim, recoDim OrthoDim>
205 bool get_kspace_sampling_pattern(
const RecoCoord& mask,
unsigned int& reduction_factor,
bool& partial_fourier,
bool& half_fourier)
const;
207 bool autorecipe(
const RecoCoord& mask, STD_string& result)
const;
209 bool create_selection_map(
const STD_string& selstr, STD_map<recoDim,unsigned short>& selmap,
RecoCoord* initcoord=0)
const;
211 typedef STD_map<int, STD_string> WaitingMap;
213 STD_string waiting_error;
216 void incr_waiting_threads(
const STD_string& condition) {
MutexLock lock(waiting_mutex); waiting[
Thread::self()]=condition;}
217 void decr_waiting_threads() {
MutexLock lock(waiting_mutex); waiting.erase(waiting.find(
Thread::self()));}
218 unsigned int numof_waiting_threads() {
MutexLock lock(waiting_mutex);
return waiting.size();}
220 STD_map<int, UInt> thread_depth;
221 Mutex thread_depth_mutex;
224 mutable Mutex inputmutex;
231 ProgressDisplayConsole display;
235 unsigned short numof_cache[n_recoDims];
236 mutable bool has_readoutshape;
237 mutable unsigned char has_flag_cache;
238 mutable bool has_templcorr_cache[n_templateTypes];
239 mutable bool has_navigator_cache[n_navigatorTypes];
240 mutable bool has_traj;
241 mutable bool has_oversampling_cache;
242 mutable bool has_relcenter_cache;
246 volatile bool status;
248 mutable STD_map<STD_string,const CoordCountMap*> countmap_cache;
249 void delete_countmap_cache();
bool announced(const STD_string &label) const
void post(const STD_string &label, const RecoData &data)
void announce(const STD_string &label)
RecoStep * create_pipeline(const STD_string &rec, const RecoCoord *initial_coord=0, int argc=0, char *argv[]=0) const
void announce_data(const STD_string &label)
bool create_numof(const RecoCoord &mask, unsigned short numof[n_recoDims], STD_string &printed) const
TinyVector< float, 3 > kspace_extent() const
bool inquire_data(const RecoStep &caller, const STD_string &label, RecoData &data)
void post_data(const STD_string &label, const RecoData &data)
dvector dim_values(recoDim dim) const
TinyVector< float, 3 > reloffset() const
bool data_announced(const STD_string &label)
bool init(RecoReaderInterface *reader, LDRblock &opts, int argc, char *argv[])
const CoordCountMap * create_count_map(const RecoCoord &mask) const
RecoController(LDRblock &parblock)
STD_string image_proc() const
TinyVector< int, 3 > image_size() const
const Protocol & protocol() const
STD_string stepmanual() const
STD_map< RecoCoord, UInt > CoordCountMap
void(* tracefunction)(const LogMessage &msg)