Data Structures | |
struct | KS_SEQLOC |
struct | KS_RT_SCALE_LOG |
struct | KS_WFINSTANCE |
struct | KS_BASE |
struct | KS_WAIT |
struct | KS_ISIROT |
struct | KS_TRAP |
struct | KS_WAVE |
struct | KS_READ_RESAMPLER |
struct | KS_READ |
struct | KS_RF |
struct | KS_GRADRFCTRL |
struct | KS_SEQ_HANDLE |
struct | KS_SEQ_CONTROL |
struct | KS_SEQ_COLLECTION |
struct | KS_SAR |
struct | KS_SLICE_PLAN |
struct | KS_SMS_INFO |
struct | KS_SELRF |
struct | KS_READTRAP |
struct | KS_READWAVE |
struct | kscommon_wave_params |
struct | KSCOMMON_RESAMPLER |
struct | KS_PHASER |
struct | KS_PHASEENCODING_COORD |
struct | KS_PHASEENCODING_SHOTCOORDS |
struct | KS_PHASEENCODING_PLAN |
struct | KS_DYNAMIC_STATE |
struct | KS_EPI |
struct | KS_READCONTROL_STATE |
struct | KS_READCONTROL_PULSEGEN |
struct | KS_READCONTROL |
struct | KS_ECHOTRAIN |
struct | KS_ECHOTRAIN_READOUT_TIMING |
struct | KS_DIXON_ASYMREADWAVE |
struct | KS_PEPLAN_SHOT_DISTRIBUTION |
struct | KS_KCOORD |
struct | KS_VIEW |
struct | KS_KSPACE_ACQ |
struct | KS_PHASEENCODING_REPEAT_DESIGN |
struct | KS_KACQ_RECONSHEDULE_ENTRY |
struct | ks_crusher_constraints |
Typedefs | |
typedef char | KS_DESCRIPTION[KS_DESCRIPTION_LENGTH] |
typedef float | KS_WAVEFORM[KS_MAXWAVELEN] |
typedef short | KS_IWAVE[KS_MAXWAVELEN] |
typedef double | KS_MAT3x3[9] |
typedef float | KS_MAT3x3f[9] |
typedef double | KS_MAT4x4[16] |
typedef float | KS_MAT4x4f[16] |
Functions | |
_cvfloat * | opuser_from_number (_cvfloat *cv) |
int | isNaN (float a) |
STATUS | ks_bitmask_set (unsigned int out, const unsigned int in, const unsigned int size, const unsigned int offset) |
unsigned int | ks_bitmask_get (const unsigned int in, const unsigned int size, const unsigned int offset) |
int | ks_isIceHardware () |
int | ks_default_ssitime () |
KS_PEPLAN_SHOT_DISTRIBUTION | ks_peplan_distribute_shots (const int etl, const int num_coords, const int center) |
void | ks_init_read (KS_READ *read) |
void | ks_init_trap (KS_TRAP *trap) |
void | ks_init_rtscalelog (KS_RT_SCALE_LOG *const rtscale) |
void | ks_init_wait (KS_WAIT *wait) |
void | ks_init_wave (KS_WAVE *wave) |
void | ks_init_rf (KS_RF *rf) |
void | ks_init_sms_info (KS_SMS_INFO *sms_info) |
void | ks_init_selrf (KS_SELRF *selrf) |
void | ks_init_readtrap (KS_READTRAP *readtrap) |
void | ks_init_readwave (KS_READWAVE *readwave) |
void | ks_init_phaser (KS_PHASER *phaser) |
void | ks_init_epi (KS_EPI *epi) |
void | ks_init_gradrfctrl (KS_GRADRFCTRL *gradrfctrl) |
void | ks_init_seqcontrol (KS_SEQ_CONTROL *seqcontrol) |
void | ks_init_seqcollection (KS_SEQ_COLLECTION *seqcollection) |
void | ks_init_echotrain (KS_ECHOTRAIN *const echotrain) |
STATUS | ks_init_slewratecontrol (LOG_GRAD *loggrd, PHYS_GRAD *phygrd, float srfact) WARN_UNUSED_RESULT |
STATUS | ks_eval_addtoseqcollection (KS_SEQ_COLLECTION *seqcollection, KS_SEQ_CONTROL *seqctrl) WARN_UNUSED_RESULT |
STATUS | ks_eval_seqcollection_isadded (KS_SEQ_COLLECTION *seqcollection, KS_SEQ_CONTROL *seqctrl) |
STATUS | ks_eval_addtraptogradrfctrl (KS_GRADRFCTRL *gradrfctrl, KS_TRAP *trap) WARN_UNUSED_RESULT |
STATUS | ks_eval_addwavetogradrfctrl (KS_GRADRFCTRL *gradrfctrl, KS_WAVE *wave) WARN_UNUSED_RESULT |
STATUS | ks_eval_addrftogradrfctrl (KS_GRADRFCTRL *gradrfctrl, KS_RF *rf) WARN_UNUSED_RESULT |
STATUS | ks_eval_addreadtogradrfctrl (KS_GRADRFCTRL *gradrfctrl, KS_READ *read) WARN_UNUSED_RESULT |
STATUS | ks_eval_addwaittogradrfctrl (KS_GRADRFCTRL *gradrfctrl, KS_WAIT *wait) WARN_UNUSED_RESULT |
STATUS | ks_eval_wait (KS_WAIT *wait, const char *const desc, int pg_duration, int maxduration) WARN_UNUSED_RESULT |
STATUS | ks_eval_isirot (KS_ISIROT *isirot, const char *const desc, int isinumber) WARN_UNUSED_RESULT |
STATUS | ks_eval_read (KS_READ *read, const char *const desc) WARN_UNUSED_RESULT |
STATUS | ks_eval_trap_constrained (KS_TRAP *trap, const char *const desc, float ampmax, float slewrate, int minduration) WARN_UNUSED_RESULT |
STATUS | ks_eval_trap (KS_TRAP *trap, const char *const desc) WARN_UNUSED_RESULT |
STATUS | ks_eval_trap2 (KS_TRAP *trap, const char *const desc) WARN_UNUSED_RESULT |
STATUS | ks_eval_trap1 (KS_TRAP *trap, const char *const desc) WARN_UNUSED_RESULT |
STATUS | ks_eval_trap_constrained_time_maxarea (KS_TRAP *trap, const char *const desc, float ampmax, float slewrate, float maxarea, int derate_slewrate) WARN_UNUSED_RESULT |
STATUS | ks_eval_set_asym_padding (KS_READTRAP *readtrap, float wanted_paddingarea_pre, float wanted_paddingarea_post) WARN_UNUSED_RESULT |
STATUS | ks_eval_trap1p (KS_TRAP *trap, const char *const desc) WARN_UNUSED_RESULT |
STATUS | ks_eval_trap_rotation_invariant_75_max_slewrate (KS_TRAP *trap, const char *const desc) |
STATUS | ks_eval_crusher (KS_WAVE *crusher, const float end_amp, const ks_crusher_constraints crusher_constraints) |
STATUS | ks_eval_readtrap_constrained (KS_READTRAP *readtrap, const char *const desc, float ampmax, float slewrate) WARN_UNUSED_RESULT |
STATUS | ks_eval_readtrap (KS_READTRAP *readtrap, const char *const desc) WARN_UNUSED_RESULT |
STATUS | ks_eval_readtrap2 (KS_READTRAP *readtrap, const char *const desc) WARN_UNUSED_RESULT |
STATUS | ks_eval_readtrap1 (KS_READTRAP *readtrap, const char *const desc) WARN_UNUSED_RESULT |
STATUS | ks_eval_readtrap_constrained_sample_duration (KS_READTRAP *readtrap, const char *const desc, const float ampmax, const float slewrate, const int t_A, const int sample_duration, const float area_post, const float area_total) WARN_UNUSED_RESULT |
STATUS | ks_eval_readwave_constrained (KS_READWAVE *readwave, KS_WAVE *acq_waves, const int numstates, int flag_symmetric_padding, ks_crusher_constraints pre_crusher_constraints, ks_crusher_constraints post_crusher_constraints) |
STATUS | ks_eval_readwave (KS_READWAVE *readwave, KS_WAVE *acq_wave, float pre_crusher_area, float post_crusher_area, int flag_symmetric_padding, ks_enum_crusher_strategy pre_strategy, ks_enum_crusher_strategy post_strategy) |
STATUS | ks_eval_readwave_multistated (KS_READWAVE *readwave, KS_WAVE *acq_waves, const int num_waves, float pre_crusher_area, float post_crusher_area, int flag_symmetric_padding, ks_enum_crusher_strategy pre_strategy, ks_enum_crusher_strategy post_strategy) |
STATUS | ks_eval_readtrap1p (KS_READTRAP *readtrap, const char *const desc) WARN_UNUSED_RESULT |
int | ks_eval_kynover_fromnex (int yres, float partial_ky, int minkynover) |
void | ks_eval_phaseviewtable (KS_PHASER *phaser) |
STATUS | ks_eval_phaser_adjustres (KS_PHASER *phaser, const char *const desc) WARN_UNUSED_RESULT |
STATUS | ks_eval_phaser_setaccel (KS_PHASER *phaser, int min_acslines, float R) WARN_UNUSED_RESULT |
STATUS | ks_eval_phaser_constrained (KS_PHASER *phaser, const char *const desc, float ampmax, float slewrate, int minplateautime) WARN_UNUSED_RESULT |
STATUS | ks_eval_phaser (KS_PHASER *phaser, const char *const desc) WARN_UNUSED_RESULT |
STATUS | ks_eval_phaser2 (KS_PHASER *phaser, const char *const desc) WARN_UNUSED_RESULT |
STATUS | ks_eval_phaser1 (KS_PHASER *phaser, const char *const desc) WARN_UNUSED_RESULT |
STATUS | ks_eval_phaser1p (KS_PHASER *phaser, const char *const desc) WARN_UNUSED_RESULT |
STATUS | ks_eval_wave (KS_WAVE *wave, const char *const desc, const int res, const int duration, const KS_WAVEFORM waveform) WARN_UNUSED_RESULT |
STATUS | ks_eval_mirrorwave (KS_WAVE *wave) |
STATUS | ks_eval_mirrorwaveform (KS_WAVEFORM waveform, int res) |
STATUS | ks_eval_wave_file (KS_WAVE *wave, const char *const desc, int res, int duration, const char *const filename, const char *const format) WARN_UNUSED_RESULT |
STATUS | ks_eval_rf_sinc (KS_RF *rf, const char *const desc, double bw, double tbw, float flip, int wintype) WARN_UNUSED_RESULT |
STATUS | ks_eval_rf_secant (KS_RF *rf, const char *const desc, float A0, float tbw, float bw) |
STATUS | ks_eval_rf_hard (KS_RF *rf, const char *const desc, int duration, float flip) WARN_UNUSED_RESULT |
STATUS | ks_eval_rf_hard_optimal_duration (KS_RF *rf, const char *const desc, int order, float flip, float offsetFreq) WARN_UNUSED_RESULT |
STATUS | ks_eval_rf_binomial (KS_RF *rf, const char *const desc, int offResExc, int nPulses, float flip, float offsetFreq, int MTreduction) WARN_UNUSED_RESULT |
STATUS | ks_eval_mt_rf_binomial (KS_RF *rf, const char *const desc, int sub_pulse_dur, int nPulses, int prp) |
STATUS | ks_eval_rfstat (KS_RF *rf) WARN_UNUSED_RESULT |
STATUS | ks_eval_rf (KS_RF *rf, const char *const desc) WARN_UNUSED_RESULT |
void | ks_eval_rf_relink (KS_RF *rf) |
STATUS | ks_eval_stretch_rf (KS_RF *rf, float stretch_factor) |
STATUS | ks_eval_seltrap (KS_TRAP *trap, const char *const desc, float slewrate, float slthick, float bw, int rfduration) WARN_UNUSED_RESULT |
STATUS | ks_eval_selrf_constrained (KS_SELRF *selrf, const char *const desc, float ampmax, float slewrate) WARN_UNUSED_RESULT |
STATUS | ks_eval_selrf (KS_SELRF *selrf, const char *const desc) WARN_UNUSED_RESULT |
STATUS | ks_eval_selrf2 (KS_SELRF *selrf, const char *const desc) WARN_UNUSED_RESULT |
STATUS | ks_eval_selrf1 (KS_SELRF *selrf, const char *const desc) WARN_UNUSED_RESULT |
STATUS | ks_eval_selrf1p (KS_SELRF *selrf, const char *const desc) WARN_UNUSED_RESULT |
STATUS | ks_eval_sms_get_phase_modulation (float *sms_phase_modulation, const int sms_multiband_factor, const int sms_phase_modulation_mode) WARN_UNUSED_RESULT |
float | ks_eval_findb1 (KS_SELRF *selrf, float max_b1, double scaleFactor, int sms_multiband_factor, int sms_phase_modulation_mode, float sms_slice_gap) |
void | ks_eval_transient_SPGR_FA_train_recursive (float *FA_train, float *MZ_train, int N, float E1, float target_MT, int n) |
void | ks_eval_transient_SPGR_FA_train_binary_search (float *FA_train, float *MZ_train, int N, float E1, float MTlo, float MThi, float total_FA) |
STATUS | ks_eval_check_FA_train (int N, float *FA_train, float *MZ_train, float total_FA) |
STATUS | ks_eval_transient_SPGR_FA_train (float *FA_train, int N, float TR, float T1, float total_FA) |
STATUS | ks_eval_sms_make_multiband (KS_SELRF *selrfMB, const KS_SELRF *selrf, const int sms_multiband_factor, const int sms_phase_modulation_mode, const float sms_slice_gap, int debug) WARN_UNUSED_RESULT |
float | ks_eval_sms_calc_slice_gap (int sms_multiband_factor, int nslices, float slthick, float slspace) |
float | ks_eval_sms_calc_slice_gap_from_scan_info (int sms_multiband_factor, int nslices, const SCAN_INFO *org_slice_positions) |
float | ks_eval_sms_calc_caipi_area (int caipi_fov_shift, float sms_slice_gap) |
STATUS | ks_eval_sms_make_pins (KS_SELRF *selrfPINS, const KS_SELRF *selrf, float sms_slice_gap) |
STATUS | ks_eval_sms_make_pins_dante (KS_SELRF *selrfPINS, const KS_SELRF *selrf, float sms_slice_gap) |
int | ks_eval_findNearestNeighbourIndex (float value, const float *x, int length) |
void | ks_eval_linear_interp1 (const float *x, int x_length, const float *y, const float *xx, int xx_length, float *yy) |
STATUS | ks_eval_trap2wave (KS_WAVE *wave, const KS_TRAP *trap) WARN_UNUSED_RESULT |
STATUS | ks_eval_coords2wave (KS_WAVE *wave, float *t, float *G, int num_coords, int dwell, const char *desc) WARN_UNUSED_RESULT |
STATUS | ks_eval_append_two_waves (KS_WAVE *first_wave, KS_WAVE *second_wave) WARN_UNUSED_RESULT |
STATUS | ks_eval_append_two_waveforms (KS_WAVEFORM first_waveform, KS_WAVEFORM second_waveform, int res1, int res2) WARN_UNUSED_RESULT |
STATUS | ks_eval_concatenate_waves (int num_waves, KS_WAVE *target_wave, KS_WAVE **waves_to_append) WARN_UNUSED_RESULT |
STATUS | ks_eval_epi_constrained (KS_EPI *epi, const char *const desc, float ampmax, float slewrate) WARN_UNUSED_RESULT |
STATUS | ks_eval_epi_setinfo (KS_EPI *epi) |
STATUS | ks_eval_epi_maxamp_slewrate (float *ampmax, float *slewrate, int xres, float quietnessfactor) |
STATUS | ks_eval_epi (KS_EPI *epi, const char *const desc, float quietnessfactor) WARN_UNUSED_RESULT |
STATUS | ks_eval_echotrain (KS_ECHOTRAIN *const echotrain) |
int | ks_echotrain_get_max_kspace_index (KS_ECHOTRAIN *echotrain) |
PSD_FILTER_GEN | ks_get_maxsize_finfo (PSD_FILTER_GEN my_psd_filter_spec[]) |
void | ks_grad_heat_reset () |
void | ks_grad_heat_init (KS_SEQ_COLLECTION *seqcollection_p, STATUS(*play)(const INT max_encode_mode, int nargs, void **args), int nargs, void **args) |
int | ks_eval_rflimits (KS_SAR *sar, KS_SEQ_COLLECTION *seqcollection) |
STATUS | ks_eval_gradlimits (int *newtime, KS_SEQ_COLLECTION *seqcollection, const LOG_GRAD *log_grad, STATUS(*play)(const INT max_encode_mode, int nargs, void **args), int nargs, void **args) |
STATUS | ks_eval_hwlimits (int *newtime, KS_SEQ_COLLECTION *seqcollection, const LOG_GRAD *log_grad, STATUS(*play)(const INT max_encode_mode, int nargs, void **args), int nargs, void **args) |
s64 | ks_eval_getduration (KS_SEQ_COLLECTION *seqcollection, STATUS(*play)(const INT max_encode_mode, int nargs, void **args), int nargs, void **args) |
int | ks_eval_mintr (int nslices, KS_SEQ_COLLECTION *seqcollection, int(*play_loop)(int, int, void **), int nargs, void **args) |
int | ks_eval_maxslicespertr (int TR, KS_SEQ_COLLECTION *seqcollection, int(*play_loop)(int, int, void **), int nargs, void **args) |
STATUS | ks_eval_seqctrl_setminduration (KS_SEQ_CONTROL *seqctrl, int mindur) |
STATUS | ks_eval_seqctrl_setduration (KS_SEQ_CONTROL *seqctrl, int dur) |
STATUS | ks_eval_seqcollection_durations_setminimum (KS_SEQ_COLLECTION *seqcollection) WARN_UNUSED_RESULT |
STATUS | ks_eval_seqcollection_durations_atleastminimum (KS_SEQ_COLLECTION *seqcollection) WARN_UNUSED_RESULT |
void | ks_eval_seqcollection_resetninst (KS_SEQ_COLLECTION *seqcollection) |
void | ks_print_seqcollection (KS_SEQ_COLLECTION *seqcollection, FILE *fp) |
void | ks_print_scaninfo (const SCAN_INFO *scan_info, int nslices, const char *desc, FILE *fp) |
s64 | ks_eval_seqcollection_gettotalduration (KS_SEQ_COLLECTION *seqcollection) |
s64 | ks_eval_seqcollection_gettotalminduration (KS_SEQ_COLLECTION *seqcollection) |
STATUS | ks_eval_seqcollection2rfpulse (RF_PULSE *rfpulse, KS_SEQ_COLLECTION *seqcollection) |
GRAD_PULSE | ks_eval_makegradpulse (KS_TRAP *trp, int gradchoice) |
void | ks_create_suffixed_description (char *const out, const char *const prefix, const char *suffix,...) __attribute__((format(printf |
void void | ks_read_header_pool (int *exam_number, int *series_number, int *run_number) |
float | ks_rt_scale_log_get (const KS_RT_SCALE_LOG *log, int instance_idx, int playout_idx) |
int | ks_rt_scale_log_get_state (const KS_RT_SCALE_LOG *log, int instance_idx, int playout_idx) |
void | ks_rt_scale_log_set (KS_RT_SCALE_LOG *log, int instance_idx, float ampscale) |
void | ks_rt_scale_log_set_state (KS_RT_SCALE_LOG *log, int instance_idx, int state) |
void | ks_rt_scale_log_next (KS_RT_SCALE_LOG *log) |
unsigned int | ks_calc_nextpow2 (unsigned int x) |
int | ks_calc_roundupms (int time) |
STATUS | ks_calc_filter (FILTER_INFO *echo_filter, int tsp, int duration) WARN_UNUSED_RESULT |
int | ks_calc_bw2tsp (float bw) |
float | ks_calc_tsp2bw (int tsp) |
int | ks_calc_trap_time2area (KS_TRAP *trap, float area) |
float | ks_calc_nearestbw (float bw) |
float | ks_calc_lower_rbw (float rbw) |
float | ks_calc_higher_rbw (float rbw) |
float | ks_calc_max_rbw (float ampmax, float fov) |
float | ks_calc_minfov (float ampmax, int tsp) |
float | ks_calc_minslthick (float bw) |
int | ks_calc_mintsp (float ampmax, float fov) |
float | ks_calc_fov2gradareapixel (float fov) |
STATUS | ks_phaseencoding_memorypool_init (KS_PHASEENCODING_COORD *entries, uint64_t size) |
void | ks_init_dynamic (KS_DYNAMIC_STATE *dynamic) |
int | ks_phaseencoding_isvalid (const KS_PHASEENCODING_PLAN *phaseenc_plan_ptr) |
KS_PHASEENCODING_COORD | ks_phaseencoding_get (const KS_PHASEENCODING_PLAN *phaseenc_plan_ptr, int encode, int shot) |
KS_PHASEENCODING_SHOTCOORDS | ks_phaseencoding_get_shot (const KS_PHASEENCODING_PLAN *phaseenc_plan_ptr, int shot) |
STATUS | ks_repeat_peplan (KS_PHASEENCODING_PLAN *peplan, const KS_PHASEENCODING_REPEAT_DESIGN *const repeat) |
void | ks_phaseencoding_set (KS_PHASEENCODING_PLAN *phaseenc_plan_ptr, int encode, int shot, int ky, int kz) |
void | ks_phaseencoding_print (const KS_PHASEENCODING_PLAN *phaseenc_plan_ptr) |
STATUS | ks_phaseencoding_alloc (KS_PHASEENCODING_PLAN *phaseenc_plan_ptr, int etl, int num_shots) WARN_UNUSED_RESULT |
STATUS | ks_phaseencoding_generate_simple (KS_PHASEENCODING_PLAN *phaseenc_plan_ptr, const char *const desc, KS_PHASER *phaser, KS_PHASER *zphaser, int encodes_per_shot) WARN_UNUSED_RESULT |
STATUS | ks_phaseencoding_generate_simple_ellipse (KS_PHASEENCODING_PLAN *phaseenc_plan_ptr, const char *const desc, KS_PHASER *phaser, KS_PHASER *zphaser) WARN_UNUSED_RESULT |
STATUS | ks_phaseencoding_generate_2d_singleshot_cal (KS_PHASEENCODING_PLAN *phaseenc_plan_ptr, int yres) WARN_UNUSED_RESULT |
int | ks_comp_kcoord_r_t (const void *a, const void *b) |
int | ks_comp_kcoord_z_y (const void *a, const void *b) |
int | ks_comp_kcoord_y_z (const void *a, const void *b) |
int | ks_comp_kview_r_t (const void *a, const void *b) |
int | ks_comp_kview_y_z (const void *a, const void *b) |
int | ks_comp_kview_e_t (const void *a, const void *b) |
int | ks_comp_kview_e_z (const void *a, const void *b) |
int | ks_cal_from_nacslines (int R, int nacslines) |
int | ks_get_ry_from_kcoords (KS_KCOORD *coord, const int num_coords) |
int | ks_get_rz_from_kcoords (KS_KCOORD *coord, const int num_coords) |
void | ks_get_matrix_from_kcoords (KS_KCOORD *K, const int num_coords, int *y, int *z) |
STATUS | ks_generate_3d_coords_caipi (KS_KSPACE_ACQ *kacq, int Ny, int Nz, int nover_y, int nover_z, int Ry, int Rz, int cal_y, int cal_z, KS_COVERAGE cal_coverage, KS_COVERAGE acq_coverage, int dy, int dz, int step_y, int step_z) WARN_UNUSED_RESULT |
STATUS | ks_generate_3d_coords_radial (KS_KSPACE_ACQ *kacq, int tiny_level, int Ny, int Nz, int Ry, int Rz, KS_RADIAL_SAMPLING_MODE radial_mode, KS_RADIAL_SAMPLING_COVERAGE radial_sampling_coverage) WARN_UNUSED_RESULT |
STATUS | ks_generate_3d_coords_simple (KS_KSPACE_ACQ *kacq, int Ny, int Nz, int nover_y, int nover_z, int Ry, int Rz, int cal_y, int cal_z, KS_COVERAGE cal_coverage, KS_COVERAGE acq_coverage) WARN_UNUSED_RESULT |
STATUS | ks_generate_2d_coords_cal (KS_KSPACE_ACQ *kacq, int num_desired_coords, int yres) WARN_UNUSED_RESULT |
STATUS | ks_generate_3d_coords_poisson_disc (KS_KSPACE_ACQ *kacq, int Ny, int Nz, float min_spacing, float max_spacing, KS_COVERAGE cal_coverage, int cal_y, int cal_z, RADIUS_PATTERN pattern) WARN_UNUSED_RESULT |
STATUS | ks_generate_3d_coords_poisson_disc_R (KS_KSPACE_ACQ *kacq, int Ny, int Nz, float R, KS_COVERAGE cal_coverage, int cal_y, int cal_z, RADIUS_PATTERN pattern) WARN_UNUSED_RESULT |
STATUS | ks_generate_3d_coords_epi (KS_KSPACE_ACQ *kacq, const KS_EPI *epitrain, const ks_enum_epiblipsign blipsign, const int Ry, const int caipi_delta) WARN_UNUSED_RESULT |
void | ks_pe_linear (int *view_order, int ETL) |
void | ks_pe_linear_roll (int *view_order, int ETL, int c) |
void | ks_pe_pivot_roll (int *view_order, int ETL, int c) |
void | ks_pivot_linear_center_symk (int *view_order, int ETL, int c) |
STATUS | ks_pe_permute_pclo_rad (int *view_order, const int etl, const int center) |
void | ks_pivot_specific_center_symk (int *view_order, int ETL, int c) |
void | ks_pivot_specific_center_radk (int *view_order, int ETL, int c) |
STATUS | ks_generate_peplan_from_kcoords (const KS_KSPACE_ACQ *kacq, KS_PHASEENCODING_PLAN *peplan, KS_MTF_DIRECTION mtf_direction, KS_VIEW_SORT_ORDER encode_shot_assignment_order, KS_VIEW_MTF_PROFILE mtf_profile, const int etl, int center, const KS_COORDINATE_TYPE *const coord_types) WARN_UNUSED_RESULT |
STATUS | ks_generate_peplan_from_kcoords_american (const KS_KSPACE_ACQ *kacq, KS_PHASEENCODING_PLAN *peplan, const KS_MTF_DIRECTION mtf_direction, const int etl, const int center) WARN_UNUSED_RESULT |
STATUS | ks_fse_calcecho (double *bestecho, double *optecho, int *nacqlines_to_kspacecenter, const KS_PHASER *const pe, KS_PF_EARLYLATE pf_direction, int TE, int etl, int esp) |
STATUS | ks_phaseencoding_generate_epi (KS_PHASEENCODING_PLAN *phaseenc_plan_ptr, const char *const desc, const KS_EPI *epitrain, const ks_enum_epiblipsign blipsign, const KS_PF_EARLYLATE pf_direction, const int numileavestoacq, ks_enum_sweep_order sweep_order, int numsegments, const int caipi_delta) WARN_UNUSED_RESULT |
STATUS | ks_calc_sliceplan (KS_SLICE_PLAN *slice_plan, int nslices, int slperpass) |
STATUS | ks_calc_sliceplan_interleaved (KS_SLICE_PLAN *slice_plan, int nslices, int slperpass, int inpass_interleaves) |
STATUS | ks_calc_sliceplan_sms (KS_SLICE_PLAN *slice_plan, int nslices, int slperpass, int multiband_factor) |
STATUS | ks_sms_check_divisibility (int *inpass_interleaves, const int sms_factor, const int nslices_per_pass, const int nslices) |
int | ks_calc_slice_acquisition_order_smssingleacq (DATA_ACQ_ORDER *dacq, int nslices) |
float | ks_calc_integrate_coords (float *t, float *G, int num_coords) |
int | ks_calc_sms_min_gap (DATA_ACQ_ORDER *dacq, int nslices) |
void | ks_print_sliceplan (const KS_SLICE_PLAN slice_plan, FILE *fp) |
void | ks_print_waveform (const KS_WAVEFORM waveform, const char *filename, int res) |
STATUS | ks_print_acqwaves (KS_SEQ_COLLECTION *seqcollection) |
void | ks_print_readwave (const KS_READWAVE *const readwave, const char *filename) |
void | ks_print_wave_part (const KS_WAVE *const wave, const char *filename, int startidx, int stopidx) |
void | ks_print_wave (const KS_WAVE *const wave, const char *filename) |
void | ks_print_read (KS_READ read, FILE *fp) |
void | ks_print_trap (KS_TRAP trap, FILE *fp) |
void | ks_print_readtrap (KS_READTRAP readtrap, FILE *fp) |
void | ks_print_phaser (KS_PHASER phaser, FILE *fp) |
void | ks_print_epi (KS_EPI epi, FILE *fp) |
void | ks_print_rf (KS_RF rf, FILE *fp) |
void | ks_print_rfpulse (RF_PULSE rfpulse, FILE *fp) |
void | ks_print_selrf (KS_SELRF selrf, FILE *fp) |
void | ks_print_readwaves (KS_ECHOTRAIN *const echotrain, const char *suffix, int rhkacq_uid) |
void | ks_print_gradrfctrl (KS_GRADRFCTRL gradrfctrl, FILE *fp) |
STATUS | ks_error (const char *format,...) __attribute__((format(printf |
STATUS STATUS | ks_dbg (const char *format,...) __attribute__((format(printf |
STATUS STATUS STATUS | existfile (const char *fname) |
int | ks_syslimits_hasICEhardware () |
void | ks_dbg_reset () |
float | ks_syslimits_ampmax (LOG_GRAD loggrd) |
float | ks_syslimits_ampmax2 (LOG_GRAD loggrd) |
float | ks_syslimits_ampmax1 (LOG_GRAD loggrd) |
float | ks_syslimits_ampmax1p (LOG_GRAD loggrd) |
int | ks_syslimits_ramptimemax (LOG_GRAD loggrd) |
float | ks_syslimits_slewrate (LOG_GRAD loggrd) |
float | ks_syslimits_slewrate2 (LOG_GRAD loggrd) |
float | ks_syslimits_slewrate1 (LOG_GRAD loggrd) |
float | ks_syslimits_slewrate1p (LOG_GRAD loggrd) |
float | ks_syslimits_gradtarget (LOG_GRAD loggrd, int board) |
float | ks_syslimits_ampmax_phys () |
int | ks_syslimits_ramptimemax_phys () |
float | ks_syslimits_slewrate_phys () |
unsigned short | ks_cycles_to_iphase (double cycles) |
unsigned short | ks_degrees_to_iphase (double degrees) |
unsigned short | ks_radians_to_iphase (double radians) |
float | ks_calc_selgradamp (float rfbw, float slthick) |
void | ks_wave_compute_params (KS_WAVE *const wave) |
int | ks_wave_res (const KS_WAVE *wave) |
float | ks_waveform_max (const KS_WAVEFORM waveform, int res) |
float | ks_wave_max (const KS_WAVE *wave) |
float | ks_waveform_min (const KS_WAVEFORM waveform, int res) |
float | ks_wave_min (const KS_WAVE *wave) |
float | ks_waveform_absmax (const KS_WAVEFORM waveform, int res) |
float | ks_waveform_maxslew (const KS_WAVEFORM waveform, int res, int duration, int *index) |
float | ks_wave_maxslew (const KS_WAVE *wave) |
short | ks_iwave_absmax (const KS_IWAVE waveform, int res) |
float | ks_wave_absmax (const KS_WAVE *wave) |
int | ks_wave_time2area (const KS_WAVE *wave, float area_in) |
float | ks_waveform_area (const KS_WAVEFORM waveform, int start, int end, int dwelltime) |
long | ks_iwave_area (const KS_IWAVE iwave, int start, int end, int dwelltime) |
float | ks_wave_area (const KS_WAVE *wave, int start, int end) |
float | ks_wave_full_area (const KS_WAVE *wave) |
float | ks_waveform_sum (const KS_WAVEFORM waveform, int res) |
float | ks_wave_sum (const KS_WAVE *wave) |
float | ks_waveform_norm (const KS_WAVEFORM waveform, int res) |
float | ks_wave_norm (const KS_WAVE *wave) |
void | ks_waveform_cumsum (KS_WAVEFORM cumsumwaveform, const KS_WAVEFORM waveform, int res) |
void | ks_wave_cumsum (KS_WAVE *cumsumwave, const KS_WAVE *wave) |
void | ks_waveform_multiply (KS_WAVEFORM waveform_mod, const KS_WAVEFORM waveform, int res) |
void | ks_wave_multiply (KS_WAVE *wave_mod, const KS_WAVE *wave) |
void | ks_waveform_add (KS_WAVEFORM waveform_mod, const KS_WAVEFORM waveform, int res) |
void | ks_eval_readwave_negatestate (KS_READWAVE *readwave, int state) |
void | ks_wave_add (KS_WAVE *wave_mod, const KS_WAVE *wave) |
void | ks_waveform_multiplyval (KS_WAVEFORM waveform, float val, int res) |
void | ks_wave_multiplyval (KS_WAVE *wave, float val) |
void | ks_waveform_addval (KS_WAVEFORM waveform, float val, int res) |
void | ks_wave_addval (KS_WAVE *wave, float val) |
STATUS | ks_waveform2iwave (KS_IWAVE iwave, const KS_WAVEFORM waveform, int res, int board, float max, float fs_factor) WARN_UNUSED_RESULT |
STATUS | ks_wave2iwave (KS_IWAVE iwave, const KS_WAVE *wave, int board) WARN_UNUSED_RESULT |
WF_PULSE * | ks_pg_echossp (WF_PULSE *echo, const char *suffix) |
STATUS | ks_pg_trap (KS_TRAP *trap, KS_SEQLOC loc, KS_SEQ_CONTROL *ctrl) WARN_UNUSED_RESULT |
STATUS | ks_pg_read (KS_READ *read, int pos, KS_SEQ_CONTROL *ctrl) WARN_UNUSED_RESULT |
STATUS | ks_pg_phaser (KS_PHASER *phaser, KS_SEQLOC loc, KS_SEQ_CONTROL *ctrl) WARN_UNUSED_RESULT |
STATUS | ks_pg_readtrap (KS_READTRAP *readtrap, KS_SEQLOC loc, KS_SEQ_CONTROL *ctrl) WARN_UNUSED_RESULT |
STATUS | ks_pg_wave (KS_WAVE *wave, KS_SEQLOC loc, KS_SEQ_CONTROL *ctrl) WARN_UNUSED_RESULT |
STATUS | ks_pg_addwaveformstate (KS_WAVE *wave, KS_WAVEFORM waveform, int state_index) |
STATUS | ks_pg_rf (KS_RF *rf, KS_SEQLOC loc, KS_SEQ_CONTROL *ctrl) WARN_UNUSED_RESULT |
STATUS | ks_pg_selrf (KS_SELRF *selrf, KS_SEQLOC loc, KS_SEQ_CONTROL *ctrl) WARN_UNUSED_RESULT |
STATUS | ks_pg_wait (KS_WAIT *wait, KS_SEQLOC loc, KS_SEQ_CONTROL *ctrl) WARN_UNUSED_RESULT |
STATUS | ks_pg_isirot (KS_ISIROT *isirot, SCAN_INFO scan_info, int pos, void(*rotfun)(), KS_SEQ_CONTROL *ctrl) WARN_UNUSED_RESULT |
STATUS | ks_pg_epi_dephasers (KS_EPI *epi, KS_SEQLOC loc, KS_SEQ_CONTROL *ctrl) WARN_UNUSED_RESULT |
STATUS | ks_pg_epi_rephasers (KS_EPI *epi, KS_SEQLOC loc, KS_SEQ_CONTROL *ctrl) WARN_UNUSED_RESULT |
STATUS | ks_pg_epi_echo (KS_EPI *epi, KS_SEQLOC loc, KS_SEQ_CONTROL *ctrl) WARN_UNUSED_RESULT |
STATUS | ks_pg_epi (KS_EPI *epi, KS_SEQLOC loc, KS_SEQ_CONTROL *ctrl) WARN_UNUSED_RESULT |
KS_SEQLOC | ks_pg_get_trap_loc (KS_TRAP *trap, int instance) |
KS_SEQLOC | ks_pg_get_wave_loc (KS_WAVE *wave, int instance) |
void | ks_mat4_zero (KS_MAT4x4 m) |
void | ks_mat4_identity (KS_MAT4x4 m) |
void | ks_mat4_print (const KS_MAT4x4 m) |
void | ks_mat4_multiply (KS_MAT4x4 lhs, const KS_MAT4x4 rhs_left, const KS_MAT4x4 rhs_right) |
void | ks_mat4_invert (KS_MAT4x4 lhs, const KS_MAT4x4 rhs) |
void | ks_mat4_double_to_float (KS_MAT4x4f out, const KS_MAT4x4 in) |
void | ks_mat4_float_to_double (KS_MAT4x4 out, const KS_MAT4x4f in) |
void | ks_mat4_setgeometry (KS_MAT4x4 lhs, float x, float y, float z, float xr, float yr, float zr) |
void | ks_mat4f_setgeometry (KS_MAT4x4f lhs, float x, float y, float z, float xr, float yr, float zr) |
void | ks_mat4_setrotation1axis (KS_MAT4x4 rhs, float rot, char axis) |
void | ks_mat4_extractrotation (KS_MAT3x3 R, const KS_MAT4x4 M) |
void | ks_mat4_extracttranslation (double *T, const KS_MAT4x4 M) |
void | ks_mat3_identity (KS_MAT3x3 m) |
void | ks_mat3_multiply (KS_MAT3x3 lhs, const KS_MAT3x3 rhs_left, const KS_MAT3x3 rhs_right) |
void | ks_mat3_print (const KS_MAT3x3 m) |
void | ks_mat3_apply (double *w, const KS_MAT3x3 R, const double *v) |
void | ks_mat3f_apply (float *w, const KS_MAT3x3f R, const float *v) |
void | ks_mat3_invapply (double *w, const KS_MAT3x3 R, const double *v) |
void | ks_mat3f_invapply (float *w, const KS_MAT3x3f R, const float *v) |
void | ks_scan_update_slice_location (SCAN_INFO *new_loc, const SCAN_INFO orig_loc, const KS_MAT4x4 M_physical, const KS_MAT4x4 M_logical) |
void | ks_scan_update_slice_location_float (SCAN_INFO *new_loc, const SCAN_INFO orig_loc, const KS_MAT4x4f M_physical, const KS_MAT4x4f M_logical) |
void | ks_scan_rotate (SCAN_INFO slice_pos) |
void | ks_scan_isirotate (KS_ISIROT *isirot) |
STATUS | ks_pg_fse_flip_angle_taperoff (double *flip_angles, int etl, double flip1, double flip2, double flip3, double target_flip, int start_middle) |
void | ks_pg_mod_fse_rfpulse_structs (KS_SELRF *rf1, KS_SELRF *rf2, KS_SELRF *rf3, const double *flip_angles, const int etl) |
void | ks_instancereset_trap (KS_TRAP *trap) |
void | ks_instancereset_wait (KS_WAIT *wait) |
void | ks_instancereset_phaser (KS_PHASER *phaser) |
void | ks_instancereset_readtrap (KS_READTRAP *readtrap) |
void | ks_instancereset_rf (KS_RF *rf) |
void | ks_instancereset_selrf (KS_SELRF *selrf) |
void | ks_instancereset_epi (KS_EPI *epi) |
int | ks_compare_wfi_by_timeboard (const KS_WFINSTANCE *a, const KS_WFINSTANCE *b) |
int | ks_compare_wfi_by_boardtime (const KS_WFINSTANCE *a, const KS_WFINSTANCE *b) |
int | ks_compare_wfp_by_time (const WF_PULSE *a, const WF_PULSE *b) |
int | ks_compare_pint (const void *v1, const void *v2) |
int | ks_compare_pshort (const void *v1, const void *v2) |
int | ks_compare_pfloat (const void *v1, const void *v2) |
int | ks_compare_int (const void *v1, const void *v2) |
int | ks_compare_short (const void *v1, const void *v2) |
int | ks_compare_float (const void *v1, const void *v2) |
void | ks_sort_getsortedindx (int *sortedindx, int *array, int n) |
void | ks_sort_getsortedindx_s (int *sortedindx, short *array, int n) |
void | ks_sort_getsortedindx_f (int *sortedindx, float *array, int n) |
void | ks_sort_wfi_by_timeboard (KS_WFINSTANCE *a, int nitems) |
void | ks_sort_loc_by_timeboard (KS_SEQLOC *a, int nitems) |
void | ks_sort_wfi_by_boardtime (KS_WFINSTANCE *a, int nitems) |
void | ks_sort_wfp_by_time (WF_PULSE *a, int nitems) |
int | ks_file_exist (char *filename) |
void | ks_plot_host_slicetime_delete () |
void | ks_plot_slicetime_begin () |
void | ks_plot_slicetime (const KS_SEQ_CONTROL *ctrl, int nslices, float *slicepos_mm, float slthick_mm, KS_PLOT_EXCITATION_MODE exctype) |
void | ks_plot_slicetime_endofslicegroup (const char *desc) |
void | ks_plot_slicetime_endofslicegroup_tagged (const char *desc, const KS_PLOT_SLICEGROUP_MODE tag) |
void | ks_plot_slicetime_endofpass (KS_PLOT_PASS_MODE pass_mode) |
void | ks_plot_slicetime_end () |
void | ks_plot_write_peplans (const KS_PHASEENCODING_PLAN *const *plans, const int num_plans, FILE *fp) |
void | ks_plot_host_slicetime_begin () |
void | ks_plot_host_slicetime (const KS_SEQ_CONTROL *ctrl, int nslices, float *slicepos_mm, float slthick_mm, KS_PLOT_EXCITATION_MODE exctype) |
void | ks_plot_host_slicetime_endofslicegroup (const char *desc, const KS_PLOT_SLICEGROUP_MODE tag) |
void | ks_plot_host_slicetime_endofpass (KS_PLOT_PASS_MODE pass_mode) |
void | ks_plot_host_slicetime_end () |
void | ks_plot_host (const KS_SEQ_COLLECTION *seqcollection, const KS_PHASEENCODING_PLAN *plan) |
void | ks_plot_host_seqctrl (const KS_SEQ_CONTROL *ctrl, const KS_PHASEENCODING_PLAN *plan) |
void | ks_plot_host_seqctrl_manyplans (const KS_SEQ_CONTROL *ctrl, const KS_PHASEENCODING_PLAN **plan, const int num_plans) |
void | ks_plot_tgt_reset (KS_SEQ_CONTROL *ctrl) |
void | ks_plot_filename (char *fname, char *path, char *outputdir, char *outputdir_uid, const char *const seq_desc) |
void | ks_plot_saveconfig (KS_SEQ_CONTROL *ctrl) |
void | ks_plot_tgt_addframe (KS_SEQ_CONTROL *ctrl) |
int | ks_get_center_encode (const KS_PHASEENCODING_PLAN *const peplan, int shot, int yres, int zres) |
int | ks_peplan_find_center_from_linear_sweep (KS_KCOORD *const K, KS_VIEW *view, const int num_coords, const KS_MTF_DIRECTION mtf_direction, const int sweep_sign, const int segment_size, const int start_encode) |
int | ks_get_center_encode_linearsweep (const KS_KSPACE_ACQ *kacq, const int etl, const KS_PF_EARLYLATE pf_earlylate_te) |
float | ks_calc_caipi_scale (const int ky, const int R, const int caipi_factor) |
float | ks_calc_caipi_phase (const float sms_slice_gap, const int sms_multiband_factor, const SCAN_INFO *slice_info, const float caipi_blip_area, const int slice_encode_dir) |
float | ks_calc_caipi_offset_phase (const float sms_slice_gap, const int sms_multiband_factor, const SCAN_INFO *slice_info, const int caipi_factor, const float caipi_blip_area, const int ky, const int R, const int slice_encode_dir) |
STATUS | ks_eval_caipiblip (KS_TRAP *caipiblip, const int caipi_factor, const float sms_slice_gap, const KS_DESCRIPTION seq_desc) |
int | ks_eval_sms_rf_scan_info (SCAN_INFO *sms_slice_positions, const SCAN_INFO *org_slice_positions, int sms_multiband_factor, int nslices) |
void | ks_scan_rf_ampscale (KS_RF *rf, int instanceno, float ampscale) |
void | ks_scan_rf_on (KS_RF *rf, int instanceno) |
void | ks_scan_rf_on_chop (KS_RF *rf, int instanceno) |
void | ks_scan_rf_off (KS_RF *rf, int instanceno) |
void | ks_scan_selrf_setfreqphase (KS_SELRF *selrf, int instanceno, SCAN_INFO sliceinfo, float rfphase) |
void | ks_scan_selrf_setfreqphase_pins (KS_SELRF *selrf, int instanceno, SCAN_INFO sliceinfo, int sms_multiband_factor, float sms_slice_gap, float rfphase) |
void | ks_scan_rf_setphase (KS_RF *rf, int instanceno, float rfphase) |
void | ks_scan_wave2hardware (KS_WAVE *wave, const KS_WAVEFORM newwaveform, int state) |
void | ks_scan_setwavestate (KS_WAVE *wave, int state, int instance) |
void | ks_scan_offsetfov_iso (KS_READTRAP *readtrap, int instanceno, SCAN_INFO sliceinfo, double ky, double kz, double rcvphase) |
void | ks_scan_offsetfov (KS_READTRAP *readtrap, int instanceno, SCAN_INFO sliceinfo, float view, float phasefovratio, float rcvphase) |
void | ks_scan_offsetfov3D (KS_READTRAP *readtrap, int instanceno, SCAN_INFO sliceinfo, float kyview, float phasefovratio, float kzview, float zphasefovratio, float rcvphase) |
void | ks_scan_offsetfov3D_readwave (KS_READWAVE *readwave, int instanceno, SCAN_INFO sliceinfo, float ky, float phasefovratio, float kz, float zphasefovratio, float rcvphase) |
void | ks_scan_offsetfov_iso_readwave (KS_READWAVE *readwave, int instanceno, SCAN_INFO sliceinfo, double ky, double kz, double rcvphase) |
void | ks_scan_offsetfov_iso_readwave_oneread (KS_READWAVE *readwave, KS_READ *read, int gradinstanceno, int readinstanceno, SCAN_INFO sliceinfo, double ky, double kz, double rcvphase) |
void | ks_scan_offsetfov_readwave (KS_READWAVE *readwave, int instanceno, SCAN_INFO sliceinfo, float ky, float phasefovratio, float rcvphase) |
int | ks_eval_append_blip (KS_WAVE *wave, const float s, const int max_points, const float area) |
unsigned short | ks_scan_omegatrap_hz (KS_TRAP *trap, int instanceno, float Hz, int omega_iwave_phase_at_null) |
unsigned short | ks_scan_omegawave_hz (KS_WAVE *wave, int instanceno, float Hz, int omega_iwave_phase_at_null) |
void | ks_scan_wait (KS_WAIT *wait, int waitperiod) |
void | ks_scan_trap_ampscale (KS_TRAP *trap, int instanceno, float ampscale) |
void | ks_scan_wave_ampscale (KS_WAVE *wave, int instanceno, float ampscale) |
void | ks_scan_trap_ampscale_slice (KS_TRAP *trap, int start, int skip, int count, float ampscale) |
void | ks_scan_phaser_kmove (KS_PHASER *phaser, int instanceno, double pixelunits) |
void | ks_scan_phaser_toline (KS_PHASER *phaser, int instanceno, int view) |
void | ks_scan_phaser_fromline (KS_PHASER *phaser, int instanceno, int view) |
void | ks_scan_phaser_average (KS_PHASER *phaser, int instanceno) |
void | ks_scan_phaser_max (KS_PHASER *phaser, int instanceno) |
int | ks_scan_getsliceloc (const KS_SLICE_PLAN *slice_plan, int passindx, int sltimeinpass) |
int | ks_scan_getslicetime (const KS_SLICE_PLAN *slice_plan, int passindx, int slloc) |
ks_enum_epiblipsign | ks_scan_epi_verify_phaseenc_plan (KS_EPI *epi, KS_PHASEENCODING_PLAN *phaseenc_plan, int shot) |
void | ks_scan_epi_shotcontrol_sms (KS_EPI *epi, int echo, SCAN_INFO sliceinfo, KS_PHASEENCODING_COORD starting_coord, ks_enum_epiblipsign blipsign, float rcvphase, int sms_factor, float sms_slice_gap, int caipi_factor, int sms_slice_encoding_direction) |
void | ks_scan_epi_shotcontrol (KS_EPI *epi, int echo, SCAN_INFO sliceinfo, KS_PHASEENCODING_COORD starting_coord, ks_enum_epiblipsign blipsign, float rcvphase) |
void | ks_scan_epi_loadecho (KS_EPI *epi, int echo, int storeecho, int slice, KS_PHASEENCODING_COORD starting_coord, ks_enum_epiblipsign blipsign, KS_DYNAMIC_STATE *dynamic) |
void | ks_loaddab_reserved (WF_PULSE_ADDR echo, short state, short resampler_index) |
void | ks_loaddab (WF_PULSE_ADDR echo, const char *dab_array) |
void | ks_loaddab_full (WF_PULSE_ADDR echo, const char *custom_dab_array) |
const KS_READ * | ks_get_read_in_echotrain (const KS_ECHOTRAIN *echotrain, const int readout_index) |
WF_PULSE_ADDR | ks_get_wf_pulse (KS_ECHOTRAIN *echotrain, const int readout_index) |
LONG | ks_get_override_R1 (KS_ECHOTRAIN *echotrain, const int readout_index) |
void | ks_scan_acq_to_rtp (KS_READ *read, TYPDAB_PACKETS dabacqctrl, float fatoffset) |
void | ks_scan_switch_to_sequence (KS_SEQ_CONTROL *ctrl) |
int | ks_scan_playsequence (KS_SEQ_CONTROL *ctrl) |
STATUS | ks_scan_loaddabwithindices (WF_PULSE_ADDR pulse, LONG slice, LONG echo, LONG view, uint8_t acq, uint8_t vol, TYPDAB_PACKETS acqon_flag) |
STATUS | ks_scan_loaddabwithindices_nex (WF_PULSE_ADDR pulse, LONG slice, LONG echo, LONG view, uint8_t acq, uint8_t vol, LONG operation, TYPDAB_PACKETS acqon_flag) |
int | ks_scan_wait_for_rtp (void *rtpmsg, int maxmsgsize, int maxwait, KS_SEQ_CONTROL *waitctrl) |
void | ks_copy_and_reset_obj (void *pobj) |
void | ks_show_clock (FLOAT scantime) |
float | ks_scan_rf_phase_spoiling (int counter) |
int | ks_scan_gettherightshot (const KS_DYNAMIC_STATE *dynamic) |
float | ks_get_trapamp_instance (const KS_TRAP *trap, int instance) |
void | ks_tgt_reset_gradrfctrl (KS_GRADRFCTRL *gradrfctrl) |
int | ks_eval_clear_readwave (KS_READWAVE *readwave) |
void | ks_polyder (const double *coeffs, const int order, double *der_coeffs) |
void | ks_polyval (const double *coeffs, const int order, const double *x, const int numx, double *values) |
void | ks_polyval_f (const double *coeffs, const int order, const float *x, const int numx, float *values) |
double | ks_Newtons_method (const double *coeffs, const int order, const double x0, const int num_iter) |
int | ks_pg_readwave (KS_READWAVE *readwave, KS_SEQLOC loc, KS_SEQ_CONTROL *ctrl) |
STATUS | ks_pg_echotrain_readout (KS_ECHOTRAIN *echotrain, int readout_index, int echo_time, KS_ECHOTRAIN_READOUT_TIMING *timing, KS_SEQ_CONTROL *ctrl) |
int | ks_numplaced (KS_BASE *base) |
void | ks_set_opcode (WF_PULSE_ADDR echo, short opcode) |
int | ks_write_vector_bf (float *vec, uint32_t numel, const char *fname) |
FILE * | ks_open_file_in_embed (const char *fname, const char *write_mode) |
Variables | |
int | abort_on_kserror |
int | ks_rhoboard |
LOG_GRAD | loggrd |
PHYS_GRAD | phygrd |
int | pscR1 |
int | rspent |
(typedef structs) and function prototypes for KSFoundation. @inline
this file in the main sequence
#define WARN_UNUSED_RESULT |
Compiler flag for DV25 and higher, causing a compiler error if the returned function value is not used by the calling function
#define KS_GOLDEN_MEANS_1D (1.0+sqrt(5.0))/2.0 /* approx. 1.618033988749895 */ |
#define KS_GOLDEN_MEANS_2D_1 1.0/pow((1.0/pow((sqrt(3.1E+1)*sqrt(1.08E+2))/1.08E+2+2.9E+1/5.4E+1,1.0/3.0)/9.0+pow((sqrt(3.1E+1)*sqrt(1.08E+2))/1.08E+2+2.9E+1/5.4E+1,1.0/3.0)+1.0/3.0),2.0) /* approx. 0.4655712319 */ |
#define KS_GOLDEN_MEANS_2D_2 1.0/(1.0/pow((sqrt(3.1E+1)*sqrt(1.08E+2))/1.08E+2+2.9E+1/5.4E+1,1.0/3.0)/9.0+pow((sqrt(3.1E+1)*sqrt(1.08E+2))/1.08E+2+2.9E+1/5.4E+1,1.0/3.0)+1.0/3.0) /* approx. 0.6823278038 */ |
#define KS_ANGLE_PER_INT_16_MAX_180 (180.0 / 0x8000) |
#define KS_ANGLE_PER_UINT_16_MAX_180 (180.0 / 0xF000) |
#define KS_SIGN | ( | x | ) | ((x < 0) ? -1 : 1) |
#define DEFAULT_SCAN_INFO_HEAD 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 1.0, 1.0, 1.0 |
#define INT_MAX 2147483647 |
#define DEFAULT_SCAN_INFO_TAIL |
#define DEFAULT_AXIAL_SCAN_INFO |
#define DEFAULT_AX_SCAN_INFO_FREQ_LR DEFAULT_AXIAL_SCAN_INFO |
#define DEFAULT_AX_SCAN_INFO_FREQ_AP |
#define DEFAULT_SAG_SCAN_INFO_FREQ_SI |
#define DEFAULT_SAG_SCAN_INFO_FREQ_AP |
#define DEFAULT_COR_SCAN_INFO_FREQ_SI |
#define DEFAULT_COR_SCAN_INFO_FREQ_LR |
#define KS_NOTSET -1 |
Unrealistic value used on some variables to trigger errors
#define KS_INFINITY (1.0/0.0) |
Infinity
#define _cvdesc | ( | cv, | |
string | |||
) |
#define KS_EXPAND_OPUSER | ( | number | ) | number, &_opuser ## number |
expand opuser number. For instance KS_EXPAND_OPUSER(5) becomes 5 and &_opuser5
#define KS_EXPAND_CVFLOAT | ( | number | ) | &_opuser ## number |
#define KS_OPUSER_FROM_NUM | ( | number | ) | opuser_from_number(KS_EXPAND_CVFLOAT(number)); |
#define KS_OPUSER_VALUE_FROM_NUM | ( | number | ) | *opuser_from_number(KS_EXPAND_CVFLOAT(number))->addr; |
#define areSame | ( | a, | |
b | |||
) | (fabs((a) - (b)) < 1e-5) |
#define areWithinTol | ( | a, | |
b, | |||
tol | |||
) | (fabs((a) - (b)) < tol) |
#define areSameRelative | ( | a, | |
b, | |||
r | |||
) | (fabs((a) - (b)) < r * (fabs((a)) + fabs((b)))) |
#define isSet | ( | a | ) | !isNotSet(a) |
#define ks_abs | ( | x | ) | (x)<0 ? -(x) : (x) |
#define ks_round | ( | x | ) | ((x)>=0?(int)((x)+0.5):(int)((x)-0.5)) |
#define KS_RUP_GRD_FLOAT | ( | X | ) | ( fmod((X), GRAD_UPDATE_TIME) > 0 ? RUP_GRD( (X) + 1 ) : RUP_GRD( (X) ) ) |
#define KS_SRC_FILE (__builtin_strrchr (__FILE__, '/') ? __builtin_strrchr (__FILE__, '/') + 1 : __FILE__) |
#define KS_THROW | ( | format, | |
... | |||
) | ks_error("%s (%s:%d): " format, __FUNCTION__, KS_SRC_FILE, __LINE__, ##__VA_ARGS__) |
#define KS_RAISE_TRACE_FN ks_error |
#define KS_RAISE | ( | status | ) | if ((status) != SUCCESS) { KS_RAISE_TRACE_FN("===> %s (%s:%d)", __FUNCTION__, KS_SRC_FILE, __LINE__); return ADVISORY_FAILURE; } |
#define KS_ISI_predelay 256 |
#define KS_ISI_time 256 |
#define KS_ISI_rotupdatetime 12 |
#define KS_ISI_postdelay 256 |
#define KS_MINPLATEAUTIME 8 |
Shortest plateautime of a trapezoid (KS_TRAP)
#define KS_DEFAULT_SSI_TIME 1500 |
#define KS_DEFAULT_SSI_TIME_MR750w 500 |
#define KS_DEFAULT_SSI_TIME_MR750 1000 |
#define KS_DEFAULT_SSI_TIME_MR450W 500 |
#define KS_DEFAULT_SSI_TIME_MR450 1000 |
#define KS_DEFAULT_SSI_TIME_PREMIER 500 |
#define KS_DEFAULT_SSI_TIME_ICE 200 |
#define KS_DEFAULT_SSI_TIME_OTHERWISE 1500 |
#define KS_RFSSP_PRETIME 64 |
Time in [us] before an RF pulse that is needed for SSP packets. May sometimes be taken into account
#define KS_RFSSP_POSTTIME 56 |
Time in [us] after an RF pulse that is needed for SSP packets. May sometimes be taken into account
#define KS_EPI_MIN_INTERTRAIN_SSPGAP 80 |
EXPERIMENTAL. Check how the SSP packets in the beginning/end of the EPI train can be packed to minimize this one for all possible acq. parameters
#define L_REF 10 |
#define KS_SSP_PRE_READ_TIME 256 |
#define PSD_HRMW_COIL 13 |
#define HAVE_PREMIER_GRADIENTS (cfgcoiltype == PSD_HRMW_COIL) |
#define HALF_KHZ_USEC 500.0 |
#define KS_SAVEPFILES RHXC_AUTO_LOCK |
Bit for rhexecctrl
to dump Pfiles
#define KS_GERECON (RHXC_AUTO_DISPLAY+RHXC_XFER_IM) |
Bit for rhexecctrl
for GE product image reconstruction
#define KS_3D_SELECTED (opimode == PSD_3D || opimode == PSD_3DM) |
#define KS_3D_SINGLESLAB_SELECTED (opimode == PSD_3D) |
#define KS_3D_MULTISLAB_SELECTED (opimode == PSD_3DM) |
#define KS_PLANE_AX ((exist(opplane) == PSD_AXIAL) || (exist(opplane) == PSD_OBL && exist(opobplane) == PSD_AXIAL)) |
#define KS_PLANE_COR ((exist(opplane) == PSD_COR) || (exist(opplane) == PSD_OBL && exist(opobplane) == PSD_COR)) |
#define KS_PLANE_SAG ((exist(opplane) == PSD_SAG) || (exist(opplane) == PSD_OBL && exist(opobplane) == PSD_SAG)) |
#define KS_DESCRIPTION_LENGTH 128 |
Max # of characters in the description of the various sequence objects
#define KS_MAXWAVELEN 10000 |
KS_MAXWAVELEN (10000) sample points
#define KS_MAXUNIQUE_RF 30 |
Maximum number of different RF pulses in the sequence (c.f. also grad_rf_empty**.h)
#define KS_MAXUNIQUE_TRAP 200 |
Maximum number of different KS_TRAPs in the sequence
#define KS_MAXUNIQUE_WAVE 100 |
Maximum number of different KS_WAVEs in the sequence
#define KS_MAXUNIQUE_WAIT 10 |
Maximum number of different KS_WAITs in the sequence
#define KS_READCONTROL_MAXSTATE 2 |
Maximum number of states in a KS_ECHOTRAIN object
#define KS_MAXUNIQUE_READWAVE 2 |
Maximum number of different KS_READWAVEs in the sequence
#define KS_MAXUNIQUE_SEQUENCES 200 |
Maximum number of pulses sequence modules, including core, (i.e. with own SEQLENGTH/bofffset()) in this pulse sequence
#define KS_MAX_SEQUENCE_PLAYOUTS 200 |
Maximum number of pulses sequence modules, played during a TR
#define KS_MAX_PHASEDYN 2049 |
Maximum number of phase encoding steps in a KS_PHASER sequence object
#define KS_MAXUNIQUE_READ 2048 |
Maximum number of readout instances
#define KS_MAX_NUM_KSPACES 16 |
#define KS_MAX_NUM_USERDATA 10 |
#define KS_EPI_MINBLIPAREA 100 |
Default value of lowest EPI blip area until blip is made wider to avoid discretization errors
#define KS_ECHOTRAIN_MAX_TRAPS 4 |
Maximum number of different KS_READTRAP objects in a KS_ECHOTRAIN
#define KS_ECHOTRAIN_MAX_WAVES 2 |
Maximum number of different KS_READWAVE objects in a KS_ECHOTRAIN
#define KS_INITZEROS | ( | n | ) | {[0 ... (n-1)] = 0} |
C macro to initialize arrays with zeros at declaration
#define KS_INITVALUE | ( | n, | |
a | |||
) | {[0 ... (n-1)] = a} |
C macro to initialize each element in an array with a number at declaration
#define KS_INIT_BASE | ( | OBJECT | ) | {0,0,0,NULL,sizeof(OBJECT)} |
#define KS_INIT_FINFO {0.0, 0, 0.0, 0.0, KS_NOTSET, 0, 0, 0} |
#define KS_INIT_DESC KS_INITZEROS(KS_DESCRIPTION_LENGTH) |
Default values for KS_DESCRIPTION strings
#define KS_INIT_WFINSTANCE {NULL, 0, NULL, {KS_INIT_SEQLOC}} |
Default values for KS_WFINSTANCE structs (internal use)
#define KS_INIT_RT_SCALE_LOG {NULL, NULL, 0, 0, 0, 0} |
#define KS_INIT_WAVEVALUE 0 |
Default value for one element in a KS_WAVEFORM
#define KS_WAVE_MAXNSTATES 16 |
#define KS_INIT_WAVEFORM KS_INITVALUE(KS_MAXWAVELEN, KS_INIT_WAVEVALUE) |
Default values for KS_WAVEFORM
#define KS_INIT_WAVE {KS_INIT_BASE(KS_WAVE), KS_INIT_DESC, 0, 0, KS_INIT_WAVEFORM, {NULL}, {0,0,0}, KS_NOTSET, NULL, NULL, NULL, KS_INIT_RT_SCALE_LOG, 1.0, 0.0, 0.0, 0.0, 0.0, 0.0, NULL, NULL} |
Default values for KS_WAVE sequence objects
#define KS_INIT_WAIT {KS_INIT_BASE(KS_WAIT), KS_INIT_DESC, 0, KS_NOTSET, NULL, NULL, NULL, KS_INIT_RT_SCALE_LOG } |
Default values for KS_WAIT sequence objects
#define KS_INIT_ISIROT {KS_INIT_WAIT, KS_INIT_WAIT, NULL, 0, 0, 0, 0} |
#define KS_INIT_TRAP {KS_INIT_BASE(KS_TRAP), KS_INIT_DESC, 0.0, 0.0, 0, 0, 0, {0, 0, 0}, {0, 0, 0}, {1, 1, 1}, 1.0f, NULL, NULL, NULL, KS_INIT_RT_SCALE_LOG} |
Default values for KS_TRAP sequence objects
#define KS_INIT_READ_RESAMPLER {NULL, NULL, NULL, 0, 0, {0}, 0, 0} |
#define KS_INIT_READ {KS_INIT_BASE(KS_READ), KS_INIT_DESC, 0, KS_NOTSET, KS_INIT_FINFO, NULL, 0, NULL, KS_INIT_READ_RESAMPLER} |
Default values for KS_READ sequence objects
#define KS_INIT_READ_EPI {KS_INIT_BASE(KS_READ), KS_INIT_DESC, 0, 250.0, KS_INIT_FINFO, NULL, 0, NULL, KS_INIT_READ_RESAMPLER} |
#define KS_INIT_READTRAP {KS_INIT_READ, 240.0, 256, 0, 0, 0, 0.0, 0.0, 0.0, 0, KS_INIT_TRAP, KS_INIT_WAVE, 0} |
Default values for KS_READTRAP sequence objects
#define KS_INIT_READTRAP_EPI {KS_INIT_READ_EPI, 240.0, 64, 0, 0, 0, 0.0, 0.0, 0.0, 0, KS_INIT_TRAP, KS_INIT_WAVE, 0} |
Default values for the KS_READTRAP sequence objects in KS_EPI
#define KS_INIT_PHASEENCTABLE KS_INITZEROS(KS_MAX_PHASEDYN) |
Default values for the phase encoding table *.linetoacq* in the KS_PHASER sequence object
#define KS_INIT_PHASER {KS_INIT_TRAP, 240.0, KS_NOTSET, 0, 1, 0, 0, 0.0, 0, KS_INIT_PHASEENCTABLE, FALSE} |
Default values for KS_PHASER sequence objects
#define KS_INIT_PHASEENCODING_PLAN {KS_NOTSET, KS_NOTSET, 0, KS_INIT_DESC, 0, {CARTESIAN_COORD, CARTESIAN_COORD}} |
#define KS_INIT_PHASEENCODING_ALLEPIPLANS KS_INITVALUE(KS_EPI_PEPLAN_NUMPLANS, KS_INIT_PHASEENCODING_PLAN) |
#define KS_INIT_PHASEENCODING_PLAN_16PTRS KS_INITVALUE(16, NULL) |
#define KS_INIT_EPI {KS_INIT_READTRAP_EPI, KS_INIT_TRAP, KS_INIT_TRAP, KS_INIT_TRAP, KS_INIT_TRAP, KS_INIT_PHASER, KS_INIT_PHASER, KS_EPI_BIPOLAR, 1, 0, 0, 0, 0, 1.0, KS_EPI_MINBLIPAREA, 0} |
Default values for KS_EPI sequence objects
#define KS_INIT_READWAVE {KS_INIT_WAVE, KS_INIT_WAVE, KS_INIT_READ, 0, 0, 0.0, 0.0, 0, 0, 0.0, 0, 0, {KS_INIT_WAVEFORM}, {KS_INIT_WAVEFORM}} |
#define RX27_APPLY_HADAMARD |
#define KS_INIT_RFPULSE {NULL, NULL, 0.0,0.0,0.0,0.0,0.0,0,0.0,0.0,0.0,0.0,NULL,0.0,0.0,0,0,-1,0.0,NULL,0,NULL RX27_APPLY_HADAMARD} |
Default values for GE's RF_PULSE structure
#define KS_INIT_RF {KS_RF_ROLE_NOTSET, KS_NOTSET, KS_NOTSET, 0.0, 0.0, KS_NOTSET, KS_NOTSET, KS_NOTSET, KS_INIT_DESC, KS_INIT_RFPULSE, KS_INIT_WAVE, KS_INIT_WAVE, KS_INIT_WAVE, 0} |
Default values for KS_RF sequence objects
#define KS_INIT_SELRF {KS_INIT_RF, KS_NOTSET, 2.0, 0, 0.0, 0.0, KS_INIT_TRAP, KS_INIT_TRAP, KS_INIT_TRAP, KS_INIT_WAVE, KS_NOTSET, KS_NOTSET, KS_INIT_SMS_INFO} |
Default values for KS_SELRF sequence objects
#define KS_INIT_GRADRFCTRL {KS_INITZEROS(KS_MAXUNIQUE_RF), 0, KS_INITZEROS(KS_MAXUNIQUE_TRAP), 0, KS_INITZEROS(KS_MAXUNIQUE_WAVE), 0, KS_INITZEROS(KS_MAXUNIQUE_READ), 0, KS_INITZEROS(KS_MAXUNIQUE_WAIT), 0, FALSE /* is_cleared_on_tgt */ } |
Default values for KS_GRADRFCTRL control handler
#define KS_INIT_SEQ_HANDLE {NULL, 0, NULL} |
Default values for the KS_SEQ_HANDLE struct
#define KS_INIT_SEQ_CONTROL {0, 0, KS_DEFAULT_SSI_TIME, 0, KS_NOTSET, FALSE, KS_DISCRETE_REPRESENTATION_SYMMETRIC, KS_INIT_DESC, KS_INIT_SEQ_HANDLE, KS_INIT_GRADRFCTRL, NULL, 0} |
Default values for the KS_SEQ_CONTROL struct
#define KS_INIT_SEQ_COLLECTION {0, KS_SEQ_COLLECTION_ALLOWNEW, FALSE, KS_INITVALUE(KS_MAXUNIQUE_SEQUENCES, NULL), 0, KS_INITVALUE(KS_MAX_SEQUENCE_PLAYOUTS, NULL)} |
Default values for the KS_SEQ_CONTROL struct
#define KS_INIT_SAR {0, 0, 0, 0} |
Default values for the KS_SAR struct
#define KS_INIT_SLICEPLAN {0,0,0,{{0,0,0}}} |
Default values for the KS_SLICE_PLAN struct
#define KS_INIT_SMS_INFO {1, 0, 0} |
Default values for the KS_INIT_SMS_INFO struct
#define KS_INIT_LOGGRD {0,0,0,0,0,0,{0,0,0,0,0,0},{0,0,0,0},{0,0,0,0},{0,0,0,0},{0,0,0,0},{0,0,0,0},{0,0,0,0},0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 } |
Default values for GE's loggrd struct
#define KS_INIT_PHYSGRD { 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 } |
Default values for GE's phygrd struct
#define KS_MAT3x3_IDENTITY {1,0,0,0,1,0,0,0,1} |
Identity matrix initialization for KS_MAT3x3
#define KS_MAT4x4_IDENTITY {1,0,0,0, 0,1,0,0, 0,0,1,0, 0,0,0,1} |
Identity matrix initialization for KS_MAT4x4
#define KS_SPOIL_X 1 |
Toggle spoiling on X
#define KS_SPOIL_Y 2 |
Toggle spoiling on Y
#define KS_SPOIL_Z 4 |
Toggle spoiling on Z
#define ANYINVERSION (opirprep || opt1flair || opt2flair) |
#define KSCOMMON_INIT_GRAD_PARAMS {0, 0, 0, 0} |
#define KSCOMMON_INIT_RESAMPLER {0, 0, 0.0, KSCOMMON_INIT_GRAD_PARAMS, KSCOMMON_INIT_GRAD_PARAMS, KSCOMMON_INIT_GRAD_PARAMS} |
#define KS_INIT_PHASEENCODING_SHOTCOORDS {0, NULL} |
#define KS_INIT_DYNAMIC_STATE {0, 0, 0, 0, 0, 0, KS_INIT_PHASEENCODING_SHOTCOORDS, 0, 0, 0, 0, 0, 0, 0, 0, {0.0}, 0, 0, KS_MAT4x4_IDENTITY, KS_MAT4x4_IDENTITY} |
#define KS_DABARRAY_KS_RECON_RESERVED 2 |
#define KS_DABARRAY_ONLINE_RECON_RESERVED 6 |
#define KS_DABARRAY_FULL_LENGTH 28 |
#define KS_DABARRAY_AVAILABLE_BYTES (KS_DABARRAY_FULL_LENGTH - KS_DABARRAY_ONLINE_RECON_RESERVED - KS_DABARRAY_KS_RECON_RESERVED) |
#define KS_DEFAULT_READ_TYPE KS_READ_NOTSET |
#define KS_INIT_READCONTROL_PULSEGEN {KS_DEFAULT_READ_TYPE, 0, 0, 1.0, KS_NOTSET} |
#define KS_INIT_READ_CONTROL {{KS_INIT_READCONTROL_STATE}, KS_INIT_READCONTROL_PULSEGEN} |
#define KS_INIT_ECHOTRAIN {KS_INITVALUE(KS_MAXUNIQUE_READ,KS_INIT_READ_CONTROL), KS_INITVALUE(KS_ECHOTRAIN_MAX_TRAPS,KS_INIT_READTRAP), KS_INITVALUE(KS_ECHOTRAIN_MAX_WAVES,KS_INIT_READWAVE), 0, 0, 0, {0}, 1} |
#define KS_DEFAULT_KSACQ_RECONSHEDULE_ENTRY {0, 0, -1, -1} |
#define KS_INIT_CRUSHER_CONSTRAINT {0, 0, 0, 0, KS_MINPLATEAUTIME, KS_CRUSHER_STRATEGY_FASTEST} |
#define cvset | ( | cv, | |
min, | |||
max, | |||
def, | |||
desc | |||
) |
Macro to set CVs directly with min/max/def
typedef char KS_DESCRIPTION[KS_DESCRIPTION_LENGTH] |
Char array used in all KS_**** sequence objects
typedef float KS_WAVEFORM[KS_MAXWAVELEN] |
Waveform array for RF, Theta or custom gradients
typedef short KS_IWAVE[KS_MAXWAVELEN] |
Interim short integer array to copy to hardware (internal use)
typedef double KS_MAT3x3[9] |
Array to store a row major 3x3 matrix
typedef float KS_MAT3x3f[9] |
Array to store a row major 3x3 matrix (float)
typedef double KS_MAT4x4[16] |
Array to store a row major 4x4 matrix
typedef float KS_MAT4x4f[16] |
Array to store a row major 4x4 matrix (float)
enum KS_PF_EARLYLATE |
enum KS_PLOT_FILEFORMATS |
enum KS_PLOT_PASS_MODE |
enum KS_COORDINATE_TYPE |
enum KS_READ_TYPE |
Enumerator | |
---|---|
KS_READ_NOTSET | |
KS_READ_TRAP | |
KS_READ_WAVE |
enum ks_enum_sweep_order |
enum KS_COVERAGE |
enum KS_MTF_DIRECTION |
enum KS_VIEW_SORT_ORDER |
enum KS_VIEW_MTF_PROFILE |
Enumerator | |
---|---|
LINEAR_SWEEP | |
PIVOT_CENTER_OUTER_LINEAR | |
LCPO | |
SPLIT_SHOTS_LCPO | |
LINEAR_ROLL | |
PIVOT_ROLL | |
SPLIT_SHOTS_AMERICAN | |
SPLIT_SHOTS_DUTCH |
enum RADIUS_PATTERN |
enum KS_REPEAT_MODE |
Enumerator | |
---|---|
NO_REPEAT | |
INTERLEAVED_LONGER_SHOTS | |
SEQUENTIAL_LONGER_SHOTS | |
INTERLEAVED_EXTRA_SHOTS | |
SEQUENTIAL_EXTRA_SHOTS |
enum ks_snr_mode |
enum ks_enum_trapparts |
enum ks_enum_boarddef |
Enumerator | |
---|---|
KS_X | |
KS_Y | |
KS_Z | |
KS_RHO | |
KS_RHO2 | |
KS_THETA | |
KS_OMEGA | |
KS_SSP | |
KS_FREQX_PHASEY | |
KS_FREQY_PHASEX | |
KS_FREQX_PHASEZ | |
KS_FREQZ_PHASEX | |
KS_FREQY_PHASEZ | |
KS_FREQZ_PHASEY | |
KS_XYZ | |
KS_ALL |
enum ks_enum_epiblipsign |
Enumerator | |
---|---|
KS_EPI_POSBLIPS | |
KS_EPI_NOBLIPS | |
KS_EPI_NEGBLIPS |
enum ks_enum_diffusion |
enum ks_enum_imsize |
enum ks_enum_accelmenu |
enum ks_enum_rfrole |
Enumerator | |
---|---|
KS_RF_ROLE_NOTSET | |
KS_RF_ROLE_EXC | |
KS_RF_ROLE_REF | |
KS_RF_ROLE_CHEMSAT | |
KS_RF_ROLE_SPSAT | |
KS_RF_ROLE_INV |
enum ks_enum_sincwin |
Enumerator | |
---|---|
KS_RF_SINCWIN_OFF | |
KS_RF_SINCWIN_HAMMING | |
KS_RF_SINCWIN_HANNING | |
KS_RF_SINCWIN_BLACKMAN | |
KS_RF_SINCWIN_BARTLETT |
enum ks_enum_smstype |
Enumerator | |
---|---|
KS_SELRF_SMS_PHAS_MOD_OFF | |
KS_SELRF_SMS_PHAS_MOD_PHAS | |
KS_SELRF_SMS_PHAS_MOD_AMPL | |
KS_SELRF_SMS_PHAS_MOD_QUAD | |
KS_SELRF_SMS_PHAS_MOD_SIZE |
anonymous enum |
Enumerator | |
---|---|
KS_CRUSHER_STRATEGY_FASTEST | |
KS_CRUSHER_STRATEGY_EXACT | |
KS_CRUSHER_STRATEGY_MIN_SLEW | |
KS_CRUSHER_STRATEGY_MAX_AREA | |
KS_CRUSHER_STRATEGY_PLATEAU |
STATUS ks_bitmask_set | ( | unsigned int | out, |
const unsigned int | in, | ||
const unsigned int | size, | ||
const unsigned int | offset | ||
) |
unsigned int ks_bitmask_get | ( | const unsigned int | in, |
const unsigned int | size, | ||
const unsigned int | offset | ||
) |
int ks_isIceHardware | ( | ) |
int ks_default_ssitime | ( | ) |
KS_PEPLAN_SHOT_DISTRIBUTION ks_peplan_distribute_shots | ( | const int | etl, |
const int | num_coords, | ||
const int | center | ||
) |
ADDDESCHERE
[in] | etl | ADDTEXTHERE |
[in] | num_coords | ADDTEXTHERE |
[in] | center | ADDTEXTHERE |
KS_PEPLAN_SHOT_DISTRIBUTION | ADDTEXTHERE |
void ks_init_read | ( | KS_READ * | read | ) |
void ks_init_trap | ( | KS_TRAP * | trap | ) |
void ks_init_rtscalelog | ( | KS_RT_SCALE_LOG *const | rtscale | ) |
[in,out] | rtscale | Pointer to a KS_RT_SCALE_LOG instance |
void ks_init_wait | ( | KS_WAIT * | wait | ) |
void ks_init_wave | ( | KS_WAVE * | wave | ) |
void ks_init_rf | ( | KS_RF * | rf | ) |
void ks_init_sms_info | ( | KS_SMS_INFO * | sms_info | ) |
[out] | sms_info | Pointer to KS_SMS_INFO |
void ks_init_selrf | ( | KS_SELRF * | selrf | ) |
void ks_init_readtrap | ( | KS_READTRAP * | readtrap | ) |
[out] | readtrap | Pointer to KS_READTRAP |
void ks_init_readwave | ( | KS_READWAVE * | readwave | ) |
[out] | readwave | Pointer to KS_READWAVE |
void ks_init_phaser | ( | KS_PHASER * | phaser | ) |
void ks_init_epi | ( | KS_EPI * | epi | ) |
void ks_init_gradrfctrl | ( | KS_GRADRFCTRL * | gradrfctrl | ) |
[out] | gradrfctrl | Pointer to KS_GRADRFCTRL |
void ks_init_seqcontrol | ( | KS_SEQ_CONTROL * | seqcontrol | ) |
[out] | seqcontrol | Pointer to KS_INIT_SEQ_CONTROL |
void ks_init_seqcollection | ( | KS_SEQ_COLLECTION * | seqcollection | ) |
[out] | seqcollection | Pointer to KS_INIT_SEQ_COLLECTION |
void ks_init_echotrain | ( | KS_ECHOTRAIN *const | echotrain | ) |
[in,out] | echotrain | pointer to the structure you want to initialise with (KS_INIT_ECHOTRAIN). |
STATUS ks_init_slewratecontrol | ( | LOG_GRAD * | loggrd, |
PHYS_GRAD * | phygrd, | ||
float | srfact | ||
) |
inittargets()
in e.g. GEReq_init_gradspecs())If srfact
< 1.0, both phygrd
and loggrd
are updated, and the gradients will be switched propotionally slower. This can be used to make the acquistion quieter. If srfact
> 1.0, only loggrd
will be updated. This could be used as an attempt to switch the gradients faster, but should be used with care as the risk for peripheral nerve stimulation (PNS) increases and the gradients may trip.
[in,out] | loggrd | Pointer to LOG_GRAD |
[in,out] | phygrd | Pointer to PHYS_GRAD |
[in] | srfact | Slewrate factor (< 1.0 means less acquistic noise and reduced risk for PNS) |
STATUS ks_eval_addtoseqcollection | ( | KS_SEQ_COLLECTION * | seqcollection, |
KS_SEQ_CONTROL * | seqctrl | ||
) |
The KS_SEQ_CONTROL object will be ignored if added previously or if its .duration
field is zero. A zero duration of a KS_SEQ_CONTROL indicates that this sequence module should not be used with the current settings
[in,out] | seqcollection | Pointer to the KS_SEQ_COLLECTION for the sequence |
[in] | seqctrl | Pointer to KS_SEQ_CONTROL |
STATUS | SUCCESS or FAILURE |
STATUS ks_eval_seqcollection_isadded | ( | KS_SEQ_COLLECTION * | seqcollection, |
KS_SEQ_CONTROL * | seqctrl | ||
) |
[in] | seqcollection | Pointer to the KS_SEQ_COLLECTION for the sequence |
[in] | seqctrl | Pointer to KS_SEQ_CONTROL |
STATUS | SUCCESS or FAILURE |
STATUS ks_eval_addtraptogradrfctrl | ( | KS_GRADRFCTRL * | gradrfctrl, |
KS_TRAP * | trap | ||
) |
The KS_TRAP object will be ignored if added previously
[in,out] | gradrfctrl | Pointer to the KS_GRADRFCTRL for the sequence |
[in] | trap | Pointer to KS_TRAP |
STATUS | SUCCESS or FAILURE |
STATUS ks_eval_addwavetogradrfctrl | ( | KS_GRADRFCTRL * | gradrfctrl, |
KS_WAVE * | wave | ||
) |
The KS_WAVE object will be ignored if added previously
[in,out] | gradrfctrl | Pointer to the KS_GRADRFCTRL for the sequence |
[in] | wave | Pointer to KS_WAVE |
STATUS | SUCCESS or FAILURE |
STATUS ks_eval_addrftogradrfctrl | ( | KS_GRADRFCTRL * | gradrfctrl, |
KS_RF * | rf | ||
) |
The RF object will be ignored if added previously
[in,out] | gradrfctrl | Pointer to the KS_GRADRFCTRL for the sequence |
[in] | rf | Pointer to KS_RF |
STATUS | SUCCESS or FAILURE |
STATUS ks_eval_addreadtogradrfctrl | ( | KS_GRADRFCTRL * | gradrfctrl, |
KS_READ * | read | ||
) |
[in,out] | gradrfctrl | Pointer to the KS_GRADRFCTRL for the sequence |
[in] | read | Pointer to acquisition object. |
STATUS | SUCCESS or FAILURE |
STATUS ks_eval_addwaittogradrfctrl | ( | KS_GRADRFCTRL * | gradrfctrl, |
KS_WAIT * | wait | ||
) |
[in,out] | gradrfctrl | Pointer to the KS_GRADRFCTRL for the sequence |
[in] | wait | Pointer to the wait object. |
STATUS | SUCCESS or FAILURE |
STATUS ks_eval_wait | ( | KS_WAIT * | wait, |
const char *const | desc, | ||
int | pg_duration, | ||
int | maxduration | ||
) |
This function should be called in cveval()
and defines a wait pulse whose duration can be changed at scan-time up to .duration
[us].
If ks_eval_wait() returns FAILURE, one must also make sure cveval()
returns FAILURE, otherwise an error message created in ks_eval_wait() will not be seen in the UI.
[out] | wait | Pointer to the KS_WAIT object to be set up |
[in] | desc | A description (text string) of the KS_WAIT object. This description is used for pulse sequence generation (seen in the file generated by TimeHist in MGD Sim/WTools) |
[in] | pg_duration | ADDTEXTHERE |
[in] | maxduration | The desired maximum duration in [us] of the KS_WAIT object |
STATUS | SUCCESS or FAILURE |
STATUS ks_eval_isirot | ( | KS_ISIROT * | isirot, |
const char *const | desc, | ||
int | isinumber | ||
) |
See also ks_pg_isirot() and ks_scan_isirotate().
[out] | isirot | Pointer to the KS_ISIROT object to be set up |
[in] | desc | A description (text string) of the KS_ISIROT object |
[in] | isinumber | A free ISI interrupt number in range [4,7] |
STATUS | SUCCESS or FAILURE |
STATUS ks_eval_read | ( | KS_READ * | read, |
const char *const | desc | ||
) |
This function should be called in cveval()
and defines a data acquisition window of a certain duration with some receiver bandwidth. Before calling this function, the following fields in the KS_READ object must be set:
.rbw
: The desired receiver bandwidth / FOV in [kHz] (max: 250).duration
: The duration in [us]ks_eval_read() will validate the desired rBW and round it to the nearest valid value. Also the duration will be rounded up to fit a whole number of samples in the acquisition window.
To use an acquisition window with a gradient, see KS_READTRAP and ks_eval_readtrap()
If ks_eval_read() returns FAILURE, one must also make sure cveval()
returns FAILURE, otherwise an error message created in ks_eval_read() will not be seen in the UI.
[in,out] | read | Pointer to the KS_READ object to be set up |
[in] | desc | A description (text string) of the KS_READ object. This description is used for pulse sequence generation (seen in the file generated by TimeHist in MGD Sim/WTools) |
STATUS | SUCCESS or FAILURE |
STATUS ks_eval_trap_constrained | ( | KS_TRAP * | trap, |
const char *const | desc, | ||
float | ampmax, | ||
float | slewrate, | ||
int | minduration | ||
) |
Before calling this function, the following field in the KS_TRAP object must be set:
.area
: Desired gradient area in units of [(G/cm) * us]ks_eval_trap_constrained() will make a trapezoid pulse with the desired area, constrained by the specified maximum gradient amplitude, slewrate, and minimum plateau time (args 3-5).
If ks_eval_trap_constrained() returns FAILURE, one must also make sure cveval()
returns FAILURE, otherwise an error message created in ks_eval_trap_constrained() will not be seen in the UI.
There are three wrapper functions to this function (ks_eval_trap(), ks_eval_trap1(), ks_eval_trap2()) that have reduced number of input arguments, and calls ks_eval_trap_constrained() with different preset gradient constraints. ks_eval_trap() makes fewest assumptions, making it the most general choice.
[in,out] | trap | Pointer to the KS_TRAP object to be set up |
[in] | desc | A description (text string) of the KS_TRAP object. This description is used for pulse sequence generation (seen in the file generated by TimeHist in MGD Sim/WTools) |
[in] | ampmax | The maximum allowed gradient amplitude ([G/cm]) |
[in] | slewrate | The maximum allowed slewrate ([(G/cm) / us]). Value of 0.01 corresponds to 100 mT/m/s |
[in] | minduration | Optional minimum duration ([us]). A zero value is used to disregard this constraint |
STATUS | SUCCESS or FAILURE |
STATUS ks_eval_trap | ( | KS_TRAP * | trap, |
const char *const | desc | ||
) |
Before calling this function, the following field in the KS_TRAP object must be set:
.area
: Desired gradient area in units of [(G/cm) * us]This is a wrapper function to ks_eval_trap_constrained() with gradient constraints set to allow this KS_TRAP to be simultaneously played on XGRAD, YGRAD, ZGRAD for any slice angulation.
[in,out] | trap | Pointer to the KS_TRAP object to be set up |
[in] | desc | A description (text string) of the KS_TRAP object. This description is used for pulse sequence generation (seen in the file generated by TimeHist in MGD Sim/WTools) |
STATUS | SUCCESS or FAILURE |
STATUS ks_eval_trap2 | ( | KS_TRAP * | trap, |
const char *const | desc | ||
) |
Before calling this function, the following field in the KS_TRAP object must be set:
.area
: Desired gradient area in units of [(G/cm) * us]This is a wrapper function to ks_eval_trap_constrained() with gradient constraints set to allow this KS_TRAP to be simultaneously played on up to two (2) logical gradients for any slice angulation.
[in,out] | trap | Pointer to the KS_TRAP object to be set up |
[in] | desc | A description (text string) of the KS_TRAP object. This description is used for pulse sequence generation (seen in the file generated by TimeHist in MGD Sim/WTools) |
STATUS | SUCCESS or FAILURE |
STATUS ks_eval_trap1 | ( | KS_TRAP * | trap, |
const char *const | desc | ||
) |
Before calling this function, the following field in the KS_TRAP object must be set:
.area
: Desired gradient area in units of [(G/cm) * us]This is a wrapper function to ks_eval_trap_constrained() with gradient constraints set to allow this KS_TRAP to only be played out on one (1) logical gradient at a time. No gradient may be active on another board while this trapezoid is played out.
[in,out] | trap | Pointer to the KS_TRAP object to be set up |
[in] | desc | A description (text string) of the KS_TRAP object. This description is used for pulse sequence generation (seen in the file generated by TimeHist in MGD Sim/WTools) |
STATUS | SUCCESS or FAILURE |
STATUS ks_eval_trap_constrained_time_maxarea | ( | KS_TRAP * | trap, |
const char *const | desc, | ||
float | ampmax, | ||
float | slewrate, | ||
float | maxarea, | ||
int | derate_slewrate | ||
) |
STATUS ks_eval_set_asym_padding | ( | KS_READTRAP * | readtrap, |
float | wanted_paddingarea_pre, | ||
float | wanted_paddingarea_post | ||
) |
STATUS ks_eval_trap1p | ( | KS_TRAP * | trap, |
const char *const | desc | ||
) |
Before calling this function, the following field in the KS_TRAP object must be set:
.area
: Desired gradient area in units of [(G/cm) * us]This is a wrapper function to ks_eval_trap_constrained() with physical gradient constraints set to allow this KS_TRAP to only be played out on one (1) logical gradient at a time. No gradient may be active on another board while this trapezoid is played out.
[in,out] | trap | Pointer to the KS_TRAP object to be set up |
[in] | desc | A description (text string) of the KS_TRAP object. This description is used for pulse sequence generation (seen in the file generated by TimeHist in MGD Sim/WTools) |
STATUS | SUCCESS or FAILURE |
STATUS ks_eval_trap_rotation_invariant_75_max_slewrate | ( | KS_TRAP * | trap, |
const char *const | desc | ||
) |
Before calling this function, the following field in the KS_TRAP object must be set:
.area
: Desired gradient area in units of [(G/cm) * us]This is a wrapper function to ks_eval_trap_constrained() with the gradient amplitude limited to 1/sqrt(3) of the weakest amplifier (rotation invariant even if played on all boards simultanously). The slewrate is limited to 1/sqrt(3) of the weakest amplifier or 75 T/m/s to avoid unessesary PNS. This trapezoid setup is a good choice for not so timing sensitive situations (spoiler, SPGR phasers, ...)
[in,out] | trap | Pointer to the KS_TRAP object to be set up |
[in] | desc | A description (text string) of the KS_TRAP object. This description is used for pulse sequence generation (seen in the file generated by TimeHist in MGD Sim/WTools) |
STATUS | SUCCESS or FAILURE |
STATUS ks_eval_crusher | ( | KS_WAVE * | crusher, |
const float | end_amp, | ||
const ks_crusher_constraints | crusher_constraints | ||
) |
[out] | crusher | Pointer to the KS_WAVE object to be set up |
[in] | end_amp | ADDTEXTHERE |
[in] | crusher_constraints | ADDTEXTHERE |
STATUS | SUCCESS or FAILURE |
STATUS ks_eval_readtrap_constrained | ( | KS_READTRAP * | readtrap, |
const char *const | desc, | ||
float | ampmax, | ||
float | slewrate | ||
) |
Before calling this function, the following fields in the KS_READTRAP object must be set:
.fov
: Desired image Field-of-View (FOV) in [mm] along the sequence board one intends to place the KS_READTRAP on (typically XGRAD).res
: Number of pixels within the FOV.acq.rbw
: Receiver bandwidth (rBW) in [kHz/FOV]. Maximum is 250.rampsampling
: If non-zero, data acquisition will be performed on the ramps of the trapezoid as well. This reduces the readout time, especially for high rBWs..acqdelay
: Needs to be set only if .rampsampling = 1
. The .acqdelay
(in [us]) will dictate the time from the start of the ramp-up until data acquisition will begin.nover
: Number of 'overscans'. If 0, a full echo will be generated (filling k-space). If > 0, fractional echo (i.e. shorter TE) will be set up with .nover
number of extra sample points beyond .res/2
. The total number of samples will be .res/2 + .nover
. Values of .nover
between 1 and about 16 should be avoided since half Fourier reconstruction methods will likely have difficulties.If the KS_READTRAP object is initialized with KS_INIT_READTRAP, the fields .nover
, .rampsampling
and .acqdelay
will all be zero (steps 4-6 can be skipped)
Based on the information in the KS_READTRAP object, ks_eval_readtrap_constrained() will set up its .grad
trapezoid (KS_TRAP) and its acquisition window .acq
(KS_READ), constrained by the specified maximum gradient amplitude, slewrate, and minimum plateau time (args 3-5).
If .rampsampling = 1
, ks_eval_readtrap_constrained() will also copy the shape of .grad
to .omega
(also a KS_TRAP). This is needed for FOV-offsets in the readout direction when data acquisition is done on both the ramps and on the plateau, and ks_pg_readtrap() and ks_scan_offsetfov() will handle the .omega
KS_TRAP so that the intended FOV shift in [mm] will be performed.
ks_eval_readtrap_constrained() will also fill in the convenience fields .area2center
and .time2center
properly. .area2center
is useful to use as .area
for a read dephaser, and .time2center
makes sequence timing calculations easier. Both fields take partial/full Fourier (.nover
) into account.
If ks_eval_readtrap_constrained() returns FAILURE, one must also make sure cveval()
returns FAILURE, otherwise an error message created in ks_eval_readtrap_constrained() will not be seen in the UI.
There are three wrapper functions to this function (ks_eval_readtrap(), ks_eval_readtrap1(), ks_eval_readtrap2()) that have reduced number of input arguments, and calls ks_eval_readtrap_constrained() with different preset gradient constraints. ks_eval_readtrap() makes fewest assumptions, making it the most general choice.
[in,out] | readtrap | Pointer to the KS_READTRAP object to be set up |
[in] | desc | A description (text string) of the KS_READTRAP object. This description is used for pulse sequence generation (seen in the file generated by TimeHist in MGD Sim/WTools) |
[in] | ampmax | The maximum allowed gradient amplitude ([G/cm]) |
[in] | slewrate | The maximum allowed slewrate ([(G/cm) / us]). Value of 0.01 corresponds to 100 mT/m/s |
STATUS | SUCCESS or FAILURE |
STATUS ks_eval_readtrap | ( | KS_READTRAP * | readtrap, |
const char *const | desc | ||
) |
This is a wrapper function to ks_eval_readtrap_constrained() with gradient constraints set to allow this KS_READTRAP to simultaneously be played on XGRAD, YGRAD, ZGRAD for any slice angulation. This is the generic and safest configuration, but for readouts with small FOV and high rBW, the gradient limits may be reached, especially for double oblique slices. See ks_eval_readtrap_constrained() for details on fields that need to be set before calling this function.
[in,out] | readtrap | Pointer to the KS_READTRAP object to be set up |
[in] | desc | A description (text string) of the KS_READTRAP object. This description is used for pulse sequence generation (seen in the file generated by TimeHist in MGD Sim/WTools) |
STATUS | SUCCESS or FAILURE |
STATUS ks_eval_readtrap2 | ( | KS_READTRAP * | readtrap, |
const char *const | desc | ||
) |
This is a wrapper function to ks_eval_readtrap_constrained() with gradient constraints set to allow this KS_TRAP to simultaneously be played on up to two (2) logical gradients for any slice angulation. For double oblique slice angulations, this function will allow for smaller FOVs and higher rBWs than ks_eval_readtrap().
See ks_eval_readtrap_constrained() for details on fields that need to be set before calling this function.
[in,out] | readtrap | Pointer to the KS_READTRAP object to be set up |
[in] | desc | A description (text string) of the KS_READTRAP object. This description is used for pulse sequence generation (seen in the file generated by TimeHist in MGD Sim/WTools) |
STATUS | SUCCESS or FAILURE |
STATUS ks_eval_readtrap1 | ( | KS_READTRAP * | readtrap, |
const char *const | desc | ||
) |
This is a wrapper function to ks_eval_readtrap_constrained() with gradient constraints set to allow this KS_TRAP to only be played out on one (1) logical gradient at a time. No gradient may be active on another board while this trapezoid is played out. For double oblique slice angulations, this function will allow for smaller FOVs and higher rBWs than ks_eval_readtrap() and ks_eval_readtrap2(). See ks_eval_readtrap_constrained() for details on fields that need to be set before calling this function.
[in,out] | readtrap | Pointer to the KS_READTRAP object to be set up |
[in] | desc | A description (text string) of the KS_READTRAP object. This description is used for pulse sequence generation (seen in the file generated by TimeHist in MGD Sim/WTools) |
STATUS | SUCCESS or FAILURE |
STATUS ks_eval_readtrap_constrained_sample_duration | ( | KS_READTRAP * | readtrap, |
const char *const | desc, | ||
const float | ampmax, | ||
const float | slewrate, | ||
const int | t_A, | ||
const int | sample_duration, | ||
const float | area_post, | ||
const float | area_total | ||
) |
STATUS ks_eval_readwave_constrained | ( | KS_READWAVE * | readwave, |
KS_WAVE * | acq_waves, | ||
const int | numstates, | ||
int | flag_symmetric_padding, | ||
ks_crusher_constraints | pre_crusher_constraints, | ||
ks_crusher_constraints | post_crusher_constraints | ||
) |
The following members of the readwave object are treated as inputs to this function: fov - Desired image Field-of-View (FOV) in [mm] along the sequence board one intends to place the KS_READWAVE on (typically XGRAD) res - Number of pixels within the FOV nover - Number of 'overscans'. If 0, a full echo will be generated (filling k-space). If > 0, fractional echo (i.e. shorter TE) will be set up with .nover
number of extra sample points beyond .res/2
.
[in,out] | readwave | - Pointer to KS_READWAVE |
[in] | acq_waves | - an array of KS_WAVE objects describing the gradient amplitude while the ADC is on. |
[in] | numstates | - number of KS_WAVES in acq_waves |
[in] | flag_symmetric_padding | - match pre and post areas and duration |
[in] | pre_crusher_constraints | - how to optimise the pre crusher waveform shape (fastest, exact area, maximum area) |
[in] | post_crusher_constraints | - how to optimise the post crusher waveform shape (fastest, exact area, maximum area) |
STATUS | SUCCESS or FAILURE |
STATUS ks_eval_readwave | ( | KS_READWAVE * | readwave, |
KS_WAVE * | acq_wave, | ||
float | pre_crusher_area, | ||
float | post_crusher_area, | ||
int | flag_symmetric_padding, | ||
ks_enum_crusher_strategy | pre_strategy, | ||
ks_enum_crusher_strategy | post_strategy | ||
) |
Sets up a KS_READWAVE with one state and converts the crusher statergies into constraints
[out] | readwave | - Pointer to an initialised KS_READWAVE object. |
[in] | acq_wave | - Pointer to a KS_WAVE that defines the read gradient shape during the ADC sampling. |
[in] | pre_crusher_area | - desired area before the readout starts |
[in] | post_crusher_area | - desired area after the readout is complete |
[in] | flag_symmetric_padding | - match pre and post areas |
[in] | pre_strategy | - how to optimise the pre crusher waveform shape (fastest, exact area, maximum area) |
[in] | post_strategy | - how to optimise the post crusher waveform shape (fastest, exact area, maximum area) |
STATUS | SUCCESS or FAILURE |
STATUS ks_eval_readwave_multistated | ( | KS_READWAVE * | readwave, |
KS_WAVE * | acq_waves, | ||
const int | num_waves, | ||
float | pre_crusher_area, | ||
float | post_crusher_area, | ||
int | flag_symmetric_padding, | ||
ks_enum_crusher_strategy | pre_strategy, | ||
ks_enum_crusher_strategy | post_strategy | ||
) |
Converts the crusher statergies into constraints
[out] | readwave | - Pointer to an initialised KS_READWAVE object. |
[in] | acq_waves | - Pointer to a KS_WAVE that defines the read gradient shape during the ADC sampling. |
[in] | num_waves | - Number of waves |
[in] | pre_crusher_area | - desired area before the readout starts |
[in] | post_crusher_area | - desired area after the readout is complete |
[in] | flag_symmetric_padding | - match pre and post areas |
[in] | pre_strategy | - how to optimise the pre crusher waveform shape (fastest, exact area, maximum area) |
[in] | post_strategy | - how to optimise the post crusher waveform shape (fastest, exact area, maximum area) |
STATUS | SUCCESS or FAILURE |
STATUS ks_eval_readtrap1p | ( | KS_READTRAP * | readtrap, |
const char *const | desc | ||
) |
This is a wrapper function to ks_eval_readtrap_constrained() with physical gradient constraints
[in,out] | readtrap | Pointer to the KS_READTRAP object to be set up |
[in] | desc | A description (text string) of the KS_READTRAP object. This description is used for pulse sequence generation (seen in the file generated by TimeHist in MGD Sim/WTools) |
STATUS | SUCCESS or FAILURE |
int ks_eval_kynover_fromnex | ( | int | yres, |
float | partial_ky, | ||
int | minkynover | ||
) |
void ks_eval_phaseviewtable | ( | KS_PHASER * | phaser | ) |
This function sets the following fields in a KS_PHASER object
.numlinestoacq
: Number of phase encoding lines to acquire.linetoacq[]
: Array, where the first .numlinestoacq
elements denotes which lines to acquire with indices corresponding to a fully sampled k-space. The top-most line has index 0 and the bottom-most line has index (.res
-1).These two fields are set based on .res
, .nover
, .nacslines
, and .R
in the KS_PHASER object. If .nover
< 0, partial Fourier will be set up, but with flipped k-space coverage
[in,out] | phaser | Pointer to the KS_PHASER object to be set up |
STATUS ks_eval_phaser_adjustres | ( | KS_PHASER * | phaser, |
const char *const | desc | ||
) |
Phase resolution must be divisible by .R
and be even, and there are additional requirements for partial ky Fourier scans. Moreover, for parallel imaging using ASSET, only the acquired lines are stored in the data (compressed BAM), resulting in an R times lower value for rhnframes.
Here are the rules:
[in,out] | phaser | Pointer to KS_PHASER |
[in] | desc | A description (text string) of the KS_PHASER object, only used for error msg |
STATUS | SUCCESS or FAILURE |
STATUS ks_eval_phaser_setaccel | ( | KS_PHASER * | phaser, |
int | min_acslines, | ||
float | R | ||
) |
[ks_eval_phaser_setaccel description]
[in,out] | phaser | Pointer to KS_PHASER |
[in] | min_acslines | Minimum # of ACS lines |
[in] | R | (floating point) acceleration (taken e.g. from the UI opaccel_ph_stride ) |
STATUS | SUCCESS or FAILURE |
STATUS ks_eval_phaser_constrained | ( | KS_PHASER * | phaser, |
const char *const | desc, | ||
float | ampmax, | ||
float | slewrate, | ||
int | minplateautime | ||
) |
Before calling this function, the following fields in KS_PHASER must be set up:
.fov
: The desired image Field-of-View (FOV) in [mm] along the sequence board one intends to place the KS_PHASER on (typically YGRAD, for 3D also ZGRAD).res
: The number of pixels within the FOV.nover
: Number of 'overscans'. If 0, a full-Fourier k-space will be set up. If > 0, partial Fourier will be set up (shorter scan time) where .nover
number of extra k-space lines beyond .res/2
. If < 0, partial Fourier will be set up, but with flipped k-space coverage. The total number of samples will be .res/2 + abs(.nover)
. Absolute values of .nover
between 1 and about 16 should be avoided since half Fourier reconstruction methods will likely have difficulties.R
: The parallel imaging acceleration factor.nacslines
: If .R > 1
, the value of .nacslines
is the number of calibration lines around k-space center for parallel imaging calibration.areaoffset
: It is possible to embed a static gradient area in the phase encoding functionality of KS_PHASER. This is useful for 3D imaging, where the area needed for the rephaser for the slice select gradient can be put into .areaoffset
. This makes the KS_PHASER to act as both slice rephaser and slice phase encoding gradient, which can shorten TEIf the KS_PHASER object is initialized with KS_INIT_PHASER, .nover
, .nacslines
and .areaoffset
will be zero, and .R
will be 1 (steps 3-6 can be skipped)
Based on the information in the KS_PHASER object, ks_eval_phaser_constrained() will set up the .grad
trapezoid (KS_TRAP). By internally calling ks_eval_phaseviewtable(), .numlinestoacq
, and the array .linetoacq[]
are also set up. The field .numlinestoacq
is an integer corresponding to the actual number of lines to acquire, and also the number of elements to read in .linetoacq[]
, containing the complete list of phase encoding lines to acquire (honoring partial Fourier, parallel imaging acceleration and ACS lines)
If ks_eval_phaser_constrained() returns FAILURE, one must also make sure cveval()
returns FAILURE, otherwise an error message created in ks_eval_phaser_constrained() will not be seen in the UI
There are three wrapper functions to this function (ks_eval_phaser(), ks_eval_phaser1(), ks_eval_phaser2()) that have reduced number of input arguments, and calls ks_eval_phaser_constrained() with different preset gradient constraints. ks_eval_phaser() makes fewest assumptions, making it the most general choice
[in,out] | phaser | Pointer to the KS_PHASER object to be set up |
[in] | desc | A description (text string) of the KS_PHASER object. This description is used for pulse sequence generation (seen in the file generated by TimeHist in MGD Sim/WTools) |
[in] | ampmax | The maximum allowed gradient amplitude ([G/cm]) |
[in] | slewrate | The maximum allowed slewrate ([(G/cm) / us]). Value of 0.01 corresponds to 100 mT/m/s |
[in] | minplateautime | The minimum plateau time of the trapezoid ([us]) |
STATUS | SUCCESS or FAILURE |
STATUS ks_eval_phaser | ( | KS_PHASER * | phaser, |
const char *const | desc | ||
) |
This is a wrapper function to ks_eval_phaser_constrained() with gradient constraints set to allow this KS_PHASER to simultaneously be played on XGRAD, YGRAD, ZGRAD for any slice angulation. This is the generic and safest configuration, but the duration of the KS_PHASER object may increase for double oblique slices
See ks_eval_phaser_constrained() for details on fields that need to be set before calling this function
[in,out] | phaser | Pointer to the KS_PHASER object to be set up |
[in] | desc | A description (text string) of the KS_PHASER object. This description is used for pulse sequence generation (seen in the file generated by TimeHist in MGD Sim/WTools) |
STATUS | SUCCESS or FAILURE |
STATUS ks_eval_phaser2 | ( | KS_PHASER * | phaser, |
const char *const | desc | ||
) |
This is a wrapper function to ks_eval_phaser_constrained() with gradient constraints set to allow this KS_PHASER to simultaneously be played on up to two (2) logical gradients for any slice angulation. For double oblique slice angulations, this function may allow for shorter duration than ks_eval_phaser()
See ks_eval_phaser_constrained() for details on fields that need to be set before calling this function
[in,out] | phaser | Pointer to the KS_PHASER object to be set up |
[in] | desc | A description (text string) of the KS_PHASER object. This description is used for pulse sequence generation (seen in the file generated by TimeHist in MGD Sim/WTools) |
STATUS | SUCCESS or FAILURE |
STATUS ks_eval_phaser1 | ( | KS_PHASER * | phaser, |
const char *const | desc | ||
) |
This is a wrapper function to ks_eval_phaser_constrained() with gradient constraints set to allow this KS_PHASER to only be played out on one (1) logical gradient at a time. No gradient may be active on another board while this trapezoid is played out. For double oblique slice angulations, this function may allow for shorter duration than ks_eval_phaser() and ks_eval_phaser2()
See ks_eval_phaser_constrained() for details on fields that need to be set before calling this function
[in,out] | phaser | Pointer to the KS_PHASER object to be set up |
[in] | desc | A description (text string) of the KS_PHASER object. This description is used for pulse sequence generation (seen in the file generated by TimeHist in MGD Sim/WTools) |
STATUS | SUCCESS or FAILURE |
STATUS ks_eval_phaser1p | ( | KS_PHASER * | phaser, |
const char *const | desc | ||
) |
This is a wrapper function to ks_eval_phaser_constrained() with physical gradient constraints
[in,out] | phaser | Pointer to the KS_PHASER object to be set up |
[in] | desc | A description (text string) of the KS_PHASER object. This description is used for pulse sequence generation (seen in the file generated by TimeHist in MGD Sim/WTools) |
STATUS | SUCCESS or FAILURE |
STATUS ks_eval_wave | ( | KS_WAVE * | wave, |
const char *const | desc, | ||
const int | res, | ||
const int | duration, | ||
const KS_WAVEFORM | waveform | ||
) |
ks_eval_wave() copies the content of a KS_WAVEFORM into a KS_WAVE sequence object. KS_WAVEFORM (5th arg) is a typedef
for a float array with a fixed length of KS_MAXWAVELEN elements. Hence, a KS_WAVEFORM, or float array, must first be created and filled with some wave contents before calling this function. res elements are copied from the input KS_WAVEFORM to the field .waveform
in the KS_WAVE object (1st arg). duration (4th arg) must be divisible by res (3rd arg) and at least 2x res.
When using (i.e. calling ks_pg_wave()) the waveform for:
[out] | wave | KS_WAVE object to be created |
[in] | desc | A description (text string) of the KS_WAVE object. This description is used for pulse sequence generation (seen in the file generated by TimeHist in MGD Sim/WTools) |
[in] | res | Resolution of the waveform, i.e. number of elements from KS_WAVEFORM (5th arg) to read |
[in] | duration | Desired duration in [us] of the waveform (must be divisible with res) |
[in] | waveform | KS_WAVEFORM (float array of max length KS_MAXWAVELEN) with existing waveform content |
STATUS | SUCCESS or FAILURE |
STATUS ks_eval_mirrorwave | ( | KS_WAVE * | wave | ) |
ks_eval_mirrorwave() replaces the KS_WAVEFORM with its (temporally) mirrored version. This can be used to e.g. mirror a minimum phase excitation pulse for fast recovery and T1-optimization in FSE sequences (ksfse.e) See also ks_eval_stretch_rf().
[in,out] | wave | KS_WAVE object, whose KS_WAVEFORM to be mirrored |
STATUS | SUCCESS or FAILURE |
STATUS ks_eval_mirrorwaveform | ( | KS_WAVEFORM | waveform, |
int | res | ||
) |
[in] | waveform | pointer to an array of floats |
[in] | res | the number of points in the wave shape you want to mirrow |
STATUS | SUCCESS or FAILURE |
STATUS ks_eval_wave_file | ( | KS_WAVE * | wave, |
const char *const | desc, | ||
int | res, | ||
int | duration, | ||
const char *const | filename, | ||
const char *const | format | ||
) |
ks_eval_wave_file() reads waveforms on disk into a KS_WAVE. The data format (arg 6) may currently be one of:
When the first two formats are used the field .waveform
in KS_WAVE will contain data in the range [-1.0,1.0]. res elements are read from disk in the specified format into the field .waveform
in the KS_WAVE object (1st arg). duration (4th arg) must be divisible by res (3rd arg) and at least 2x res.
When using (i.e. calling ks_pg_wave()) the waveform for:
[out] | wave | KS_WAVE object to be created |
[in] | desc | A description (text string) of the KS_WAVE object. This description is used for pulse sequence generation (seen in the file generated by TimeHist in MGD Sim/WTools) |
[in] | res | KS_WAVE object to be created |
[in] | duration | KS_WAVE object to be created |
[in] | filename | Filename on disk |
[in] | format | String denoting the data format on disk. Valid values are: "ge" (reads GE's *.rho files with 32byte header), "short", and "float", the latter two being header-less |
STATUS | SUCCESS or FAILURE |
STATUS ks_eval_rf_sinc | ( | KS_RF * | rf, |
const char *const | desc, | ||
double | bw, | ||
double | tbw, | ||
float | flip, | ||
int | wintype | ||
) |
For small flip angles, the Fourier transform of the RF envelope is a good approximation of the final slice profile and SLR designed pulses may not be necessary. For these cases, this function can be used to create a Sinc RF pulse (as a KS_RF object) with a desired bandwidth (BW), time-bandwidth-product (TBW) and window function (e.g. KS_RF_SINCWIN_HAMMING, see ks_enum_sincwin). An increased TBW results in more Sinc lobes and sharper slice profiles, and the minimum value is 2. The duration of the RF pulse (.rfwave.duration
) increases when BW decreases or TBW increases
[out] | rf | KS_RF object to be created |
[in] | desc | A description (text string) of the KS_RF object. This description is used for pulse sequence generation (seen in the file generated by TimeHist in MGD Sim/WTools) |
[in] | bw | Bandwidth of the RF pulse [Hz] |
[in] | tbw | Time-bandwidth-product of the RF pulse. Higher value gives sharper slice profiles but increases the duration |
[in] | flip | Nominal flip angle of the RF pulse |
[in] | wintype | Window function over the Sinc. See ks_enum_sincwin for enums names that steer the window choice |
STATUS | SUCCESS or FAILURE |
STATUS ks_eval_rf_secant | ( | KS_RF * | rf, |
const char *const | desc, | ||
float | A0, | ||
float | tbw, | ||
float | bw | ||
) |
STATUS ks_eval_rf_hard | ( | KS_RF * | rf, |
const char *const | desc, | ||
int | duration, | ||
float | flip | ||
) |
This function creates a hard RF pulse of the desired duration. Hard pulses are typically used as non-slice selective RF pulses, as their slice profile would be very poor (Sinc-like). The resolution of the RF pulse created is equal to the duration/2
[out] | rf | KS_RF object to be created |
[in] | desc | A description (text string) of the KS_RF object. This description is used for pulse sequence generation (seen in the file generated by TimeHist in MGD Sim/WTools) |
[in] | duration | Desired duration in [us] of the waveform (must be even) |
[in] | flip | Nominal flip angle of the RF pulse |
STATUS | SUCCESS or FAILURE |
STATUS ks_eval_rf_hard_optimal_duration | ( | KS_RF * | rf, |
const char *const | desc, | ||
int | order, | ||
float | flip, | ||
float | offsetFreq | ||
) |
This function creates a hard RF pulse with optimal duration for fat selection/saturation. Hard pulses are typically used as non-slice selective RF pulses. Their slice profile is sinc-like and with this function you can create a hard pulse with a sinc-minima at the center of the spectral fat-peak. You can select wich minima using the input 'order'. A higher order generates a longer pulse duration with a more narrow frequency response. If the pulse is tuned to the fat peak, using input 'offsetFreq', the minimia will instead end up at the water-peak. The resolution of the RF pulse created is equal to the duration/2
[out] | rf | KS_RF object to be created |
[in] | desc | A description (text string) of the KS_RF object. This description is used for pulse sequence generation (seen in the file generated by TimeHist in MGD Sim/WTools) |
[in] | order | Select wich minima to use |
[in] | flip | Nominal flip angle of the RF pulse |
[in] | offsetFreq | choose center frequency offset |
STATUS | SUCCESS or FAILURE |
STATUS ks_eval_rf_binomial | ( | KS_RF * | rf, |
const char *const | desc, | ||
int | offResExc, | ||
int | nPulses, | ||
float | flip, | ||
float | offsetFreq, | ||
int | MTreduction | ||
) |
This function creates a binomial RF pulse, which consists of a series of hard pulses. Binomial pulses are used for spectral selection. They utilize the difference in resonance frequency of different tissue types, such as water and fat. Increasing the number of sub-pulses will improve the spectral selectivity but also increse the pulse duration.
[out] | rf | KS_RF object to be created |
[in] | desc | A description (text string) of the KS_RF object. This description is used for pulse sequence generation (seen in the file generated by TimeHist in MGD Sim/WTools) |
[in] | offResExc | If 0 the pulse will excite the spinns at the center frequency, If 1 the pulse will excite the spinns at the offset frequency (given by input: offsetFreq) |
[in] | nPulses | Number of sub-pulses |
[in] | flip | Nominal flip angle of the RF pulse |
[in] | offsetFreq | choose center frequency offset in Hz |
[in] | MTreduction | [0=OFF,1=ON] reduces offresonace excitation and therefore MT effects |
STATUS | SUCCESS or FAILURE |
STATUS ks_eval_mt_rf_binomial | ( | KS_RF * | rf, |
const char *const | desc, | ||
int | sub_pulse_dur, | ||
int | nPulses, | ||
int | prp | ||
) |
The major features of binomial-pulse-train frequency spectra are as follows: a series of sinc functions at frequency intervals of 1/PRP, whose width is inversely related to the overall pulse train duration (nPulses-1)*PRP, modulated by the single-binomial-pulse spectrum. Hence, the width of the sinc functions, or “spikes” in the frequency spectrum becomes narrower as the number of pulses is increased, and they become closer together as the pulse repetition period is increased.
[out] | rf | KS_RF object to be created |
[in] | desc | A description (text string) of the KS_RF object. This description is used for pulse sequence generation (seen in the file generated by TimeHist in MGD Sim/WTools) |
[in] | sub_pulse_dur | |
[in] | nPulses | |
[in] | prp |
STATUS | SUCCESS or FAILURE |
STATUS ks_eval_rfstat | ( | KS_RF * | rf | ) |
For RF scaling, SAR calculation, and RF heating calculations, GE uses a global array of RF_PULSE structs, where each RF pulse is associated with one RF_PULSE struct each. This struct array contains RF pulses from Prescan as well as the pulse sequence itself, and is normally declared in a grad_rf_<psd>.h file.
Here, each KS_RF object has its own RF_PULSE struct (the field .rfpulse
), which this function sets up. The following fields in the KS_RF object must be set before calling this ks_eval_rfstat()
.rfwave
: Must contain the RF pulse waveform. An error is return if either .thetawave
or .omegawave
are non-empty (complex RF pulses not allowed).bw
: The bandwidth of the RF pulse [Hz].iso2end
: Time from the magnetic center of the RF pulse to the end, in [us].flip
: The flip angle of the RF pulse [degrees]. In this function, .flip
will set .rfpulse.nom_fa
and make sure .rfpulse.act_fa
points to .flip
The RF waveform will be amplitude scaled so that its maximum absolute amplitude is 1.0 before making the calculations. Also the proper links between fields int the .rfpulse
(RF_PULSE) struct and the parent fields in KS_RF are set up by calling ks_eval_rf_relink()
Credits: This function has been made largely after the code by Atsushi Takahashi, GE Healthcare.
[in,out] | rf | KS_RF object to calculate the RF_PULSE parameters for (in field .rfpulse ) |
STATUS | SUCCESS or FAILURE |
STATUS ks_eval_rf | ( | KS_RF * | rf, |
const char *const | desc | ||
) |
See documentation for the KS_RF object for details on how to prepare the KS_RF object before calling ks_eval_rf()
This function does not set up a KS_RF object by itself, merely it peforms final validation, naming, makes sure fields and links in KS_RF are properly set up. ks_eval_rf() should be called for non-slice selective RF pulses. For slice-selective RF pulses, use KS_SELRF and call ks_eval_selrf() instead
[in,out] | rf | Pointer to the KS_RF object to be set up |
[in] | desc | A description (text string) of the KS_RF object. This description is used for pulse sequence generation (seen in the file generated by TimeHist in MGD Sim/WTools) |
STATUS | SUCCESS or FAILURE |
void ks_eval_rf_relink | ( | KS_RF * | rf | ) |
This function is used by other RF functions to make sure that the links from pointers in .rfpulse
are relinked to other fields inside the KS_RF object. This function does not need to be called manually as long as either ks_eval_rf(), ks_eval_selrf() are called.
If a KS_RF object is copied to another KS_RF object by simple assignment ('=' sign), then these pointers must be updated before the assigned KS_RF object can be used. Best practice is to call ks_eval_rf() or ks_eval_selrf() instead of this function, as more validation is performed and because description of the new KS_RF is also updated
[in,out] | rf | Pointer to the KS_RF object to be set up |
STATUS ks_eval_stretch_rf | ( | KS_RF * | rf, |
float | stretch_factor | ||
) |
This function takes a KS_RF object already set up, having some resolution (rfwave.res
), bandwidth (.bw
), duration (rfwave.duration
) and waveform (.rfwave.waveform
) and performs a linear interpolation of the waveform contained in .rfwave.waveform
so its new duration becomes
newDuration = oldDuration * stretch_factor
.rfwave.description
) is updated with a suffix stretched.start2iso
, .iso2end
and .bw
are automatically updated to reflect the new duration[in,out] | rf | Pointer to the KS_RF object to be stretched |
[in] | stretch_factor | Stretch factor (float) that widens/shortens the RF pulse if larger/smaller than 1.0. If negative, the RF waveform will be mirrored (in time) |
STATUS | SUCCESS or FAILURE |
STATUS ks_eval_seltrap | ( | KS_TRAP * | trap, |
const char *const | desc, | ||
float | slewrate, | ||
float | slthick, | ||
float | bw, | ||
int | rfduration | ||
) |
This function is used by ks_eval_selrf_constrained() (and its wrapper functions, e.g. ks_eval_selrf()), and there is no need to use this function directly.
Based on the RF bandwidth and duration, this function will create a trapezoid gradient that with this type of RF pulse creates a slice with the desired thickness, by in turn calling ks_calc_selgradamp().
[out] | trap | Pointer to the KS_TRAP object to be set up |
[in] | desc | A description (text string) of the KS_PHASER object. This description is used for pulse sequence generation (seen in the file generated by TimeHist in MGD Sim/WTools) |
[in] | slewrate | The maximum allowed slewrate ([(G/cm) / us]). Value of 0.01 corresponds to 100 mT/m/s |
[in] | slthick | The desired slice thickness in [mm]. If = 0, the slice selection gradient will have zero amplitude (hard pulses) |
[in] | bw | The bandwidth of the RF pulse to use with the gradient. If = 0, the slice selection gradient will have zero amplitude (hard pulses) |
[in] | rfduration | The duration of the RF pulse to use with the gradient |
STATUS | SUCCESS or FAILURE |
STATUS ks_eval_selrf_constrained | ( | KS_SELRF * | selrf, |
const char *const | desc, | ||
float | ampmax, | ||
float | slewrate | ||
) |
This function does not set up the KS_RF field in KS_SELRF itself, see KS_RF and ks_eval_rf() for more details on how to prepare the .rf
field in KS_SELRF before calling ks_eval_selrf_constrained()
The following fields in the KS_SELRF object must be set up before calling this function:
.rf.role
(see below for details).slthick
: Slice thickness in [mm]. Note that the slice thickness often needs to be made larger to compensate from slice narrowing due to multiple RF pulses. GE uses usually gscale_rfX
CVs with values often between 0.8-0.9. Dividing with this number gives a thicker slice in the calculations. NOTE: .slthick = 0
is accepted and results in zero gradient amplitude with minimal 4us ramps and a plateautime = .rf.rfwave.duration (cf. ks_eval_seltrap()->ks_calc_selgradamp())ks_eval_selrf_constrained() checks .rf.role
to decide on how to set up its gradient objects. The following values of .rf.role
are allowed:
KS_RF_ROLE_EXC
, indicating an RF excitation role. ks_eval_selrf_constrained() will in this case:.pregrad
.grad.plateautime
equal to the RF duration (.rf.rfwave.duration
) and the gradient amplitude (.grad.amp
[G/cm]) will be set to the proper value depending on the BW (.rf.bw
) and slice thickness (.slthick
). The field .grad.description
will have a ".trap" suffix added to it.postgrad
to have a gradient area that rephases the slice. This is dependent on the isodelay of the RF pulse (.rf.iso2end
) and the slice select gradient amplitude (.grad.amp
). The field .postgrad.description
will have a ".reph" suffix added to itKS_RF_ROLE_REF
, indicating an RF refocusing role. ks_eval_selrf_constrained() will in this case:.pregrad
to make the left crusher (never bridged with slice selection). The size of the crusher can be controlled by .crusherscale
. The field .pregrad.description
will have a ".LC" suffix added to it.grad
as done for KS_RF_ROLE_EXC
.postgrad
to make the right crusher (never bridged with slice selection). The size of the crusher can be controlled by .crusherscale
. The field .postgrad.description
will have a ".RC" suffix added to itKS_RF_ROLE_INV
, indicating an RF inversion role. ks_eval_selrf_constrained() will in this case:.pregrad
.grad
as done for KS_RF_ROLE_EXC
.postgrad
KS_RF_ROLE_SPSAT
, indicating a spatial RF saturation. ks_eval_selrf_constrained() will in this case:.pregrad
.grad
as done for KS_RF_ROLE_EXC
.postgrad
to make a gradient spoiler (never bridged with slice selection). The size of the spoiler can be controlled by .crusherscale
. The field .postgrad.description
will have a ".spoiler" suffix added to itThe role KS_RF_ROLE_CHEMSAT
, indicates a non-slice selective, chemically selective, RF (usually fat-sat). ks_eval_selrf_constrained() will in this case throw an error since no gradients should be used
There are three wrapper functions to this function (ks_eval_selrf(), ks_eval_selrf1(), ks_eval_selrf2()) that have reduced number of input arguments, and calls ks_eval_selrf_constrained() with different preset gradient constraints. ks_eval_selrf() makes fewest assumptions, making it the most general choice.
.gradwave
)To support e.g. VERSEd RF excitations, a custom gradient wave can be used. If .gradwave.res > 0
, ks_eval_selrf_constrained() will disable .grad
and use .gradwave
instead. When .rf.role = KS_RF_ROLE_EXC
, the rephasing gradient area (in .postgrad
) will be calculated by integrating the gradient waveform from the RF isocenter to the end. .gradwave
must be created before calling ks_eval_selrf_constrained() using either ks_eval_wave() or ks_eval_wave_file(), and the units must be in [G/cm]. To further scale the amplitude of .gradwave
before calling ks_eval_selrf_constrained(), consider e.g. ks_wave_multiplyval(), ks_wave_absmax(), and possibly ks_wave_addval()
[in,out] | selrf | Pointer to the KS_SELRF object to be set up |
[in] | desc | A description (text string) of the KS_SELRF object. This description is used for pulse sequence generation (seen in the file generated by TimeHist in MGD Sim/WTools) |
[in] | ampmax | The maximum allowed gradient amplitude ([G/cm]) |
[in] | slewrate | The maximum allowed slewrate ([(G/cm) / us]). Value of 0.01 corresponds to 100 mT/m/s |
STATUS | SUCCESS or FAILURE |
STATUS ks_eval_selrf | ( | KS_SELRF * | selrf, |
const char *const | desc | ||
) |
This is a wrapper function to ks_eval_selrf_constrained() with gradient constraints set to allow this KS_SELRF to be played on any axis while other gradients (set up with the same constraints) can be played out on the other two gradient boards, for any slice angulation. This is the generic and safest configuration, but for thin slices and high RF BWs, the gradient limits may be reached, especially for double oblique slices
See ks_eval_selrf_constrained() for details on fields that need to be set before calling this function
[in,out] | selrf | Pointer to the KS_SELRF object to be set up |
[in] | desc | A description (text string) of the KS_SELRF object. This description is used for pulse sequence generation (seen in the file generated by TimeHist in MGD Sim/WTools) |
STATUS | SUCCESS or FAILURE |
STATUS ks_eval_selrf2 | ( | KS_SELRF * | selrf, |
const char *const | desc | ||
) |
This is a wrapper function to ks_eval_selrf_constrained() with gradient constraints set to allow this KS_SELRF to be played on any axis while one more gradient (set up with the same constraints) can be played out on another gradient board, for any slice angulation. For double oblique slice angulations, this function will allow for thinner slices and higher RF BWs than ks_eval_selrf()
See ks_eval_selrf_constrained() for details on fields that need to be set before calling this function
[in,out] | selrf | Pointer to the KS_SELRF object to be set up |
[in] | desc | A description (text string) of the KS_SELRF object. This description is used for pulse sequence generation (seen in the file generated by TimeHist in MGD Sim/WTools) |
STATUS | SUCCESS or FAILURE |
STATUS ks_eval_selrf1 | ( | KS_SELRF * | selrf, |
const char *const | desc | ||
) |
This is a wrapper function to ks_eval_selrf_constrained() with gradient constraints set to allow this KS_SELRF to be played on any axis, as long as no other gradients are be played out simultaneously. For double oblique slice angulations, this function will allow for thinner slices and higher RF BWs than ks_eval_selrf() and ks_eval_selrf2()
See ks_eval_selrf_constrained() for details on fields that need to be set before calling this function
[in,out] | selrf | Pointer to the KS_SELRF object to be set up |
[in] | desc | A description (text string) of the KS_SELRF object. This description is used for pulse sequence generation (seen in the file generated by TimeHist in MGD Sim/WTools) |
STATUS | SUCCESS or FAILURE |
STATUS ks_eval_selrf1p | ( | KS_SELRF * | selrf, |
const char *const | desc | ||
) |
[in,out] | selrf | Pointer to the KS_SELRF object to be set up |
[in] | desc | A description (text string) of the KS_SELRF object. This description is used for pulse sequence generation (seen in the file generated by TimeHist in MGD Sim/WTools) |
STATUS | SUCCESS or FAILURE |
STATUS ks_eval_sms_get_phase_modulation | ( | float * | sms_phase_modulation, |
const int | sms_multiband_factor, | ||
const int | sms_phase_modulation_mode | ||
) |
[out] | sms_phase_modulation | Array with phase modulation between slices in a MB RF |
[in] | sms_multiband_factor | The multi-band acceleration factor |
[in] | sms_phase_modulation_mode | See ks_enum_smstype for options |
STATUS | SUCCESS or FAILURE |
float ks_eval_findb1 | ( | KS_SELRF * | selrf, |
float | max_b1, | ||
double | scaleFactor, | ||
int | sms_multiband_factor, | ||
int | sms_phase_modulation_mode, | ||
float | sms_slice_gap | ||
) |
[in] | selrf | rf object KS_SELRF |
[in] | max_b1 | peak B1 |
[in] | scaleFactor | initial stretch factor |
[in] | sms_multiband_factor | SMS factor |
[in] | sms_phase_modulation_mode | SMS phase modulation mode |
[in] | sms_slice_gap | SMS slice gap |
void ks_eval_transient_SPGR_FA_train_recursive | ( | float * | FA_train, |
float * | MZ_train, | ||
int | N, | ||
float | E1, | ||
float | target_MT, | ||
int | n | ||
) |
ADDDESCHERE
FA_train | ADDTEXTHERE | |
MZ_train | ADDTEXTHERE | |
[in] | N | ADDTEXTHERE |
[in] | E1 | ADDTEXTHERE |
[in] | target_MT | ADDTEXTHERE |
[in] | n | ADDTEXTHERE |
void ks_eval_transient_SPGR_FA_train_binary_search | ( | float * | FA_train, |
float * | MZ_train, | ||
int | N, | ||
float | E1, | ||
float | MTlo, | ||
float | MThi, | ||
float | total_FA | ||
) |
ADDDESCHERE
FA_train | ADDTEXTHERE | |
MZ_train | ADDTEXTHERE | |
[in] | N | ADDTEXTHERE |
[in] | E1 | ADDTEXTHERE |
[in] | MTlo | ADDTEXTHERE |
[in] | MThi | ADDTEXTHERE |
[in] | total_FA | ADDTEXTHERE |
STATUS ks_eval_check_FA_train | ( | int | N, |
float * | FA_train, | ||
float * | MZ_train, | ||
float | total_FA | ||
) |
ADDDESCHERE
[in] | N | ADDTEXTHERE |
FA_train | ADDTEXTHERE | |
MZ_train | ADDTEXTHERE | |
[in] | total_FA | ADDTEXTHERE |
STATUS | ADDTEXTHERE |
STATUS ks_eval_transient_SPGR_FA_train | ( | float * | FA_train, |
int | N, | ||
float | TR, | ||
float | T1, | ||
float | total_FA | ||
) |
ADDDESCHERE
FA_train | ADDTEXTHERE | |
[in] | N | ADDTEXTHERE |
[in] | TR | ADDTEXTHERE |
[in] | T1 | ADDTEXTHERE |
[in] | total_FA | ADDTEXTHERE |
STATUS | ADDTEXTHERE |
STATUS ks_eval_sms_make_multiband | ( | KS_SELRF * | selrfMB, |
const KS_SELRF * | selrf, | ||
const int | sms_multiband_factor, | ||
const int | sms_phase_modulation_mode, | ||
const float | sms_slice_gap, | ||
int | debug | ||
) |
[out] | selrfMB | Pointer to multiband (SMS) KS_SELRF object |
[in] | selrf | The original (single-band) KS_SELRF object (set up using ks_eval_selrf()) |
[in] | sms_multiband_factor | The multi-band acceleration factor |
[in] | sms_phase_modulation_mode | See ks_enum_smstype for options |
[in] | sms_slice_gap | Slice gap in [mm] for the selrfMB pulse |
[in] | debug | Debug flag for writing out text files (SIM: in current dir HW:/usr/g/mrraw/kstmp) |
STATUS | SUCCESS or FAILURE |
float ks_eval_sms_calc_slice_gap | ( | int | sms_multiband_factor, |
int | nslices, | ||
float | slthick, | ||
float | slspace | ||
) |
[in] | sms_multiband_factor | The multi-band acceleration factor |
[in] | nslices | Prescribed number of slices |
[in] | slthick | Prescribed slice thickness |
[in] | slspace | Prescribed slice spacing |
slicegap | SMS slice gap in [mm] |
float ks_eval_sms_calc_slice_gap_from_scan_info | ( | int | sms_multiband_factor, |
int | nslices, | ||
const SCAN_INFO * | org_slice_positions | ||
) |
[in] | sms_multiband_factor | The multi-band acceleration factor |
[in] | nslices | Prescribed number of slices |
[in] | org_slice_positions | Prescribed slice positions |
slicegap | SMS slice gap in [mm] |
float ks_eval_sms_calc_caipi_area | ( | int | caipi_fov_shift, |
float | sms_slice_gap | ||
) |
[in] | caipi_fov_shift | The FOV shift in units of faction of FOV (e.g. 2 means shift of FOV/2) |
[in] | sms_slice_gap | Slice gap in [mm] for the selrfMB pulse |
caipi_blip_area | The area of the CAIPIRINHA blip in [(G/cm) * us] |
[out] | selrfPINS | PINS RF pulse (KS_SELRF object) |
[in] | selrf | The original (single-band) KS_SELRF object (set up using ks_eval_selrf()) |
[in] | sms_slice_gap | Slice gap in [mm] for the selrfMB pulse |
STATUS | SUCCESS or FAILURE |
STATUS ks_eval_sms_make_pins_dante | ( | KS_SELRF * | selrfPINS, |
const KS_SELRF * | selrf, | ||
float | sms_slice_gap | ||
) |
ADDDESCHERE
selrfPINS | ADDTEXTHERE | |
selrf | ADDTEXTHERE | |
[in] | sms_slice_gap | ADDTEXTHERE |
STATUS | ADDTEXTHERE |
int ks_eval_findNearestNeighbourIndex | ( | float | value, |
const float * | x, | ||
int | length | ||
) |
[in] | value | |
[in] | x | Input array |
[in] | length | Length of array |
index | Index into array |
void ks_eval_linear_interp1 | ( | const float * | x, |
int | x_length, | ||
const float * | y, | ||
const float * | xx, | ||
int | xx_length, | ||
float * | yy | ||
) |
[in] | x | Input array of x coordinates for data (y) |
[in] | x_length | Length of array |
[in] | y | Input array of data (same length as x) |
[in] | xx | Array of new sample points of the data in y |
[in] | xx_length | Length of array with new sample points |
[out] | yy | Output array with interpolated data |
STATUS | SUCCESS or FAILURE |
The input KS_TRAP object will be converted to a KS_WAVE object, which will have its .waveform
(float array) field filled with the shape of the trapezoid with the maintained GRAD_UPDATE_TIME (4 [us]) sample duration. The .waveform
amplitude on the plateau will be .amp
[G/cm].
[out] | wave | Pointer to a KS_WAVE object to be set up with same shape as the trapezoid (KS_TRAP) in arg 2 |
[in] | trap | The trapezoid to convert into a waveform |
STATUS | SUCCESS or FAILURE |
STATUS ks_eval_coords2wave | ( | KS_WAVE * | wave, |
float * | t, | ||
float * | G, | ||
int | num_coords, | ||
int | dwell, | ||
const char * | desc | ||
) |
STATUS ks_eval_append_two_waveforms | ( | KS_WAVEFORM | first_waveform, |
KS_WAVEFORM | second_waveform, | ||
int | res1, | ||
int | res2 | ||
) |
STATUS ks_eval_concatenate_waves | ( | int | num_waves, |
KS_WAVE * | target_wave, | ||
KS_WAVE ** | waves_to_append | ||
) |
STATUS ks_eval_epi_constrained | ( | KS_EPI * | epi, |
const char *const | desc, | ||
float | ampmax, | ||
float | slewrate | ||
) |
The KS_EPI composite sequence object controls an entire EPI train (including de/rephasers on freq & phase axes). Four fields in KS_EPI are other sequence objects:
.read
: The EPI readout lobes including data acquisition.readphaser
: The dephaser & rephaser gradients before & after the train of readout lobes, on the same board as .read
.blip
: The blip gradients in the phase encoding direction between the readout lobes.blipphaser
: The dephaser & rephaser gradients on the same board as the .blip
gradients. For multi-shot EPI these gradients will change in scan() when calling ks_scan_epi_shotcontrol()Before calling this function, portions of the .read
field (KS_READTRAP) and .blipphaser
field (KS_PHASER) must be set up. Here follows a list of fields that must be set:
.read.fov
: The Field-of-View (FOV) in the frequency encoding (readout) direction.read.res
: The number of pixels within the FOV along the frequency encoding direction.blipphaser.fov
: The Field-of-View (FOV) in the phase encoding direction.blipphaser.res
: The number of pixels within the FOV along the phase encoding direction.blipphaser.R
: Either the number of EPI shots or the parallel imaging factor.read.rampsampling
: Whether rampsampling should be used (see KS_READTRAP). Value of 1 is recommended for EPI.read.acq.rbw
: The receiver bandwidth in [kHz/FOV]. Maximum: 250 (recommended)If the KS_EPI object is initialized with KS_INIT_EPI on declaration, .read.rampsampling
will already be set to 1 and .read.acq.rbw
will be set to 250.0 (hence steps 6-7 can be skipped).
Single-shot EPI acquisitions are geometrically distorted to some degree depending on chosen .read.res
and .blipphaser.fov
. To reduce the EPI distortions, either multi-shot EPI or parallel imaging acceleration can be used. For both alternatives, every Rth phase ecoding lines are acquired in k-space as the EPI train is played out. R corresponds to the number of shots (opnshots
menu in the UI) or the parallel imaging factor. Therefore, e.g. a 4-shot EPI readout is identical to an R = 4 accelerated EPI readout with the same FOV and resolution, why one same field .R
may be used to control the EPI train setup, be it multi-shot or parallel imaging acceleration (but not both at the same time). What differs between multi-shot and parallel imaging acceleration in the acquisition is only whether the .blipphaser
should change from TR to TR. Hence, to set up a KS_EPI object, use the field .R
for both multi-shot EPI and parallel imaging scenarios.
The remaining fields of interest in the KS_EPI sequence objects are:
.etl
: This is the echo-train-length (ETL) of the EPI readout train, set by ks_eval_epi() based on .blipphaser.res
and .blipphaser.R
.read_spacing
: Additional spacing in [us] between readout lobes. Default value is zero, but can be set > 0 if additional gradients is to be inserted between the readout lobes. One scenario is adding CAIPIRINHA blips on ZGRAD during the time where the EPI readout is played out in the pulse sequence.duration
: Convenience information for timing calculations, set by ks_eval_epi(). This is the total time in [us] for the EPI train, including the de/rephasers on the frequency/phase axes. Note that there are also .duration
fields for each of the four KS_***
sequence objects in KS_EPI, stating the duration of each of these components..time2center
: Convenience information for timing calculations, set by ks_eval_epi(). The time in [us] from the start of the first dephaser until the center of k-space is reached. This deviates from <epi>.duration/2
for partial Fourier EPI trains where .blipphaser.nover > 0
(a.k.a. fractional NEX, but typically shown as MiniumTE in the UI for EPI)If peripheral nerve stimulation would be observed, consider calling ks_eval_epi_constrained() with reduced slewrate. This will however increase the geometric distortions in the images
[in,out] | epi | Pointer to the KS_EPI object to be set up |
[in] | desc | A description (text string) of the KS_SELRF object. This description is used for pulse sequence generation (seen in the file generated by TimeHist in MGD Sim/WTools) |
[in] | ampmax | The maximum allowed gradient amplitude ([G/cm]) |
[in] | slewrate | The maximum allowed slewrate ([(G/cm) / us]). Value of 0.01 corresponds to 100 mT/m/s |
STATUS | SUCCESS or FAILURE |
STATUS ks_eval_epi_setinfo | ( | KS_EPI * | epi | ) |
STATUS ks_eval_epi_maxamp_slewrate | ( | float * | ampmax, |
float * | slewrate, | ||
int | xres, | ||
float | quietnessfactor | ||
) |
Get a reasonably optimized max gradient amplitude and slewrate for the EPI train. This function results in similar values as GE's epigradopts(), where gradient system limits and peripheral-nerve-stimulation (PNS) are not to be exceeded. ks_eval_epi_maxamp_slewrate() has no dB/dt model, but is dependent on xres (assuming fixed FOV, rampsampling and maxmimum rBW). This has also been tested for axial and oblique scans on volunteers at Karolinska without PNS experience using FOV = 24 cm on both DV750 and DV750w with rampsampling and rBW = 250. If PNS should still occur, the slewrate value passed to ks_eval_epi_constrained() should be decreased. The units of the slewrate is [(G / cm) / us], i.e. gradient amp in G / cm divided by the ramptime in us. This value times 1e4 gives slewrate in SI units: T / m / s (up to e.g. 200).
[out] | ampmax | The maximum allowed gradient amplitude ([G/cm]) |
[out] | slewrate | The maximum allowed slewrate ([(G/cm) / us]). Value of 0.01 corresponds to 100 mT/m/s |
[in] | xres | The frequency encoding resolution |
[in] | quietnessfactor | Value >= 1 used for optional gradient derating |
STATUS | SUCCESS or FAILURE |
STATUS ks_eval_epi | ( | KS_EPI * | epi, |
const char *const | desc, | ||
float | quietnessfactor | ||
) |
This is a wrapper function to ks_eval_epi_constrained() with a reduced set of input arguments using preset gradient constraints. These constraints should allow for EPI readouts for double oblique slice angulations, but the values for ampmax or slewrate may not be optimal. If peripheral nerve stimulation (PNS) would be observed, consider calling ks_eval_epi_constrained() directly with reduced slewrate. This will however increase the geometric distortions in the images
See ks_eval_epi_constrained() for more details on fields in KS_EPI that must be set before calling this function
[in,out] | epi | Pointer to the KS_EPI object to be set up |
[in] | desc | A description (text string) of the KS_SELRF object. This description is used for pulse sequence generation (seen in the file generated by TimeHist in MGD Sim/WTools) |
[in] | quietnessfactor | Value >= 1 used for optional gradient derating |
STATUS | SUCCESS or FAILURE |
STATUS ks_eval_echotrain | ( | KS_ECHOTRAIN *const | echotrain | ) |
Ensures the echotrain design is resonable and counts the number of unique KS_READTRAPS and KS_READWAVES used. The array of KS_READCONTROL controls[KS_MAXUNIQUE_READ] and eval'd KS_READWAVES/KS_READTRAPS are the inputs.
[in,out] | echotrain | - A pointer to a KS_ECHOTRAIN structure |
STATUS | SUCCESS or FAILURE |
int ks_echotrain_get_max_kspace_index | ( | KS_ECHOTRAIN * | echotrain | ) |
echotrain | - A pointer to a KS_ECHOTRAIN structure that has been eval'ed |
int | - The maximum kspace(echo) index. |
PSD_FILTER_GEN ks_get_maxsize_finfo | ( | PSD_FILTER_GEN | my_psd_filter_spec[] | ) |
[in] | my_psd_filter_spec | - typically GE's global array of filters |
PSD_FILTER_GEN | - the filter with the maximum length |
void ks_grad_heat_reset | ( | ) |
void ks_grad_heat_init | ( | KS_SEQ_COLLECTION * | seqcollection_p, |
STATUS(*)(const INT max_encode_mode, int nargs, void **args) | play, | ||
int | nargs, | ||
void ** | args | ||
) |
int ks_eval_rflimits | ( | KS_SAR * | sar, |
KS_SEQ_COLLECTION * | seqcollection | ||
) |
This function uses one KS_SEQ_COLLECTION struct holding the RF for the entire psd (involving one or more sequence modules) to check if an interval can be played out as is or if the overall duration needs to be increased to honor SAR and hardware limits. The interval of measurement is given by the function pointer passed to ks_eval_mintr(), which typically is a sliceloop function playing out the slices for one TR (using one or more sequence modules).
The net time for this period is given by the sum of instances and durations of the sequence modules involved. This information is taken from ks_eval_seqcollection_gettotalduration(), which sums the product of the duration of each sequence module by the number of instances of each sequence module.
ks_eval_hwlimits() will call GE's regular SAR, RF power and gradient heating functions after creating temporary RF_PULSE and GRAD_PULSE structs using the sequence objects (RF and gradients) in the sequence modules.
The gradient information for all sequence modules is accessed via seqcollection->seqctrlptr[i].gradrf.trapptr[...]
, while the RF information for all sequence modules is accessed via seqcollection->seqctrlptr[i].gradrf.rfptr[...]
, with i being the internal sequence module index.
GE's hardware and SAR check functions will return new minimum durations, which may be equal or larger than the net time, depending on the hardware and safety limits. The largest new minimum duration is the return value for this function. Also, if the 1st argument (KS_SAR *) is not pointing to NULL, the SAR information will be stored in this struct, so it can be used by the calling function.
Currently, KSFoundation does not use GE's new gradheat method where cornerpoints of the sequence waveforms are used for the gradient heating calculations. When using the old method, the minseq()
function will likely be too conservative and may add unnecessary time penalty. The level of exaggeration is not clear, why there is a temporary solution with a 'gheatfact' as an input argument, where it is up to the EPIC programmer to decide on this. This variable should be 1.0 to fully obey the old gradient heating calculations (understanding the minimum TR can bump up significantly). To fully ignore gradient heating calculations a value of 0.0 is used. The proper value of this variable, that would correspond to the actual hardware gradient limits, is not known at the moment, but a value closer to 0.0 than 1.0 better matches the new gradient heating model used by GE's product psds. Having said that, absolutely no guarantees are given in terms of gradient damage or similar.
See also: ks_eval_mintr(), ks_eval_maxslicespertr(), ks_eval_seqcollection_gettotalduration()
[out] | sar | Pointer to KS_SAR struct with SAR parameters. If NULL, no attempt to store SAR parameters will be done. If not null, KS_SAR will be set up. In addition, the description of GE's CV 'optr' will be changed so that one can see the limit factor and how much time that had to be added to be within specs. This information can be viewed on the MR system while scanning by DisplayCV and type in 'optr'. |
[in] | seqcollection | A KS_SEQ_COLLECTION struct, which have undergone a reset of seqctlptr[].nseqinstances followed by a single run of the sequence's slice loop or equivalent period |
int | Minimum time in [us] that is needed to safetly play out the .nseqinstances sequence modules over the intended interval (usually one TR for 2D sequences) |
STATUS ks_eval_gradlimits | ( | int * | newtime, |
KS_SEQ_COLLECTION * | seqcollection, | ||
const LOG_GRAD * | log_grad, | ||
STATUS(*)(const INT max_encode_mode, int nargs, void **args) | play, | ||
int | nargs, | ||
void ** | args | ||
) |
STATUS ks_eval_hwlimits | ( | int * | newtime, |
KS_SEQ_COLLECTION * | seqcollection, | ||
const LOG_GRAD * | log_grad, | ||
STATUS(*)(const INT max_encode_mode, int nargs, void **args) | play, | ||
int | nargs, | ||
void ** | args | ||
) |
s64 ks_eval_getduration | ( | KS_SEQ_COLLECTION * | seqcollection, |
STATUS(*)(const INT max_encode_mode, int nargs, void **args) | play, | ||
int | nargs, | ||
void ** | args | ||
) |
int ks_eval_mintr | ( | int | nslices, |
KS_SEQ_COLLECTION * | seqcollection, | ||
int(*)(int, int, void **) | play_loop, | ||
int | nargs, | ||
void ** | args | ||
) |
This function relies on the existence of a slice loop (wrapper) function that can be run on both HOST and TGT. In addition, it needs a KS_SEQ_COLLECTION struct containing references to the sequence modules (KS_SEQ_CONTROL) used in the slice loop. ks_eval_mintr() will call the slice loop, passed in as a function pointer, with nslices as the first argument.
Different psds have different arguments to their slice loop function depending on what is needed to know for the particular sequence, but a standardized argument list of the sliceloop function is required to allow it to be passed in to ks_eval_mintr(). Therefore, a small wrapper function is likely needed for the psd's sliceloop. Moreover, the sliceloop function must return the time in [us] (int) corresponding to the duration to play out the slice loop for nslices number of slices. E.g. if there is a psd specific function
there should be a wrapper function with the following fixed input args:
(void *)
for the nargs extra arguments)The most important argument is nslices, which must be passed to mysliceloop()
so that different times are returned for different nslices. Hence, mysliceloop()
must also have nslices as an input argument.
If the remaining arguments to mysliceloop()
(like ky, exc, somecustominfo) do not affect the sequence timing, the sliceloop wrapper function can be written as (using mysliceloop() above):
If some of the remaining arguments to mysliceloop()
(like ky, exc, somecustominfo) affect the sequence timing, the sliceloop wrapper function can be written as (using mysliceloop() above):
For scenario #2, nargs and args must be set up before calling ks_eval_mintr(), e.g. like:
[in] | nslices | Number of slices to play out in the slice loop |
[in] | seqcollection | A KS_SEQ_COLLECTION struct, which have undergone a reset of seqctlptr[].nseqinstances followed by a single run of the sequence's slice loop or equivalent period |
[in] | play_loop | Function pointer to the sliceloop (wrapper) function of the sequence. This function should perform all time consuming tasks for one TR. It is a requirement that this function has three input arguments: int nslices, int nargs, void **args |
[in] | nargs | Number of extra arguments to the slice loop wrapper function. This can be 0 if the slice loop is only temporally dependent on nslices |
[in] | args | void * pointer array to extra arguments. This can be NULL if the slice loop is temporally dependent only on nslices |
int | Minimum time in [us] that is needed to safetly play out the .nseqinstances sequence modules over the intended interval (usually one TR for 2D sequences) |
int ks_eval_maxslicespertr | ( | int | TR, |
KS_SEQ_COLLECTION * | seqcollection, | ||
int(*)(int, int, void **) | play_loop, | ||
int | nargs, | ||
void ** | args | ||
) |
The maximum numbers of slices per TR is determined by calling ks_eval_mintr() with an increasing number of slices until the input TR value is reached
[in] | TR | Repetition time in [us] |
[in] | seqcollection | A KS_SEQ_COLLECTION struct, which have undergone a reset of seqctlptr[].nseqinstances followed by a single run of the sequence's slice loop or equivalent period |
[in] | play_loop | Function pointer to the sliceloop (wrapper) function of the sequence. This function should perform all time consuming tasks for one TR. It is a requirement that this function has three input arguments: int nslices, int nargs, void **args |
[in] | nargs | Number of extra arguments to the slice loop wrapper function. This can be 0 if the slice loop is only temporally dependent on nslices |
[in] | args | void * pointer array to extra arguments. This can be NULL if the slice loop is temporally dependent only on nslices |
int | Maximum number of slices that can fit in one TR |
STATUS ks_eval_seqctrl_setminduration | ( | KS_SEQ_CONTROL * | seqctrl, |
int | mindur | ||
) |
It is recommended that this function is put at the end of the sequence generating function for the current sequence module (c.f. KS_SEQ_CONTROL), e.g. mypsd_pg(), which is a point where one knows how long the pulse sequence is, as the last gradient or RF waveform has been placed out. After passing the known minimum allowed sequence module duration as arg2 to ks_eval_seqctrl_setminduration(), both seqctrl.duration
and `seqctrl.min_duration are set to this minimum value + the SSI time for the sequence module (which must be > 0 before calling this function).
This function is only available on HOST for the reason that the .duration
field should not be reset to the minimum duration on TGT. The recommended order of events is the following:
cveval()
on HOST: Call mypsd_pg(). Having the ks_eval_seqctrl_setminduration() call at the end of mypsd_pg(), with the second argument (minimum duration) set to the absolute time corresponding to the last waveform, it is assured that both seqctrl.duration
(which can grow bigger later) and seqctrl.min_duration
(which should not be modified later) is equal to the same minimum possible value at this point. cveval()
on HOST, after the mypsd_pg() call: Do some TR timing calculations and increase the seqctrl.duration
field(s) for one or more sequence modules to fill up to the intended TR. The reasons for why seqctrl.duration
needs to be larger than seqctrl.min_duration
could be either that the TR is larger than the minimum possible by the waveforms, and/or that SAR or hardware constraints (reported back by ks_eval_mintr()) mandates that additional time must be added to the sequence to honor these limits.pulsegen()
on TGT (IPG): The mypsd_pg() function is called to place out the actual hardware waveforms, followed by the "sequence ending here"-call to KS_SEQLENGTH(), which is using seqctrl.duration
to determine the length of the sequence module. As efforts have been made on HOST to set seqctrl.duration
, we cannot have ks_eval_seqctrl_setminduration() to reset it again on TGT when mypsd_pg() is called. Hence this is why ks_eval_seqctrl_setminduration() is only accessible on HOST[in,out] | seqctrl | Pointer to KS_SEQ_CONTROL struct for the current sequence module |
[in] | mindur | mindur + .ssi_time => .min_duration = .duration @retval STATUS SUCCESSor FAILURE` |
STATUS ks_eval_seqctrl_setduration | ( | KS_SEQ_CONTROL * | seqctrl, |
int | dur | ||
) |
.duration
field of the sequence module (KS_SEQ_CONTROL), while checking that the input value is not less than .min_duration
[in,out] | seqctrl | Pointer to KS_SEQ_CONTROL struct for the current sequence module |
[in] | dur | Desired duration of the current sequence module (including its SSI time, .ssi_time ) |
STATUS | SUCCESS or FAILURE |
STATUS ks_eval_seqcollection_durations_setminimum | ( | KS_SEQ_COLLECTION * | seqcollection | ) |
.duration
fields of all sequence modules being part of the sequence collection (KS_SEQ_COLLECTION) to their .min_duration
value[in,out] | seqcollection | Pointer to KS_SEQ_COLLECTION struct holding pointers to all sequence modules |
STATUS | SUCCESS or FAILURE |
STATUS ks_eval_seqcollection_durations_atleastminimum | ( | KS_SEQ_COLLECTION * | seqcollection | ) |
.duration
fields of all sequence modules being part of the sequence collection (KS_SEQ_COLLECTION) are at least their .min_duration
value[in,out] | seqcollection | Pointer to KS_SEQ_COLLECTION struct holding pointers to all sequence modules |
STATUS | SUCCESS or FAILURE |
void ks_eval_seqcollection_resetninst | ( | KS_SEQ_COLLECTION * | seqcollection | ) |
.nseqinstances
field of each sequence module (KS_SEQ_CONTROL) equal to 0This function is called in ks_eval_mintr() and GEReq_eval_TR() to reset the sequence module counters before calling the psd's scanloop function, where the ks_scan_playsequence() functions internally increment .nseqinstances
by one every time they are called
[in,out] | seqcollection | Collection of all sequence modules (KS_SEQ_COLLECTION). C.f. ks_eval_addtoseqcollection() |
void ks_print_seqcollection | ( | KS_SEQ_COLLECTION * | seqcollection, |
FILE * | fp | ||
) |
[in] | seqcollection | Collection of all sequence modules (KS_SEQ_COLLECTION). C.f. ks_eval_addtoseqcollection() |
[in] | fp | File pointer to file to write to |
void ks_print_scaninfo | ( | const SCAN_INFO * | scan_info, |
int | nslices, | ||
const char * | desc, | ||
FILE * | fp | ||
) |
[in] | scan_info | File pointer to SCAN_INFO |
[in] | nslices | Number of slices prescribed |
[in] | desc | Description of the slice info (or NULL) |
[in] | fp | File pointer to file to write to |
s64 ks_eval_seqcollection_gettotalduration | ( | KS_SEQ_COLLECTION * | seqcollection | ) |
Based on the seqctrl.ninstances
and seqctrl.duration
fields for each KS_SEQ_CONTROL (sequence module) that have been added to the sequence collection struct (KS_SEQ_COLLECTION), this function returns the total duration of the sequence collection. No time is added to comply with SAR or hardware limits, hence this time may not be possible to use in practice. See ks_eval_mintr(), GEReq_eval_TR(), and ks_eval_hwlimits() for more details.
[in] | seqcollection | Collection of all sequence modules (KS_SEQ_COLLECTION). C.f. ks_eval_addtoseqcollection() |
int | Time in [us] |
s64 ks_eval_seqcollection_gettotalminduration | ( | KS_SEQ_COLLECTION * | seqcollection | ) |
Based on the seqctrl.ninstances
and seqctrl.min_duration
fields for each KS_SEQ_CONTROL (sequence module) that have been added to the sequence collection struct (KS_SEQ_COLLECTION), this function returns the total minimum duration possible of the sequence collection, i.e. the time needed to play out the sequence waveforms without any deadtime. See ks_eval_mintr(), GEReq_eval_TR(), and ks_eval_hwlimits() for more details
[in] | seqcollection | Collection of all sequence modules (KS_SEQ_COLLECTION). C.f. ks_eval_addtoseqcollection() |
int | Time in [us] |
STATUS ks_eval_seqcollection2rfpulse | ( | RF_PULSE * | rfpulse, |
KS_SEQ_COLLECTION * | seqcollection | ||
) |
rfpulse[]
array from the contents of a KS_SEQ_COLLECTION structTo use GE's maxsar()
and maxseqrfamp()
functions in ks_eval_hwlimits() there needs to be an rfpulse[]
array containing info about the RF pulses. This info is for standard EPIC psds stored on disk in a file grad_rf_<psdname>.h. KSFoundation EPIC psds with one or more sequence modules (KS_SEQ_CONTROL) have all RF information stored in seqcollection->seqctrlptr[i].gradrf.rfptr[]. This function takes all RF information from all sequence modules in the sequence collection and puts in the proper format in rfpulse[]
. Then rfpulse[]
can be passed on to maxsar()
and maxseqrfamp()
(see ks_eval_hwlimits())
[out] | rfpulse | Pointer to rfpulse[] array |
[in] | seqcollection | Pointer to the sequence collection struct for the sequence |
STATUS | SUCCESS or FAILURE |
GRAD_PULSE ks_eval_makegradpulse | ( | KS_TRAP * | trp, |
int | gradchoice | ||
) |
GRAD_PULSE
struct from a KS_TRAP objectTo use GE's minseq()
function that determines gradient heating limits from the gradient usage, a GRAD_PULSE array needs to be generated for each gradient axis. This info is for standard EPIC psds stored on disk in a file grad_rf_<psdname>.h. KSFoundation EPIC psds with one or more sequence modules (KS_SEQ_CONTROL) being part of a KS_SEQ_COLLECTION struct, have all gradient trapezoid (KS_TRAP) information stored in seqcollection->seqctrlptr[i].gradrf.trapptr[]. Hence, from the seqcollection struct it is possible to reach all KS_TRAP for all sequence modules (see ks_eval_hwlimits()), which one by one can be converted to GRAD_PULSE structs using this function.
[in] | trp | Pointer to a KS_TRAP object |
[in] | gradchoice | XGRAD, YGRAD, or ZGRAD, specifying which gradient this is used on |
GRAD_PULSE | A gradient pulse structure in GE's standard form |
void ks_create_suffixed_description | ( | char *const | out, |
const char *const | prefix, | ||
const char * | suffix, | ||
... | |||
) |
void void ks_read_header_pool | ( | int * | exam_number, |
int * | series_number, | ||
int * | run_number | ||
) |
ADDDESCHERE
exam_number | ADDTEXTHERE |
series_number | ADDTEXTHERE |
run_number | ADDTEXTHERE |
float ks_rt_scale_log_get | ( | const KS_RT_SCALE_LOG * | log, |
int | instance_idx, | ||
int | playout_idx | ||
) |
int ks_rt_scale_log_get_state | ( | const KS_RT_SCALE_LOG * | log, |
int | instance_idx, | ||
int | playout_idx | ||
) |
void ks_rt_scale_log_set | ( | KS_RT_SCALE_LOG * | log, |
int | instance_idx, | ||
float | ampscale | ||
) |
void ks_rt_scale_log_set_state | ( | KS_RT_SCALE_LOG * | log, |
int | instance_idx, | ||
int | state | ||
) |
void ks_rt_scale_log_next | ( | KS_RT_SCALE_LOG * | log | ) |
unsigned int ks_calc_nextpow2 | ( | unsigned int | x | ) |
[in] | x | Integer (usually related to resolution) |
nextpow2 | Unsigned integer with a value equal to the nearest larger power-of-2 |
int ks_calc_roundupms | ( | int | time | ) |
STATUS ks_calc_filter | ( | FILTER_INFO * | echo_filter, |
int | tsp, | ||
int | duration | ||
) |
This function is used internally by ks_eval_read() as a part of the setup of a KS_READ sequence object, which contains the .filt
(FILTER_INFO) field that is used with the corresponding acquisition window in the field .echo
of the KS_READ object
ks_calc_filter() will set the field .filt.slot
to KS_NOTSET
(= -1). A final (global) hardware slot number is set when either setfilter()
or GEReq_predownload_setfilter() is called in predownload()
. With the assigned slot number, ks_pg_read() in pulsegen()
will connect this filter to the acquisition window by internally calling setrfltrs()
initfilter()
is called in the Requiredcvinit section of GERequired.e. Make sure this section is @inline'd in cvinit()
in the main sequencesetfilter()
, after @inlining the RequiredpredownloadBegin section of GERequired.e. Pass the .filt
field set up by this function to GEReq_predownload_setfilter()[out] | echo_filter | FILTER_INFO struct needed for data acquisition |
[in] | tsp | Duration in [us] for each data sample (dwell time) in the acquisition window. Minimum: 2 [us] |
[in] | duration | Duration in [us] of the entire data acquisition window |
STATUS | SUCCESS or FAILURE |
int ks_calc_bw2tsp | ( | float | bw | ) |
[in] | bw | +/- bandwidth per FOV in [kHz]. Maximum: 250 |
tsp | Duration in [us] for each data sample (dwell time) in the acquisition window |
float ks_calc_tsp2bw | ( | int | tsp | ) |
[in] | tsp | Duration in [us] for each data sample in the acquisition window. Minimum: 2 [us] |
bw | +/- bandwidth per FOV in [kHz] |
int ks_calc_trap_time2area | ( | KS_TRAP * | trap, |
float | area | ||
) |
[in] | trap | KS_TRAP* Trapezoid gradient |
[in] | area | Area to reach |
time | in [us] |
float ks_calc_nearestbw | ( | float | bw | ) |
As the dwell time is an integer and the reciprocal of receiver bandwidth, only certain values of receiver bandwidth are possible. This functions rounds a desired receiver bandwidth to the nearest valid value
[in] | bw | +/- bandwidth per FOV in [kHz]. Maximum: 250 |
bw | Rounded +/- bandwidth per FOV in [kHz] |
float ks_calc_lower_rbw | ( | float | rbw | ) |
ADDDESCHERE
[in] | rbw | ADDTEXTHERE |
float | ADDTEXTHERE |
float ks_calc_higher_rbw | ( | float | rbw | ) |
ADDDESCHERE
[in] | rbw | ADDTEXTHERE |
float | ADDTEXTHERE |
float ks_calc_max_rbw | ( | float | ampmax, |
float | fov | ||
) |
As the dwell time is an integer and the reciprocal of receiver bandwidth, only certain values of receiver bandwidth are possible. This functions rounds a desired receiver bandwidth to the nearest valid value
[in] | ampmax | Max gradient amplitude allowed |
[in] | fov | FOV in the readout direction [mm] |
bw | Rounded +/- bandwidth per FOV in [kHz] |
float ks_calc_minfov | ( | float | ampmax, |
int | tsp | ||
) |
Given a maximum allowed gradient amplitude in [G/cm] and a dwell time in [us] (see ks_calc_bw2tsp()), the minimum possible readout FOV in [mm] is calculated. This function is called internally by ks_eval_readtrap_constrained() when rampsampling is not used (.rampsampling = 0
)
[in] | ampmax | The maximum allowed gradient amplitude ([G/cm]) |
[in] | tsp | Duration in [us] for each data sample in the acquisition window. Minimum: 2 [us] |
minFOV | Minimum FOV in the readout direction |
float ks_calc_minslthick | ( | float | bw | ) |
Given an RF bandwidth in [kHz], this function returns the minimum slice thickness possible given the gradient max amplitude.
[in] | bw | RF bandwidth in [kHz] |
minSliceThickness | Minimum slice thickness in [mm] |
int ks_calc_mintsp | ( | float | ampmax, |
float | fov | ||
) |
Given a maximum allowed gradient amplitude in [G/cm] and a readout FOV in [mm], the smallest dwell time (i.e. largest rBW) in [us] is calculated.
[in] | ampmax | The maximum allowed gradient amplitude ([G/cm]) |
[in] | fov | FOV in the readout direction |
tsp | Duration in [us] for each data sample in the acquisition window |
float ks_calc_fov2gradareapixel | ( | float | fov | ) |
Given a readout FOV in [mm], the gradient area needed to move one pixel in a fully sampled k-space is calculated
[in] | fov | FOV in the readout direction |
area | Gradient area in [(G/cm) * us] |
STATUS ks_phaseencoding_memorypool_init | ( | KS_PHASEENCODING_COORD * | entries, |
uint64_t | size | ||
) |
[in] | entries | Pointer to KS_PHASEENCODING_COORD array with phase encoding coordinates |
[in] | size | Size of memory pool |
void ks_init_dynamic | ( | KS_DYNAMIC_STATE * | dynamic | ) |
It is important to have dynamic in a known state at the start of any scan function.
dynamic | The current state of the scan (used by ksscan) |
int ks_phaseencoding_isvalid | ( | const KS_PHASEENCODING_PLAN * | phaseenc_plan_ptr | ) |
ADDDESCHERE
phaseenc_plan_ptr | ADDTEXTHERE |
int | ADDTEXTHERE |
KS_PHASEENCODING_COORD ks_phaseencoding_get | ( | const KS_PHASEENCODING_PLAN * | phaseenc_plan_ptr, |
int | encode, | ||
int | shot | ||
) |
If the .ky and .kz values returned by this function is = KS_NOTSET (-1), it indicates that this encode/shot combination should have zero phase encoding and should be ignored. For 2D, .kz will always be KS_NOTSET
[in] | phaseenc_plan_ptr | Pointer to KS_PHASEENCODING_PLAN |
[in] | encode | Phase encoding index in the sequence echo train in range [0,encodes_per_shot-1] |
[in] | shot | Shot index (i.e. how many times the sequence is played out per slice). For 3D, this is the combined number of shots over ky and kz |
<tt>KS_PHASEENCODING_COORD</tt> |
KS_PHASEENCODING_SHOTCOORDS ks_phaseencoding_get_shot | ( | const KS_PHASEENCODING_PLAN * | phaseenc_plan_ptr, |
int | shot | ||
) |
ADDDESCHERE
phaseenc_plan_ptr | ADDTEXTHERE | |
[in] | shot | ADDTEXTHERE |
KS_PHASEENCODING_SHOTCOORDS | ADDTEXTHERE |
STATUS ks_repeat_peplan | ( | KS_PHASEENCODING_PLAN * | peplan, |
const KS_PHASEENCODING_REPEAT_DESIGN *const | repeat | ||
) |
ADDDESCHERE
peplan | ADDTEXTHERE |
repeat | ADDTEXTHERE |
STATUS | ADDTEXTHERE |
void ks_phaseencoding_set | ( | KS_PHASEENCODING_PLAN * | phaseenc_plan_ptr, |
int | encode, | ||
int | shot, | ||
int | ky, | ||
int | kz | ||
) |
If the .ky and .kz values passed to this function is = KS_NOTSET (-1), it indicates that this encode/shot combination should have zero phase encoding and should be ignored. However, ignored encode/shot combinations are not necessary since the etl*num_shots entries in .entries
of KS_PHASEENCODING_PLAN are always initialized to KS_NOTSET by ks_phaseencoding_resize(). Hence, it is only necessary to explicitly set the encode/shot combination for ky/kz coordinates being acquired.
For 2D, kz (5th arg) should always be KS_NOTSET.
[in] | phaseenc_plan_ptr | Pointer to KS_PHASEENCODING_PLAN |
[in] | encode | Phase encoding index in the sequence echo train in range [0,encodes_per_shot-1] |
[in] | shot | Shot index (in range [0,how many times the sequence is played out per slice - 1]). For 3D, this is the combined number of shots over ky and kz |
[in] | ky | K-space coordinate along the first (only for 2D) phase encoding direction (integer) in range [0, phaser.numlinestoacq-1] |
[in] | kz | K-space coordinate along the second (use KS_NOTSET for 2D) phase encoding direction (integer) in range [0, zphaser.numlinestoacq-1] |
void ks_phaseencoding_print | ( | const KS_PHASEENCODING_PLAN * | phaseenc_plan_ptr | ) |
In SIM (WTools), a file ks_phaseencodingtable.txt will be generated in the current directory On HW (MR scanner), the same file will be located in /usr/g/mrraw
[in] | phaseenc_plan_ptr | Pointer to KS_PHASEENCODING_PLAN |
STATUS ks_phaseencoding_alloc | ( | KS_PHASEENCODING_PLAN * | phaseenc_plan_ptr, |
int | etl, | ||
int | num_shots | ||
) |
For every (and custom) ks_phaseencoding_generate_** functions, this function must be called before ks_phaseencoding_set() so that there is memory allocataed for the array of KS_PHASEENCODING_COORD
[in] | phaseenc_plan_ptr | Pointer to KS_PHASEENCODING_PLAN |
[in] | etl | The number of acquisition window in the pulse sequence, or echo train length (ETL) |
[in] | num_shots | Number of shots (i.e. how many times the sequence is played out per slice). For 3D, shot is over both ky and kz |
STATUS ks_phaseencoding_generate_simple | ( | KS_PHASEENCODING_PLAN * | phaseenc_plan_ptr, |
const char *const | desc, | ||
KS_PHASER * | phaser, | ||
KS_PHASER * | zphaser, | ||
int | encodes_per_shot | ||
) |
For sequences having only one echo (ETL=1) or having more echoes but where all echoes have the same ky/kz coordinate, there is no special logic necessary regarding which order to traverse the ky-kz plane over shots.
Parallel imaging in ky (and kz for 3D), with acs lines, is set up as usual using ks_eval_phaser() first before calling this function. For 2D, the phase encoding object (KS_PHASER) is then passed in as the 2nd arg to this function, with the 3rd arg being NULL
. For 3D, both KS_PHASERs are passed in as 2nd and 3rd args, each with their own acceleration and resolution. For both 2D and 3D, the KS_PHASEENCODING_PLAN will be set up based on the KS_PHASER(s), but for 2D all entries.kz in the KS_PHASEENCODING_PLAN will be KS_NOTSET (-1)
[out] | phaseenc_plan_ptr | Pointer to KS_PHASEENCODING_PLAN |
[in] | desc | A description (text string) of the KS_PHASEENCODING_PLAN object. This description is used in the psd plot. |
[in] | phaser | Pointer to the KS_PHASER object for the first (3D) / only (2D) phase encoding direction |
[in] | zphaser | Pointer to the KS_PHASER object for the second phase encoding direction (NULL for 2D) |
[in] | encodes_per_shot | How many readouts are acquired for each shot |
STATUS ks_phaseencoding_generate_simple_ellipse | ( | KS_PHASEENCODING_PLAN * | phaseenc_plan_ptr, |
const char *const | desc, | ||
KS_PHASER * | phaser, | ||
KS_PHASER * | zphaser | ||
) |
For sequences having only one echo (ETL=1) or having more echoes but where all echoes have the same ky/kz coordinate, there is no special logic necessary regarding which order to traverse the ky-kz plane over shots.
Parallel imaging in ky (and kz for 3D), with acs lines, is set up as usual using ks_eval_phaser() first before calling this function. For 2D, the phase encoding object (KS_PHASER) is then passed in as the 2nd arg to this function, with the 3rd arg being NULL
. For 3D, both KS_PHASERs are passed in as 2nd and 3rd args, each with their own acceleration and resolution. For both 2D and 3D, the KS_PHASEENCODING_PLAN will be set up based on the KS_PHASER(s), but for 2D all entries.kz in the KS_PHASEENCODING_PLAN will be KS_NOTSET (-1). This function will create an elliptical k-space in ky/kz. For rectangular k-space, use ks_phaseencoding_generate_simple
.
[out] | phaseenc_plan_ptr | Pointer to KS_PHASEENCODING_PLAN |
[in] | desc | A description (text string) of the KS_PHASEENCODING_PLAN object. This description is used in the psd plot. |
[in] | phaser | Pointer to the KS_PHASER object for the first (3D) / only (2D) phase encoding direction |
[in] | zphaser | Pointer to the KS_PHASER object for the second phase encoding direction (NULL for 2D) |
STATUS ks_phaseencoding_generate_2d_singleshot_cal | ( | KS_PHASEENCODING_PLAN * | phaseenc_plan_ptr, |
int | yres | ||
) |
ADDDESCHERE
[out] | phaseenc_plan_ptr | Pointer to KS_PHASEENCODING_PLAN |
yres | ADDTEXTHERE |
STATUS | SUCCESS or FAILURE |
int ks_comp_kcoord_r_t | ( | const void * | a, |
const void * | b | ||
) |
ADDDESCHERE
a | ADDTEXTHERE |
b | ADDTEXTHERE |
int | ADDTEXTHERE |
int ks_comp_kcoord_z_y | ( | const void * | a, |
const void * | b | ||
) |
ADDDESCHERE
a | ADDTEXTHERE |
b | ADDTEXTHERE |
int | ADDTEXTHERE |
int ks_comp_kcoord_y_z | ( | const void * | a, |
const void * | b | ||
) |
ADDDESCHERE
a | ADDTEXTHERE |
b | ADDTEXTHERE |
int | ADDTEXTHERE |
int ks_comp_kview_r_t | ( | const void * | a, |
const void * | b | ||
) |
ADDDESCHERE
a | ADDTEXTHERE |
b | ADDTEXTHERE |
int | ADDTEXTHERE |
int ks_comp_kview_y_z | ( | const void * | a, |
const void * | b | ||
) |
ADDDESCHERE
a | ADDTEXTHERE |
b | ADDTEXTHERE |
int | ADDTEXTHERE |
int ks_comp_kview_e_t | ( | const void * | a, |
const void * | b | ||
) |
ADDDESCHERE
a | ADDTEXTHERE |
b | ADDTEXTHERE |
int | ADDTEXTHERE |
int ks_comp_kview_e_z | ( | const void * | a, |
const void * | b | ||
) |
ADDDESCHERE
a | ADDTEXTHERE |
b | ADDTEXTHERE |
int | ADDTEXTHERE |
int ks_cal_from_nacslines | ( | int | R, |
int | nacslines | ||
) |
int ks_get_ry_from_kcoords | ( | KS_KCOORD * | coord, |
const int | num_coords | ||
) |
Checks all KCOORDS to find the largest gap in ky.
[in] | coord | - Will be sorted |
[in] | num_coords |
int ks_get_rz_from_kcoords | ( | KS_KCOORD * | coord, |
const int | num_coords | ||
) |
Checks all KCOORDS to find the largest gap in kz.
[in] | coord | - Will be sorted |
[in] | num_coords |
void ks_get_matrix_from_kcoords | ( | KS_KCOORD * | K, |
const int | num_coords, | ||
int * | y, | ||
int * | z | ||
) |
Checks all KCOORDS to find the largest span in ky and/or kz.
[in] | K | - Will be sorted |
[in] | num_coords | - number of entries in K |
[out] | y | - matrix size in y |
[out] | z | - matrix size in z |
STATUS ks_generate_3d_coords_caipi | ( | KS_KSPACE_ACQ * | kacq, |
int | Ny, | ||
int | Nz, | ||
int | nover_y, | ||
int | nover_z, | ||
int | Ry, | ||
int | Rz, | ||
int | cal_y, | ||
int | cal_z, | ||
KS_COVERAGE | cal_coverage, | ||
KS_COVERAGE | acq_coverage, | ||
int | dy, | ||
int | dz, | ||
int | step_y, | ||
int | step_z | ||
) |
Generates Cartesian Coordinates with or without CAPIRINHA undersampling.
[out] | kacq | KS_KSPACE_ACQ object to be populated with coords, num_coords, and matrix_size |
[in] | Ny | Number of lines along ky (without acceleration) |
[in] | Nz | Number of lines accross Nz (without acceleration). |
[in] | nover_y | Number of lines beyond Ny/2 to acquire when using partial Fourier. If nover_y < 0 remove low ky. If nover_y > 0 remove high ky. If nover_y = 0 no Partial Fourier in y. |
[in] | nover_z | Number of lines beyond Nz/2 to acquire when using partial Fourier. If nover_z < 0 remove low ky. If nover_z > 0 remove high ky. If nover_z = 0 no Partial Fourier in z. |
[in] | Ry | Undersampling factor in y |
[in] | Rz | Undersampling factor in z |
[in] | cal_y | Width of calibration region in y |
[in] | cal_z | Width of calibration region in z |
[in] | cal_coverage | Calibration region coverage, (RECTANGULAR or ELLIPTICAL) |
[in] | acq_coverage | Acquisition region coverage, (RECTANGULAR or ELLIPTICAL) |
[in] | dy | (CAIPIRINHA) Amount of shifting of the y-coordinate between consecutive kz rows |
[in] | dz | Not used |
[in] | step_y | (CAIPIRINHA) Maximum y offset (N*dy) before it loops back to 0 |
[in] | step_z | Not used |
STATUS | SUCCESS or FAILURE |
STATUS ks_generate_3d_coords_radial | ( | KS_KSPACE_ACQ * | kacq, |
int | tiny_level, | ||
int | Ny, | ||
int | Nz, | ||
int | Ry, | ||
int | Rz, | ||
KS_RADIAL_SAMPLING_MODE | radial_mode, | ||
KS_RADIAL_SAMPLING_COVERAGE | radial_sampling_coverage | ||
) |
Generates Radial Coordinates.
If radial_sampling_mode is CARTESIAN, this function will call ks_generate_3d_coords_simple(kacq, Ny, Nz, 0, 0, Ry, Rz, 0, 0, RECTANGULAR, RECTANGULAR);
For 2D radial, Nz<=1. For 3D Kooshball radial, radial_mode must be RADIAL_THROUGH_CENTER and Nz>1. For 3D Stack-of-stars radial, radial_mode must be RADIAL_SOS and Nz>1.
For golden angle sampling (tiny_level != 0), the angular increment between consecutive spokes are generated using the following formula for 2D and stack of stars (Wundrak et al. https://doi.org/10.1002/mrm.25831):
phi_step = 1.0 /(KS_GOLDEN_MEANS_1D+tiny_level-1)
...and for kooshball this formula is followed (Fyrdahl et al. https://doi.org/10.1007/s10334-020-00859-z):
phi_step = 1.0/(pow(KS_GOLDEN_MEANS_2D_2,-1) + tiny_level-1.0)
theta_step = phi_step/(1+KS_GOLDEN_MEANS_2D_1)
For SAMPLE_360 radial_sampling_coverage the spokes are generated on the half circle/sphere but every other spoke is inverted.
In kacq.coords the angles are stored as signed 16 bit integers that can be converted to floats in the range -180:180 degrees using KS_ANGLE_PER_INT_16_MAX_180
[out] | kacq | KS_KSPACE_ACQ object to be populated with coords, num_coords, and matrix_size |
[in] | tiny_level | Tiny level for golden angle radial sampling (0 means uniform sampling instead of golden angle). |
[in] | Ny | Number of lines along ky (without acceleration) |
[in] | Nz | Number of lines accross Nz (without acceleration). |
[in] | Ry | Undersampling factor in coordinate 1 (phi) |
[in] | Rz | Undersampling factor in coordinte 2 (kz or theta) |
[in] | radial_mode | Sampling mode (Cartesian, radial through center, or stack-of-stars) |
[in] | radial_sampling_coverage | Whether the spokes should originate from a half circle/sphere or full circel/sphere |
STATUS | SUCCESS or FAILURE |
STATUS ks_generate_3d_coords_simple | ( | KS_KSPACE_ACQ * | kacq, |
int | Ny, | ||
int | Nz, | ||
int | nover_y, | ||
int | nover_z, | ||
int | Ry, | ||
int | Rz, | ||
int | cal_y, | ||
int | cal_z, | ||
KS_COVERAGE | cal_coverage, | ||
KS_COVERAGE | acq_coverage | ||
) |
Generates Cartesian Coordinates.
Calls ks_generate_3d_coords_caipi with the CAIPIRINHA variables, dy, dz, step_y, and step_z set to 0.
[out] | kacq | KS_KSPACE_ACQ object to be populated with coords, num_coords, and matrix_size |
[in] | Ny | Number of lines along ky (without acceleration) |
[in] | Nz | Number of lines accross Nz (without acceleration). |
[in] | nover_y | Number of lines beyond Ny/2 to acquire when using partial Fourier. If nover_y < 0 remove low ky. If nover_y > 0 remove high ky. If nover_y = 0 no Partial Fourier in y. |
[in] | nover_z | Number of lines beyond Nz/2 to acquire when using partial Fourier. If nover_z < 0 remove low ky. If nover_z > 0 remove high ky. If nover_z = 0 no Partial Fourier in z. |
[in] | Ry | Undersampling factor in y |
[in] | Rz | Undersampling factor in z |
[in] | cal_y | Width of calibration region in y |
[in] | cal_z | Width of calibration region in z |
[in] | cal_coverage | Calibration region coverage, (RECTANGULAR or ELLIPTICAL) |
[in] | acq_coverage | Acquisition region coverage, (RECTANGULAR or ELLIPTICAL) |
STATUS | SUCCESS or FAILURE |
STATUS ks_generate_2d_coords_cal | ( | KS_KSPACE_ACQ * | kacq, |
int | num_desired_coords, | ||
int | yres | ||
) |
ADDDESCHERE
STATUS | SUCCESS or FAILURE |
STATUS ks_generate_3d_coords_poisson_disc | ( | KS_KSPACE_ACQ * | kacq, |
int | Ny, | ||
int | Nz, | ||
float | min_spacing, | ||
float | max_spacing, | ||
KS_COVERAGE | cal_coverage, | ||
int | cal_y, | ||
int | cal_z, | ||
RADIUS_PATTERN | pattern | ||
) |
ADDDESCHERE
STATUS | SUCCESS or FAILURE |
STATUS ks_generate_3d_coords_poisson_disc_R | ( | KS_KSPACE_ACQ * | kacq, |
int | Ny, | ||
int | Nz, | ||
float | R, | ||
KS_COVERAGE | cal_coverage, | ||
int | cal_y, | ||
int | cal_z, | ||
RADIUS_PATTERN | pattern | ||
) |
ADDDESCHERE
STATUS | SUCCESS or FAILURE |
STATUS ks_generate_3d_coords_epi | ( | KS_KSPACE_ACQ * | kacq, |
const KS_EPI * | epitrain, | ||
const ks_enum_epiblipsign | blipsign, | ||
const int | Ry, | ||
const int | caipi_delta | ||
) |
ADDDESCHERE
STATUS | SUCCESS or FAILURE |
void ks_pe_linear | ( | int * | view_order, |
int | ETL | ||
) |
void ks_pe_linear_roll | ( | int * | view_order, |
int | ETL, | ||
int | c | ||
) |
ADDDESCHERE
view_order | ADDTEXTHERE | |
[in] | ETL | ADDTEXTHERE |
[in] | c | ADDTEXTHERE |
void ks_pe_pivot_roll | ( | int * | view_order, |
int | ETL, | ||
int | c | ||
) |
ADDDESCHERE
view_order | ADDTEXTHERE | |
[in] | ETL | ADDTEXTHERE |
[in] | c | ADDTEXTHERE |
void ks_pivot_linear_center_symk | ( | int * | view_order, |
int | ETL, | ||
int | c | ||
) |
ADDDESCHERE
view_order | ADDTEXTHERE | |
[in] | ETL | ADDTEXTHERE |
[in] | c | ADDTEXTHERE |
STATUS ks_pe_permute_pclo_rad | ( | int * | view_order, |
const int | etl, | ||
const int | center | ||
) |
ADDDESCHERE
view_order | ADDTEXTHERE | |
[in] | etl | ADDTEXTHERE |
[in] | center | ADDTEXTHERE |
STATUS | SUCCESS or FAILURE |
void ks_pivot_specific_center_symk | ( | int * | view_order, |
int | ETL, | ||
int | c | ||
) |
ADDDESCHERE
view_order | ADDTEXTHERE | |
[in] | ETL | ADDTEXTHERE |
[in] | c | ADDTEXTHERE |
void ks_pivot_specific_center_radk | ( | int * | view_order, |
int | ETL, | ||
int | c | ||
) |
ADDDESCHERE
view_order | ADDTEXTHERE | |
[in] | ETL | ADDTEXTHERE |
[in] | c | ADDTEXTHERE |
STATUS ks_generate_peplan_from_kcoords | ( | const KS_KSPACE_ACQ * | kacq, |
KS_PHASEENCODING_PLAN * | peplan, | ||
KS_MTF_DIRECTION | mtf_direction, | ||
KS_VIEW_SORT_ORDER | encode_shot_assignment_order, | ||
KS_VIEW_MTF_PROFILE | mtf_profile, | ||
const int | etl, | ||
int | center, | ||
const KS_COORDINATE_TYPE *const | coord_types | ||
) |
ADDDESCHERE
[in] | kacq | ADDTEXTHERE |
[out] | peplan | ADDTEXTHERE |
[in] | mtf_direction | ADDTEXTHERE |
[in] | encode_shot_assignment_order | ADDTEXTHERE |
[in] | mtf_profile | ADDTEXTHERE |
[in] | etl | ADDTEXTHERE |
[in] | center | ADDTEXTHERE |
[in] | coord_types | KS_COORDINATE_TYPE ADDTEXTHERE |
STATUS | SUCCESS or FAILURE |
STATUS ks_generate_peplan_from_kcoords_american | ( | const KS_KSPACE_ACQ * | kacq, |
KS_PHASEENCODING_PLAN * | peplan, | ||
const KS_MTF_DIRECTION | mtf_direction, | ||
const int | etl, | ||
const int | center | ||
) |
<-— center
^ *
| *
ky *
Time ->
STATUS ks_fse_calcecho | ( | double * | bestecho, |
double * | optecho, | ||
int * | nacqlines_to_kspacecenter, | ||
const KS_PHASER *const | pe, | ||
KS_PF_EARLYLATE | pf_direction, | ||
int | TE, | ||
int | etl, | ||
int | esp | ||
) |
Given the KS_PHASER object used in the FSE train (containing res and partial ky Fourier info), the desired effective echo time (TE
[us]), the echo train length (etl
) and the echo spacing between consecutive echoes (esp
[us]), this function calculates two echo indices:
bestecho
: is the 0-based index corresponding to the echo in the FSE train that should be placed in the center of k-space, i.e. the echo that most closely matches the desired TE. If bestecho
is an integer value (although it is in double format), the data acquired for this echo should straddle the k-space center. bestecho
can also be an interger + 0.5, indicating that there are two echo indices that should be placed around the k-space center. For example, floor(bestecho) corresponds to the echo index that should be placed just below the k-space center and ceil(bestecho) corresponds to the echo index that should be placed just above the k-space center. I.e. when bestecho = *.5
, no single echo index will straddle the k-space center, and the k-space line located at ky position +0.5 will come from data acquired from echo #[floor(bestecho)] and ky position -0.5 correspondingly from echo #[ceil(bestecho)].optecho
: is the 0-based index corresponding to an ideal TE choice that would allow the data from the echoes in the FSE train to be placed out linearly each time. Doing so will reduce ghosting and T2 blurring. Hence, optecho
ignores the input TE value here, but the calling function can use this information to determine k-space acquisition order, but also to suggest a TE (optecho * esp) that would result in optimal image quality for the chosen ETL.[out] | bestecho | Pointer to the echo number in the train that should be placed at the center of k-space given the current ETL and ESP |
[out] | optecho | Pointer to the optimal echo number in the train that would allow k-space to be sampled linearly (to reduce T2-blurring and ghosting) |
[out] | nacqlines_to_kspacecenter | Pointer to a an integer with the number of k-space lines until center |
[in] | pe | Pointer to a KS_PHASER |
[in] | pf_direction | Should be either KS_PF_EARLY or KS_PF_LATE (applies to partial Fourier in ky to set if k-space center should be acquired early or late in the EPI train. Has no effect for full ky Fourier) |
[in] | TE | (Echo Time in [us]) |
[in] | etl | (EchoTrain Length) |
[in] | esp | (Echo Spacing in [us]) |
STATUS | SUCCESS or FAILURE |
STATUS ks_phaseencoding_generate_epi | ( | KS_PHASEENCODING_PLAN * | phaseenc_plan_ptr, |
const char *const | desc, | ||
const KS_EPI * | epitrain, | ||
const ks_enum_epiblipsign | blipsign, | ||
const KS_PF_EARLYLATE | pf_direction, | ||
const int | numileavestoacq, | ||
ks_enum_sweep_order | sweep_order, | ||
int | numsegments, | ||
const int | caipi_delta | ||
) |
The etl is the number of readouts in the EPI train, derived from the phaser. The number of ky shots is also given by the phaser, while the number of kz shots is given by zphaser. Any partial fourier is handled by the phasers, and acceleration and acs lines in the z direction is handled by zphaser. For 3D EPI, the number of shots in the phase encoding plan will be the product of the number of shots in the ky direction and the number of kz lines to acquire.
Each shot will be played out in a single kz plane. The shot order will be linear in ky and kz. The ky shots will be in the inner loop, unless kzshotsfirst is TRUE.
[out] | phaseenc_plan_ptr | Pointer to the phase encoding plan |
[in] | desc | A description (text string) of the KS_PHASEENCODING_PLAN object. This description is used in the psd plot. |
[in] | epitrain | Pointer to a KS_EPI |
[in] | blipsign | Should be either KS_EPI_POSBLIPS or KS_EPI_NEGBLIPS . Determines distortion direction. |
[in] | pf_direction | Should be either KS_PF_EARLY or KS_PF_LATE (applies to partial Fourier in ky to set if k-space center should be acquired early or late in the EPI train. Has no effect for full ky Fourier) |
[in] | numileavestoacq | Number of ky interleaves to play. Must be within 1-numInterleaves and an integer factor of numInterleaves. Set =1 for single-shot EPI. Set to phaser.R for full multi-shot EPI. |
[in] | sweep_order | Sweep order for shots as defined in KSFoundation.h (ks_enum_sweep_order). Has no effect on distortions. |
[in] | numsegments | Number of kz encodes to play |
[in] | caipi_delta | Use CAIPIRINHA sampling pattern (affects 3D epi only) |
STATUS | SUCCESS or FAILURE |
STATUS ks_calc_sliceplan | ( | KS_SLICE_PLAN * | slice_plan, |
int | nslices, | ||
int | slperpass | ||
) |
This function calls ks_calc_slice_acquisition_order_interleaved() with the last argument being 2, indicating an interleave factor of 2. This will make odd slices in each pass to be acquired first, followed by the even slices.
[out] | slice_plan | The slice plan (KS_SLICE_PLAN) set up earlier using ks_calc_sliceplan() or similar |
[in] | nslices | Total number of slices (usually opslquant) |
[in] | slperpass | Number of slices per pass (i.e. per TR) |
STATUS | SUCCESS or FAILURE |
STATUS ks_calc_sliceplan_interleaved | ( | KS_SLICE_PLAN * | slice_plan, |
int | nslices, | ||
int | slperpass, | ||
int | inpass_interleaves | ||
) |
The last argument to this function indicates the interleave factor of slices within each pass. If this value is
[out] | slice_plan | Pointer to the slice plan (KS_SLICE_PLAN) set up earlier using ks_calc_sliceplan() or similar |
[in] | nslices | Total number of slices (usually opslquant) |
[in] | slperpass | Number of slices per pass (i.e. per TR) |
[in] | inpass_interleaves | Interleave factor of slices in a pass |
STATUS | SUCCESS or FAILURE |
STATUS ks_calc_sliceplan_sms | ( | KS_SLICE_PLAN * | slice_plan, |
int | nslices, | ||
int | slperpass, | ||
int | multiband_factor | ||
) |
[out] | slice_plan | The slice plan (KS_SLICE_PLAN) set up earlier using ks_calc_sliceplan() or similar |
[in] | nslices | Total number of slices (usually opslquant) |
[in] | slperpass | Number of slices per pass (i.e. per TR) |
[in] | multiband_factor | Number of SMS slices |
STATUS | SUCCESS or FAILURE |
STATUS ks_sms_check_divisibility | ( | int * | inpass_interleaves, |
const int | sms_factor, | ||
const int | nslices_per_pass, | ||
const int | nslices | ||
) |
If possible, the number of inpass_interleaves will be adjusted to fix the issue.
[out] | inpass_interleaves | Interleave factor of slices in a pass |
[in] | sms_factor | Number of SMS slices |
[in] | nslices_per_pass | Number of slices per pass (i.e. per TR) |
[in] | nslices | Total number of slices |
STATUS | SUCCESS or FAILURE |
int ks_calc_slice_acquisition_order_smssingleacq | ( | DATA_ACQ_ORDER * | dacq, |
int | nslices | ||
) |
[out] | dacq | Data acquisition order array (local) |
[in] | nslices | Total number of slices prescribed |
int | Resulting number of passes (or acqs) (in this case 1) |
float ks_calc_integrate_coords | ( | float * | t, |
float * | G, | ||
int | num_coords | ||
) |
[in] | t | Time points (array with num_coords elements) |
[in] | G | Amplitude (array with num_coords elements) |
[in] | num_coords | Number of points in t and G |
float | Integral (in units of G*t) |
int ks_calc_sms_min_gap | ( | DATA_ACQ_ORDER * | dacq, |
int | nslices | ||
) |
TODO: just works for single acquisitions
[out] | dacq | Data acquisition order array (local) |
[in] | nslices | Total number of slices prescribed |
int | The minimum time gap between adjacent slices |
void ks_print_sliceplan | ( | const KS_SLICE_PLAN | slice_plan, |
FILE * | fp | ||
) |
slice_plan | KS_SLICE_PLAN for the sequence |
fp | A file pointer (or stderr ) |
void ks_print_waveform | ( | const KS_WAVEFORM | waveform, |
const char * | filename, | ||
int | res | ||
) |
[in] | waveform | A KS_WAVEFORM (i.e. float array) to be written |
[in] | filename | String with the output file name |
[in] | res | Number of elements in the waveform to be written |
STATUS ks_print_acqwaves | ( | KS_SEQ_COLLECTION * | seqcollection | ) |
[in] | seqcollection | The KS_SEQ_COLLECTION sequence collection |
void ks_print_readwave | ( | const KS_READWAVE *const | readwave, |
const char * | filename | ||
) |
ks_print_wave
on readwave.grads[].
[in] | readwave | Pointer to KS_READWAVE to be printed |
[in] | filename | String with the output file name |
void ks_print_wave_part | ( | const KS_WAVE *const | wave, |
const char * | filename, | ||
int | startidx, | ||
int | stopidx | ||
) |
void ks_print_wave | ( | const KS_WAVE *const | wave, |
const char * | filename | ||
) |
void ks_print_read | ( | KS_READ | read, |
FILE * | fp | ||
) |
If 2nd argument is stderr
or stdout
, the printed result will be seen in WTools for simulation. On the MR system, stderr
will show up in one of the mgd_term windows. A file pointer (opened with e.g. fp = fopen("/usr/g/mrraw/myname.txt","w")) saves a text file to disk
[in] | read | A KS_READ object to be printed |
[in] | fp | A file pointer (or stderr ) |
void ks_print_trap | ( | KS_TRAP | trap, |
FILE * | fp | ||
) |
If 2nd argument is stderr
or stdout
, the printed result will be seen in WTools for simulation. On the MR system, stderr
will show up in one of the mgd_term windows. A file pointer (opened with e.g. fp = fopen("/usr/g/mrraw/myname.txt","w")) saves a text file to disk
[in] | trap | A KS_TRAP object to be printed |
[in] | fp | A file pointer (or stderr ) |
void ks_print_readtrap | ( | KS_READTRAP | readtrap, |
FILE * | fp | ||
) |
If 2nd argument is stderr
or stdout
, the printed result will be seen in WTools for simulation. On the MR system, stderr
will show up in one of the mgd_term windows. A file pointer (opened with e.g. fp = fopen("/usr/g/mrraw/myname.txt","w")) saves a text file to disk
[in] | readtrap | A KS_READTRAP object to be printed |
[in] | fp | A file pointer (or stderr ) |
void ks_print_phaser | ( | KS_PHASER | phaser, |
FILE * | fp | ||
) |
If 2nd argument is stderr
or stdout
, the printed result will be seen in WTools for simulation. On the MR system, stderr
will show up in one of the mgd_term windows. A file pointer (opened with e.g. fp = fopen("/usr/g/mrraw/myname.txt","w")) saves a text file to disk
[in] | phaser | A KS_PHASER object to be printed |
[in] | fp | A file pointer (or stderr ) |
void ks_print_epi | ( | KS_EPI | epi, |
FILE * | fp | ||
) |
If 2nd argument is stderr
or stdout
, the printed result will be seen in WTools for simulation. On the MR system, stderr
will show up in one of the mgd_term windows. A file pointer (opened with e.g. fp = fopen("/usr/g/mrraw/myname.txt","w")) saves a text file to disk
[in] | epi | A KS_EPI object to be printed |
[in] | fp | A file pointer (or stderr ) |
void ks_print_rf | ( | KS_RF | rf, |
FILE * | fp | ||
) |
If 2nd argument is stderr
or stdout
, the printed result will be seen in WTools for simulation. On the MR system, stderr
will show up in one of the mgd_term windows. A file pointer (opened with e.g. fp = fopen("/usr/g/mrraw/myname.txt","w")) saves a text file to disk
[in] | rf | A KS_RF object to be printed |
[in] | fp | A file pointer (or stderr ) |
void ks_print_rfpulse | ( | RF_PULSE | rfpulse, |
FILE * | fp | ||
) |
If 2nd argument is stderr
or stdout
, the printed result will be seen in WTools for simulation. On the MR system, stderr
will show up in one of the mgd_term windows. A file pointer (opened with e.g. fp = fopen("/usr/g/mrraw/myname.txt","w")) saves a text file to disk
[in] | rfpulse | An RF_PULSE struct (<rf>.rfpulse ) to be printed |
[in] | fp | A file pointer (or stderr ) |
void ks_print_selrf | ( | KS_SELRF | selrf, |
FILE * | fp | ||
) |
If 2nd argument is stderr
or stdout
, the printed result will be seen in WTools for simulation. On the MR system, stderr
will show up in one of the mgd_term windows. A file pointer (opened with e.g. fp = fopen("/usr/g/mrraw/myname.txt","w")) saves a text file to disk
[in] | selrf | A KS_SELRF object to be printed |
[in] | fp | A file pointer (or stderr ) |
void ks_print_readwaves | ( | KS_ECHOTRAIN *const | echotrain, |
const char * | suffix, | ||
int | rhkacq_uid | ||
) |
ADDDESCHERE
echotrain | ADDTEXTHERE | |
suffix | ADDTEXTHERE | |
[in] | rhkacq_uid | ADDTEXTHERE |
void ks_print_gradrfctrl | ( | KS_GRADRFCTRL | gradrfctrl, |
FILE * | fp | ||
) |
If 2nd argument is stderr
or stdout
, the printed result will be seen in WTools for simulation. On the MR system, stderr
will show up in one of the mgd_term windows. A file pointer (opened with e.g. fp = fopen("/usr/g/mrraw/myname.txt","w")) saves a text file to disk
[in] | gradrfctrl | A KS_GRADRFCTRL object to be printed |
[in] | fp | A file pointer (or stderr ) |
STATUS ks_error | ( | const char * | format, |
... | |||
) |
/usr/g/mrraw/ksf_errors.txt
in addition to sending an epic_error()
, which will show the error at the bottom of the UI[in] | format | Standard C printf input arguments |
STATUS | Returns FAILURE |
STATUS STATUS ks_dbg | ( | const char * | format, |
... | |||
) |
/usr/g/mrraw/ksf_debug.txt
[in] | format | Standard C printf input arguments |
STATUS | Returns SUCCESS |
STATUS STATUS STATUS existfile | ( | const char * | fname | ) |
int ks_syslimits_hasICEhardware | ( | ) |
void ks_dbg_reset | ( | ) |
float ks_syslimits_ampmax | ( | LOG_GRAD | loggrd | ) |
Since the waveform design (using ks_eval_***()
functions) is separated from the placement of waveforms (using ks_pg_***()
functions), the maximum gradient limit to use for gradient design must account for the least capable gradient board given the current slice angulation. ks_syslimits_ampmax() assumes that all gradients may be on simultaneously
The return value from this function can be passed in as ampmax
to all ks_eval***_constrained()
functions
[in] | loggrd | GE's LOG_GRAD struct, dependent on the gradient system and current slice angulation |
gradmax | Maximum gradient amplitude ([G/cm]) that can be used on all boards simultaneously |
float ks_syslimits_ampmax2 | ( | LOG_GRAD | loggrd | ) |
Since the waveform design (using ks_eval_***()
functions) is separated from the placement of waveforms (using ks_pg_***()
functions), the maximum gradient limit to use for gradient design must account for the least capable gradient board given the current slice angulation. ks_syslimits_ampmax2() assumes that gradients are played out on at most one more board at the same time as the current trapezoid
The return value from this function can be passed in as ampmax
to all ks_eval***_constrained()
functions
[in] | loggrd | GE's LOG_GRAD struct, dependent on the gradient system and current slice angulation |
gradmax | Maximum gradient amplitude ([G/cm]) that can be used on 2 boards simultaneously |
float ks_syslimits_ampmax1 | ( | LOG_GRAD | loggrd | ) |
Since the waveform design (using ks_eval_***()
functions) is separated from the placement of waveforms (using ks_pg_***()
functions), the maximum gradient limit to use for gradient design must account for the least capable gradient board given the current slice angulation. ks_syslimits_ampmax1() assumes that no other gradient is played out on another board at the same time as the current trapezoid
The return value from this function can be passed in as ampmax
to all ks_eval***_constrained()
functions
[in] | loggrd | GE's LOG_GRAD struct, dependent on the gradient system and current slice angulation |
gradmax | Maximum gradient amplitude ([G/cm]) that can be used on one board at a time |
float ks_syslimits_ampmax1p | ( | LOG_GRAD | loggrd | ) |
[in] | loggrd | GE's LOG_GRAD struct, dependent on the gradient system and current slice angulation |
gradmax | Maximum gradient amplitude ([G/cm]) as defined by the physical gradients (lowest of physical X, Y, Z) |
int ks_syslimits_ramptimemax | ( | LOG_GRAD | loggrd | ) |
[in] | loggrd | GE's LOG_GRAD struct, dependent on the gradient system and current slice angulation |
ramptime | Ramptime in [us] to get from zero to full gradient scale |
float ks_syslimits_slewrate | ( | LOG_GRAD | loggrd | ) |
The return value from this function is the ratio of ks_syslimits_ampmax() and ks_syslimits_ramptimemax() and can be passed in as slewrate
to all ks_eval***_constrained()
functions
[in] | loggrd | GE's LOG_GRAD struct, dependent on the gradient system and current slice angulation |
slewrate | Maximum slewrate ([(G/cm) / us]) that can be used on all boards simultaneously |
float ks_syslimits_slewrate2 | ( | LOG_GRAD | loggrd | ) |
The return value from this function is the ratio of ks_syslimits_ampmax2() and ks_syslimits_ramptimemax() and can be passed in as slewrate
to all ks_eval***_constrained()
functions
[in] | loggrd | GE's LOG_GRAD struct, dependent on the gradient system and current slice angulation |
slewrate | Maximum slewrate ([(G/cm) / us]) that can be used on all boards simultaneously |
float ks_syslimits_slewrate1 | ( | LOG_GRAD | loggrd | ) |
The return value from this function is the ratio of ks_syslimits_ampmax1() and ks_syslimits_ramptimemax() and can be passed in as slewrate
to all ks_eval***_constrained()
functions
[in] | loggrd | GE's LOG_GRAD struct, dependent on the gradient system and current slice angulation |
slewrate | Maximum slewrate ([(G/cm) / us]) that can be used on one board at at time |
float ks_syslimits_slewrate1p | ( | LOG_GRAD | loggrd | ) |
[in] | loggrd | GE's LOG_GRAD struct, dependent on the gradient system and current slice angulation |
gradmax | Maximum slewrate ([(G/cm) / us]) that can be used on one board at at time as defined by the physical gradients (lowest of physical X, Y, Z) |
float ks_syslimits_gradtarget | ( | LOG_GRAD | loggrd, |
int | board | ||
) |
For gradient boards, the field .tx
, .ty
or .tz
is returned. For non-gradient boards, 1.0 is returned. This function is used internally by ks_pg_***()
functions and there should be no need to call it directly.
[in] | loggrd | GE's LOG_GRAD struct, dependent on the gradient system and current slice angulation |
[in] | board | The board on which the current trapezoid or waveform is to be played out on |
gradamp | Maximum target amplitude for a board |
float ks_syslimits_ampmax_phys | ( | ) |
int ks_syslimits_ramptimemax_phys | ( | ) |
float ks_syslimits_slewrate_phys | ( | ) |
unsigned short ks_cycles_to_iphase | ( | double | cycles | ) |
All phase values in KSFoundation are in [degrees], including flip angles, RF/receive phases and THETA waveforms. This function is used internally by another internal function ks_wave2iwave(), which is in turn called by ks_pg_wave()
[in] | cycles | periods |
unsigned | iphase to use on THETA board on hardwarewrapper of ks_cycles_to_iphase for degrees |
unsigned short ks_degrees_to_iphase | ( | double | degrees | ) |
wrapper of ks_cycles_to_iphase for radians
unsigned short ks_radians_to_iphase | ( | double | radians | ) |
float ks_calc_selgradamp | ( | float | rfbw, |
float | slthick | ||
) |
Given an RF bandwidth in [Hz] and a slice thickness in [mm], this function calculates the gradient strength in [G/cm] necessary to produce a slice with the given slice thickness
This function is used by ks_eval_seltrap(), ks_eval_selrf_constrained() and ks_scan_selrf_setfreqphase()
[in] | rfbw | The bandwidth of the RF pulse to use with the gradient |
[in] | slthick | The desired slice thickness in [mm] |
gradamp | Gradient amplitude to use [G/cm] |
void ks_wave_compute_params | ( | KS_WAVE *const | wave | ) |
int ks_wave_res | ( | const KS_WAVE * | wave | ) |
[in] | wave | KS_WAVE object |
res | Resolution (i.e. number of samples) in the KS_WAVE object |
float ks_waveform_max | ( | const KS_WAVEFORM | waveform, |
int | res | ||
) |
[in] | waveform | KS_WAVEFORM (float array) |
[in] | res | Resolution (i.e. number of samples) in the KS_WAVEFORM |
maxval | Maximum value |
float ks_wave_max | ( | const KS_WAVE * | wave | ) |
float ks_waveform_min | ( | const KS_WAVEFORM | waveform, |
int | res | ||
) |
[in] | waveform | KS_WAVEFORM (float array) |
[in] | res | Resolution (i.e. number of samples) in the KS_WAVEFORM |
minval | Minimum value |
float ks_wave_min | ( | const KS_WAVE * | wave | ) |
float ks_waveform_absmax | ( | const KS_WAVEFORM | waveform, |
int | res | ||
) |
[in] | waveform | KS_WAVEFORM (float array) |
[in] | res | Resolution (i.e. number of samples) in the KS_WAVEFORM |
absmaxval | Maximum absolute value |
float ks_waveform_maxslew | ( | const KS_WAVEFORM | waveform, |
int | res, | ||
int | duration, | ||
int * | index | ||
) |
[in] | waveform | KS_WAVEFORM |
[in] | res | Resolution (i.e. number of samples) in the KS_WAVEFORM |
[in] | duration | Duration of the waveform in us |
[out] | index | Index in waveform where max slewrate is. Can be NULL if you are not interested. |
absmaxval | Maximum absolute value |
float ks_wave_maxslew | ( | const KS_WAVE * | wave | ) |
short ks_iwave_absmax | ( | const KS_IWAVE | waveform, |
int | res | ||
) |
[in] | waveform | KS_WAVE object |
[in] | res | Check up to this many samples |
maximum | amplitude of the waveform |
float ks_wave_absmax | ( | const KS_WAVE * | wave | ) |
int ks_wave_time2area | ( | const KS_WAVE * | wave, |
float | area_in | ||
) |
[in] | wave | Pointer to KS_WAVE |
[in] | area_in | float [(G/cm) * us] |
time | [us] |
float ks_waveform_area | ( | const KS_WAVEFORM | waveform, |
int | start, | ||
int | end, | ||
int | dwelltime | ||
) |
[in] | waveform | KS_WAVEFORM (float array) |
[in] | start | [us] Start position of area calculation in [us] (0 = start of waveform) |
[in] | end | [us] End position of area calculation in [us] (res * dwelltime = end of waveform) |
[in] | dwelltime | [us] of each waveform point (duration/res) |
area | The area of the KS_WAVEFORM over the specified interval in [(G/cm) * us] |
long ks_iwave_area | ( | const KS_IWAVE | iwave, |
int | start, | ||
int | end, | ||
int | dwelltime | ||
) |
[in] | iwave | KS_IWAVE (short array) |
[in] | start | [us] Start position of area calculation in [us] (0 = start of waveform) |
[in] | end | [us] End position of area calculation in [us] (res * dwelltime = end of waveform) |
[in] | dwelltime | [us] of each waveform point (duration/res) |
area | The area of the KS_IWAVE over the specified interval in aribtrary units |
float ks_wave_area | ( | const KS_WAVE * | wave, |
int | start, | ||
int | end | ||
) |
[in] | wave | KS_WAVE object |
[in] | start | [us] Start position of area calculation in [us] (0 = start of waveform) |
[in] | end | [us] End position of area calculation in us |
area | The area of the KS_WAVE object over the specified interval in [(G/cm) * us] |
float ks_wave_full_area | ( | const KS_WAVE * | wave | ) |
[in] | wave | KS_WAVE object |
area | The area of the KS_WAVE object in [(G/cm) * us] |
float ks_waveform_sum | ( | const KS_WAVEFORM | waveform, |
int | res | ||
) |
[in] | waveform | KS_WAVEFORM (float array) |
[in] | res | Resolution (i.e. number of samples) in the KS_WAVEFORM |
sum | The sum of the KS_WAVEFORM |
float ks_wave_sum | ( | const KS_WAVE * | wave | ) |
float ks_waveform_norm | ( | const KS_WAVEFORM | waveform, |
int | res | ||
) |
[in] | waveform | KS_WAVEFORM (float array) |
[in] | res | Resolution (i.e. number of samples) in the KS_WAVEFORM |
norm2 | The 2-norm of a KS_WAVEFORM |
float ks_wave_norm | ( | const KS_WAVE * | wave | ) |
void ks_waveform_cumsum | ( | KS_WAVEFORM | cumsumwaveform, |
const KS_WAVEFORM | waveform, | ||
int | res | ||
) |
[out] | cumsumwaveform | KS_WAVEFORM (float array) |
[in] | waveform | KS_WAVEFORM (float array) |
[in] | res | Resolution (i.e. number of samples) in the KS_WAVEFORM |
void ks_waveform_multiply | ( | KS_WAVEFORM | waveform_mod, |
const KS_WAVEFORM | waveform, | ||
int | res | ||
) |
Multiplication of waveform a
(arg 1) with waveform b
(arg 2) as: a *= b
[in,out] | waveform_mod | KS_WAVE object |
[in] | waveform | KS_WAVEFORM (float array) |
[in] | res | Resolution (i.e. number of samples) in the KS_WAVEFORM |
Multiplication of waveform a
(arg 1) with waveform b
(arg 2) as: a *= b
If the duration of the two KS_WAVE objects have different resolution, the shorter KS_WAVE will be multiplied with the first part of the longer KS_WAVE
void ks_waveform_add | ( | KS_WAVEFORM | waveform_mod, |
const KS_WAVEFORM | waveform, | ||
int | res | ||
) |
Addition of waveform a
(arg 1) with waveform b
(arg 2) as: a += b
[in,out] | waveform_mod | KS_WAVEFORM (float array) |
[in] | waveform | KS_WAVEFORM (float array) |
[in] | res | Resolution (i.e. number of samples) in the KS_WAVEFORM |
void ks_eval_readwave_negatestate | ( | KS_READWAVE * | readwave, |
int | state | ||
) |
[in,out] | readwave | A pointer to KS_READWAVE you would like to negate |
[in] | state | The wavestate to modify |
Addition of waveform a
(arg 1) with waveform b
(arg 2) as: a *= b
If the duration of the two KS_WAVE objects have different resolution, the shorter KS_WAVE will be added to the first part of the longer KS_WAVE
void ks_waveform_multiplyval | ( | KS_WAVEFORM | waveform, |
float | val, | ||
int | res | ||
) |
The values in a KS_WAVEFORM are multiplied with a scalar value val
[in,out] | waveform | KS_WAVEFORM (float array) |
[in] | val | Floating point value to multiply with |
[in] | res | Resolution (i.e. number of samples) in the KS_WAVEFORM |
void ks_wave_multiplyval | ( | KS_WAVE * | wave, |
float | val | ||
) |
The waveform values in a KS_WAVE sequence object (.waveform[]
) are multiplied with a scalar value val
[in,out] | wave | KS_WAVE object |
[in] | val | Floating point value to multiply with |
void ks_waveform_addval | ( | KS_WAVEFORM | waveform, |
float | val, | ||
int | res | ||
) |
The values in a KS_WAVEFORM are added with a scalar value val
[in,out] | waveform | KS_WAVEFORM (float array) |
[in] | val | Floating point value to add |
[in] | res | Resolution (i.e. number of samples) in the KS_WAVEFORM |
void ks_wave_addval | ( | KS_WAVE * | wave, |
float | val | ||
) |
The waveform values in a KS_WAVE sequence object (.waveform[]
) are added with a scalar value val
[in,out] | wave | KS_WAVE object |
[in] | val | Floating point value to add |
STATUS ks_waveform2iwave | ( | KS_IWAVE | iwave, |
const KS_WAVEFORM | waveform, | ||
int | res, | ||
int | board, | ||
float | max, | ||
float | fs_factor | ||
) |
This function is used internally by ks_pg_wave() and there should be no need to call this function directly.
For all boards except THETA, this function auto-scales the (float) values in KS_WAVEFORM so that the maximum absolute value becomes +/- 32766. The output short int (KS_IWAVE) array is to be copied to hardware. For a KS_WAVEFORM on the THETA board, the necessary phase wraps and scaling to short int format is performed using ks_cycles_to_iphase(). GE's requirement of only having even numbers in the waveform except for a final odd value (end-of-waveform) is also taken care of here
Note that the preservation of the physical units are done in ks_pg_wave() by setting the correct instruction amplitude to multiply this auto-scaled waveform with in the sequence's hardware memory
[out] | iwave | KS_IWAVE (short int array) |
[in] | waveform | KS_WAVEFORM |
[in] | res | Resolution (i.e. number of samples) in the KS_WAVEFORM |
[in] | board | One of XGRAD, YGRAD, ZGRAD, RHO, THETA, OMEGA |
[in] | max | max value of the waveform |
[in] | fs_factor | how much of the dynamic range to use 1 = FULL |
STATUS | SUCCESS or FAILURE |
This function is used internally by ks_pg_wave() and there should be no need to call this function directly.
For all boards except THETA, this function auto-scales the (float) values in the .waveform[]
field so that the maximum absolute value becomes +/- 32766. The output short int (KS_IWAVE) array is to be copied to hardware. For a KS_WAVE on the THETA board, the necessary phase wraps and scaling to short int format is performed using ks_cycles_to_iphase(). GE's requirement of only having even numbers in the waveform except for a final odd value (end-of-waveform) is also taken care of here
Note that the preservation of the physical units are done in ks_pg_wave() by setting the correct instruction amplitude to multiply this auto-scaled waveform with in the sequence's hardware memory
[out] | iwave | KS_IWAVE (short int array) |
[in] | wave | KS_WAVE |
[in] | board | One of XGRAD, YGRAD, ZGRAD, RHO, THETA, OMEGA |
STATUS | SUCCESS or FAILURE |
WF_PULSE* ks_pg_echossp | ( | WF_PULSE * | echo, |
const char * | suffix | ||
) |
This function is used internally by ks_pg_read() to get pointers to the XTR and RBA SSP packets for an acquisition window
[in] | echo | Pointer to an echo (WF_PULSE) |
[in] | suffix | String being "xtr", "rba", or empty |
wfptr | Pointer to a WF_PULSE |
STATUS ks_pg_trap | ( | KS_TRAP * | trap, |
KS_SEQLOC | loc, | ||
KS_SEQ_CONTROL * | ctrl | ||
) |
This function should be called in the @pg
section to place out a KS_TRAP sequence object that creates a static trapezoid in the pulse sequence. The same KS_TRAP object can be freely placed on XGRAD, YGRAD and ZGRAD as many times as desired, by only changing the second argument each time (to avoid waveform overlaps). The second argument is a KS_SEQLOC struct with three fields:
.board
: Choose between XGRAD, YGRAD, ZGRAD (or OMEGA).pos
: Absolute time in [us] of the start of the attack ramp of the trapezoid.ampscale
: A factor that must be in range [-1.0,1.0] that is multiplied with .amp
to yield a per-instance (i.e. per-placement) amplitude ([G/cm]). The simplest is to use 1.0, which makes the KS_TRAP object to be placed out on the board as initially designed using ks_eval_trap(). For the OMEGA board, this factor must be 1.0.Regardless of the order placed out in the @pg
section, and on which boards (XGRAD, YGRAD, ZGRAD) the KS_TRAP object is placed, the instance number of the KS_TRAP is automatically sorted in time. If two instances of one KS_TRAP occur at the same time (.pos
) on different boards, XGRAD comes before YGRAD, which comes before ZGRAD. These abstract, sorted, instance numbers are used by ks_scan_***()
functions in scan() to refer to a specific instance of a KS_TRAP object in the sequence
If the .duration
field in the KS_TRAP object is 0, ks_pg_trap() will return SUCCESS and quietly ignore placing it out. This is a part of the mechanism that setting the .duration
field to 0 in cveval()
should eliminate its existance in both timing calulations and in the pulse sequence generation in @pg
When a trapezoid is placed on OMEGA, neither the designed amplitude (the .amp
field in KS_TRAP) nor the .ampscale
(in KS_SEQLOC) has an effect on the final frequency modulation. Instead the run-time amplitude of a KS_TRAP object on the OMEGA board is controlled in scan() via a function called ks_scan_omegatrap_hz()
GENERAL NOTE: It is a requirement that the function in the @pg
section containing all ks_pg_***()
calls is also called exactly once in cveval()
after the calls to the corresponding ks_eval_***()
functions that design the KS_*** sequence objects. Each ks_pg_***()
will throw an error if this has not been done.
[in,out] | trap | Pointer to a KS_TRAP sequence object |
[in] | loc | KS_SEQLOC struct to specify when and where to place the KS_TRAP |
[in,out] | ctrl | Pointer to the KS_SEQ_CONTROL struct corresponding to the sequence module for this KS_TRAP |
STATUS | SUCCESS or FAILURE |
STATUS ks_pg_read | ( | KS_READ * | read, |
int | pos, | ||
KS_SEQ_CONTROL * | ctrl | ||
) |
This function should be called in the @pg
section to place out a KS_READ sequence object that creates an acquisition window in the pulse sequence. The same KS_READ object can be freely placed as many times as desired, by only changing the second argument each time (to avoid overlaps). The second argument is an integer with the absolute time in [us] of the start of the acquisition. System gradient delays are accounted for in ks_pg_read() by internally adjusting the position by adding the system variable psd_grd_wait
to the position value. This assures the gradients boards and acquisition window are in sync on the MR system.
Regardless of the order the acquisition windows are placed out in the @pg
section, the instance number of the KS_READ is automatically sorted in time
If the .duration
field in the KS_READ object is 0, ks_pg_read() will return SUCCESS and quietly ignore placing it out. This is a part of the mechanism that setting the .duration
field to 0 in cveval()
should eliminate its existance in both timing calulations and in the pulse sequence generation in @pg
GENERAL NOTE: It is a requirement that the function in the @pg
section containing all ks_pg_***()
calls is also called exactly once in cveval()
after the calls to the corresponding ks_eval_***()
functions that design the KS_*** sequence objects. Each ks_pg_***()
will throw an error if this has not been done.
[in,out] | read | Pointer to a KS_READ sequence object |
[in] | pos | Absolute time in [us] when to start data acquisition |
[in,out] | ctrl | Pointer to the KS_SEQ_CONTROL struct corresponding to the sequence module for this KS_READ |
STATUS | SUCCESS or FAILURE |
STATUS ks_pg_phaser | ( | KS_PHASER * | phaser, |
KS_SEQLOC | loc, | ||
KS_SEQ_CONTROL * | ctrl | ||
) |
This function should be called in the @pg
section to place out a KS_PHASER sequence object that creates a dynamic trapezoid for phase encoding. For 3D applications, two different KS_PHASER objects should have been designed by calling ks_eval_phaser() on each KS_PHASER as FOV and resolution typically differ for the two phase encoding directions. The same KS_PHASER object can be freely placed on XGRAD, YGRAD and ZGRAD as many times as desired, by only changing the second argument each time (to avoid waveform overlaps). For Cartesian applications, phase encoding gradients such as KS_PHASER are typically placed out on YGRAD (phase encoding axis), for 3D also on ZGRAD. For 3D, the KS_PHASER object may embed a slice rephaser (static trapezoid) by setting .areaoffset
to a non-zero value (see ks_eval_phaser()). The second argument is a KS_SEQLOC struct with three fields:
.board
: Choose between XGRAD, YGRAD, ZGRAD.pos
: Absolute time in [us] of the start of the attack ramp of the phase encoding trapezoid.ampscale
: For KS_PHASER objects, this must be 1.0. If not, ks_pg_phaser() will throw an error. Amplitude control should solely be done in scan using ks_scan_phaser_toline() and ks_scan_phaser_fromline().Regardless of the order placed out in the @pg
section, and on which boards (XGRAD, YGRAD, ZGRAD) the KS_PHASER object is placed, the instance number of the KS_PHASER is automatically sorted in time. If two instances of one KS_PHASER occur at the same time (.pos
) on different boards, XGRAD comes before YGRAD, which comes before ZGRAD. These abstract, sorted, instance numbers are used by ks_scan_***()
functions in scan() to refer to a specific instance of a KS_PHASER object in the sequence
If the .duration
field in the KS_PHASER object is 0, ks_pg_phaser() will return SUCCESS and quietly ignore placing it out. This is a part of the mechanism that setting the .duration
field to 0 in cveval()
should eliminate its existance in both timing calulations and in the pulse sequence generation in @pg
GENERAL NOTE: It is a requirement that the function in the @pg
section containing all ks_pg_***()
calls is also called exactly once in cveval()
after the calls to the corresponding ks_eval_***()
functions that design the KS_*** sequence objects. Each ks_pg_***()
will throw an error if this has not been done.
[in,out] | phaser | Pointer to a KS_PHASER sequence object |
[in] | loc | KS_SEQLOC struct to specify when and where to place the KS_PHASER |
[in,out] | ctrl | Pointer to the KS_SEQ_CONTROL struct corresponding to the sequence module for this KS_PHASER |
STATUS | SUCCESS or FAILURE |
STATUS ks_pg_readtrap | ( | KS_READTRAP * | readtrap, |
KS_SEQLOC | loc, | ||
KS_SEQ_CONTROL * | ctrl | ||
) |
This function should be called in the @pg
section to place out a KS_READTRAP sequence object consisting of a trapezoid (KS_TRAP) and an acquisition window (KS_READ). The same KS_READTRAP object can be freely placed on XGRAD, YGRAD and ZGRAD as many times as desired, by only changing the second argument each time (to avoid waveform overlaps). For Cartesian applications, readouts such as KS_READTRAP are typically placed on XGRAD (frequency encoding axis). The second argument is a KS_SEQLOC struct with three fields:
.board
: Choose between XGRAD, YGRAD, ZGRAD.pos
: Absolute time in [us] of the start of the attack ramp of the readout trapezoid.ampscale
: For KS_READTRAP objects, this must be either +1.0 or -1.0 so that the FOV is not altered. Negative amplitudes will automatically be taken into account in ks_scan_offsetfov() to create the necessary frequency offsetRegardless of the order placed out in the @pg
section, and on which boards (XGRAD, YGRAD, ZGRAD) the KS_READTRAP object is placed, the instance number of the KS_READTRAP is automatically sorted in time. If two instances of one KS_READTRAP occur at the same time (.pos
) on different boards, XGRAD comes before YGRAD, which comes before ZGRAD. These abstract, sorted, instance numbers are used by ks_scan_***()
functions in scan() to refer to a specific instance of a KS_READTRAP object in the sequence.
If the .duration
field in the KS_READTRAP object is 0, ks_pg_readtrap() will return SUCCESS and quietly ignore placing it out. This is a part of the mechanism that setting the .duration
field to 0 in cveval()
should eliminate its existance in both timing calulations and in the pulse sequence generation in @pg
GENERAL NOTE: It is a requirement that the function in the @pg
section containing all ks_pg_***()
calls is also called exactly once in cveval()
after the calls to the corresponding ks_eval_***()
functions that design the KS_*** sequence objects. Each ks_pg_***()
will throw an error if this has not been done.
[in,out] | readtrap | Pointer to a KS_READTRAP sequence object |
[in] | loc | KS_SEQLOC struct to specify when and where to place the KS_READTRAP |
[in,out] | ctrl | Pointer to the KS_SEQ_CONTROL struct corresponding to the sequence module for this KS_READTRAP |
STATUS | SUCCESS or FAILURE |
STATUS ks_pg_wave | ( | KS_WAVE * | wave, |
KS_SEQLOC | loc, | ||
KS_SEQ_CONTROL * | ctrl | ||
) |
This function should be called in the @pg
section to place out a KS_WAVE sequence object that creates an arbitrary waveform in the pulse sequence. The same KS_WAVE object can be placed on any board as many times as desired, by only changing the second argument each time (to avoid waveform overlaps). However, the RHO (RF) board should be avoided as this bypasses RF scaling and SAR calculations, providing no control over the flip angle. For RF waveforms, always use KS_RF (or KS_SELRF). The second argument is a KS_SEQLOC struct with three fields:
.board
: Choose between XGRAD, YGRAD, ZGRAD, OMEGA, THETA.pos
: Absolute time in [us] of the start of the waveform. For RF
, OMEGA and THETA, pos_rf_wait
will be added to this time to take system delays into account.ampscale
: For gradient boards, this factor must be in range [-1.0,1.0] that is multiplied with the waveform to yield a per-instance (i.e. per-placement) amplitude ([G/cm]). For THETA, only values of +1.0 and -1.0 is allowed, and for OMEGA only 1.0 is allowedThe KS_WAVE sequence object contains a KS_WAVEFORM (float[KS_MAXWAVELEN]) to hold the waveform. The physical unit of the waveform in the KS_WAVE object depends the board on which it is placed using ks_pg_wave(). For the
When a waveform is placed on OMEGA, neither the waveform amplitude nor the .ampscale
(in KS_SEQLOC) affects the final frequency modulation. Instead the run-time amplitude of a KS_WAVE object on the OMEGA board is controlled in scan() via a function called ks_scan_omegawave_hz(), where the largest value in the field .waveform[]
in the KS_WAVE will correspond to the value in [Hz] provided.
If the .duration
field in the KS_WAVE object is 0, ks_pg_wave() will return SUCCESS and quietly ignore placing it out. This is a part of the mechanism that setting the .duration
field to 0 in cveval()
should eliminate its existance in both timing calulations and in the pulse sequence generation in @pg
This function adds an instruction and a waveform (state 0) in the sequencer memory. If you intend to use states this function must always be called first, before you try: ks_pg_addwaveformstate. For more infor see ks_pg_addwaveformstate
Regardless of the order placed out in the @pg
section, and on which boards (XGRAD, YGRAD, ZGRAD) the KS_WAVE object is placed, the instance number of the KS_WAVE is automatically sorted in time. If two instances of one KS_WAVE occur at the same time (.pos
) on different boards, XGRAD comes before YGRAD, which comes before ZGRAD. These abstract, sorted, instance numbers are used by ks_scan_***()
functions in scan() to refer to a specific instance of a KS_WAVE object in the sequence.
GENERAL NOTE: It is a requirement that the function in the @pg
section containing all ks_pg_***()
calls is also called exactly once in cveval()
after the calls to the corresponding ks_eval_***()
functions that design the KS_*** sequence objects. Each ks_pg_***()
will throw an error if this has not been done.
[in,out] | wave | Pointer to a KS_WAVE sequence object |
[in] | loc | KS_SEQLOC struct to specify when and where to place the KS_WAVE |
[in,out] | ctrl | Pointer to the KS_SEQ_CONTROL struct corresponding to the sequence module for this KS_WAVE |
STATUS | SUCCESS or FAILURE |
STATUS ks_pg_addwaveformstate | ( | KS_WAVE * | wave, |
KS_WAVEFORM | waveform, | ||
int | state_index | ||
) |
This function reserves additional space on the sequencer waveform memory and assignes the state=state_index to the waveform. During the scan it is then possible to make any instance of theat KS_WAVE object point to an alternative state using the fuction ks_scan_setwavestate, effectively changing the waveform shape in real time. This approach is much more effecient and safer than ks_scan_wave2hardware because we can ensure the waveform states used pass gradient and SAR limits. A drawback is that sequencer memory is not unlimited, so we have limited the number of states to #define KS_WAVE_MAXNSTATES 16 (in future we will increase this). If you require more waveform shapes than that, then you would have to use the more complicated ks_scan_wave2hardware.
ks_pg_wave needs to be called on the KS_WAVE object before you can use this function. It is also important to note that ks_pg_wave reserves state0, so don't overwrite 0 if you intend to use it. This function can be used on any KS_WAVE object. eg. if you would like to add multiple RF envelopes to a KS_SELRF compound object you can add additional states to the KS_WAVE members (like &myselrf->rf.wave) once you have called the pg_selrf function.
[in,out] | wave | Pointer to a KS_WAVE sequence object |
[in] | waveform | A KS_WAVEFORM representing a new state/shape |
[in] | state_index |
STATUS ks_pg_rf | ( | KS_RF * | rf, |
KS_SEQLOC | loc, | ||
KS_SEQ_CONTROL * | ctrl | ||
) |
This function should be called in the @pg
section to place out a KS_RF sequence object that creates an RF pulse in the pulse sequence. The same KS_RF object can be placed out as many times as desired, by only changing the second argument each time (to avoid waveform overlaps). The second argument is a KS_SEQLOC struct with three fields:
.board
: Ignored. .rfwave
will always be placed on RHO. If the resolution of .omegawave
is non-zero it will be placed on OMEGA, and correspondingly for .thetawave
on THETA.pos
: Absolute time in [us] of the start of the waveform.ampscale
: A factor that must be in range [-1.0,1.0] that is multiplied with .amp
to yield a per-instance (i.e. per-placement) amplitude. For KS_RF objects this will cause the flip angle to be reduced on a per-instance basis. This can be used to generate a variable flip-angle train of RF pulses using a single KS_RF object. An .ampscale
of -1.0 is equivalent to adding a 180 degree RF phase shift to the RF pulseIf the rfwave.duration
field in the KS_RF object is 0, ks_pg_rf() will return SUCCESS and quietly ignore placing it out. This is a part of the mechanism that setting the .duration
field to 0 in cveval()
should eliminate its existance in both timing calulations and in the pulse sequence generation in @pg
As ks_pg_rf() internally calls ks_pg_wave() for its KS_WAVEs, see ks_scan_setwavestate, ks_scan_wave2hardware if you want to modiy waveforms during the scan.
Regardless of the order placed out in the @pg
section the KS_RF object is placed, the instance number of the KS_RF is automatically sorted in time. These abstract, sorted, instance numbers are used by ks_scan_***()
functions in scan() to refer to a specific instance of a KS_RF object in the sequence.
GENERAL NOTE: It is a requirement that the function in the @pg
section containing all ks_pg_***()
calls is also called exactly once in cveval()
after the calls to the corresponding ks_eval_***()
functions that design the KS_*** sequence objects. Each ks_pg_***()
will throw an error if this has not been done.
When ks_pg_rf() is run in cveval()
(on HOST), the field .rfpulse.activity
that was first set to 0 by ks_eval_rf() is now set to PSD_APS2_ON + PSD_MPS2_ON + PSD_SCAN_ON
by ks_pg_rf(). This triggers the RF functions used in ks_eval_hwlimits() to include this KS_RF object in RF scaling and SAR calculations. Each time ks_pg_rf() is called, the field .rfpulse.num
is incremented after being first set to 0 by ks_eval_rf(). Hence, it is crucial that the sequence generating function (c.f. KS_SEQ_CONTROL) containing all ks_pg_***()
calls is executed between the ks_eval_rf() setup call and the call to ks_eval_hwlimits()
[in,out] | rf | Pointer to a KS_RF sequence object |
[in] | loc | KS_SEQLOC struct to specify when to place the KS_RF |
[in,out] | ctrl | Pointer to the KS_SEQ_CONTROL struct corresponding to the sequence module for this KS_RF |
STATUS | SUCCESS or FAILURE |
STATUS ks_pg_selrf | ( | KS_SELRF * | selrf, |
KS_SEQLOC | loc, | ||
KS_SEQ_CONTROL * | ctrl | ||
) |
This function should be called in the @pg
section to place out a KS_SELRF sequence object that creates an RF pulse with associated trapezoids in the pulse sequence. The same KS_SELRF object can be placed out as many times as desired, by only changing the second argument each time (to avoid waveform overlaps). The second argument is a KS_SEQLOC struct with three fields:
.board
: Choose between XGRAD, YGRAD, ZGRAD for the board on which .pregrad
, .grad
(or .gradwave
) and .postgrad
should be placed.pos
: Absolute time in [us] of the start of the .pregrad
attack ramp. If .pregrad
has zero duration, .pos
will in effect refer to the start of the .grad
attack ramp.ampscale
: A factor that must be in range [-1.0,1.0] that is multiplied with rf.rfwave.amp
to yield a per-instance (i.e. per-placement) amplitude. For KS_SELRF objects the .ampscale
value will be passed on its internal call to ks_pg_rf(), but not to its internal ks_pg_trap() calls. Hence .ampscale
will have the same effect for ks_pg_selrf() as for ks_pg_rf(), with no per-instance control of the amplitude of the gradients involved. A reduced .ampscale
will cause the flip angle to be reduced on a per-instance basis. This can be used to generate a variable flip-angle train of selective RF pulses using a single KS_SELRF object. An .ampscale
of -1.0 is equivalent to adding a 180 degree RF phase shift to the RF pulseIf the .gradwave
field has a non-zero resolution, ks_pg_selrf() will place out the .gradwave
(KS_WAVE) instead of the .grad
(KS_TRAP) during the time the RF pulse is played out. An error is thrown if .gradwave.duration
(if .gradwave.res
> 0) is not equal to the .rf.rfwave.duration
. If .pregrad
or .postgrad
has zero duration, they will not be placed out. The existance of non-zero .pregrad
and .postgrad
is determined by ks_eval_selrf() based on .rf.role
As ks_pg_selrf() internally calls ks_pg_wave() for its KS_WAVEs, see ks_scan_setwavestate, ks_scan_wave2hardware if you want to modiy waveforms during the scan.
Regardless of the order placed out in the @pg
section the KS_SELRF object is placed, the instance number of the KS_SELRF is automatically sorted in time. These abstract, sorted, instance numbers are used by ks_scan_***()
functions in scan() to refer to a specific instance of a KS_SELRF object in the sequence.
GENERAL NOTE: It is a requirement that the function in the @pg
section containing all ks_pg_***()
calls is also called exactly once in cveval()
after the calls to the corresponding ks_eval_***()
functions that design the KS_*** sequence objects. Each ks_pg_***()
will throw an error if this has not been done.
[in,out] | selrf | Pointer to a KS_SELRF sequence object |
[in] | loc | KS_SEQLOC struct to specify when and where to place the KS_SELRF |
[in,out] | ctrl | Pointer to the KS_SEQ_CONTROL struct corresponding to the sequence module for this KS_SELRF |
STATUS | SUCCESS or FAILURE |
STATUS ks_pg_wait | ( | KS_WAIT * | wait, |
KS_SEQLOC | loc, | ||
KS_SEQ_CONTROL * | ctrl | ||
) |
This function should be called in the @pg
section to place out a KS_WAIT sequence object that creates a wait pulse. The same KS_WAIT object can be placed out as many times as desired, by only changing the second argument each time (to avoid waveform overlaps). The second argument is a KS_SEQLOC struct with three fields:
.board
: Ignored.pos
: Absolute time in [us] of the start of the wait pulse.ampscale
: IgnoredThis function will insert a deadtime of duration equal to the .duration
field in the KS_WAIT object at position .pos
. This delay can be changed in run-time by calling ks_scan_wait().
GENERAL NOTE: It is a requirement that the function in the @pg
section containing all ks_pg_***()
calls is also called exactly once in cveval()
after the calls to the corresponding ks_eval_***()
functions that design the KS_*** sequence objects. Each ks_pg_***()
will throw an error if this has not been done.
[in,out] | wait | Pointer to a KS_WAIT sequence object |
[in] | loc | KS_SEQLOC struct to specify when and where to place the KS_WAIT |
[in,out] | ctrl | Pointer to the KS_SEQ_CONTROL struct corresponding to the sequence module for this KS_WAIT |
STATUS | SUCCESS or FAILURE |
STATUS ks_pg_isirot | ( | KS_ISIROT * | isirot, |
SCAN_INFO | scan_info, | ||
int | pos, | ||
void(*)() | rotfun, | ||
KS_SEQ_CONTROL * | ctrl | ||
) |
This function connects the execution of a psd-specific rotation function in realtime when time passes this point in the sequence. This is done by two KS_WAIT pulses (being part of KS_ISIROT) on the SSP board.
Example of use in a myseqmodule_pg()
function of the sequence module (in pulsegen()):
where the psd-specific rotation function is declared as:
Note that the only difference between the psd-specific myisirotatefun()
and the general ks_scan_isirotate() is that myisirotatefun()
has no input arguments. Input arguments cannot be used as it is called from an interrupt routine, not from some other parent function.
Care must be taken when mixing the use of ks_scan_rotate() (executing during the SSI time) and these ISI interrupts, so that they are executed in the correct order. One way is to consistently avoid the use of ks_scan_rotate() and instead return to the prescribed slice rotation by calling ks_pg_isirot() again, last in the same myseqmodule_pg()
function, this time using the prescribed scan_info struct:
[in,out] | isirot | Pointer to a KS_ISIROT sequence object |
[in] | scan_info | SCAN_INFO struct holding an .oprot matrix to be used for real-time rotation |
[in] | pos | Absolute position in [us] in the pulse sequence when this rotation should occur |
[in] | rotfun | Function pointer to the psd-specific rotation function |
[in,out] | ctrl | Pointer to the KS_SEQ_CONTROL struct corresponding to the sequence module |
STATUS | SUCCESS or FAILURE |
STATUS ks_pg_epi_dephasers | ( | KS_EPI * | epi, |
KS_SEQLOC | loc, | ||
KS_SEQ_CONTROL * | ctrl | ||
) |
This function is called internally by ks_pg_epi() to place out the dephasing gradients of a KS_EPI object. See ks_pg_epi() for more details
For advanced usage of KS_EPI, it is possible to call ks_pg_epi_dephaser(), ks_pg_epi_echo() and ks_pg_epi_rephasers() separately instead of the single call to ks_pg_epi(). This allows the dephasing and rephasing gradients to be detached from the core EPI readout part
[in,out] | epi | Pointer to a KS_EPI sequence object |
[in] | loc | KS_SEQLOC struct to specify when and where to place the dephasers of the KS_EPI object |
[in] | ctrl | Pointer to the KS_SEQ_CONTROL struct corresponding to the sequence module for this KS_EPI |
STATUS | SUCCESS or FAILURE |
STATUS ks_pg_epi_rephasers | ( | KS_EPI * | epi, |
KS_SEQLOC | loc, | ||
KS_SEQ_CONTROL * | ctrl | ||
) |
This function is called internally by ks_pg_epi() to place out the rephasing gradients of a KS_EPI object. See ks_pg_epi() for more details
For advanced usage of KS_EPI, it is possible to call ks_pg_epi_dephaser(), ks_pg_epi_echo() and ks_pg_epi_rephasers() separately instead of the single call to ks_pg_epi(). This allows the dephasing and rephasing gradients to be detached from the core EPI readout part
[in,out] | epi | Pointer to a KS_EPI sequence object |
[in] | loc | KS_SEQLOC struct to specify when to place the rephasers of the KS_EPI object |
[in] | ctrl | Pointer to the KS_SEQ_CONTROL struct corresponding to the sequence module for this KS_EPI |
STATUS | SUCCESS or FAILURE |
STATUS ks_pg_epi_echo | ( | KS_EPI * | epi, |
KS_SEQLOC | loc, | ||
KS_SEQ_CONTROL * | ctrl | ||
) |
This function is called internally by ks_pg_epi() to place out the core part of a KS_EPI object. The core part is the EPI train without leading dephaser gradients or trailing rephaser gradients. See ks_pg_epi() for more details
For advanced usage of KS_EPI, it is possible to call ks_pg_epi_dephaser(), ks_pg_epi_echo() and ks_pg_epi_rephasers() separately instead of the single call to ks_pg_epi(). This allows the dephasing and rephasing gradients to be detached from the core EPI readout part
[in,out] | epi | Pointer to a KS_EPI sequence object |
[in] | loc | KS_SEQLOC struct to specify when to place the core part of the KS_EPI object |
[in] | ctrl | Pointer to the KS_SEQ_CONTROL struct corresponding to the sequence module for this KS_EPI |
STATUS | SUCCESS or FAILURE |
STATUS ks_pg_epi | ( | KS_EPI * | epi, |
KS_SEQLOC | loc, | ||
KS_SEQ_CONTROL * | ctrl | ||
) |
This function should be called in the @pg
section to place out a KS_EPI sequence object that creates an EPI readout including dephaser and rephaser gradients. The moments of all trapezoids in the KS_EPI object sum to zero on the two axes the KS_EPI object is placed on. The KS_EPI object is to be placed on two out of three gradients, why special values for the field loc.board
must be used. The value should state which logical board (X,Y or Z) that should be used for the readout lobes (FREQ) and which logical board (X, Y or Z) that should be used for the blips (PHASE). One example is KS_FREQX_PHASEY, which will put the EPI readout lobes on XGRAD and the phase encoding blips on YGRAD
The same KS_EPI object can be placed out 16 times per sequence. This limitation is due to the hard limitation on the number of echoes (i.e. different k-spaces per image plane and image volume) that can be acquired per scan. Each time an instance of the KS_EPI object is placed out using ks_pg_epi(), the second argument (the KS_SEQLOC struct) should be modified:
.board
: Choose between KS_FREQX_PHASEY
, KS_FREQY_PHASEX
, KS_FREQX_PHASEZ
, KS_FREQZ_PHASEX
, KS_FREQY_PHASEZ
, KS_FREQZ_PHASEY
.pos
: Absolute time in [us] of the start of the first dephaser gradient.ampscale
: For KS_EPI objects, valid values are only +1.0 and -1.0, and this will control the polarity of the first readout gradient. This is rarely needed, and 1.0 should be the standard choice as this does only affect gradient delays and Nyquist ghosting, not the geometric distortion direction.The sign of the EPI blips will control the direction of the geometric distortions, and this is not done via .ampscale
but in run-time using ks_scan_epi_shotcontrol()
For advanced usage of KS_EPI, it is possible to call ks_pg_epi_dephaser(), ks_pg_epi_echo() and ks_pg_epi_rephasers() separately instead of the single call to ks_pg_epi(). This allows the dephasing and rephasing gradients to be detached from the core EPI readout part
[in,out] | epi | Pointer to a KS_EPI sequence object |
[in] | loc | KS_SEQLOC struct to specify when to place the core part of the KS_EPI object |
[in] | ctrl | Pointer to the KS_SEQ_CONTROL struct corresponding to the sequence module for this KS_EPI |
STATUS | SUCCESS or FAILURE |
This function should be called in the @pg
section to find the SEQLOC of a PGed trap. If instance = -1 it returns the last SEQLOC of the last instance.
[in] | trap | |
[in] | instance |
KS_SEQLOC |
This function should be called in the @pg
section to find the SEQLOC of a PGed wave. If instance = -1 it returns the last SEQLOC of the last instance.
[in] | wave | |
[in] | instance |
KS_SEQLOC |
void ks_mat4_zero | ( | KS_MAT4x4 | m | ) |
void ks_mat4_identity | ( | KS_MAT4x4 | m | ) |
[in,out] | m | Matrix (KS_MAT4x4) |
void ks_mat4_print | ( | const KS_MAT4x4 | m | ) |
Matrix product: [rhs_left] * [rhs_right]
[out] | lhs | Matrix product (KS_MAT4x4) |
[in] | rhs_left | Left matrix (KS_MAT4x4) |
[in] | rhs_right | Right matrix (KS_MAT4x4) |
4x4 matrix inversion (http://download.intel.com/design/PentiumIII/sml/24504301.pdf
[out] | lhs | Inverted matrix (KS_MAT4x4) |
[in] | rhs | Matrix to be inverted (KS_MAT4x4) |
void ks_mat4_double_to_float | ( | KS_MAT4x4f | out, |
const KS_MAT4x4 | in | ||
) |
void ks_mat4_float_to_double | ( | KS_MAT4x4 | out, |
const KS_MAT4x4f | in | ||
) |
void ks_mat4_setgeometry | ( | KS_MAT4x4 | lhs, |
float | x, | ||
float | y, | ||
float | z, | ||
float | xr, | ||
float | yr, | ||
float | zr | ||
) |
[out] | lhs | set matrix (KS_MAT4x4) |
[in] | x | displacement (mm) |
[in] | y | displacement (mm) |
[in] | z | displacement (mm) |
[in] | xr | rotation (deg) |
[in] | yr | rotation (deg) |
[in] | zr | rotation (deg) |
void ks_mat4f_setgeometry | ( | KS_MAT4x4f | lhs, |
float | x, | ||
float | y, | ||
float | z, | ||
float | xr, | ||
float | yr, | ||
float | zr | ||
) |
void ks_mat4_setrotation1axis | ( | KS_MAT4x4 | rhs, |
float | rot, | ||
char | axis | ||
) |
[out] | rhs | Rotation matrix (KS_MAT4x4) |
[in] | rot | Amount of rotation around axis [degrees] |
[in] | axis | One of (include the quotes): 'x', 'y', 'z' |
[out] | R | 3x3 rotation matrix (KS_MAT3x3), row major |
[in] | M | Transformation matrix (KS_MAT4x4), row major |
void ks_mat4_extracttranslation | ( | double * | T, |
const KS_MAT4x4 | M | ||
) |
void ks_mat3_identity | ( | KS_MAT3x3 | m | ) |
Matrix product: [rhs_left] * [rhs_right]
[out] | lhs | Matrix product (KS_MAT3x3) |
[in] | rhs_left | Left matrix (KS_MAT3x3) |
[in] | rhs_right | Right matrix (KS_MAT3x3) |
void ks_mat3_print | ( | const KS_MAT3x3 | m | ) |
void ks_mat3_apply | ( | double * | w, |
const KS_MAT3x3 | R, | ||
const double * | v | ||
) |
Apply an active (alibi) rotation – i.e w = R * v
[out] | w | Output vector (float array with 3 elements) |
[in] | R | Rotation matrix (KS_MAT3x3) |
[in] | v | Input vector (float array with 3 elements) |
void ks_mat3f_apply | ( | float * | w, |
const KS_MAT3x3f | R, | ||
const float * | v | ||
) |
[in] | w | column vector (3) |
[in] | R | rotation matrix |
v | result of R.dot(v) |
void ks_mat3_invapply | ( | double * | w, |
const KS_MAT3x3 | R, | ||
const double * | v | ||
) |
Apply a passive (alias) rotation – i.e w = R' * v = R^-1 * v
[out] | w | Output vector (float array with 3 elements) |
[in] | R | Rotation matrix (KS_MAT3x3) |
[in] | v | Input vector (float array with 3 elements) |
void ks_mat3f_invapply | ( | float * | w, |
const KS_MAT3x3f | R, | ||
const float * | v | ||
) |
[in] | w | column vector (3) |
[in] | R | rotation matrix |
v | result of R.dot(v) |
void ks_scan_update_slice_location | ( | SCAN_INFO * | new_loc, |
const SCAN_INFO | orig_loc, | ||
const KS_MAT4x4 | M_physical, | ||
const KS_MAT4x4 | M_logical | ||
) |
Updates the slice location – e.g for motion correction (physical space) or propeller rotations (logical space)
M_physical and M_logical are row-major 4x4 matricies that describe rotations (R_physical, R_logical) and translations (T_physical, T_logical) of the FOV in the physical and logical coordinate systems, respectively. If R_slice and T_slice describe the position of the prescribed FOV contained in orig_loc then new_loc will describe the overall rotation R_new and translation T_new of the FOV such that:
R_new = R_physical * R_slice * R_logical
T_new = R_logical^-1 * (R_slice^-1 * R_physical^-1 * T_physical + T_slice + T_logical)
NOTE: All transformations are expected to be active (alibi) that denote a change of position/orientation, not passive (alias) that denote a change of coordinates system. See https://en.wikipedia.org/wiki/Active_and_passive_transformation
SCAN_INFO is defined in $ESE_TOP/psd/include/epic_geometry_types.h and the global scan_info
variable is an array of SCAN_INFO structs holding information of the graphically prescribed slices
[out] | new_loc | Pointer to a SCAN_INFO struct holding the new slice information |
[in] | orig_loc | SCAN_INFO struct holding the original slice information |
[in] | M_physical | Transformation matrix (4x4) in the physical space |
[in] | M_logical | Transformation matrix (4x4) in the logical (i.e. XGRAD, YGRAD, ZGRAD) space |
void ks_scan_update_slice_location_float | ( | SCAN_INFO * | new_loc, |
const SCAN_INFO | orig_loc, | ||
const KS_MAT4x4f | M_physical, | ||
const KS_MAT4x4f | M_logical | ||
) |
void ks_scan_rotate | ( | SCAN_INFO | slice_pos | ) |
The field .oprot
(9-element array) in the SCAN_INFO struct holds the rotation matrix that should be played out
This function performs the necessary scaling of the rotation matrix using loggrd
and phygrd
and then calls setrotatearray()
, which performs the actual rotation on hardware during the next SSI time.
See ks_scan_update_slice_location() for detail on how to create new SCAN_INFO structs in run-time
[in] | slice_pos | SCAN_INFO struct holding new slice information |
void ks_scan_isirotate | ( | KS_ISIROT * | isirot | ) |
This function needs a psd-specific wrapper function to execute (see ks_pg_isirot()) since the ISI interupt routine is calling a void function without input arguments. This psd-specific wrapper function should only contain the call to ks_scan_isirotate() with the psd-specific KS_ISIROT set up in pulsegen().
For N number of calls to ks_pg_isirot() in the sequence module's pg-function, the field isirot.numinstances
will be set to N, and this many ISI interrupt with a corresponding isirot.isinumber
exist in the sequence module. Valid ISI numbers are 4-7, and one available number should be linked to one specific wrapper function using ks_eval_isirot() and ks_pg_isirot().
In real-time, ks_scan_isirotate() will increment the isirot.counter
field by 1 and restart at 0 after isirot->numinstances
. isirot.counter
is set to 0 in ks_pg_isirot(). Based on the value of the .counter
field, it will assign a pre-stored SCAN_INFO struct corresponding to this counter value. Again, this connection is done by ks_pg_isirot().
ks_scan_isirotate() takes the current SCAN_INFO and converts it to long int, and then calls setrotateimm(..., WARP_UPDATE_ON_SSP_INT);
[in] | isirot | Pointer to the KS_ISIROT struct set up by ks_pg_isirot() |
STATUS ks_pg_fse_flip_angle_taperoff | ( | double * | flip_angles, |
int | etl, | ||
double | flip1, | ||
double | flip2, | ||
double | flip3, | ||
double | target_flip, | ||
int | start_middle | ||
) |
void ks_pg_mod_fse_rfpulse_structs | ( | KS_SELRF * | rf1, |
KS_SELRF * | rf2, | ||
KS_SELRF * | rf3, | ||
const double * | flip_angles, | ||
const int | etl | ||
) |
void ks_instancereset_trap | ( | KS_TRAP * | trap | ) |
This function is for advanced use where a single sequence generating function is used in parallel in multiple sequences (i.e. in different SEQLENGTH()). This should be called after calling ks_copy_and_reset_obj()
The function sets .base.ngenerated
to 0 (counter for number of times placed out on TGT), and sets .wfpulse
and .wfi
to NULL to trigger the allocation of new hardware memory, before running the sequence generating function again.
[in,out] | trap | Pointer to a KS_TRAP sequence object |
void ks_instancereset_wait | ( | KS_WAIT * | wait | ) |
This function is for advanced use where a single sequence generating function is used in parallel in multiple sequences (i.e. in different SEQLENGTH()). This should be called after calling ks_copy_and_reset_obj()
The function sets .base.ngenerated
to 0 (counter for number of times placed out on TGT), and sets .wfpulse
and .wfi
to NULL to trigger the allocation of new hardware memory, before running the sequence generating function again.
[in,out] | wait | Pointer to a KS_WAIT sequence object |
void ks_instancereset_phaser | ( | KS_PHASER * | phaser | ) |
This function is for advanced use where a single sequence generating function is used in parallel in multiple sequences (i.e. in different SEQLENGTH()). This should be called after calling ks_copy_and_reset_obj()
The function sets .base.ngenerated
to 0 (counter for number of times placed out on TGT), and sets .wfpulse
and .wfi
to NULL to trigger the allocation of new hardware memory, before running the sequence generating function again.
[in,out] | phaser | Pointer to a KS_PHASER sequence object |
void ks_instancereset_readtrap | ( | KS_READTRAP * | readtrap | ) |
This function is for advanced use where a single sequence generating function is used in parallel in multiple sequences (i.e. in different SEQLENGTH()). This should be called after calling ks_copy_and_reset_obj()
The function sets .base.ngenerated
to 0 (counter for number of times placed out on TGT), and sets .wfpulse
and .wfi
to NULL to trigger the allocation of new hardware memory, before running the sequence generating function again.
[in,out] | readtrap | Pointer to a KS_READTRAP sequence object |
void ks_instancereset_rf | ( | KS_RF * | rf | ) |
This function is for advanced use where a single sequence generating function is used in parallel in multiple sequences (i.e. in different SEQLENGTH()). This should be called after calling ks_copy_and_reset_obj()
The function sets .base.ngenerated
to 0 (counter for number of times placed out on TGT), and sets .wfpulse
and .wfi
to NULL to trigger the allocation of new hardware memory, before running the sequence generating function again.
[in,out] | rf | Pointer to a KS_RF sequence object |
void ks_instancereset_selrf | ( | KS_SELRF * | selrf | ) |
This function is for advanced use where a single sequence generating function is used in parallel in multiple sequences (i.e. in different SEQLENGTH()). This should be called after calling ks_copy_and_reset_obj()
The function sets .base.ngenerated
to 0 (counter for number of times placed out on TGT), and sets .wfpulse
and .wfi
to NULL to trigger the allocation of new hardware memory, before running the sequence generating function again.
[in,out] | selrf | Pointer to a KS_SELRF sequence object |
void ks_instancereset_epi | ( | KS_EPI * | epi | ) |
This function is for advanced use where a single sequence generating function is used in parallel in multiple sequences (i.e. in different SEQLENGTH()). This should be called after calling ks_copy_and_reset_obj()
The function sets .base.ngenerated
to 0 (counter for number of times placed out on TGT), and sets .wfpulse
and .wfi
to NULL to trigger the allocation of new hardware memory, before running the sequence generating function again.
[in,out] | epi | Pointer to a KS_EPI sequence object |
int ks_compare_wfi_by_timeboard | ( | const KS_WFINSTANCE * | a, |
const KS_WFINSTANCE * | b | ||
) |
This function is used by the qsort() routine in ks_compare_wfi_by_timeboard()
If two WF_INSTANCEs occur at the same time, XGRAD will come before YGRAD and YGRAD before ZGRAD
[in] | a | Pointer to the first KS_WFINSTANCE |
[in] | b | Pointer to the second KS_WFINSTANCE |
value | Larger or less than 0 depending on sorting order |
int ks_compare_wfi_by_boardtime | ( | const KS_WFINSTANCE * | a, |
const KS_WFINSTANCE * | b | ||
) |
This function is used by the qsort() routine in ks_compare_wfi_by_boardtime()
WF_INSTANCEs are sorted first by board. If two WF_INSTANCEs occur on the same board, t they will be sorted in time
[in] | a | Pointer to the first KS_WFINSTANCE |
[in] | b | Pointer to the second KS_WFINSTANCE |
value | Larger or less than 0 depending on sorting order |
int ks_compare_wfp_by_time | ( | const WF_PULSE * | a, |
const WF_PULSE * | b | ||
) |
This function is used by the qsort() routine in ks_sort_wfp_by_time(), which is called from ks_pg_read() for data acquisition sorting purposes. It is assumed both WF_PULSEs have only one instance
[in] | a | Pointer to the first WF_PULSE |
[in] | b | Pointer to the second WF_PULSE |
value | Larger or less than 0 depending on sorting order |
int ks_compare_pint | ( | const void * | v1, |
const void * | v2 | ||
) |
[in] | v1 | Pointer to the first int pointer |
[in] | v2 | Pointer to the second int pointer |
value | Larger or less than 0 depending on sorting order |
int ks_compare_pshort | ( | const void * | v1, |
const void * | v2 | ||
) |
[in] | v1 | Pointer to the first short pointer |
[in] | v2 | Pointer to the second shot pointer |
value | Larger or less than 0 depending on sorting order |
int ks_compare_pfloat | ( | const void * | v1, |
const void * | v2 | ||
) |
[in] | v1 | Pointer to the first float pointer |
[in] | v2 | Pointer to the second float pointer |
value | Larger or less than 0 depending on sorting order |
int ks_compare_int | ( | const void * | v1, |
const void * | v2 | ||
) |
[in] | v1 | Pointer to the first int |
[in] | v2 | Pointer to the second int |
value | Larger or less than 0 depending on sorting order |
int ks_compare_short | ( | const void * | v1, |
const void * | v2 | ||
) |
[in] | v1 | Pointer to the first short |
[in] | v2 | Pointer to the second short |
value | Larger or less than 0 depending on sorting order |
int ks_compare_float | ( | const void * | v1, |
const void * | v2 | ||
) |
[in] | v1 | Pointer to the first float |
[in] | v2 | Pointer to the second float |
value | Larger or less than 0 depending on sorting order |
void ks_sort_getsortedindx | ( | int * | sortedindx, |
int * | array, | ||
int | n | ||
) |
[out] | sortedindx | Array of indices into the array to make it sorted |
[in,out] | array | Array to be sorted |
[in] | n | Number of elements in array |
void ks_sort_getsortedindx_s | ( | int * | sortedindx, |
short * | array, | ||
int | n | ||
) |
[out] | sortedindx | Array of indices into the array to make it sorted |
[in,out] | array | Array to be sorted |
[in] | n | Number of elements in array |
void ks_sort_getsortedindx_f | ( | int * | sortedindx, |
float * | array, | ||
int | n | ||
) |
[out] | sortedindx | Array of indices into the array to make it sorted |
[in,out] | array | Array to be sorted |
[in] | n | Number of elements in array |
void ks_sort_wfi_by_timeboard | ( | KS_WFINSTANCE * | a, |
int | nitems | ||
) |
This is the sorting method used in all ks_pg_***() functions on tgt
[in,out] | a | Array of KS_WFINSTANCE elements |
[in] | nitems | Number of elements in array |
void ks_sort_loc_by_timeboard | ( | KS_SEQLOC * | a, |
int | nitems | ||
) |
This is the sorting method used in all ks_pg_***() on host
[in,out] | a | Array of KS_SEQLOC elements |
[in] | nitems | Number of elements in array |
void ks_sort_wfi_by_boardtime | ( | KS_WFINSTANCE * | a, |
int | nitems | ||
) |
This function is an alternative to ks_sort_wfi_by_timeboard(), which is not used at the moment
[in,out] | a | Array of KS_WFINSTANCE elements |
[in] | nitems | Number of elements in array |
void ks_sort_wfp_by_time | ( | WF_PULSE * | a, |
int | nitems | ||
) |
This is the sorting method used in ks_pg_read()
It is assumed that all a[idx] for idx in [0,nitems) have only one instance each
[in,out] | a | Array of WF_PULSE elements |
[in] | nitems | Number of elements in array |
int ks_file_exist | ( | char * | filename | ) |
void ks_plot_host_slicetime_delete | ( | ) |
ADDDESCHERE
void ks_plot_slicetime_begin | ( | ) |
ADDDESCHERE
void ks_plot_slicetime | ( | const KS_SEQ_CONTROL * | ctrl, |
int | nslices, | ||
float * | slicepos_mm, | ||
float | slthick_mm, | ||
KS_PLOT_EXCITATION_MODE | exctype | ||
) |
ADDDESCHERE
ctrl | ADDTEXTHERE | |
[in] | nslices | ADDTEXTHERE |
slicepos_mm | ADDTEXTHERE | |
[in] | slthick_mm | ADDTEXTHERE |
[in] | exctype | ADDTEXTHERE |
void ks_plot_slicetime_endofslicegroup | ( | const char * | desc | ) |
ADDDESCHERE
desc | ADDTEXTHERE |
void ks_plot_slicetime_endofslicegroup_tagged | ( | const char * | desc, |
const KS_PLOT_SLICEGROUP_MODE | tag | ||
) |
ADDDESCHERE
desc | ADDTEXTHERE | |
[in] | tag | ADDTEXTHERE |
void ks_plot_slicetime_endofpass | ( | KS_PLOT_PASS_MODE | pass_mode | ) |
ADDDESCHERE
[in] | pass_mode | ADDTEXTHERE |
void ks_plot_slicetime_end | ( | ) |
ADDDESCHERE
void ks_plot_write_peplans | ( | const KS_PHASEENCODING_PLAN *const * | plans, |
const int | num_plans, | ||
FILE * | fp | ||
) |
ADDDESCHERE
plans | ADDTEXTHERE | |
[in] | num_plans | ADDTEXTHERE |
fp | ADDTEXTHERE |
void ks_plot_host_slicetime_begin | ( | ) |
ADDDESCHERE
void ks_plot_host_slicetime | ( | const KS_SEQ_CONTROL * | ctrl, |
int | nslices, | ||
float * | slicepos_mm, | ||
float | slthick_mm, | ||
KS_PLOT_EXCITATION_MODE | exctype | ||
) |
ADDDESCHERE
ctrl | ADDTEXTHERE | |
[in] | nslices | ADDTEXTHERE |
slicepos_mm | ADDTEXTHERE | |
[in] | slthick_mm | ADDTEXTHERE |
[in] | exctype | ADDTEXTHERE |
void ks_plot_host_slicetime_endofslicegroup | ( | const char * | desc, |
const KS_PLOT_SLICEGROUP_MODE | tag | ||
) |
ADDDESCHERE
desc | ADDTEXTHERE | |
[in] | tag | ADDTEXTHERE |
void ks_plot_host_slicetime_endofpass | ( | KS_PLOT_PASS_MODE | pass_mode | ) |
ADDDESCHERE
[in] | pass_mode | ADDTEXTHERE |
void ks_plot_host_slicetime_end | ( | ) |
ADDDESCHERE
void ks_plot_host | ( | const KS_SEQ_COLLECTION * | seqcollection, |
const KS_PHASEENCODING_PLAN * | plan | ||
) |
ADDDESCHERE
seqcollection | ADDTEXTHERE |
plan | ADDTEXTHERE |
void ks_plot_host_seqctrl | ( | const KS_SEQ_CONTROL * | ctrl, |
const KS_PHASEENCODING_PLAN * | plan | ||
) |
ADDDESCHERE
ctrl | ADDTEXTHERE |
plan | ADDTEXTHERE |
void ks_plot_host_seqctrl_manyplans | ( | const KS_SEQ_CONTROL * | ctrl, |
const KS_PHASEENCODING_PLAN ** | plan, | ||
const int | num_plans | ||
) |
ADDDESCHERE
ctrl | ADDTEXTHERE | |
plan | ADDTEXTHERE | |
[in] | num_plans | ADDTEXTHERE |
void ks_plot_tgt_reset | ( | KS_SEQ_CONTROL * | ctrl | ) |
ADDDESCHERE
ctrl | ADDTEXTHERE |
void ks_plot_filename | ( | char * | fname, |
char * | path, | ||
char * | outputdir, | ||
char * | outputdir_uid, | ||
const char *const | seq_desc | ||
) |
ADDDESCHERE
fname | ADDTEXTHERE |
path | ADDTEXTHERE |
outputdir | ADDTEXTHERE |
outputdir_uid | ADDTEXTHERE |
seq_desc | ADDTEXTHERE |
void ks_plot_saveconfig | ( | KS_SEQ_CONTROL * | ctrl | ) |
ADDDESCHERE
ctrl | ADDTEXTHERE |
void ks_plot_tgt_addframe | ( | KS_SEQ_CONTROL * | ctrl | ) |
Writes a plot frame to file
ctrl | Pointer to sequence control |
int ks_get_center_encode | ( | const KS_PHASEENCODING_PLAN *const | peplan, |
int | shot, | ||
int | yres, | ||
int | zres | ||
) |
TODO: Support searching more than one shot
int ks_peplan_find_center_from_linear_sweep | ( | KS_KCOORD *const | K, |
KS_VIEW * | view, | ||
const int | num_coords, | ||
const KS_MTF_DIRECTION | mtf_direction, | ||
const int | sweep_sign, | ||
const int | segment_size, | ||
const int | start_encode | ||
) |
int ks_get_center_encode_linearsweep | ( | const KS_KSPACE_ACQ * | kacq, |
const int | etl, | ||
const KS_PF_EARLYLATE | pf_earlylate_te | ||
) |
float ks_calc_caipi_scale | ( | const int | ky, |
const int | R, | ||
const int | caipi_factor | ||
) |
float ks_calc_caipi_phase | ( | const float | sms_slice_gap, |
const int | sms_multiband_factor, | ||
const SCAN_INFO * | slice_info, | ||
const float | caipi_blip_area, | ||
const int | slice_encode_dir | ||
) |
float ks_calc_caipi_offset_phase | ( | const float | sms_slice_gap, |
const int | sms_multiband_factor, | ||
const SCAN_INFO * | slice_info, | ||
const int | caipi_factor, | ||
const float | caipi_blip_area, | ||
const int | ky, | ||
const int | R, | ||
const int | slice_encode_dir | ||
) |
STATUS ks_eval_caipiblip | ( | KS_TRAP * | caipiblip, |
const int | caipi_factor, | ||
const float | sms_slice_gap, | ||
const KS_DESCRIPTION | seq_desc | ||
) |
int ks_eval_sms_rf_scan_info | ( | SCAN_INFO * | sms_slice_positions, |
const SCAN_INFO * | org_slice_positions, | ||
int | sms_multiband_factor, | ||
int | nslices | ||
) |
The slice positions used for SMS needs to be shifted, since the SMS pulses are created symetrically around the center freq.
Even sms factor case: slice pos: | | | | | | | | sms slices: o o center freq. pos: v
Odd sms factor case: slice pos: | | | | | | | | | sms slices: o o o center freq. pos: v
[in,out] | sms_slice_positions | |
[in] | org_slice_positions | |
[in] | sms_multiband_factor | |
[in] | nslices |
sms_nslices |
void ks_scan_rf_ampscale | ( | KS_RF * | rf, |
int | instanceno, | ||
float | ampscale | ||
) |
This function multiplies one instance of a KS_RF object with an amplitude scale factor (3rd arg) that must be in range [-1.0,1.0]. To change all instances of a KS_RF object, use INSTRALL
as the 2nd argument.
The actual flip angle for an instance of a KS_RF object is the multiplication of the three factors:
.ampscale
in the KS_SEQLOC struct passed to ks_pg_rf()ampscale
value passed in as 3rd argument to this function. Since both ampscale factors are forced to be in range [-1.0,1.0], it is not possible to increase the flip angle beyond the designed value (.flip
)[in,out] | rf | Pointer to KS_RF |
[in] | instanceno | Instance of KS_RF to change (INSTRALL changes all instances) |
[in] | ampscale | RF amplitude scale factor in range [-1.0,1.0] |
void ks_scan_rf_on | ( | KS_RF * | rf, |
int | instanceno | ||
) |
This function (re)sets the RF amplitude to the state given by ks_pg_rf()
[in,out] | rf | Pointer to KS_RF |
[in] | instanceno | Instance of KS_RF to change (INSTRALL changes all instances) |
void ks_scan_rf_on_chop | ( | KS_RF * | rf, |
int | instanceno | ||
) |
Everytime this function is called, the magnitude of the RF amplitude will be (re)set the RF amplitude to the state given by ks_pg_rf() and the polarity of the RF amplitude will be changed. If this function is called each TR (RF chopping) for a linear single-line k-space acquisition, a FOV/2 shift will occur in the image with any DC component shifted out to the edges of the image FOV.
[in,out] | rf | Pointer to KS_RF |
[in] | instanceno | Instance of KS_RF to change (INSTRALL changes all instances) |
void ks_scan_rf_off | ( | KS_RF * | rf, |
int | instanceno | ||
) |
This can be undone by calling ks_scan_rf_on(), ks_scan_rf_on_chop(), or ks_scan_rf_ampscale()
[in,out] | rf | Pointer to KS_RF |
[in] | instanceno | Instance of KS_RF to change (INSTRALL changes all instances) |
void ks_scan_selrf_setfreqphase | ( | KS_SELRF * | selrf, |
int | instanceno, | ||
SCAN_INFO | sliceinfo, | ||
float | rfphase | ||
) |
This function alters the frequency of the RF pulse in a KS_SELRF object to excite a spatial location corresponding to the information in sliceinfo.tloc
. The phase of the RF pulse is also updated
[in,out] | selrf | Pointer to KS_SELRF |
[in] | instanceno | Instance of KS_RF to change (INSTRALL changes all instances) |
[in] | sliceinfo | SCAN_INFO struct for the current slice to be played out |
[in] | rfphase | Phase of the RF pulse in [degrees] |
STATUS | SUCCESS or FAILURE |
void ks_scan_selrf_setfreqphase_pins | ( | KS_SELRF * | selrf, |
int | instanceno, | ||
SCAN_INFO | sliceinfo, | ||
int | sms_multiband_factor, | ||
float | sms_slice_gap, | ||
float | rfphase | ||
) |
This function alters the phase of the PINS RF pulse in a KS_SELRF object to excite spatial locations corresponding to the information in sliceinfo.tloc
.
[in,out] | selrf | Pointer to KS_SELRF |
[in] | instanceno | Instance of KS_RF to change (INSTRALL changes all instances) |
[in] | sliceinfo | SCAN_INFO struct for the current slice to be played out |
[in] | sms_multiband_factor | |
[in] | sms_slice_gap | in [mm] |
[in] | rfphase | Phase of the RF pulse in [degrees] |
STATUS | SUCCESS or FAILURE |
void ks_scan_rf_setphase | ( | KS_RF * | rf, |
int | instanceno, | ||
float | rfphase | ||
) |
This function sets the phase of an RF pulse object (KS_RF). Can be used for RF spoiling
[in,out] | rf | Pointer to KS_SEL |
[in] | instanceno | Instance of KS_RF to change (INSTRALL changes all instances) |
[in] | rfphase | Phase of the RF pulse in [degrees] |
void ks_scan_wave2hardware | ( | KS_WAVE * | wave, |
const KS_WAVEFORM | newwaveform, | ||
int | state | ||
) |
This function copies a waveform to the iwave buffer on the sequencer associated with the specified wave state. In order to use this function multiple wave states are required, these are added using ks_pg_addwavestate. During run time, it is the responsibility of the programmer to not copy a waveform into the currently active wave state. This is because the sequencer and your psd-code are asynchronous and this function writes into the sequence immediately. If the KS_WAVE is currently playing this could trip you scanner! Note: This function affects all instructions (instances) pointing to this state.
[in,out] | wave | Pointer to KS_WAVE |
[in] | newwaveform | KS_WAVEFORM to copy to hardware (if NULL , the .waveform field in KS_WAVE will be used instead) |
[in] | state | The wave state to write the waveform into; this can't be equal to the currently active wavestate |
void ks_scan_setwavestate | ( | KS_WAVE * | wave, |
int | state, | ||
int | instance | ||
) |
During the ks_pg_addwaveform state calls we keep track of the address of each new waveform that was added. This function then allows you to switch to a new waveform by simply changing the address in the intstruction. Be aware that each instance of the KS_WAVE has a unique instruction. This allows you change wave_state on an instance granularity level.
[in] | wave | Pointer to a KS_WAVE sequence object |
[in] | state | The new state to switch to (previously added by ks_pg_addwaveformstate) |
[in] | instance | Which instance you would like to change state (INSTRALL affects all) |
void ks_scan_offsetfov_iso | ( | KS_READTRAP * | readtrap, |
int | instanceno, | ||
SCAN_INFO | sliceinfo, | ||
double | ky, | ||
double | kz, | ||
double | rcvphase | ||
) |
[in,out] | readtrap | Pointer to KS_READTRAP |
[in] | instanceno | Instance of KS_RF to change (INSTRALL changes all instances) |
[in] | sliceinfo | SCAN_INFO struct for the current slice to be played out |
[in] | ky | phase offset in k-space measured in voxels/pixels |
[in] | kz | phase offset in k-space measured in voxels/pixels |
[in] | rcvphase | Receiver phase in [degrees] of the acquisition window corresponding to the KS_READTRAP and instanceno |
void ks_scan_offsetfov | ( | KS_READTRAP * | readtrap, |
int | instanceno, | ||
SCAN_INFO | sliceinfo, | ||
float | view, | ||
float | phasefovratio, | ||
float | rcvphase | ||
) |
This function can be used by 2D Cartesian pulse sequences to build up the phase ramp in k-space necessary to shift the image FOV. The desired image FOV shift is given by the SCAN_INFO struct passed in as 3rd argument. The view
field and the phasefovratio
arguments are necessary to know where in the physical k-space the acquired data is placed. Knowing this and the FOV offset in the phase encoding direction, the necessary receiver phase for the current view
can be set. After this function has been called for all view
numbers, the necessary phase ramp has been set up in k-space to perform the phase FOV shift in the image domain. The rcvphase
is added to the receive phase required for the FOV shift. In general, the rcvphase
should be the same as the phase of the RF excitation pulse.
For rampsampled acquisitions (.rampsampling
= 1 in KS_READTRAP), the ks_scan_offsetfov_iso() function called will internally call ks_scan_omegatrap_hz() for FOV shifts in the readout direction. Both ks_scan_offsetfov() and ks_scan_offsetfov3D() calls the same ks_scan_offsetfov_iso() function after performing unit conversions of the input arguments.
[in,out] | readtrap | Pointer to KS_READTRAP |
[in] | instanceno | Instance of KS_RF to change (INSTRALL changes all instances) |
[in] | sliceinfo | SCAN_INFO struct for the current slice to be played out |
[in] | view | Phase encoding line to acquire with index corresponding to a fully sampled k-space [0, res-1] |
[in] | phasefovratio | The ratio of FOVphase/FOVfreq (as opphasefov ) |
[in] | rcvphase | Receiver phase in [degrees] of the acquisition window corresponding to the KS_READTRAP and instanceno |
void ks_scan_offsetfov3D | ( | KS_READTRAP * | readtrap, |
int | instanceno, | ||
SCAN_INFO | sliceinfo, | ||
float | kyview, | ||
float | phasefovratio, | ||
float | kzview, | ||
float | zphasefovratio, | ||
float | rcvphase | ||
) |
This function can be used by 3D Cartesian pulse sequences to build up the phase ramp in k-space necessary to shift the image FOV. The desired image FOV shift is given by the SCAN_INFO struct passed in as 3rd argument. The kyview
/kzview
field and the phasefovratio
/zphasefovratio
arguments are necessary to know where in the physical k-space the acquired data is placed. Knowing this and the FOV offset in both phase encoding directions, the necessary receiver phase for the current kyview
/kzview
can be set. After this function has been called for all kyview
/kzview
numbers, the necessary phase ramp has been set up in k-space to perform the phase FOV shift in the image domain. The rcvphase
is added to the receive phase required for the FOV shift. In general, the rcvphase
should be the same as the phase of the RF excitation pulse.
For rampsampled acquisitions (.rampsampling
= 1 in KS_READTRAP), the ks_scan_offsetfov_iso() function called will internally call ks_scan_omegatrap_hz() for FOV shifts in the readout direction. Both ks_scan_offsetfov() and ks_scan_offsetfov3D() calls the same ks_scan_offsetfov_iso() function after performing unit conversions of the input arguments.
[in,out] | readtrap | Pointer to KS_READTRAP |
[in] | instanceno | Instance of KS_RF to change (INSTRALL changes all instances) |
[in] | sliceinfo | SCAN_INFO struct for the current slice to be played out |
[in] | kyview | Phase encoding line to acquire with index corresponding to a fully sampled k-space [0, res-1] (YGRAD) |
[in] | phasefovratio | The ratio of FOVphase/FOVfreq (as opphasefov ) |
[in] | kzview | Z Phase encoding line to acquire with index corresponding to a fully sampled k-space [0, res-1] (ZGRAD) |
[in] | zphasefovratio | The ratio of FOVslice/FOVfreq (as (opslquant * opslthick) / opfov ) |
[in] | rcvphase | Receiver phase in [degrees] of the acquisition window corresponding to the KS_READTRAP and instanceno |
void ks_scan_offsetfov3D_readwave | ( | KS_READWAVE * | readwave, |
int | instanceno, | ||
SCAN_INFO | sliceinfo, | ||
float | ky, | ||
float | phasefovratio, | ||
float | kz, | ||
float | zphasefovratio, | ||
float | rcvphase | ||
) |
void ks_scan_offsetfov_iso_readwave | ( | KS_READWAVE * | readwave, |
int | instanceno, | ||
SCAN_INFO | sliceinfo, | ||
double | ky, | ||
double | kz, | ||
double | rcvphase | ||
) |
void ks_scan_offsetfov_iso_readwave_oneread | ( | KS_READWAVE * | readwave, |
KS_READ * | read, | ||
int | gradinstanceno, | ||
int | readinstanceno, | ||
SCAN_INFO | sliceinfo, | ||
double | ky, | ||
double | kz, | ||
double | rcvphase | ||
) |
void ks_scan_offsetfov_readwave | ( | KS_READWAVE * | readwave, |
int | instanceno, | ||
SCAN_INFO | sliceinfo, | ||
float | ky, | ||
float | phasefovratio, | ||
float | rcvphase | ||
) |
int ks_eval_append_blip | ( | KS_WAVE * | wave, |
const float | s, | ||
const int | max_points, | ||
const float | area | ||
) |
unsigned short ks_scan_omegatrap_hz | ( | KS_TRAP * | trap, |
int | instanceno, | ||
float | Hz, | ||
int | omega_iwave_phase_at_null | ||
) |
A KS_TRAP object on OMEGA is used for rampsampled acquisitions and is placed out using ks_pg_readtrap() for a KS_READTRAP object if the field .rampsampling
= 1. This will cause a trapezoidal frequency shift during the readout instead of a fixed frequency offset when rampsampling is not used. An error is returned if the current instance of the KS_TRAP is on another board than OMEGA
For Cartesian applications, there is no need to call this function directly, since ks_scan_offsetfov() already calls this function
Special note for OMEGA: Neither the .amp
field nor the .ampscale
field passed in to ks_pg_trap() has an effect. Only the Hz
argument controls the frequency shift
[in,out] | trap | Pointer to KS_TRAP |
[in] | instanceno | Instance of KS_RF to change (INSTRALL changes all instances) |
[in] | Hz | Desired frequency offset in [Hz] at the plateau of the trapezoid |
[in] | omega_iwave_phase_at_null | the area of the integer waveform at the null point |
iphase | correction to be applied with XTR packet |
unsigned short ks_scan_omegawave_hz | ( | KS_WAVE * | wave, |
int | instanceno, | ||
float | Hz, | ||
int | omega_iwave_phase_at_null | ||
) |
A KS_WAVE object on OMEGA can be used to perform a dynamic frequency offset
[in,out] | wave | Pointer to KS_WAVE |
[in] | instanceno | Instance of KS_RF to change (INSTRALL changes all instances) |
[in] | Hz | Desired frequency offset in [Hz] for the point in the KS_WAVE with the largest absolute amplitude |
[in] | omega_iwave_phase_at_null | the area of the integer waveform at the null point |
iphase | correction to be applied with XTR packet |
void ks_scan_wait | ( | KS_WAIT * | wait, |
int | waitperiod | ||
) |
waitperiod
must not exceed.duration
.
[in,out] | wait | Pointer to KS_WAIT |
[in] | waitperiod | Time in [us] to wait |
STATUS | SUCCESS or FAILURE |
void ks_scan_trap_ampscale | ( | KS_TRAP * | trap, |
int | instanceno, | ||
float | ampscale | ||
) |
This function multiplies one instance of a KS_TRAP object with an amplitude scale factor (3rd arg) that should be in range [-1.0,1.0] to avoid slewrate issues. To change all instances of a KS_TRAP object, use INSTRALL
as the 2nd argument.
The actual amplitude for an instance of a KS_TRAP object is the multiplication of the three factors:
.ampscale
in the KS_SEQLOC struct passed to ks_pg_trap()ampscale
value passed in as 3rd argument to this function.[in,out] | trap | Pointer to KS_TRAP |
[in] | instanceno | Instance of KS_TRAP to change (INSTRALL changes all instances) |
[in] | ampscale | Gradient amplitude scale factor, normally in range [-1.0,1.0], but the range [-1.2, 1.2] is allowed to allow certain run-time gradient corrections |
STATUS | SUCCESS or FAILURE |
void ks_scan_wave_ampscale | ( | KS_WAVE * | wave, |
int | instanceno, | ||
float | ampscale | ||
) |
This function multiplies one instance of a KS_WAVE object with an amplitude scale factor (3rd arg) that should be in range [-1.0,1.0] to avoid slewrate issues. To change all instances of a KS_TRAP object, use INSTRALL
as the 2nd argument.
The actual amplitude for an instance of a KS_WAVE object is the multiplication of the three factors:
.ampscale
in the KS_SEQLOC struct passed to ks_pg_trap()ampscale
value passed in as 3rd argument to this function.[in,out] | wave | Pointer to KS_WAVE |
[in] | instanceno | Instance of KS_TRAP to change (INSTRALL changes all instances) |
[in] | ampscale | Gradient amplitude scale factor, normally in range [-1.0,1.0], but the range [-1.2, 1.2] is allowed to allow certain run-time gradient corrections |
STATUS | SUCCESS or FAILURE |
void ks_scan_trap_ampscale_slice | ( | KS_TRAP * | trap, |
int | start, | ||
int | skip, | ||
int | count, | ||
float | ampscale | ||
) |
This function multiplies some instances of a KS_TRAP object with an amplitude scale factor (5th arg) that should be in range [-1.0,1.0] to avoid slewrate issues.
The instances to change are start + i * skip
, where i
goes from 0 to count
. FAILURE is returned if either start or start
+ count
* skip
out of range or count
is negative
[in,out] | trap | Pointer to KS_TRAP |
[in] | start | First instance number of the KS_TRAP |
[in] | skip | Difference in instance number between consecutive instances |
[in] | count | Number of instances to change in total |
[in] | ampscale | Gradient amplitude scale factor, normally in range [-1.0,1.0], but the range [-1.2, 1.2] is allowed to allow certain run-time gradient corrections |
STATUS | SUCCESS or FAILURE |
void ks_scan_phaser_kmove | ( | KS_PHASER * | phaser, |
int | instanceno, | ||
double | pixelunits | ||
) |
This function sets the amplitude of the gradient for a KS_PHASER object so that a shift in k-space of pixelunits
number of pixels is produced. If pixelunits
is 1.0, the gradient area corresponds to one pixel shift in a fully sampled k-space (no parallel imaging) along the board the KS_PHASER object is placed on. pixelunits
is of type float
and any non-integer value is accepted, and the sign of pixelunits
determines the direction of k-space shift
[in,out] | phaser | Pointer to KS_PHASER |
[in] | instanceno | Instance of KS_TRAP to change (INSTRALL changes all instances) |
[in] | pixelunits | Non-integer pixel units in a fully sampled k-space to move |
STATUS | SUCCESS or FAILURE |
void ks_scan_phaser_toline | ( | KS_PHASER * | phaser, |
int | instanceno, | ||
int | view | ||
) |
This function sets the amplitude of the gradient for a KS_PHASER object to produce a k-space shift from the center of k-space to the view
number (3rd arg). The view
number must be an integer in range [0, .res
-1], and the number refers to a fully sampled k-space (without parallel imaging)
[in,out] | phaser | Pointer to KS_PHASER |
[in] | instanceno | Instance of KS_TRAP to change (INSTRALL changes all instances) |
[in] | view | Phase encoding line to acquire with index corresponding to a fully sampled k-space [0, res-1] |
STATUS | SUCCESS or FAILURE |
void ks_scan_phaser_fromline | ( | KS_PHASER * | phaser, |
int | instanceno, | ||
int | view | ||
) |
This function sets the amplitude of the gradient for a KS_PHASER object to produce a k-space shift from the view
number (3rd arg) to the k-space center. The view
number must be an integer in range [0, .res
-1], and the number refers to a fully sampled k-space (without parallel imaging)
[in,out] | phaser | Pointer to KS_PHASER |
[in] | instanceno | Instance of KS_TRAP to change (INSTRALL changes all instances) |
[in] | view | Phase encoding line to acquire with index corresponding to a fully sampled k-space [0, res-1] |
STATUS | SUCCESS or FAILURE |
void ks_scan_phaser_average | ( | KS_PHASER * | phaser, |
int | instanceno | ||
) |
void ks_scan_phaser_max | ( | KS_PHASER * | phaser, |
int | instanceno | ||
) |
int ks_scan_getsliceloc | ( | const KS_SLICE_PLAN * | slice_plan, |
int | passindx, | ||
int | sltimeinpass | ||
) |
This function finds the spatially sorted slice index (.slloc
) in range [0, nslices-1] given the sequence's DATA_ACQ_ORDER struct array (in slice_plan.acq_order)
[in] | slice_plan | Pointer to the slice plan (KS_SLICE_PLAN) for the sequence |
[in] | passindx | Current pass index ([0, acqs-1]) |
[in] | sltimeinpass | Temporal index of the n slices acquired in each pass ([0, n-1]) |
slloc | Spatially sorted slice index |
int ks_scan_getslicetime | ( | const KS_SLICE_PLAN * | slice_plan, |
int | passindx, | ||
int | slloc | ||
) |
This function finds the temporally sorted slice index (.sltime
) in range [0, nslices-1] given the sequence's DATA_ACQ_ORDER struct array (in slice_plan.acq_order)
[in] | slice_plan | Pointer to the slice plan (KS_SLICE_PLAN) for the sequence |
[in] | passindx | Current pass index ([0, acqs-1]) |
[in] | slloc | Spatially sorted slice index [0, nslices-1] |
sltimeinpass | Temporal index of the n slices acquired in each pass ([0, n-1]) |
ks_enum_epiblipsign ks_scan_epi_verify_phaseenc_plan | ( | KS_EPI * | epi, |
KS_PHASEENCODING_PLAN * | phaseenc_plan, | ||
int | shot | ||
) |
void ks_scan_epi_shotcontrol_sms | ( | KS_EPI * | epi, |
int | echo, | ||
SCAN_INFO | sliceinfo, | ||
KS_PHASEENCODING_COORD | starting_coord, | ||
ks_enum_epiblipsign | blipsign, | ||
float | rcvphase, | ||
int | sms_factor, | ||
float | sms_slice_gap, | ||
int | caipi_factor, | ||
int | sms_slice_encoding_direction | ||
) |
This function has two different tasks. First, it controls the EPI blips and sets the EPI dephaser and rephaser amplitude given the current phaseshot
and blipsign
. If phaseshot
is outside the valid range ([0, .blipphaser.R
-1], all gradient amplitudes on the blip (phase encoding) axis will be zero. This can be useful to acquire a refscan for Nyquist ghost correction. Second, it sets up the proper frequency and phase modulation per readout lobe to produce the desired FOV offset in both the frequency and phase encoding directions
[in,out] | epi | Pointer to KS_EPI |
[in] | echo | EPI echo index (up to 16 EPI trains supported) |
[in] | sliceinfo | SCAN_INFO struct for the current slice to be played out |
[in] | starting_coord | coordinate in k-space from where the EPI train starts |
[in] | blipsign | KS_EPI_POSBLIPS or KS_EPI_NEGBLIPS |
[in] | rcvphase | Receiver phase in degrees, for RF spoiling. |
[in] | sms_factor | ADDTEXTHERE |
[in] | sms_slice_gap | ADDTEXTHERE |
[in] | caipi_factor | ADDTEXTHERE |
[in] | sms_slice_encoding_direction | ADDTEXTHERE |
void ks_scan_epi_shotcontrol | ( | KS_EPI * | epi, |
int | echo, | ||
SCAN_INFO | sliceinfo, | ||
KS_PHASEENCODING_COORD | starting_coord, | ||
ks_enum_epiblipsign | blipsign, | ||
float | rcvphase | ||
) |
This function has two different tasks. First, it controls the EPI blips and sets the EPI dephaser and rephaser amplitude given the current phaseshot
and blipsign
. If phaseshot
is outside the valid range ([0, .blipphaser.R
-1], all gradient amplitudes on the blip (phase encoding) axis will be zero. This can be useful to acquire a refscan for Nyquist ghost correction. Second, it sets up the proper frequency and phase modulation per readout lobe to produce the desired FOV offset in both the frequency and phase encoding directions
[in,out] | epi | Pointer to KS_EPI |
[in] | echo | EPI echo index (up to 16 EPI trains supported) |
[in] | sliceinfo | SCAN_INFO struct for the current slice to be played out |
[in] | starting_coord | coordinate in k-space from where the EPI train starts |
[in] | blipsign | KS_EPI_POSBLIPS or KS_EPI_NEGBLIPS |
[in] | rcvphase | Receiver phase in degrees, for RF spoiling. |
void ks_scan_epi_loadecho | ( | KS_EPI * | epi, |
int | echo, | ||
int | storeecho, | ||
int | slice, | ||
KS_PHASEENCODING_COORD | starting_coord, | ||
ks_enum_epiblipsign | blipsign, | ||
KS_DYNAMIC_STATE * | dynamic | ||
) |
ADDTEXTHERE
[in,out] | epi | Pointer to KS_EPI |
[in] | echo | EPI echo index to work on (up to 16 EPI trains supported) |
[in] | storeecho | EPI echo index for storing (usually the same as echo) |
[in] | slice | Slice index where to store the data (0-based) |
[in] | starting_coord | coordinate in k-space from where the EPI train starts |
[in] | blipsign | KS_EPI_POSBLIPS or KS_EPI_NEGBLIPS |
dynamic | Pointer to KS_DYNAMIC_STATE struct, which has elements being automatically updated by the scan looping functions |
void ks_loaddab_reserved | ( | WF_PULSE_ADDR | echo, |
short | state, | ||
short | resampler_index | ||
) |
[in] | echo | ADDTEXTHERE |
[in] | state | ADDTEXTHERE |
[in] | resampler_index | ADDTEXTHERE |
void ks_loaddab | ( | WF_PULSE_ADDR | echo, |
const char * | dab_array | ||
) |
[in] | echo | ADDTEXTHERE |
[in] | dab_array | ADDTEXTHERE |
void ks_loaddab_full | ( | WF_PULSE_ADDR | echo, |
const char * | custom_dab_array | ||
) |
[in] | echo | ADDTEXTHERE |
[in] | custom_dab_array | ADDTEXTHERE |
const KS_READ* ks_get_read_in_echotrain | ( | const KS_ECHOTRAIN * | echotrain, |
const int | readout_index | ||
) |
[in] | echotrain | ADDTEXTHERE |
[in] | readout_index | ADDTEXTHERE |
WF_PULSE_ADDR ks_get_wf_pulse | ( | KS_ECHOTRAIN * | echotrain, |
const int | readout_index | ||
) |
[in] | echotrain | ADDTEXTHERE |
[in] | readout_index | ADDTEXTHERE |
WF_PULSE_ADDR |
LONG ks_get_override_R1 | ( | KS_ECHOTRAIN * | echotrain, |
const int | readout_index | ||
) |
[in] | echotrain | ADDTEXTHERE |
[in] | readout_index | ADDTEXTHERE |
LONG |
void ks_scan_acq_to_rtp | ( | KS_READ * | read, |
TYPDAB_PACKETS | dabacqctrl, | ||
float | fatoffset | ||
) |
[in,out] | read | Pointer to KS_READ |
[in] | dabacqctrl | DABON or DABOFF |
[in] | fatoffset | Frequency offset in [Hz] for the current data acquisition window |
void ks_scan_switch_to_sequence | ( | KS_SEQ_CONTROL * | ctrl | ) |
int ks_scan_playsequence | ( | KS_SEQ_CONTROL * | ctrl | ) |
STATUS ks_scan_loaddabwithindices | ( | WF_PULSE_ADDR | pulse, |
LONG | slice, | ||
LONG | echo, | ||
LONG | view, | ||
uint8_t | acq, | ||
uint8_t | vol, | ||
TYPDAB_PACKETS | acqon_flag | ||
) |
[in] | pulse | Pointer to WF_PULSE in a KS_READ |
[in] | slice | 0-based temporal slice index (2D) or kz encoding step typically (3D) |
[in] | echo | 0-based echo in the echo train |
[in] | view | 1-based ky view number |
[in] | acq | 0-based acquisition index (always 0 if all slices fit in one TR) |
[in] | vol | 0-based volume index (always 0 if only one volume) |
[in] | acqon_flag | DABON or DABOFF |
STATUS | SUCCESS or FAILURE |
STATUS ks_scan_loaddabwithindices_nex | ( | WF_PULSE_ADDR | pulse, |
LONG | slice, | ||
LONG | echo, | ||
LONG | view, | ||
uint8_t | acq, | ||
uint8_t | vol, | ||
LONG | operation, | ||
TYPDAB_PACKETS | acqon_flag | ||
) |
[in] | pulse | Pointer to WF_PULSE in a KS_READ |
[in] | slice | 0-based temporal slice index (2D) or kz encoding step typically (3D) |
[in] | echo | 0-based echo in the echo train |
[in] | view | 1-based ky view number |
[in] | acq | 0-based acquisition index (always 0 if all slices fit in one TR) |
[in] | vol | 0-based volume index (always 0 if only one volume) |
[in] | operation | DABSTORE, DABADD (for 2nd to last excitation) |
[in] | acqon_flag | DABON or DABOFF |
STATUS | SUCCESS or FAILURE |
int ks_scan_wait_for_rtp | ( | void * | rtpmsg, |
int | maxmsgsize, | ||
int | maxwait, | ||
KS_SEQ_CONTROL * | waitctrl | ||
) |
[out] | rtpmsg | pointer to memory that will be filled by the RTP message |
[in] | maxmsgsize | size in bytes of the memory pointed by rtpmsg |
[in] | maxwait | timing out period in [ms] |
[in] | waitctrl | pointer to the KS_SEQ_CONTROL of a wait sequence. If NULL, the provided maxwait is ignored and a value of zero used instead. |
size | of the received message, zero if timed out |
void ks_copy_and_reset_obj | ( | void * | pobj | ) |
Create a copy of the object pointed by pobj and insert it into the linked list in second position. finally reset the (base part of) original object.
It is required that pobj
can be casted to (KS_BASE *), which is the pointed object should have a KS_BASE as first member. Note that other, object-specific, actions may need to be performed to finalize the reset. This includes calls to ks_instancereset_***() functions on each member of the current pobj
[in] | pobj | Pointer to a sequence object of some kind |
void ks_show_clock | ( | FLOAT | scantime | ) |
float ks_scan_rf_phase_spoiling | ( | int | counter | ) |
[in] | counter | [RF number] |
int ks_scan_gettherightshot | ( | const KS_DYNAMIC_STATE * | dynamic | ) |
float ks_get_trapamp_instance | ( | const KS_TRAP * | trap, |
int | instance | ||
) |
void ks_tgt_reset_gradrfctrl | ( | KS_GRADRFCTRL * | gradrfctrl | ) |
Clears KS_GRADRFCTRL on TGT. Called in ks_pg_trap, ks_pg_wave, and ks_pg_rf if the field is_cleared_on_tgt
is false.
gradrfctrl | [pointer to KS_GRADRFCTRL] |
int ks_eval_clear_readwave | ( | KS_READWAVE * | readwave | ) |
void ks_polyder | ( | const double * | coeffs, |
const int | order, | ||
double * | der_coeffs | ||
) |
void ks_polyval | ( | const double * | coeffs, |
const int | order, | ||
const double * | x, | ||
const int | numx, | ||
double * | values | ||
) |
void ks_polyval_f | ( | const double * | coeffs, |
const int | order, | ||
const float * | x, | ||
const int | numx, | ||
float * | values | ||
) |
double ks_Newtons_method | ( | const double * | coeffs, |
const int | order, | ||
const double | x0, | ||
const int | num_iter | ||
) |
int ks_pg_readwave | ( | KS_READWAVE * | readwave, |
KS_SEQLOC | loc, | ||
KS_SEQ_CONTROL * | ctrl | ||
) |
STATUS ks_pg_echotrain_readout | ( | KS_ECHOTRAIN * | echotrain, |
int | readout_index, | ||
int | echo_time, | ||
KS_ECHOTRAIN_READOUT_TIMING * | timing, | ||
KS_SEQ_CONTROL * | ctrl | ||
) |
int ks_numplaced | ( | KS_BASE * | base | ) |
void ks_set_opcode | ( | WF_PULSE_ADDR | echo, |
short | opcode | ||
) |
int ks_write_vector_bf | ( | float * | vec, |
uint32_t | numel, | ||
const char * | fname | ||
) |
FILE* ks_open_file_in_embed | ( | const char * | fname, |
const char * | write_mode | ||
) |
int abort_on_kserror |
int ks_rhoboard |
LOG_GRAD loggrd |
PHYS_GRAD phygrd |
int pscR1 |
int rspent |