Closed sophie22 closed 8 months ago
Coverage Report
Tests | Skipped | Failures | Errors | Time |
---|---|---|---|---|
208 | 0 :zzz: | 0 :x: | 0 :fire: | 2m 20s :stopwatch: |
all tests are failing as these haven't been updated to use the new functions yet
Need to update a couple of measurement values - will be checked by @mollybuckley on 14 Feb, 2024.
test_ACRObject is missing the test datasets currently
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.
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:
dx
anddy
corresponding to the PixelSpacing values from the DICOM header (in x and y directions)slice_stack
is a list of the input DICOMs, ordered by position (from ImageOrientationPatient) and ordered by phantom orientation (see below)The following methods are available for ACRobjects:
sort_dcms
: orders DICOMs based on the changing coordinate according to acquisition orientationorder_phantom_slices
: orders DICOMs based on phantom orientation - first slice is expected to have a circle while the last one is expected not to have onefind_phantom_centre
: locate the coordinates of the phantom (circle) in the image and also return its radiusget_mask_image
: pixel array with values above given threshold from input imagecircular_mask
: list of coordinate matrices from coordinate vectors with given centre and radiusdetermine_rotation
: determines rotation angle of phantom imagesrotate_images
: rotate the pixel array of all phantom slices by a defined anglemeasure_orthogonal_lengths
andfind_n_highest_peaks
are specific to task measurementsOther 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
anddetect_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.