-
Notifications
You must be signed in to change notification settings - Fork 12
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ACR slice ordering #409
ACR slice ordering #409
Conversation
|
all tests are failing as these haven't been updated to use the new functions yet |
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. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@sophie22 – I think this is fine. Bit tricky to tell the extent of the changes, but if the tests are passing, then that's okay.
One comment about the phantom_orientation function. Ultimately, the user should configure the phantom in an orientation compliant with the guidelines, but if this helps iron out some issues, then go ahead.
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.