virtualscanner.server.ana

Analyze page: run T1 and T2 mapping and ROI analysis

ROI_analysis.py

circle_analysis(circles, map_size)

Return locations of pixels inside a circle.

Parameters
  • circles (numpy.ndarray) – 1x3 matrix (center_x, center_y, radius)

  • map_size (int) – size of parameter map, for example, 256 means the size of map is 256x256

Returns

sphere_map – Binary map where pixels inside the circle is true and outside of the circle is false

Return type

numpy.ndarray

main(dicom_map_path: str, map_type: str, map_size: str, fov: str, pat_id: str)

Return ROI analysis of a ISMRM/NIST phantom, all 14 spheres are detected.

Parameters
  • dicom_map_path (path) – Path of folder where dicom files reside

  • map_type (str) – Type of map (T1 or T2)

  • map_size (str) – Size of map, for example, 128 means the size of map is 128x128

  • fov (str) – Field of view used in experiments

  • pat_id (str) – Primary key in REGISTRATION table

Returns

  • centers (numpy.ndarray) – Centers and radii for all spheres in sphere number order

  • sphere_mean (numpy.ndarray) – Mean values for all spheres in sphere number order

  • sphere_std (numpy.ndarray) – Std for all spheres in sphere number order

T1_mapping.py

T1_sig_eq(X, a, b, c)

Generate an exponential function for curve fitting.

Parameters
  • X (float) – Independent variable

  • a (float) – Curve fitting parameters

  • b (float) – Curve fitting parameters

  • c (float) – Curve fitting parameters

Returns

Exponential function used for T1 curve fitting

Return type

float

main(dicom_file_path: str, TR: str, TE: str, TI: str, pat_id: str)

Curve fitting a series of IRSE images with respect to variable TI values to generate a T1 map.

Parameters
  • dicom_file_path (path) – Path of folder where dicom files reside

  • TR (str) – TR value used in IRSE experiments (unit in milliseconds, should be constant)

  • TI (str) – TI values used in IRSE experiments (unit in milliseconds)

  • TE (str) – TE value used in IRSE experiments (unit in milliseconds, should be constant)

  • pat_id (str) – Primary key in REGISTRATION table

Returns

  • png_map_name (str) – file name of T1_map in png format

  • dicom_map_path (str) – path of T1_map in dicom format

T2_mapping.py

T2_sig_eq(X, a, b, c)

Generate an exponential function for curve fitting.

Parameters
  • X (float) – Independent variable

  • a (float) – Curve fitting parameters

  • b (float) – Curve fitting parameters

  • c (float) – Curve fitting parameters

Returns

Exponential function used for T2 curve fitting

Return type

float

main(dicom_file_path: str, TR: str, TE: str, pat_id: str)

Curve fitting a series of SE images with respect to variable TE values to generate a T2 map.

Parameters
  • dicom_file_path (path) – Path of folder where dicom files reside

  • TR (str) – TR value used in SE experiments (unit in milliseconds, should be constant)

  • TE (str) – TE value used in SE experiments (unit in milliseconds)

  • pat_id (str) – primary key in REGISTRATION table

Returns

  • png_map_name (str) – File name of T2 map in png format

  • dicom_map_path (str) – Path of T2 map in dicom format

utest_ROI_analysis_T1_T2.py

class MyTestCase(methodName='runTest')

Bases: unittest.case.TestCase

test_T1_ROI_analysis()

Unit test ROI analysis of T1 map.

test_T2_ROI_analysis()

Unit test ROI analysis of T2 map.

utest_T1_T2_mapping.py

class MyTestCase(methodName='runTest')

Bases: unittest.case.TestCase

test_T1_mapping()

Unit test T1 mapping from IRSE experiments with 7 different TI values.

test_T2_mapping()

Unit test T2 mapping from SE experiments with 7 different TE values.