Skip to content

Commit

Permalink
fixed duplicate associated file paths
Browse files Browse the repository at this point in the history
  • Loading branch information
tclose committed Feb 14, 2024
1 parent 04bfbb6 commit 53a5102
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions xnat_ingest/session.py
Original file line number Diff line number Diff line change
Expand Up @@ -531,11 +531,11 @@ def stage(
# substitute string templates int the glob template with values from the
# DICOM metadata to construct a glob pattern to select files associated
# with current session
associated_fspaths = []
associated_fspaths = set()
for dicom_dir in self.dicom_dirs:
assoc_glob = dicom_dir / associated_files.glob.format(**self.metadata)
# Select files using the constructed glob pattern
associated_fspaths.extend(Path(p) for p in glob(str(assoc_glob)))
associated_fspaths.update(Path(p) for p in glob(str(assoc_glob)))

logger.info(
"Found %s associated file paths matching '%s'",
Expand Down

0 comments on commit 53a5102

Please sign in to comment.