Skip to content

Filter only ".dcm" files when reading DICOM series #6627

@function2-llx

Description

@function2-llx

Is your feature request related to a problem? Please describe.
When I try to load a DICOM folder, the loading will fail if there is some irrelevant file in the folder (or I have to set force=True). E.g., when I load the DICOM series from the LIDC-IDRI database, there's a .xml annotation file in the folder, the loader will try to load it as well and cause failure.

Describe the solution you'd like
Change this line

series_slcs = glob.glob(os.path.join(name, "*"))

to something like

series_slcs = Path(name).glob("*.dcm")

I'm not sure if there are other suffixes to be considered.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions