virtualscanner.server.rf.tx.SAR_calc

Calculate Specific Absorption Rate (SAR) from a Pulseq sequence

SAR_calc_main.py

  1. This script computes the global head and body Specific Absoprtion Rate (SAR) values based on the Visible HUman Male model

  2. This assumes an eight channel multi-transmit system with a scaled B1+

  3. IEC checks on SAR resulting from a given sequence file

param fname

Requires coms_server_flask to be running before the unit test is run (i.e.: run coms_server_flask.py first)

type fname

str

returns

payload

  • Contains the Q-matrix, GSAR head and body for now

  • Will include local SAR based on discussions related to ongoing project

rtype

dict

SARfromseq(fname, Qtmf, Qhmf)

This definition computes the global whole body and head only SAR values

Parameters
  • fname (str) –

  • Qtmf (numpy.ndarray) –

  • Qhmf (numpy.ndarray) –

Returns

  • SARwbg_vec (numpy.ndarray)

  • SARhg_vec (numpy.ndarray)

  • t_vec (numpy.ndarray) – contains the Q-matrix, GSAR head and body for now

SARinterp(SAR, t)

This definition interpolates the SAR values for one second resolution

Parameters
  • SAR (numpy.ndarray) –

  • t (numpy.ndarray) –

Returns

  • SARinterp (numpy.ndarray)

  • tsec (numpy.ndarray) – Interpolated values of SAR for a temporal resolution of 1 second

SARlimscheck(SARwbg_lim_s, SARhg_lim_s, tsec)

This definition checks for SAR violations as compared to IEC 10 second and 6 minute averages; it returns SAR values that are interpolated for the fixed IEC time intervals.

Parameters
  • SARwbg_lim_s (numpy.ndarray) –

  • SARhg_lim_s (numpy.ndarray) –

  • tsec (numpy.ndarray) –

Returns

  • SAR_wbg_tensec (numpy.ndarray)

  • SAR_wbg_sixmin (numpy.ndarray)

  • SAR_hg_tensec (numpy.ndarray)

  • SAR_hg_sixmin (numpy.ndarray)

  • SAR_wbg_sixmin_peak (numpy.ndarray)

  • SAR_hg_sixmin_peak (numpy.ndarray)

  • SAR_wbg_tensec_peak (numpy.ndarray)

  • SAR_hg_tensec_peak (numpy.ndarray)

calc_SAR(Q, I)

This definition computes the SAR output for a given Q matrix and I current values

Parameters
  • Q (numpy.ndarray) –

  • I (numpy.ndarray) –

Returns

SAR – contains the SAR value for a particular Q matrix

Return type

numpy.ndarray

do_sw_sar(SAR, tsec, t)

This definition computes a sliding window average of SAR values

Parameters
  • SAR (numpy.ndarray) –

  • tsec (numpy.ndarray) –

  • t (numpy.ndarray) –

Returns

SAR_timeavag – Sliding window time average of SAR values

Return type

numpy.ndarray

loadQ()

This definition loads the Q matrix that is precomputed based on the VHM model for 8 channels

Returns

Qtmf, Qhmf – Contains the Q-matrix, GSAR head and body for now

Return type

numpy.ndarray

payload_process(fname='rad2D.seq')

This definition processes the seq file to compute Global SAR values for head and whole body over the specified time averages

Parameters

fname (str, optional) – Default is rad2.seq

Returns

payload – SAR graph figure filename, peak SAR values

Return type

dict

utest_SAR_calc.py

This script unit tests the SAR calculation

param .seq

Default is ‘rad2D.seq’

type .seq

str, optional

returns

status – 0: tests passed 1: fail

rtype

int