param_constants.py 4.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164
  1. # -*- coding: utf-8 -*-
  2. """
  3. Created on Mon Mar 18 11:38:59 2024
  4. @author: zilya
  5. """
  6. from types import SimpleNamespace
  7. from math import ceil
  8. def param_hardware():
  9. hardware = SimpleNamespace()
  10. hardware.gamma = 42.576e6 # Hz/T Гиромагнитное отношение водорода
  11. G_amp_max = 37.8 # mT/m. Максимальный градиент
  12. hardware.G_amp_max = G_amp_max*1e-3*hardware.gamma # Hz/m. Максимальный градиент
  13. G_slew_max = 121 # T/m/s. Максимальная скорость нарастания
  14. hardware.G_slew_max = G_slew_max*hardware.gamma # Hz/m/s. Максимальная скорость нарастания
  15. hardware.rf_raster_time = 1e-6 # s. Растр РЧ импульса
  16. hardware.grad_raster_time = 10e-6 # s. Растр градиентов
  17. tau_max = hardware.G_amp_max/hardware.G_slew_max # s. Максимальное время нарастания градиента с учетом макс скорости нарастания
  18. print(tau_max)
  19. hardware.tau_max = ceil(tau_max/ hardware.grad_raster_time)*hardware.grad_raster_time
  20. hardware.B0 = 1.5
  21. hardware.rf_ringdown_time=20e-6
  22. hardware.rf_dead_time=100e-6
  23. hardware.adc_dead_time=10e-6
  24. return hardware
  25. def param_rf_SE(sl_thkn):
  26. gamma = 42.576e6
  27. G_amp_max = 37.8
  28. G_amp_max = G_amp_max*1e-3*gamma
  29. rf_SE = SimpleNamespace()
  30. rf_SE.t_BW_product_ex1 = 3.8
  31. rf_SE.t_BW_product_ref1 = 4.2
  32. rf_SE.t_BW_product_ex2 = 3.55
  33. rf_SE.t_BW_product_ref2 = 3.55
  34. rf_SE.t_ex1 = 2.05e-3
  35. rf_SE.t_ref1 = 2.56e-3
  36. rf_SE.t_ex2 = 3.10e-3
  37. rf_SE.t_ref2 = 3.88e-3
  38. if sl_thkn > rf_SE.t_BW_product_ex1/(rf_SE.t_ex1*G_amp_max):
  39. rf_SE.t_BW_product_ex = rf_SE.t_BW_product_ex1
  40. rf_SE.t_BW_product_ref = rf_SE.t_BW_product_ref1
  41. else:
  42. rf_SE.t_BW_product_ex = rf_SE.t_BW_product_ex2
  43. rf_SE.t_BW_product_ref = rf_SE.t_BW_product_ref2
  44. if sl_thkn > rf_SE.t_BW_product_ex2/(rf_SE.t_ex1*G_amp_max):
  45. rf_SE.t_ex = rf_SE.t_ex1
  46. rf_SE.t_ref = rf_SE.t_ref1
  47. else:
  48. rf_SE.t_ex = rf_SE.t_ex2
  49. rf_SE.t_ref = rf_SE.t_ref2
  50. rf_SE.apodization = 0.27
  51. return rf_SE
  52. def param_rf_HASTE(sl_thkn):
  53. gamma = 42.576e6
  54. G_amp_max = 37.8
  55. G_amp_max = G_amp_max*1e-3*gamma
  56. rf_HASTE = SimpleNamespace()
  57. t_BW_product_ex = 3.55
  58. t_BW_product_ref = 3.55
  59. t_ex1 = 1.02e-3
  60. t_ref1 = 1.28e-3
  61. t_ex2 = 1.28e-3
  62. t_ref2 = 1.79e-3
  63. if sl_thkn > t_BW_product_ex/(t_ex1*G_amp_max):
  64. rf_HASTE.t_ex = t_ex1
  65. rf_HASTE.t_ref = t_ref1
  66. else:
  67. rf_HASTE.t_ex = t_ex2
  68. rf_HASTE.t_ref = t_ref2
  69. rf_HASTE.t_BW_product_ex = t_BW_product_ex
  70. rf_HASTE.t_BW_product_ref = t_BW_product_ref
  71. rf_HASTE.apodization = 0.27
  72. return rf_HASTE
  73. def param_rf_GRE():
  74. rf_GRE = SimpleNamespace()
  75. rf_GRE.t_ex = 0.510e-3
  76. rf_GRE.t_BW_product_ex = 2.13
  77. rf_GRE.apodization = 0.3
  78. return rf_GRE
  79. def param_rf_FS():
  80. rf_FS = SimpleNamespace()
  81. rf_FS.ppm_fat = -3.45
  82. rf_FS.t_sat = 10e-3
  83. rf_FS.flip_angle_FS = 90
  84. return rf_FS
  85. def param_rf_inv():
  86. rf_inv = SimpleNamespace()
  87. rf_inv.t_inv = 2.56e-3
  88. rf_inv.t_BW_product_inv = 4.2
  89. rf_inv.inv_flip_angle = 180
  90. return rf_inv
  91. def param_rf_sat():
  92. rf_sat = SimpleNamespace()
  93. rf_sat.t_sat = 0.510e-3
  94. rf_sat.t_BW_product_sat = 2.13
  95. rf_sat.sat_flip_angle = 90
  96. return rf_sat
  97. def param_default():
  98. default = SimpleNamespace()
  99. default.sl_nb = 1
  100. default.sl_thkn = 10e-3
  101. default.sl_gap = 100
  102. default.slab_thkn = 100e-3
  103. default.FoV_f = 250e-3
  104. default.FoV_p_image = 250e-3
  105. default.Nf = 128
  106. default.Np_image = 128
  107. default.Nss = 128
  108. default.BW_pixel = 500
  109. default.TE = 50e-3
  110. default.N_TE = 1
  111. default.IE = 10e-3
  112. default.ETL = 8
  113. default.contrasts = 2
  114. default.concats = 1
  115. default.TR = 1000e-3
  116. default.TD = 0
  117. default.alpha = 90
  118. default.beta = 180
  119. default.spoil_strenght = 4
  120. default.RF_spoil = 117
  121. default.average = 1
  122. default.D_scans = 10
  123. default.ph_over_phase = 0
  124. default.ph_over_slice = 0
  125. default.TI = 200e-3
  126. default.N_TI = 1
  127. default.b = 1000
  128. return default