Skip to content

Allow group_by and sort_by to take a list of tags #133

@sluijs

Description

@sluijs

For some DICOM datasets I would like to order the slices based on multiple tags. For example, in a dataset with a TemporalPositionIdentifier present, I would like to sort by ImagePositionPatient first, and then using the position identifier. The same applies to group_by too.

Preferably, it would be nice to add support for ascending/descending sorts for each tag too:

# single tag
dm.read(path, sort_by="InstanceNumber")

# multiple tags
dm.read(path, sort_by=["ImagePositionPatient", "TemporalPositionIdentifier"])

# multiple tags + order
dm.read(path, sort_by=[{ "tag": "ImagePositionPatient", "asc": True }, { "tag": "TemporalPositionIdentifier", "asc": False }])

NB: maybe we should consider to set the default sort_by to ImagePositionPatient.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions