KSFoundation  [October2024]
A platform for structured EPIC programming on GE MR systems
Sequence-independent RF & slicetiming for sequence generators (ksdesign.[h,cc])

Data Structures

struct  KS_SELRF_DESIGN
 
struct  KS_KSPACE_DESIGN
 
struct  KS_READWAVE_DESIGN
 
struct  KS_ECHOTRAIN_DESIGN
 

Macros

#define KS_INIT_SELRF_EXCDESIGN   {KS_INIT_DESC, KS_NOTSET, 90, 0.9, 1.0, 0, 0, 0.0, 0.0, EXC_2D, 1, 0.0, KS_SELRF_SMS_PHAS_MOD_PHAS, NULL, NULL}
 
#define KS_INIT_SELRF_REFDESIGN   {KS_INIT_DESC, KS_NOTSET, 180, 0.9, 1.0, 2.0, 1, 0.0, 0.0, REF_2D, 1, 0.0, KS_SELRF_SMS_PHAS_MOD_PHAS, NULL, NULL}
 
#define KS_INIT_SELRF_INVDESIGN   {KS_INIT_DESC, KS_NOTSET, 180, 0.9, 1.0, 0, 0, 0.0, 0.0, INV_STD, 1, 0.0, KS_SELRF_SMS_PHAS_MOD_PHAS, NULL, NULL}
 
#define KS_SPACE_DESIGN_VERSION   1
 
#define KS_INIT_KSPACE_2D_DESIGN   {KS_SPACE_DESIGN_VERSION, KS_INIT_DESC, {240,240,KS_NOTSET}, {320,320,KS_NOTSET}, 0, {0,0,0}, {1,1,1}, 1, 0, {KS_NOTSET,0,0}, {KS_NOTSET,0,0}, KSPACE_DESIGN_COMPRESSED_BAM_OFF, 31.25, KS_EPI_POSBLIPS, 0, 0, 1}
 
#define KS_INIT_KSPACE_3D_DESIGN   {KS_SPACE_DESIGN_VERSION, KS_INIT_DESC, {240,240,160}, {240,240,160}, 0, {0,0,0}, {1,1,1}, 1, 0, {KS_NOTSET,0,0}, {KS_NOTSET,0,0}, KSPACE_DESIGN_COMPRESSED_BAM_OFF, 62.5, KS_EPI_POSBLIPS, 0, 0, 1}
 
#define KS_INIT_KSPACE_EPI_DESIGN   {KS_SPACE_DESIGN_VERSION, KS_INIT_DESC, {240,240,KS_NOTSET}, {180,180,KS_NOTSET}, 1, {0,0,0}, {1,2,1}, 1, 0, {KS_NOTSET,0,0}, {KS_NOTSET,0,0}, KSPACE_DESIGN_COMPRESSED_BAM_OFF, 250.0, KS_EPI_POSBLIPS, 0, 0, 1}
 
#define KS_INIT_READWAVE_DESIGN   {NULL, 0, 1, 0.0, KS_NOTSET, KS_INIT_CRUSHER_CONSTRAINT, KS_INIT_CRUSHER_CONSTRAINT}
 
#define KS_INIT_ECHOTRAIN_DESIGN   {KS_INITVALUE(KS_MAXUNIQUE_READ,KS_INIT_READ_CONTROL), {KS_INIT_READWAVE_DESIGN}, 0}
 

Enumerations

enum  RFEXC_SELECTION {
  EXC_2D, EXC_FAST_2D, EXC_3D, EXC_FAST_3D,
  EXC_SPSP, EXC_SPSP_3D, EXC_FAST_SPSP_3D, EXC_HARD,
  EXC_HARD_LOWFAT, EXC_BINO_2, EXC_LOWSAR, EXC_CUSTOM
}
 
enum  RFREF_SELECTION {
  REF_SHARP_2D, REF_2D_FIRST, REF_2D, REF_FAST_2D,
  REF_EXTREM_FAST_2D, REF_HARD, REF_LOWSAR, REF_CUSTOM
}
 
enum  RFINV_SELECTION { INV_STD, INV_ADIABATIC, INV_LOWSAR, INV_CUSTOM }
 
enum  KSPACE_DESIGN_COMPRESSED_BAM_MODE { KSPACE_DESIGN_COMPRESSED_BAM_OFF, KSPACE_DESIGN_COMPRESSED_BAM_ON }
 
enum  KS_MULTISHOT_MODE { KS_MULTISHOT_OFF, KS_MULTISHOT_ALLVOLS, KS_MULTISHOT_1STVOL, KS_MULTISHOT_B0VOLS }
 

Functions

STATUS ks_init_design_kdesign (KS_KSPACE_DESIGN *kdesign)
 
void ks_init_design_readwave (KS_READWAVE_DESIGN *readwave_design)
 
STATUS ks_init_design_selrfexc (KS_SELRF_DESIGN *excdesign)
 
STATUS ks_init_design_selrfref (KS_SELRF_DESIGN *refdesign)
 
STATUS ks_init_design_selrfinv (KS_SELRF_DESIGN *invdesign)
 
STATUS ks_eval_validate_kspacedesign (const KS_KSPACE_DESIGN *kdesign, const char *desc)
 
STATUS ks_eval_design_readtrap (KS_READTRAP *trap, const KS_KSPACE_DESIGN *kdesign, const float crusher_area, const char *desc)
 
STATUS ks_eval_design_readwave (KS_READWAVE *readwave, const KS_READWAVE_DESIGN *design, const KS_KSPACE_DESIGN *kdesign, const char *desc)
 
STATUS ks_eval_design_echotrain (KS_ECHOTRAIN *echotrain, const KS_ECHOTRAIN_DESIGN *design, const KS_KSPACE_DESIGN *kdesign, const char *desc)
 
STATUS ks_eval_design_selrfexc (KS_SELRF *selrfexc, const KS_SELRF_DESIGN excdesign)
 
STATUS ks_eval_design_selrfref (KS_SELRF *selrfref, const KS_SELRF_DESIGN refdesign)
 
STATUS ks_eval_design_selrfinv (KS_SELRF *selrfinv, const KS_SELRF_DESIGN invdesign)
 
void ks_print_kdesign (const KS_KSPACE_DESIGN *const kdesign, const char *suffix, int rhkacq_uid)
 

Detailed Description

Macro Definition Documentation

◆ KS_INIT_SELRF_EXCDESIGN

#define KS_INIT_SELRF_EXCDESIGN   {KS_INIT_DESC, KS_NOTSET, 90, 0.9, 1.0, 0, 0, 0.0, 0.0, EXC_2D, 1, 0.0, KS_SELRF_SMS_PHAS_MOD_PHAS, NULL, NULL}

Default values for KS_SELRF_DESIGN for excitation pulses

◆ KS_INIT_SELRF_REFDESIGN

#define KS_INIT_SELRF_REFDESIGN   {KS_INIT_DESC, KS_NOTSET, 180, 0.9, 1.0, 2.0, 1, 0.0, 0.0, REF_2D, 1, 0.0, KS_SELRF_SMS_PHAS_MOD_PHAS, NULL, NULL}

Default values for KS_SELRF_DESIGN for excitation pulses

◆ KS_INIT_SELRF_INVDESIGN

#define KS_INIT_SELRF_INVDESIGN   {KS_INIT_DESC, KS_NOTSET, 180, 0.9, 1.0, 0, 0, 0.0, 0.0, INV_STD, 1, 0.0, KS_SELRF_SMS_PHAS_MOD_PHAS, NULL, NULL}

Default values for KS_SELRF_DESIGN for excitation pulses

◆ KS_SPACE_DESIGN_VERSION

#define KS_SPACE_DESIGN_VERSION   1

◆ KS_INIT_KSPACE_2D_DESIGN

#define KS_INIT_KSPACE_2D_DESIGN   {KS_SPACE_DESIGN_VERSION, KS_INIT_DESC, {240,240,KS_NOTSET}, {320,320,KS_NOTSET}, 0, {0,0,0}, {1,1,1}, 1, 0, {KS_NOTSET,0,0}, {KS_NOTSET,0,0}, KSPACE_DESIGN_COMPRESSED_BAM_OFF, 31.25, KS_EPI_POSBLIPS, 0, 0, 1}

Default values for KS_KSPACE_DESIGN for 2D scans

◆ KS_INIT_KSPACE_3D_DESIGN

#define KS_INIT_KSPACE_3D_DESIGN   {KS_SPACE_DESIGN_VERSION, KS_INIT_DESC, {240,240,160}, {240,240,160}, 0, {0,0,0}, {1,1,1}, 1, 0, {KS_NOTSET,0,0}, {KS_NOTSET,0,0}, KSPACE_DESIGN_COMPRESSED_BAM_OFF, 62.5, KS_EPI_POSBLIPS, 0, 0, 1}

Default values for KS_KSPACE_DESIGN for 3D scans

◆ KS_INIT_KSPACE_EPI_DESIGN

#define KS_INIT_KSPACE_EPI_DESIGN   {KS_SPACE_DESIGN_VERSION, KS_INIT_DESC, {240,240,KS_NOTSET}, {180,180,KS_NOTSET}, 1, {0,0,0}, {1,2,1}, 1, 0, {KS_NOTSET,0,0}, {KS_NOTSET,0,0}, KSPACE_DESIGN_COMPRESSED_BAM_OFF, 250.0, KS_EPI_POSBLIPS, 0, 0, 1}

Default values for KS_KSPACE_DESIGN for 2D EPI scans

◆ KS_INIT_READWAVE_DESIGN

#define KS_INIT_READWAVE_DESIGN   {NULL, 0, 1, 0.0, KS_NOTSET, KS_INIT_CRUSHER_CONSTRAINT, KS_INIT_CRUSHER_CONSTRAINT}

◆ KS_INIT_ECHOTRAIN_DESIGN

#define KS_INIT_ECHOTRAIN_DESIGN   {KS_INITVALUE(KS_MAXUNIQUE_READ,KS_INIT_READ_CONTROL), {KS_INIT_READWAVE_DESIGN}, 0}

Enumeration Type Documentation

◆ RFEXC_SELECTION

Enumerator
EXC_2D 
EXC_FAST_2D 
EXC_3D 
EXC_FAST_3D 
EXC_SPSP 
EXC_SPSP_3D 
EXC_FAST_SPSP_3D 
EXC_HARD 
EXC_HARD_LOWFAT 
EXC_BINO_2 
EXC_LOWSAR 
EXC_CUSTOM 
Definition: ksdesign.h:29
Definition: ksdesign.h:29
Definition: ksdesign.h:29
Definition: ksdesign.h:29
Definition: ksdesign.h:29
Definition: ksdesign.h:29
Definition: ksdesign.h:29
Definition: ksdesign.h:29
Definition: ksdesign.h:29
Definition: ksdesign.h:29
RFEXC_SELECTION
Definition: ksdesign.h:29
Definition: ksdesign.h:29
Definition: ksdesign.h:29

◆ RFREF_SELECTION

Enumerator
REF_SHARP_2D 
REF_2D_FIRST 
REF_2D 
REF_FAST_2D 
REF_EXTREM_FAST_2D 
REF_HARD 
REF_LOWSAR 
REF_CUSTOM 
Definition: ksdesign.h:30
Definition: ksdesign.h:30
Definition: ksdesign.h:30
Definition: ksdesign.h:30
Definition: ksdesign.h:30
Definition: ksdesign.h:30
RFREF_SELECTION
Definition: ksdesign.h:30
Definition: ksdesign.h:30
Definition: ksdesign.h:30

◆ RFINV_SELECTION

Enumerator
INV_STD 
INV_ADIABATIC 
INV_LOWSAR 
INV_CUSTOM 
Definition: ksdesign.h:31
Definition: ksdesign.h:31
RFINV_SELECTION
Definition: ksdesign.h:31
Definition: ksdesign.h:31
Definition: ksdesign.h:31

◆ KSPACE_DESIGN_COMPRESSED_BAM_MODE

Enumerator
KSPACE_DESIGN_COMPRESSED_BAM_OFF 
KSPACE_DESIGN_COMPRESSED_BAM_ON 

◆ KS_MULTISHOT_MODE

Enums to switch between multishot vs. parallel imaging modes (EPI sequences, ksepi_scan_domultishot()). May be discontinued in the future, solely using FLEET calibration

Enumerator
KS_MULTISHOT_OFF 

0: All volumes are undersampled by R = #shots

KS_MULTISHOT_ALLVOLS 

1: All volumes are fully sampled (multi-shot)

KS_MULTISHOT_1STVOL 

2: 1st volume is fully sampled (multi-shot), remaining are undersampled by R = #shots

KS_MULTISHOT_B0VOLS 
  1. Diffusion only: b=0 volumes are fully sampled (multi-shot), DWIs are undersampled by R = #shots
36  {
Definition: ksdesign.h:38
Definition: ksdesign.h:39
Definition: ksdesign.h:40
KS_MULTISHOT_MODE
Enums to switch between multishot vs. parallel imaging modes (EPI sequences, ksepi_scan_domultishot()...
Definition: ksdesign.h:36
Definition: ksdesign.h:37

Function Documentation

◆ ks_init_design_kdesign()

STATUS ks_init_design_kdesign ( KS_KSPACE_DESIGN kdesign)

Clear the contents of KS_KSPACE_DESIGN

32  {
34  *kdesign = default_kdesign;
35 
36  return SUCCESS;
37 
38 } /* ks_init_design_kdesign() */
#define KS_INIT_KSPACE_2D_DESIGN
Definition: ksdesign.h:99
Input design for how to set up data acquistion (FOV, matrix size, parallel imaging, rBW etc)This struct is used by e.g. ks_eval_design_readtrap(), ksepi_eval_kdesign2epitrain(), ksfse_eval_numlines2acq() and is a part of all sequence generator's design structs (KSEPI_MODULE->KSEPI_DESIGN, KSFSE_MODULE->KSFSE_DESIGN, KSGRE_MODULE->KSGRE_DESIGN)
Definition: ksdesign.h:76

◆ ks_init_design_readwave()

void ks_init_design_readwave ( KS_READWAVE_DESIGN readwave_design)

ADDTITLEHERE

ADDDESCHERE

Parameters
readwave_designADDTEXTHERE
Returns
void
43  {
44  KS_READWAVE_DESIGN default_readwave_design = KS_INIT_READWAVE_DESIGN;
45  *readwave_design = default_readwave_design;
46 
47 } /* ks_init_design_readwave() */
#define KS_INIT_READWAVE_DESIGN
Definition: ksdesign.h:112
Definition: ksdesign.h:103

◆ ks_init_design_selrfexc()

STATUS ks_init_design_selrfexc ( KS_SELRF_DESIGN excdesign)

Clear the contents of KS_SELRF_DESIGN and use excitation defaults

52  {
53  KS_SELRF_DESIGN default_excdesign = KS_INIT_SELRF_EXCDESIGN;
54  *excdesign = default_excdesign;
55 
56  return SUCCESS;
57 
58 } /* ks_init_design_selrfexc() */
Input design to create a slice selective RF pulse. Should be a part of a sequence struct and set up b...
Definition: ksdesign.h:48
#define KS_INIT_SELRF_EXCDESIGN
Definition: ksdesign.h:66

◆ ks_init_design_selrfref()

STATUS ks_init_design_selrfref ( KS_SELRF_DESIGN refdesign)

Clear the contents of KS_SELRF_DESIGN and use refocusing defaults

63  {
64  KS_SELRF_DESIGN default_refdesign = KS_INIT_SELRF_REFDESIGN;
65  *refdesign = default_refdesign;
66 
67  return SUCCESS;
68 
69 } /* ks_init_design_selrfref() */
#define KS_INIT_SELRF_REFDESIGN
Definition: ksdesign.h:67
Input design to create a slice selective RF pulse. Should be a part of a sequence struct and set up b...
Definition: ksdesign.h:48

◆ ks_init_design_selrfinv()

STATUS ks_init_design_selrfinv ( KS_SELRF_DESIGN invdesign)

Clear the contents of KS_SELRF_DESIGN and use inversion defaults

74  {
75  KS_SELRF_DESIGN default_invdesign = KS_INIT_SELRF_INVDESIGN;
76  *invdesign = default_invdesign;
77 
78  return SUCCESS;
79 
80 } /* ks_init_design_selrfinv() */
Input design to create a slice selective RF pulse. Should be a part of a sequence struct and set up b...
Definition: ksdesign.h:48
#define KS_INIT_SELRF_INVDESIGN
Definition: ksdesign.h:68

◆ ks_eval_validate_kspacedesign()

STATUS ks_eval_validate_kspacedesign ( const KS_KSPACE_DESIGN kdesign,
const char *  desc 
)

Function that performs range checks for the fields in KS_KSPACE_DESIGN before it is used

Parameters
[in]kdesignPointer to KS_KSPACE_DESIGN
[in]descDescription for error messages
Return values
STATUSSUCCESS or FAILURE
85  {
86 
87  if (kdesign->res[XGRAD] % 2 || kdesign->res[XGRAD] < 2) {
88  KS_THROW("res[XGRAD] (%d) cannot be odd or negative", kdesign->res[XGRAD]);
89  return ADVISORY_FAILURE;
90  }
91  if (kdesign->res[ZGRAD] == 0) {
92  KS_THROW("res[ZGRAD] cannot be 0. Set to KS_NOTSET for 2D");
93  return ADVISORY_FAILURE;
94  }
95  if (kdesign->res[ZGRAD] < KS_NOTSET) {
96  KS_THROW("res[ZGRAD] cannot be %d. Set to KS_NOTSET for 2D", kdesign->res[ZGRAD]);
97  return ADVISORY_FAILURE;
98  }
99  if ((kdesign->nover[XGRAD] != 0) + (kdesign->nover[YGRAD] != 0) + (kdesign->nover[ZGRAD] != 0) > 1) {
100  KS_THROW("cannot do partial fourier in more than one direction at a time.");
101  return ADVISORY_FAILURE;
102  }
103  if ((kdesign->nover[XGRAD] + kdesign->nover[YGRAD] + kdesign->nover[ZGRAD]) % 2 != 0) {
104  KS_THROW("nover must be a multiple of 2");
105  return ADVISORY_FAILURE;
106  }
107  if (kdesign->R_epi_ky > 1 && kdesign->R[YGRAD] > 1 && (kdesign->R[YGRAD] < kdesign->R_epi_ky || kdesign->R[YGRAD] % kdesign->R_epi_ky)) {
108  KS_THROW("R[Y] (%d) not divisible with R_epi_ky (%d)", kdesign->R[YGRAD], kdesign->R_epi_ky);
109  return ADVISORY_FAILURE;
110  }
111 
112  return SUCCESS;
113 
114 } /* ks_eval_validate_kspacedesign() */
int R_epi_ky
Definition: ksdesign.h:84
int R[3]
Definition: ksdesign.h:83
int nover[3]
Definition: ksdesign.h:82
#define KS_NOTSET
Definition: KSFoundation.h:115
#define KS_THROW(format,...)
Definition: KSFoundation.h:181
int res[3]
Definition: ksdesign.h:80

◆ ks_eval_design_readtrap()

STATUS ks_eval_design_readtrap ( KS_READTRAP trap,
const KS_KSPACE_DESIGN kdesign,
const float  crusher_area,
const char *  desc 
)

Function that sets up a KS_READTRAP struct based on an KS_KSPACE_DESIGN

Parameters
[out]trapPointer to KS_READTRAP
[in]kdesignPointer to KS_KSPACE_DESIGN struct
[in]crusher_areaMinimum padding area before acq starts
[in]descDescription of readtrap
Return values
STATUSSUCCESS or FAILURE
119  {
120 
121  trap->fov = kdesign->fov[XGRAD]*kdesign->readout_oversampling_factor;
122  trap->res = RUP_FACTOR(kdesign->res[XGRAD], 2)*kdesign->readout_oversampling_factor;
123  trap->acq.rbw = kdesign->rbw*kdesign->readout_oversampling_factor;
124  trap->acq.override_R1 = kdesign->override_R1;
125  trap->paddingarea = crusher_area;
126  trap->rampsampling = kdesign->rampsampling;
127  trap->nover = kdesign->nover[XGRAD];
128 
129  return ks_eval_readtrap(trap, desc);
130 
131 } /* ks_eval_design_readtrap() */
int readout_oversampling_factor
Definition: ksdesign.h:95
int nover[3]
Definition: ksdesign.h:82
LONG override_R1
Definition: KSFoundation.h:845
float fov
Definition: KSFoundation.h:1551
float rbw
Definition: KSFoundation.h:842
float paddingarea
Definition: KSFoundation.h:1556
int res
Definition: KSFoundation.h:1552
int override_R1
Definition: ksdesign.h:93
STATUS ks_eval_readtrap(KS_READTRAP *readtrap, const char *const desc) WARN_UNUSED_RESULT
Sets up an acquisition window with a trapezoid with preset gradient constraints
Definition: KSFoundation_host.c:1230
float rbw
Definition: ksdesign.h:91
int nover
Definition: KSFoundation.h:1554
int rampsampling
Definition: KSFoundation.h:1553
KS_READ acq
Definition: KSFoundation.h:1549
int rampsampling
Definition: ksdesign.h:81
int res[3]
Definition: ksdesign.h:80
float fov[3]
Definition: ksdesign.h:79

◆ ks_eval_design_readwave()

STATUS ks_eval_design_readwave ( KS_READWAVE readwave,
const KS_READWAVE_DESIGN design,
const KS_KSPACE_DESIGN kdesign,
const char *  desc 
)

ADDTITLEHERE

ADDDESCHERE

Parameters
readwaveADDTEXTHERE
[in]designADDTEXTHERE
[in]kdesignADDTEXTHERE
[in]descADDTEXTHERE
Return values
STATUSSUCCESS or FAILURE
139  {
140 
141  ks_init_readwave(readwave);
142  readwave->fov = kdesign->fov[XGRAD];
143  readwave->res = RUP_FACTOR(kdesign->res[XGRAD], 2);
144  readwave->acq.override_R1 = kdesign->override_R1;
145  if (fabs(design->pf) >= 0.5 && fabs(design->pf) < 1.0) {
146  readwave->nover = readwave->res * (fabs(design->pf) - 0.5);
147  /* Keep track of sign as it signals early/late pf */
148  if (design->pf < 0) {
149  readwave->nover *= -1;
150  }
151  }
152 
153  readwave->acq.rbw = design->rbw; /* If KS_NOTSET, then rbw will be automatically calculated later */
154  STATUS s = ks_eval_readwave_constrained(readwave,
155  design->acq_waves,
156  design->numstates,
157  design->flag_symmetric_padding,
158  design->pre_crusher,
159  design->post_crusher);
160  free(design->acq_waves);
161  KS_RAISE(s);
162  return SUCCESS;
163 }
float fov
Definition: KSFoundation.h:1610
LONG override_R1
Definition: KSFoundation.h:845
int numstates
Definition: ksdesign.h:105
float rbw
Definition: KSFoundation.h:842
ks_crusher_constraints pre_crusher
Definition: ksdesign.h:109
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)
Sets up an readwave acquisition window with the maximum sampling bandwidth.
Definition: KSFoundation_host.c:1440
float pf
Definition: ksdesign.h:107
float rbw
Definition: ksdesign.h:108
KS_WAVE * acq_waves
Definition: ksdesign.h:104
#define KS_RAISE(status)
Definition: KSFoundation.h:190
void ks_init_readwave(KS_READWAVE *readwave)
Resets a KS_READWAVE sequence object to its default value (KS_INIT_READWAVE)
Definition: KSFoundation_host.c:134
int override_R1
Definition: ksdesign.h:93
int flag_symmetric_padding
Definition: ksdesign.h:106
ks_crusher_constraints post_crusher
Definition: ksdesign.h:110
KS_READ acq
Definition: KSFoundation.h:1606
int res
Definition: KSFoundation.h:1611
int res[3]
Definition: ksdesign.h:80
float fov[3]
Definition: ksdesign.h:79
int nover
Definition: KSFoundation.h:1612

◆ ks_eval_design_echotrain()

STATUS ks_eval_design_echotrain ( KS_ECHOTRAIN echotrain,
const KS_ECHOTRAIN_DESIGN design,
const KS_KSPACE_DESIGN kdesign,
const char *  desc 
)

ADDTITLEHERE

ADDDESCHERE

Parameters
echotrainADDTEXTHERE
[in]designADDTEXTHERE
[in]kdesignADDTEXTHERE
[in]descADDTEXTHERE
Return values
STATUSSUCCESS or FAILURE
169  {
170 
171  int i;
172  STATUS status;
173  KS_DESCRIPTION tmp_desc;
174 
175  ks_init_echotrain(echotrain);
176 
177  /* copy controls */
178  for (i = 0; i < KS_MAXUNIQUE_READ; ++i) {
179  echotrain->controls[i] = design->controls[i];
180  }
181 
182  /* compute number of traps and waves */
183  status = ks_eval_echotrain(echotrain);
184  KS_RAISE(status);
185 
186 
187  /* readtraps */
188  for (i = 0; i < echotrain->numtraps; ++i) {
189  ks_create_suffixed_description(tmp_desc, desc, "_readtrap%03d", i);
190  status = ks_eval_design_readtrap(&echotrain->readtraps[i],
191  kdesign,
192  design->readtrap_crusher_area,
193  tmp_desc);
194  KS_RAISE(status);
195  }
196 
197  /* readwaves */
198  for (i = 0; i < echotrain->numwaves; ++i) {
199  ks_create_suffixed_description(tmp_desc, desc, "_readwave%03d", i);
200  status = ks_eval_design_readwave(&echotrain->readwaves[i],
201  &design->readwave_designs[i],
202  kdesign,
203  tmp_desc);
204  KS_RAISE(status);
205  }
206 
207 
208  return SUCCESS;
209 }
KS_READTRAP readtraps[KS_ECHOTRAIN_MAX_TRAPS]
Definition: KSFoundation.h:2016
KS_READWAVE readwaves[KS_ECHOTRAIN_MAX_WAVES]
Definition: KSFoundation.h:2017
STATUS ks_eval_design_readtrap(KS_READTRAP *trap, const KS_KSPACE_DESIGN *kdesign, const float crusher_area, const char *desc)
Function that sets up a KS_READTRAP struct based on an KS_KSPACE_DESIGN
Definition: ksdesign.cc:119
KS_READWAVE_DESIGN readwave_designs[KS_ECHOTRAIN_MAX_WAVES]
Definition: ksdesign.h:116
KS_READCONTROL controls[KS_MAXUNIQUE_READ]
Definition: ksdesign.h:115
int numwaves
Definition: KSFoundation.h:2019
#define KS_MAXUNIQUE_READ
Definition: KSFoundation.h:264
STATUS ks_eval_design_readwave(KS_READWAVE *readwave, const KS_READWAVE_DESIGN *design, const KS_KSPACE_DESIGN *kdesign, const char *desc)
ADDTITLEHERE
Definition: ksdesign.cc:136
void ks_create_suffixed_description(char *const out, const char *const prefix, const char *suffix,...) __attribute__((format(printf
#define KS_RAISE(status)
Definition: KSFoundation.h:190
STATUS ks_eval_echotrain(KS_ECHOTRAIN *const echotrain)
Evaluates the echotrain design
Definition: KSFoundation_host.c:4790
void ks_init_echotrain(KS_ECHOTRAIN *const echotrain)
Reinitialises an echotrain structure
Definition: KSFoundation_host.c:188
char KS_DESCRIPTION[KS_DESCRIPTION_LENGTH]
Definition: KSFoundation.h:351
KS_READCONTROL controls[KS_MAXUNIQUE_READ]
Definition: KSFoundation.h:2015
float readtrap_crusher_area
Definition: ksdesign.h:117
int numtraps
Definition: KSFoundation.h:2018

◆ ks_eval_design_selrfexc()

STATUS ks_eval_design_selrfexc ( KS_SELRF selrfexc,
const KS_SELRF_DESIGN  excdesign 
)

Function that sets up a KS_SELRF struct for selective RF excitation based on an KS_SELRF_DESIGN

Parameters
[out]selrfexcPointer to KS_SELRF (slice selective excitation)
[in]excdesignKS_SELRF_DESIGN struct with desired excitation characteristics
Return values
STATUSSUCCESS or FAILURE
212  {
213  STATUS status;
214  float rfstretchfactor = 1.0;
215  int allowcustomstretch = TRUE;
216 
217  /* clear RF pulse */
218  ks_init_selrf(selrfexc);
219 
220  if (excdesign.description == NULL || strlen(excdesign.description) == 0) {
221  return KS_THROW("empty description");
222  }
223 
224  float offsetFreq = 421.5420;
225  if (cffield != 30000) {
226  offsetFreq *= 0.5;
227  }
228 
229  switch (excdesign.rfpulse_choice) {
230  case EXC_2D: /* 0 */
231  selrfexc->rf = exc_fse90; /* 800 Hz */
232  break;
233  case EXC_FAST_2D: /* 1 */
234  selrfexc->rf = exc_ssfse90new;
235  break;
236  case EXC_3D: /* 2 */
237  selrfexc->rf = exc_3d8min; /* 14403 Hz */
238  break;
239  case EXC_FAST_3D: /* 3 */
240  selrfexc->rf = exc_tbw6_01_001_150; /* 20000 Hz */
241  break;
242  case EXC_SPSP: /* 4 */
243  if (cffield == 15000) {
244  selrfexc->rf = spsp_ss1528822; /* 1.5T SPSP. 2571 Hz */
245  selrfexc->gradwave = spsp_ss1528822_gz; /* normalized to 1 G/cm */
246  } else {
247  selrfexc->rf = spsp_ss30260334; /* 3T SPSP. 4040 Hz */
248  selrfexc->gradwave = spsp_ss30260334_gz; /* normalized to 1 G/cm */
249  }
250  allowcustomstretch = FALSE;
251  break;
252  case EXC_SPSP_3D: /* 5 */
253  if (cffield == 30000) {
254  selrfexc->rf = spsp_spsp30104233; /* 3T SPSP. 17797 Hz */
255  selrfexc->gradwave = spsp_spsp30104233_gz; /* normalized to 1 G/cm */
256  } else {
257  /* same as EXC_FAST_SPSP_3D at 1.5 T for now */
258  if (excdesign.slthick < 100) {
259  selrfexc->rf = spsp_ss1528822; /* 1.5T SPSP. 2571 Hz */
260  selrfexc->gradwave = spsp_ss1528822_gz; /* normalized to 1 G/cm */
261  } else {
264  }
265  }
266  allowcustomstretch = FALSE;
267  break;
268  case EXC_FAST_SPSP_3D: /* 6 */
269  if (cffield == 30000) {
270  if (excdesign.slthick < 100) {
271  selrfexc->rf = spsp_ss30260334; /* 3T SPSP. 4040 Hz */
272  selrfexc->gradwave = spsp_ss30260334_gz; /* normalized to 1 G/cm */
273  } else {
276  }
277  } else {
278  if (excdesign.slthick < 100) {
279  selrfexc->rf = spsp_ss1528822; /* 1.5T SPSP. 2571 Hz */
280  selrfexc->gradwave = spsp_ss1528822_gz; /* normalized to 1 G/cm */
281  } else {
284  }
285  }
286  allowcustomstretch = FALSE;
287  break;
288  case EXC_HARD: /* 7 */
289  selrfexc->rf = excnonsel_fermi100;
290  rfstretchfactor = 4; /* Make it 400us to get bit more FA */
291  break;
292  case EXC_HARD_LOWFAT: /* 8 */
293  status = ks_eval_rf_binomial(&selrfexc->rf, "MT binomial 1-1",
294  0 /* select water */,
295  2,
296  excdesign.flip,
297  offsetFreq,
298  1);
299  KS_RAISE(status);
300  selrfexc->rf.role = KS_RF_ROLE_EXC;
301  allowcustomstretch = TRUE;
302  break;
303  case EXC_BINO_2: /* 9 */
304  status = ks_eval_rf_binomial(&selrfexc->rf, "binomial 1-1",
305  0 /* select water */,
306  2, /* number of subpulses */
307  excdesign.flip, /* flip angle */
308  offsetFreq, /* fat center freq. */
309  0); /* MT reduction on/off*/
310  KS_RAISE(status);
311  selrfexc->rf.role = KS_RF_ROLE_EXC;
312  allowcustomstretch = FALSE;
313  break;
314  case EXC_LOWSAR: /* 10 */
315  selrfexc->rf = ref_fse1601; /* (4000 Hz) */
316  selrfexc->rf.role = KS_RF_ROLE_EXC;
317  rfstretchfactor = 2.5; /* 4000/rfstretchfactor = 800 Hz */
318  break;
319  case EXC_CUSTOM: /* 11 */
320  if (excdesign.customrf == NULL) {
321  return KS_THROW("Missing pointer to custom RF pulse");
322  }
323  selrfexc->rf = *(excdesign.customrf);
324  selrfexc->rf.role = KS_RF_ROLE_EXC;
325  if (excdesign.customgrad != NULL) {
326  selrfexc->gradwave = *(excdesign.customgrad);
327  }
328  break;
329  default:
330  return KS_THROW("KS_SELRF_DESIGN field rfpulse_choice out of range");
331  } /* switch */
332 
333  selrfexc->rf.flip = excdesign.flip;
334  selrfexc->slthick = excdesign.slthick / excdesign.gscale;
335 
336  selrfexc->pregrad_area_offset = excdesign.pregrad_area_offset;
337  selrfexc->postgrad_area_offset = excdesign.postgrad_area_offset;
338 
339  /* RF pulse stretching */
340  if (allowcustomstretch && !areSame(excdesign.rfstretch, 0)) {
341  rfstretchfactor *= excdesign.rfstretch;
342  }
343  status = ks_eval_stretch_rf(&selrfexc->rf, rfstretchfactor);
344  KS_RAISE(status);
345 
346  status = ks_eval_selrf1(selrfexc, excdesign.description);
347  KS_RAISE(status);
348 
349  if (excdesign.sms_factor > 1) {
350 
351  status = ks_eval_sms_make_multiband(selrfexc,
352  selrfexc,
353  excdesign.sms_factor,
354  excdesign.sms_factor == 2 ? KS_SELRF_SMS_PHAS_MOD_OFF
355  : excdesign.sms_phase_modulation_mode,
356  excdesign.sms_slice_gap, 0);
357  KS_RAISE(status);
358  }
359 
360  return SUCCESS;
361 
362 } /* ks_eval_design_selrfexc() */
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
Sets up a KS_RF object as a Binomial RF pulse
Definition: KSFoundation_host.c:2431
STATUS ks_eval_selrf1(KS_SELRF *selrf, const char *const desc) WARN_UNUSED_RESULT
Sets up a KS_SELRF object for RF slice selection with preset gradient constraints
Definition: KSFoundation_host.c:3330
DECL_TYPE KS_WAVE spsp_ss1528822_gz
Definition: KSFoundation_GERF.c:2154
#define areSame(a, b)
Definition: KSFoundation.h:144
DECL_TYPE KS_RF spsp_spsp30104233
Definition: KSFoundation_GERF.c:2375
const KS_RF * customrf
Definition: ksdesign.h:62
float pregrad_area_offset
Definition: KSFoundation.h:1459
int role
Definition: KSFoundation.h:1027
KS_ENUM_SMS_PHASE_MOD sms_phase_modulation_mode
Definition: ksdesign.h:61
float pregrad_area_offset
Definition: ksdesign.h:56
DECL_TYPE KS_RF spsp_ss30260334
Definition: KSFoundation_GERF.c:2256
KS_WAVE gradwave
Definition: KSFoundation.h:1465
float rfstretch
Definition: ksdesign.h:53
float gscale
Definition: ksdesign.h:52
Definition: KSFoundation.h:2340
Definition: ksdesign.h:29
float flip
Definition: KSFoundation.h:1028
DECL_TYPE KS_RF exc_3d8min
Definition: KSFoundation_GERF.c:735
DECL_TYPE KS_RF excnonsel_fermi100
Definition: KSFoundation_GERF.c:1325
Definition: ksdesign.h:29
Definition: ksdesign.h:29
DECL_TYPE KS_WAVE exc_SPSP3D_100mm_stbw1_2b_min_bin_gz
Definition: KSFoundation_KSRF.c:156
float flip
Definition: ksdesign.h:51
DECL_TYPE KS_WAVE exc_SPSP3D_15T_100mm_stbw10_2b_min_bin_gz
Definition: KSFoundation_KSRF.c:632
int sms_factor
Definition: ksdesign.h:59
float postgrad_area_offset
Definition: KSFoundation.h:1460
DECL_TYPE KS_WAVE spsp_ss30260334_gz
Definition: KSFoundation_GERF.c:2273
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
Creates a SMS (simultaneous-multi-slice) version of a KS_SELRF object
Definition: KSFoundation_host.c:3470
float postgrad_area_offset
Definition: ksdesign.h:57
KS_RF rf
Definition: KSFoundation.h:1454
Definition: ksdesign.h:29
int rfpulse_choice
Definition: ksdesign.h:58
DECL_TYPE KS_RF exc_fse90
Definition: KSFoundation_GERF.c:291
void ks_init_selrf(KS_SELRF *selrf)
Resets a KS_SELRF sequence object to its default value (KS_INIT_SELRF)
Definition: KSFoundation_host.c:102
DECL_TYPE KS_RF spsp_ss1528822
Definition: KSFoundation_GERF.c:2137
#define KS_RAISE(status)
Definition: KSFoundation.h:190
Definition: ksdesign.h:29
Definition: ksdesign.h:29
DECL_TYPE KS_RF exc_SPSP3D_15T_100mm_stbw10_2b_min_bin
Definition: KSFoundation_KSRF.c:615
Definition: ksdesign.h:29
DECL_TYPE KS_RF exc_ssfse90new
Definition: KSFoundation_GERF.c:513
Definition: ksdesign.h:29
DECL_TYPE KS_RF exc_tbw6_01_001_150
Definition: KSFoundation_GERF.c:883
DECL_TYPE KS_RF exc_SPSP3D_100mm_stbw1_2b_min_bin
Definition: KSFoundation_KSRF.c:139
const KS_WAVE * customgrad
Definition: ksdesign.h:63
float sms_slice_gap
Definition: ksdesign.h:60
DECL_TYPE KS_WAVE spsp_spsp30104233_gz
Definition: KSFoundation_GERF.c:2392
DECL_TYPE KS_RF ref_fse1601
Definition: KSFoundation_GERF.c:1473
Definition: ksdesign.h:29
KS_DESCRIPTION description
Definition: ksdesign.h:49
#define KS_THROW(format,...)
Definition: KSFoundation.h:181
Definition: ksdesign.h:29
Definition: KSFoundation.h:2352
STATUS ks_eval_stretch_rf(KS_RF *rf, float stretch_factor)
In-place stretching of a KS_RF object
Definition: KSFoundation_host.c:3928
float slthick
Definition: ksdesign.h:50
Definition: ksdesign.h:29
float slthick
Definition: KSFoundation.h:1456
Definition: ksdesign.h:29

◆ ks_eval_design_selrfref()

STATUS ks_eval_design_selrfref ( KS_SELRF selrfref,
const KS_SELRF_DESIGN  refdesign 
)

Function that sets up a KS_SELRF struct for selective RF refocusing based on an KS_SELRF_DESIGN

Parameters
[out]selrfrefPointer to KS_SELRF (slice selective refocusing)
[in]refdesignKS_SELRF_DESIGN struct with desired refocusing characteristics
Return values
STATUSSUCCESS or FAILURE
367  {
368  STATUS status;
369  float rfstretchfactor = 1.0;
370 
371  /* clear RF pulse */
372  ks_init_selrf(selrfref);
373 
374  if (refdesign.description == NULL || strlen(refdesign.description) == 0) {
375  return KS_THROW("empty description");
376  }
377 
378  switch (refdesign.rfpulse_choice) {
379  case REF_SHARP_2D:
380  selrfref->rf = ref_se1b4; /* 905 Hz */
381  break;
382  case REF_2D_FIRST:
383  selrfref->rf = ref_fse1601; /* 800 Hz */
384  break;
385  case REF_2D:
386  selrfref->rf = ref_fse160n; /* 800 Hz */
387  break;
388  case REF_FAST_2D:
389  selrfref->rf = ref_ssfse155; /* 1280 Hz */
390  break;
391  case REF_EXTREM_FAST_2D:
392  selrfref->rf = ref_tbw2_1_01; /* 4000 Hz */
393  rfstretchfactor = 5;
394  break;
395  case REF_HARD:
396  selrfref->rf = refnonsel_fermi124;
397  rfstretchfactor = 2;
398  break;
399  case REF_LOWSAR:
400  selrfref->rf = ref_fse160n; /* (800 Hz) */
401  rfstretchfactor = 2.5; /* 800/rfstretchfactor = 267 Hz */
402  break;
403  case REF_CUSTOM:
404  if (refdesign.customrf == NULL) {
405  return KS_THROW("Missing pointer to custom RF pulse");
406  }
407  selrfref->rf = *(refdesign.customrf);
408  selrfref->rf.role = KS_RF_ROLE_REF;
409  if (refdesign.customgrad != NULL) {
410  selrfref->gradwave = *(refdesign.customgrad);
411  }
412  break;
413  default:
414  return KS_THROW("KS_SELRF_DESIGN field rfpulse_choice out of range");
415  } /* switch */
416 
417  selrfref->rf.flip = refdesign.flip;
418  selrfref->slthick = refdesign.slthick / refdesign.gscale;
419  selrfref->crusher_dephasing = refdesign.crusher_dephasing;
420  selrfref->pregrad_area_offset = refdesign.pregrad_area_offset;
421  selrfref->postgrad_area_offset = refdesign.postgrad_area_offset;
422  selrfref->bridge_crushers = refdesign.bridge_crushers;
423 
424  /* RF pulse stretching */
425  rfstretchfactor *= refdesign.rfstretch; /* '*=' so that we use the base stretch factor for REF_HARD & REF_LOWSAR above */
426  status = ks_eval_stretch_rf(&selrfref->rf, rfstretchfactor);
427  KS_RAISE(status);
428 
429  status = ks_eval_selrf(selrfref, refdesign.description);
430  KS_RAISE(status);
431 
432  if (refdesign.sms_factor > 1) {
433 
434  status = ks_eval_sms_make_multiband(selrfref,
435  selrfref,
436  refdesign.sms_factor,
437  refdesign.sms_factor == 2 ? KS_SELRF_SMS_PHAS_MOD_OFF
438  : refdesign.sms_phase_modulation_mode,
439  refdesign.sms_slice_gap, 0);
440  KS_RAISE(status);
441  }
442 
443  return SUCCESS;
444 
445 } /* ks_eval_design_selrfref() */
Definition: ksdesign.h:30
const KS_RF * customrf
Definition: ksdesign.h:62
float pregrad_area_offset
Definition: KSFoundation.h:1459
int role
Definition: KSFoundation.h:1027
KS_ENUM_SMS_PHASE_MOD sms_phase_modulation_mode
Definition: ksdesign.h:61
STATUS ks_eval_selrf(KS_SELRF *selrf, const char *const desc) WARN_UNUSED_RESULT
Sets up a KS_SELRF object for RF slice selection with preset gradient constraints
Definition: KSFoundation_host.c:3312
float pregrad_area_offset
Definition: ksdesign.h:56
KS_WAVE gradwave
Definition: KSFoundation.h:1465
float crusher_dephasing
Definition: KSFoundation.h:1457
float rfstretch
Definition: ksdesign.h:53
Definition: KSFoundation.h:2340
int bridge_crushers
Definition: ksdesign.h:55
Definition: ksdesign.h:30
float gscale
Definition: ksdesign.h:52
int bridge_crushers
Definition: KSFoundation.h:1458
Definition: ksdesign.h:30
Definition: ksdesign.h:30
float flip
Definition: KSFoundation.h:1028
float flip
Definition: ksdesign.h:51
int sms_factor
Definition: ksdesign.h:59
float postgrad_area_offset
Definition: KSFoundation.h:1460
DECL_TYPE KS_RF ref_fse160n
Definition: KSFoundation_GERF.c:1621
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
Creates a SMS (simultaneous-multi-slice) version of a KS_SELRF object
Definition: KSFoundation_host.c:3470
float postgrad_area_offset
Definition: ksdesign.h:57
KS_RF rf
Definition: KSFoundation.h:1454
DECL_TYPE KS_RF ref_ssfse155
Definition: KSFoundation_GERF.c:1695
int rfpulse_choice
Definition: ksdesign.h:58
DECL_TYPE KS_RF refnonsel_fermi124
Definition: KSFoundation_GERF.c:1769
Definition: ksdesign.h:30
Definition: ksdesign.h:30
void ks_init_selrf(KS_SELRF *selrf)
Resets a KS_SELRF sequence object to its default value (KS_INIT_SELRF)
Definition: KSFoundation_host.c:102
#define KS_RAISE(status)
Definition: KSFoundation.h:190
DECL_TYPE KS_RF ref_tbw2_1_01
Definition: KSFoundation_GERF.c:1104
float crusher_dephasing
Definition: ksdesign.h:54
const KS_WAVE * customgrad
Definition: ksdesign.h:63
float sms_slice_gap
Definition: ksdesign.h:60
Definition: ksdesign.h:30
DECL_TYPE KS_RF ref_se1b4
Definition: KSFoundation_GERF.c:1399
DECL_TYPE KS_RF ref_fse1601
Definition: KSFoundation_GERF.c:1473
KS_DESCRIPTION description
Definition: ksdesign.h:49
Definition: ksdesign.h:30
#define KS_THROW(format,...)
Definition: KSFoundation.h:181
Definition: KSFoundation.h:2352
STATUS ks_eval_stretch_rf(KS_RF *rf, float stretch_factor)
In-place stretching of a KS_RF object
Definition: KSFoundation_host.c:3928
float slthick
Definition: ksdesign.h:50
float slthick
Definition: KSFoundation.h:1456

◆ ks_eval_design_selrfinv()

STATUS ks_eval_design_selrfinv ( KS_SELRF selrfinv,
const KS_SELRF_DESIGN  invdesign 
)

Function that sets up a KS_SELRF struct for selective RF inversion based on an KS_SELRF_DESIGN

Parameters
[out]selrfinvPointer to KS_SELRF (slice selective inversion)
[in]invdesignKS_SELRF_DESIGN struct with desired inversion characteristics
Return values
STATUSSUCCESS or FAILURE
450  {
451  STATUS status;
452  float rfstretchfactor = 1.0;
453 
454  /* clear RF pulse */
455  ks_init_selrf(selrfinv);
456 
457  if (invdesign.description == NULL || strlen(invdesign.description) == 0) {
458  return KS_THROW("empty description");
459  }
460 
461  switch (invdesign.rfpulse_choice) {
462  case INV_STD:
463  selrfinv->rf = inv_invI0;
464  break;
465  case INV_ADIABATIC:
466  selrfinv->rf = adinv_shNvrg5b;
467  break;
468  case INV_LOWSAR:
469  selrfinv->rf = ref_fse160n; /* take a refocusing RF pulse ... */
470  selrfinv->rf.role = KS_RF_ROLE_INV; /* ...and make it act as an inversion pulse */
471  break;
472  case INV_CUSTOM:
473  if (invdesign.customrf == NULL) {
474  return KS_THROW("Missing pointer to custom RF pulse");
475  }
476  selrfinv->rf = *invdesign.customrf;
477  selrfinv->rf.role = KS_RF_ROLE_INV;
478  if (invdesign.customgrad != NULL) {
479  selrfinv->gradwave = *(invdesign.customgrad);
480  }
481  break;
482  default:
483  return KS_THROW("KS_SELRF_DESIGN field rfpulse_choice out of range");
484  } /* switch */
485 
486  selrfinv->rf.flip = invdesign.flip;
487  selrfinv->slthick = invdesign.slthick / invdesign.gscale;
488  selrfinv->pregrad_area_offset = invdesign.pregrad_area_offset;
489  selrfinv->postgrad_area_offset = invdesign.postgrad_area_offset;
490 
491  /* RF pulse stretching */
492  if (invdesign.rfpulse_choice != INV_ADIABATIC) {
493  rfstretchfactor *= invdesign.rfstretch;
494  status = ks_eval_stretch_rf(&selrfinv->rf, rfstretchfactor);
495  KS_RAISE(status);
496  }
497 
498  status = ks_eval_selrf1(selrfinv, invdesign.description);
499  KS_RAISE(status);
500 
501  if (invdesign.sms_factor > 1) {
502 
503  status = ks_eval_sms_make_multiband(selrfinv,
504  selrfinv,
505  invdesign.sms_factor,
506  invdesign.sms_phase_modulation_mode,
507  invdesign.sms_slice_gap, 0);
508  KS_RAISE(status);
509  }
510 
511  return SUCCESS;
512 
513 } /* ks_eval_design_selrfinv() */
STATUS ks_eval_selrf1(KS_SELRF *selrf, const char *const desc) WARN_UNUSED_RESULT
Sets up a KS_SELRF object for RF slice selection with preset gradient constraints
Definition: KSFoundation_host.c:3330
const KS_RF * customrf
Definition: ksdesign.h:62
float pregrad_area_offset
Definition: KSFoundation.h:1459
int role
Definition: KSFoundation.h:1027
KS_ENUM_SMS_PHASE_MOD sms_phase_modulation_mode
Definition: ksdesign.h:61
float pregrad_area_offset
Definition: ksdesign.h:56
KS_WAVE gradwave
Definition: KSFoundation.h:1465
Definition: ksdesign.h:31
float rfstretch
Definition: ksdesign.h:53
Definition: KSFoundation.h:2340
Definition: ksdesign.h:31
float gscale
Definition: ksdesign.h:52
float flip
Definition: KSFoundation.h:1028
float flip
Definition: ksdesign.h:51
int sms_factor
Definition: ksdesign.h:59
float postgrad_area_offset
Definition: KSFoundation.h:1460
DECL_TYPE KS_RF ref_fse160n
Definition: KSFoundation_GERF.c:1621
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
Creates a SMS (simultaneous-multi-slice) version of a KS_SELRF object
Definition: KSFoundation_host.c:3470
float postgrad_area_offset
Definition: ksdesign.h:57
KS_RF rf
Definition: KSFoundation.h:1454
int rfpulse_choice
Definition: ksdesign.h:58
DECL_TYPE KS_RF adinv_shNvrg5b
Definition: KSFoundation_GERF.c:1867
Definition: ksdesign.h:31
void ks_init_selrf(KS_SELRF *selrf)
Resets a KS_SELRF sequence object to its default value (KS_INIT_SELRF)
Definition: KSFoundation_host.c:102
Definition: ksdesign.h:31
#define KS_RAISE(status)
Definition: KSFoundation.h:190
DECL_TYPE KS_RF inv_invI0
Definition: KSFoundation_GERF.c:2039
const KS_WAVE * customgrad
Definition: ksdesign.h:63
float sms_slice_gap
Definition: ksdesign.h:60
KS_DESCRIPTION description
Definition: ksdesign.h:49
#define KS_THROW(format,...)
Definition: KSFoundation.h:181
STATUS ks_eval_stretch_rf(KS_RF *rf, float stretch_factor)
In-place stretching of a KS_RF object
Definition: KSFoundation_host.c:3928
float slthick
Definition: ksdesign.h:50
float slthick
Definition: KSFoundation.h:1456

◆ ks_print_kdesign()

void ks_print_kdesign ( const KS_KSPACE_DESIGN *const  kdesign,
const char *  suffix,
int  rhkacq_uid 
)

Function printing out a KS_KSPACE_DESIGN struct to disk

File is being written to:

  • /usr/g/mrraw/kstmp/<rhkacq_uid>/embed/kdesign_<suffix>.bin (on MR scanner)
  • ./kdesign_<suffix>.bin (in simulation)
Parameters
[in]kdesignPointer to KS_KSPACE_DESIGN
[in]suffixFilename suffix (char array)
[in]rhkacq_uidGE's global CV with the same name as input argument to uniquely identify scan instances
Returns
void
518  {
519 
520  char filename[512];
521 #ifdef PSD_HW /* on MR-scanner (host) */
522  char outputdir_uid[512];
523  char cmd[512];
524  sprintf(outputdir_uid, "/usr/g/mrraw/kstmp/%010d/embed/", rhkacq_uid);
525  sprintf(filename, "%s/kdesign_%s.bin", outputdir_uid, suffix);
526  sprintf(cmd, "mkdir -p %s > /dev/null", outputdir_uid);
527  system(cmd);
528 #else /* e.g. WTools */
529  sprintf(filename, "./kdesign_%s.bin", suffix);
530 #endif
531  FILE* fp = fopen(filename, "wb");
532  fwrite(kdesign, sizeof(KS_KSPACE_DESIGN), 1, fp);
533  fflush(fp);
534  fclose(fp);
535 
536 } /* ks_print_kdesign() */
int rhkacq_uid
Input design for how to set up data acquistion (FOV, matrix size, parallel imaging, rBW etc)This struct is used by e.g. ks_eval_design_readtrap(), ksepi_eval_kdesign2epitrain(), ksfse_eval_numlines2acq() and is a part of all sequence generator&#39;s design structs (KSEPI_MODULE->KSEPI_DESIGN, KSFSE_MODULE->KSFSE_DESIGN, KSGRE_MODULE->KSGRE_DESIGN)
Definition: ksdesign.h:76