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

ACR slice ordering #409

Closed sophie22 closed 8 months ago

sophie22 commented 9 months ago

This PR includes important changes to how the ACR phantom image slices are being processed prior to specific task measurements.

An instance of the ACRObject class now has the following attributes:

The following methods are available for ACRobjects:

Other important changes:

In task-specific classes, the phantom centre is now being calculated based on the specific slice, not taken from the flood field slice as previously. Resolution is now being used from the ACRObject dx, dy attributes rather than being accessed from the DICOM header values. determine_orientation and detect_circle are new functions moved to the utilities to make them more widely reusable. scipy version was updated to make use of a predefined function rather than specifying our own. Unit tests were simplified for ACR tasks and new tests were added for ACRObject for a more comprehensive coverage of this class. Some test values had to be updated to account for different rounding methods, but all are within tolerance as per ACR guidelines.

github-actions[bot] commented 9 months ago

Coverage

Coverage Report
FileStmtsMissCoverMissing
hazenlib
   ACRObject.py1071091%77–83, 119, 134–137, 191–194
   HazenTask.py28389%67–71
   __init__.py561573%102, 135–144, 146–155, 157–159, 176–180, 184
   exceptions.py21576%19–23, 42
   utils.py2225973%77, 81, 102, 115, 148, 163–176, 195, 202–209, 226–228, 243–247, 263–267, 287, 292, 303, 375–376, 378–379, 384–397, 450, 453, 461–466, 469, 524, 533, 562
hazenlib/tasks
   acr_geometric_accuracy.py1115848%53–100, 124–239
   acr_ghosting.py1064260%42–58, 104–107, 154–157, 201–283
   acr_slice_position.py1364865%56–80, 281–348
   acr_slice_thickness.py1356056%45–64, 235–319
   acr_snr.py1325757%60–111, 131, 227–242, 287–305, 355–380
   acr_spatial_resolution.py2066867%70–100, 187, 285, 302–313, 460–539
   acr_uniformity.py803260%43–60, 150–202
   ghosting.py1495166%28–47, 67, 171–172, 179, 196–197, 252–256, 271–275, 346–387
   relaxometry.py2908969%210–211, 213, 226–231, 238–246, 277–326, 375, 409–431, 609, 655–659, 726, 811–833, 851–866
   slice_position.py1244068%30, 43–71, 129–130, 157, 273, 283–306
   slice_width.py3515385%44–48, 52, 123, 188–213, 383, 555, 560–561, 567, 572, 648–649, 1020–1084
   snr.py1736960%45–48, 87, 103–113, 206–225, 237–247, 287–302, 330–340, 345–361, 399–415, 428–434, 477–495
   snr_map.py107199%159
   spatial_resolution.py2464582%50–54, 58, 90, 191, 213, 294, 460–503
   uniformity.py801976%59–63, 67, 118–119, 126, 175–205
TOTAL288582471% 

Tests Skipped Failures Errors Time
208 0 :zzz: 0 :x: 0 :fire: 2m 20s :stopwatch:
sophie22 commented 9 months ago
sophie22 commented 9 months ago

all tests are failing as these haven't been updated to use the new functions yet

sophie22 commented 9 months ago

Need to update a couple of measurement values - will be checked by @mollybuckley on 14 Feb, 2024.

Screenshot 2024-02-13 at 16 43 25

sophie22 commented 9 months ago

test_ACRObject is missing the test datasets currently

sophie22 commented 9 months ago

expected values were updated following discussion with Molly, having concluded that differences are due to rounding and are well within the tolerances for their respective measurement as per ACR guidelines.