GSTT-CSC / hazen

Quality assurance framework for Magnetic Resonance Imaging
https://github.com/GSTT-CSC/hazen
Apache License 2.0
20 stars 9 forks source link

[HZN-34] Spatial Resolution: Error when using large FOV #34

Closed laurencejackson closed 1 year ago

laurencejackson commented 3 years ago

Transferred by @LaurenceJackson on Aug 9, 2020, 18:23

:::Issue recreated from Jira issue HZN-34:::

Imported from https://bitbucket.org/gsttmri/hazen/issues/35/spatial-resolution-error-when-using-large When FOV > 270, receive value error (copied below). Is this fixable? Also noted that at FOV = 270, the FE and PE resolutions are identical so may be a breakdown in the ROI method?Images for this query is here: https://emckclac-my.sharepoint.com/:f:/r/personal/stra9543_kcl_ac_uk/Documents/shared_physics-mri/quality/qa/BMI_Cavell_15T_GE_Optima450w/Annual_QA_Feb2020/Images/Spatial_Resolution?csf=1&e=ej5ZlVError:Could not calculate the spatial resolution for Cor_Res_280FOV_13_1 because of : could not broadcast input array from shape (20,20) into shape (20)Traceback (most recent call last):  File "/Users/Ansell/hazen-venv/lib/python3.7/site-packages/hazen-0.1.6-py3.7.egg/hazenlib/spatial_resolution.py", line 496, in main    results[key] = calculate_mtf(dcm, report_path)  File "/Users/Ansell/hazen-venv/lib/python3.7/site-packages/hazen-0.1.6-py3.7.egg/hazenlib/spatial_resolution.py", line 479, in calculate_mtf    pe_result = calculate_mtf_for_edge(dicom, 'right', report_path)  File "/Users/Ansell/hazen-venv/lib/python3.7/site-packages/hazen-0.1.6-py3.7.egg/hazenlib/spatial_resolution.py", line 421, in calculate_mtf_for_edge    mean = np.mean([void_arr, signal_arr])  File "<__array_function__ internals>", line 6, in mean  File "/Users/Ansell/hazen-venv/lib/python3.7/site-packages/numpy/core/fromnumeric.py", line 3257, in mean    out=out, **kwargs)  File "/Users/Ansell/hazen-venv/lib/python3.7/site-packages/numpy/core/_methods.py", line 135, in _mean    arr = asanyarray(a)  File "/Users/Ansell/hazen-venv/lib/python3.7/site-packages/numpy/core/_asarray.py", line 138, in asanyarray    return array(a, dtype, copy=False, order=order, subok=True)ValueError: could not broadcast input array from shape (20,20) into shape (20)‌‌Results at FOV = 270 'Cor_Res_270FOV_12_1': {   'frequency_encoding_direction': 1.0681928633360207,                               'phase_encoding_direction': 1.0681928633360205},

laurencejackson commented 1 year ago

Stale issue, closing for now. Please comment if further work is required.