Closed YassineAzma closed 1 year ago
Coverage Report
Tests | Skipped | Failures | Errors | Time |
---|---|---|---|---|
201 | 0 :zzz: | 0 :x: | 0 :fire: | 3m 20s :stopwatch: |
Just to add to this, you've written a fair amount of documentation in the files, which is great. When we come to fully uplifting the hazen ReadTheDocs, we'll definitely need your input on making the guidance as clear as possible. Thanks.
This PR introduces the ACRTools class in acr_tools.py, which contains a number of useful functions that are frequently used throughout the ACR analysis scripts.
sort_images = DICOM and image sorting via the image position
determine_rotation = Estimate the rotation angle of the phantom using the Hough circle detector
rotate_images = Rotates the images by the rotation angle
mask_image = Thresholds the image - if the intensity variation in the image is sufficiently large, local thresholding methods are used rather than a global intensity threshold.
find_phantom_center = Now decoupled from the masking routine. The image is blurred and the edges are then sharpened along the diagonal. The Hough circle detector is then used to identify the phantom using prior knowledge of its geometry.
circular_mask = Draw a circular mask
measure_orthogonal_lengths = Measure the horizontal and vertical extent of the mask.
rotate_point = Find x' and y' for a point rotated around a given centre by a given angle.
find_n_highest_peaks = Given an array, report the location and intensity of the highest peaks.
Along with other general improvements, these functions have been used to refactor the existing ACR functions. This will prevent unneeded repetition in the unit tests for the individual analysis scripts by grouping tests for reused functions in the acr_tools.py module.
NOTE: All ACR test outputs have changed by <2% owing to changes in the masking and centre definition methods. These changes should make them more robust to issues seen in Issues #333 and #332.
Pending: Complete unit tests for acr_tools module.
Resolves #333, #332