Tags: innolitics/dicom-numpy
Tags
Allow bypassing the sort logic for custom slice sorting (#36) * Allow bypassing the sort logic for custom slice sorting For some image series types, such as diffusion-weighted MRI, multiple scans over the same body region may be performed within a single series. Depending on the technique and scanner, the instance numbers may not be enough to separate out the slices from the different scans over the body. In this case, an option has been added to `combine_slices` that allows the user to bypass the sorting logic and perform their own sorting prior to passing the slices in. * Add test case for skipping slice sorting in combine_slices * Bump version for patch release
Use instance number sorting by default when sorting datasets (#33) This PR adds an option to the sorting order of slices in a volume to use instance number rather than image position. ## Motivation For datasets which have multiple series included without any differentiating attribute such as acquisition number, the generated image transformation was incorrect. This is because sorting by slice position causes every slice at the same location to be located sequentially, producing a median slice diff of zero. This was specifically seen with some diffusion MRI datasets in TCIA, such as patient HF1458. Sorting by slice number enables the proper order for these combined series. ## Backwards Compatibility The instance number sorting is currently off by default and requires a kwarg flag to be set. However, if this is the best practice way to do things, we may want to emit a DeprecationWarning or something similar and then move to using instance numbers by default, rather than slice position. ## Commits * Use instance number sorting by default when sorting datasets For datasets which have multiple series included without any differentiating attribute such as acquisition number, the generated image transformation was incorrect. This is because sorting by slice position causes every slice at the same location to be located sequentially, producing a median slice diff of zero. This was specifically seen with some diffusion MRI datasets in TCIA, such as patient HF1458. Defaulting slice sorting to instance number enables the proper order for these combined series. If instance number is unavailable, we fall back to the old slice position-based logic for sorting. * Sort series before other operations and make instance sorting optional * Add more tests covering instance sorting and error conditions * Bump patch version for instance number sorting * Add missing notes to changelog * Add missing module-level exports