Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[DAR-4788][External] Allow download of frames extracted from videos & multi-slotted items #972

Merged
merged 2 commits into from
Nov 21, 2024

Conversation

JBWilkie
Copy link
Collaborator

@JBWilkie JBWilkie commented Nov 21, 2024

Problem

  • 1: darwin-py will download 2 files for every frame that was extracted from a video upon upload: The frame itself, and the video file. This results in massively duplicated data, much slower downloads (due to re-downloading videos), and an incorrect local folder structure
  • 2: darwin-py will crash when trying to pull a release where any file is a multi-slotted item or a DICOM series

Solution

Problem 1 occurs because on upload, each extracted frame is associated with two source files:

  • 1: The frame itself
  • 2: The video from which the frame was extracted

When darwin-py encounters a slot associated with >1 source file, it tries to download every source file. This PR makes the following change: There are only 2 supported types of data where >1 source file can be associated with a slot, so we check:

  • If the slot is a DICOM series, or:
  • If the slot is an extracted frame, in which case it will have exactly 2 source files: 1 image and 1 video

If we detect an extracted frame, we select only the image for download. If we find that the slot is neither supported type of data, we raise an error

Problem 2 occurs because we are trying to access each source file with source_file.file_name. source_file is a dictionary, so instead we need to do source_file["file_name"]

Changelog

Resolved issues with:

  • Pulling frames extracted from videos
  • Pulling multi-slotted items & DICOM series

Copy link

linear bot commented Nov 21, 2024

@JBWilkie JBWilkie merged commit c3e29a8 into master Nov 21, 2024
20 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants