Skip to content

ENH: Fix directory structure for CHOP-Valve data#92

Open
aylward wants to merge 2 commits into
Project-MONAI:mainfrom
aylward:chop_valve
Open

ENH: Fix directory structure for CHOP-Valve data#92
aylward wants to merge 2 commits into
Project-MONAI:mainfrom
aylward:chop_valve

Conversation

@aylward

@aylward aylward commented Jul 21, 2026

Copy link
Copy Markdown
Collaborator

Summary by CodeRabbit

  • Bug Fixes
    • Updated CHOP-Valve4D dataset downloads and verification to support the revised archive layout.
    • Ensured required CT artifacts and valve-mesh files are correctly detected in the base dataset directory.

Copilot AI review requested due to automatic review settings July 21, 2026 17:23

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@coderabbitai

coderabbitai Bot commented Jul 21, 2026

Copy link
Copy Markdown

Warning

Review limit reached

@aylward, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 33 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 180eedf6-fcf6-4d67-b8a9-cd5a6e9e880c

📥 Commits

Reviewing files that changed from the base of the PR and between 6a78bf0 and aebe894.

📒 Files selected for processing (1)
  • src/physiotwin4d/data_download_tools.py

Walkthrough

CHOP-Valve4D release archives are now extracted directly into the base dataset directory. Verification checks for CT artifacts and Alterra or TPV25 valve meshes now inspect that same directory.

Changes

CHOP-Valve4D dataset layout

Layer / File(s) Summary
Flat archive extraction and verification
src/physiotwin4d/data_download_tools.py
Download extraction targets the base dataset directory, and CT, Alterra, and TPV25 verification checks use the updated flat layout.

Estimated code review effort: 2 (Simple) | ~10 minutes

Suggested reviewers: copilot

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly matches the main change: fixing the CHOP-Valve data directory structure.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
src/physiotwin4d/data_download_tools.py (1)

247-251: 🎯 Functional Correctness | 🔴 Critical | ⚡ Quick win

Flattened directory paths break data verification and mesh extraction.

Passing data_dir directly to _CHOPValve4DSubdirIsPopulated causes it to look for marker files (like RVOT28-Dias.nii.gz or *.vtk) in the root dataset directory rather than the appropriate subdirectories.

  • If the zip archives extract flat into data_dir, Alterra and TPV25 meshes will overwrite each other, and downloading one will cause the other to be skipped (since any(target_dir.glob("*.vtk")) matches both).
  • If the zip archives natively contain subdirectories (e.g., CT/), extracting to data_dir avoids double-folders, but the population check will fail because it looks for data_dir / "RVOT28-Dias.nii.gz" instead of data_dir / "CT" / "RVOT28-Dias.nii.gz". This causes VerifyCHOPValve4DData to always fail and triggers re-downloads on every run.

Restore the subdirectory paths for the checks to correctly isolate the assets:

  • src/physiotwin4d/data_download_tools.py#L247-L251: Pass data_dir / subdir_name to _CHOPValve4DSubdirIsPopulated instead of target_dir. If you are extracting to data_dir to avoid double-folders, you can keep target_dir = data_dir for the _DownloadAndExtractZip call.
  • src/physiotwin4d/data_download_tools.py#L307-L311: Append the respective subdirectory names by passing data_dir / "CT", data_dir / "Alterra", and data_dir / "TPV25" to _CHOPValve4DSubdirIsPopulated.
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@src/physiotwin4d/data_download_tools.py` around lines 247 - 251, The
population check in the download loop must use each asset’s subdirectory rather
than the root data directory. In src/physiotwin4d/data_download_tools.py lines
247-251, pass data_dir / subdir_name to _CHOPValve4DSubdirIsPopulated while
preserving target_dir for extraction; in lines 307-311, pass data_dir / "CT",
data_dir / "Alterra", and data_dir / "TPV25" to the corresponding
_CHOPValve4DSubdirIsPopulated calls.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Outside diff comments:
In `@src/physiotwin4d/data_download_tools.py`:
- Around line 247-251: The population check in the download loop must use each
asset’s subdirectory rather than the root data directory. In
src/physiotwin4d/data_download_tools.py lines 247-251, pass data_dir /
subdir_name to _CHOPValve4DSubdirIsPopulated while preserving target_dir for
extraction; in lines 307-311, pass data_dir / "CT", data_dir / "Alterra", and
data_dir / "TPV25" to the corresponding _CHOPValve4DSubdirIsPopulated calls.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: d02e7b02-a6d8-4bcb-acd7-9dd0caecd711

📥 Commits

Reviewing files that changed from the base of the PR and between e31c8af and 6a78bf0.

📒 Files selected for processing (1)
  • src/physiotwin4d/data_download_tools.py

Copilot AI review requested due to automatic review settings July 21, 2026 19:10

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

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