21 #include <tjutils/tjthread.h>
22 #include <tjutils/tjnumeric.h>
24 #include <odinpara/sample.h>
25 #include <odinseq/seqclass.h>
43 SeqSimInterval() : dt(0.0), B1(0.0), freq(0.0), phase(0.0), rec(0.0), Gx(0.0), Gy(0.0), Gz(0.0) {}
222 friend class SeqTimecourse;
229 SeqSimMagsi& resize(
unsigned int xsize,
unsigned int ysize,
unsigned int zsize,
unsigned int freqsize=1);
235 int append_all_members();
242 void set_axes_cache(
const Sample& sample);
257 unsigned int nthreads;
264 unsigned int time_index_cache;
265 unsigned int numof_time_intervals_cache;
266 double* time_intervals_cache;
289 unsigned int oneframe_size_cache;
293 float* freqoffset_cache;
294 unsigned int nframes_ppm_cache;
296 unsigned int nframes_spin_density_cache;
297 float* spin_density_cache;
298 STD_complex* B1map_transm_cache;
299 unsigned int num_rec_channel_cache;
300 STD_complex** B1map_receiv_cache;
301 unsigned int nframes_Dcoeff_cache;
304 unsigned int nframes_r1_cache;
306 unsigned int nframes_r2_cache;
308 bool* has_relax_cache;
311 bool simcache_up2date;
312 void outdate_simcache();
320 #ifdef STANDALONE_PLUGIN
334 SeqSimMonteCarlo(
const STD_string& label=
"unnamedSeqSimMonteCarlo",
unsigned int nparticles=10000,
unsigned int nthreads=1);
339 SeqSimMonteCarlo(
const SeqSimMonteCarlo& ssmc) {common_init(); SeqSimMonteCarlo::operator = (ssmc);}
344 SeqSimMonteCarlo& operator = (
const SeqSimMonteCarlo& ssmc);
350 farray get_spatial_dist()
const;
356 void finalize_simulation();
370 unsigned int linear_index(
const float pos[3])
const;
372 STD_vector<Particle> particle;
373 unsigned int numof_threads;
379 unsigned int size_cache[3];
386 float* spinDensity_cache;
388 float pixelspacing_cache[3];
Virtual Sample for Simulation.
virtual void prepare_simulation(const Sample &sample, CoilSensitivity *transmit_coil=0, CoilSensitivity *receive_coil=0, ProgressMeter *progmeter=0)=0
virtual cvector simulate(const SeqSimInterval &simvals, double gamma)=0
virtual void finalize_simulation()=0
MAGSI-based Magnetization Simulator.
SeqSimMagsi & reset_magnetization()
SeqSimMagsi & operator=(const SeqSimMagsi &ssm)
const farray & get_Mamp() const
void finalize_simulation()
SeqSimMagsi & set_initial_vector(float Mx, float My, float Mz)
SeqSimMagsi & set_intravoxel_simulation(bool ivflag)
void prepare_simulation(const Sample &sample, CoilSensitivity *transmit_coil=0, CoilSensitivity *receive_coil=0, ProgressMeter *progmeter=0)
bool kernel(const SeqSimInterval &simvals, cvector &signal, int &, unsigned int begin, unsigned int end)
SeqSimMagsi & set_online_simulation(bool onlineflag)
SeqSimMagsi & set_spat_rotmatrix(const RotMatrix &rotmatrix)
SeqSimMagsi(const STD_string &label="unnamedSeqSimMagsi")
const farray & get_Mpha() const
const farray & get_Mx() const
unsigned int get_total_size() const
const farray & get_Mz() const
cvector simulate(const SeqSimInterval &simvals, double gamma)
SeqSimMagsi & set_numof_threads(unsigned int n)
const farray & get_My() const
SeqSimMagsi(const SeqSimMagsi &ssm)
unsigned long total() const
Time interval for simulation.