GSTT-CSC / hazen

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

374 standardise task input and output #375

Closed sophie22 closed 1 year ago

sophie22 commented 1 year ago

HazenTask class objects to be initialised with a list of file paths to DICOM images (input_data: list), which are then used directly in tasks that process multiple images at once, or a single_dcm attribute is being created for tasks that process a single image at a time.

The result dictionary now has a standardised structure, consisting of the following elements:

results_dict = {
    "task": "task_name",
    "file": "DCM description or list of descriptions",
    "measurement": {dict of key value pairs},
    "report_image": [OPTIONAL list of paths to report images]
}

Furthermore, the values displayed in the result dictionary are being rounded to the appropriate precision and units are displayed in the key.

!!!CHANGE to OUTPUT!!! The Slice position task now returns only the maximum and average of slice positions, rather than a list of 40 values as previously.

Behind the scene changes for processing the ACR images and slight improvements to the slice_width and snr_map task scripts.

resolves #374

github-actions[bot] commented 1 year ago

Coverage

Coverage Report
FileStmtsMissCoverMissing
hazenlib
   ACRObject.py1061190%72, 75–77, 82–85, 123, 166–167
   HazenTask.py29390%41–43
   __init__.py571574%153, 183–185, 188–190, 202–204, 218–222, 226
   exceptions.py21576%17–21, 38
   utils.py1894377%61, 65, 75, 80, 117, 124–129, 140, 143–150, 170–172, 190–192, 211–213, 222, 227, 233, 284, 287, 295–300, 303, 346, 355, 371
hazenlib/tasks
   acr_geometric_accuracy.py1196347%41–86, 96–121, 134–168
   acr_ghosting.py1084459%34–54, 80–82, 112–114, 148–190
   acr_slice_position.py1364964%46–68, 194–241
   acr_slice_thickness.py1366155%34–54, 163–225
   acr_snr.py1326154%41–84, 94, 164–174, 208–223, 256–273
   acr_spatial_resolution.py2066967%58–86, 131, 174, 187–196, 278–330
   acr_uniformity.py823459%35–57, 113–139
   ghosting.py1515166%19–36, 51, 113–114, 118, 128–129, 155–157, 174–176, 222–259
   relaxometry.py2918969%207–208, 210, 221–224, 230–236, 268–312, 353, 387–405, 580, 626–628, 695, 769–791, 809–824
   slice_position.py1183669%27–53, 105–106, 132, 212, 220–238
   slice_width.py3525285%36–38, 42, 107, 166–187, 441, 446–447, 453, 458, 516–517, 767–809
   snr.py1666760%58, 75–80, 176–194, 209–218, 236–246, 273–283, 288–298, 329–343, 348–356, 385–399
   snr_map.py108199%152
   spatial_resolution.py2494482%41–43, 47, 68, 153, 212, 338–375
   uniformity.py791976%47–49, 53, 95–96, 103, 137–152
TOTAL286081771% 

Tests Skipped Failures Errors Time
201 0 :zzz: 0 :x: 0 :fire: 3m 51s :stopwatch:
sophie22 commented 1 year ago

Stage 1: standardise input for task.run() function - complete and tests have been adapted

sophie22 commented 1 year ago

Stage 2: round measurement results to decimal points agreed with the physicists - complete, tests have been adapted

sophie22 commented 1 year ago

Stage 3: standardise structure of output dictionary to be like:

results = {
    "task": "task_name",
    "file": "DCM description or list of descriptions",
    "measurement": {dict of key value pairs},
    "report_image": [list of paths to report images]
}
sophie22 commented 1 year ago

task_results.txt ^updated output results, including changes to SNR task results

@YassineAzma @elizaGSTT if you have time and capacity, please check that the wording, units and precision is sensible in all task outputs.

sophie22 commented 1 year ago

HazenTask objects expect a dcm_list input, single_dcm attribute is created in relevant task classes