-
Notifications
You must be signed in to change notification settings - Fork 12
Open
Description
After inspecting in detail the combine_slices code, I found some optimization possibilities:
_sort_by_slice_positionis called twice:
First in the voxels (_merge_slice_pixel_arrays),
Second in the affine (_ijk_to_patient_xyz_transform_matrix).
Obviously, it can be done once in the outercombine_slicesfunction._slice_positionsis called 4 times:
_validate_slices_form_uniform_grid- 1 time
_slice_spacing- 1 time
_sort_by_slice_position- 1 time, but_sort_by_slice_positionis called twice --> 2 times_extract_cosinesis called 6 times:
_validate_image_orientation- 1 time
_ijk_to_patient_xyz_transform_matrix- 1 time
_slice_positions- 1 time, but_slice_positionsis called 4 times --> 4 times
All these calls better be done once (and can be).
However,
- this may incorporate substantial redesign of the code,
- it will change the functionality of
_merge_slice_pixel_arraysand_ijk_to_patient_xyz_transform_matrix, which should not be used alone, but there are some special tests for_merge_slice_pixel_arrays.
Originally posted by @jond01 in #16 (comment)
Metadata
Metadata
Assignees
Labels
No labels