fastmri
Use fastMRI for MRI reconstruction data loading, MRI operators, reconstruction models, Lightning training, evaluation, and submission preparation.
- License 许可
- MIT
- 最近更新
- 2026-10-08
- Stars
- ★ 11
- Forks
- 3
01 前言 Front Matter
- name
- fastmri
- license
- MIT
- metadata
- { "disco-role": "operating" }
- description
- Use fastMRI for MRI reconstruction data loading, MRI operators, reconstruction models, Lightning training, evaluation, and submission preparation.
- disable-model-invocation
- true
02 资源文件 4
- 参考文档references/package-overview.md2.7 KB
- 参考文档references/repo-provenance.md2.5 KB
- 参考文档references/repo-routing-metadata.json420 B
- 参考文档references/troubleshooting.md4.1 KB
03 SKILL.md 正文
fastMRI
Use this repo skill when a task involves the fastmri Python package, fastMRI HDF5 k-space data, MRI reconstruction baselines, U-Net/VarNet models, PyTorch Lightning training, or fastMRI metric/submission-style outputs.
This skill targets the packaged fastmri library and selected self-contained workflows distilled from the repository examples. It assumes the user provides local fastMRI-style HDF5 data, checkpoints, and any optional external tools; it does not download datasets, model weights, or BART automatically.
Start Here
- Confirm the active Python can import
fastmri; for data/model workflows also confirmtorch,h5py,pytorch_lightning,torchmetrics, andrequestsiffastmri.datais imported. - Identify the task family from the route table below, then open the matching sub-skill before writing code or commands.
- Keep original fastMRI data/checkpoints outside the skill; use bundled scripts only as helpers and generate user outputs in user-specified locations.
- Prefer CPU-safe smoke checks and tiny fixtures before long training, GPU inference, external downloads, or leaderboard packaging.
Sub-Skill Routes
| User intent | Read |
|---|---|
Inspect .h5 keys, choose singlecoil vs multicoil, build SliceDataset/CombinedSliceDataset, configure masks/transforms, or debug cache/sample-rate issues. |
data-loading |
Use complex tensor conventions, centered FFT/IFFT, rss, crop/normalization helpers, SSIMLoss, or array metric shape checks. |
mri-operators |
| Instantiate/debug U-Net, VarNet, NormUnet, AdaptiveVarNet, LOUPE/policy modules, tiny model shape checks, or offline pretrained inference. | model-architectures |
Build PyTorch Lightning train/test workflows with FastMriDataModule, UnetModule, VarNetModule, checkpoints, CPU fast-dev, DDP, or combine_train_val. |
lightning-training |
| Save reconstructions, validate prediction HDF5 files, compute MSE/NMSE/PSNR/SSIM, build zero-filled baselines, convert v2 filenames, or prepare submission outputs. | evaluation-submission |
Shared References and Scripts
- Package overview summarizes package scope, installed dependency facts, selected examples, and advanced/example-only branches.
- Troubleshooting covers cross-cutting install/import, optional dependency, data, backend, and workflow failure modes.
- Repo provenance records the source commit, package version, dirty-state baseline, and evidence paths used to create this skill.
- Routing metadata provides structured scenario placement for managed
repo-skills-routerimport. - Environment check script prints a JSON import/backend/dependency summary for the active Python environment.
Common Task Patterns
- Data-to-training: read data-loading, then lightning-training, then evaluation-submission for output validation.
- Tensor/operator debugging: read mri-operators first, then route to model-architectures if the error happens inside U-Net/VarNet.
- Pretrained inference: read model-architectures and require a user-supplied local checkpoint unless the user explicitly authorizes network downloads.
- Submission preparation: read evaluation-submission, validate prediction files before metrics, and treat public leaderboard upload as unavailable unless the user confirms a current destination.
Important Caveats
- The package metadata declares core dependencies but this checkout's
fastmri.dataalso importsrequests; installrequestsifModuleNotFoundError: requestsappears. - The README notes a historical
h5py/HDF5 memory leak concern for tensor conversion; if users see memory growth during large HDF5 reads, prefer a condah5pybuild with an older compatible HDF5 as described in the package docs. - The repository examples often assume GPU/DDP defaults, repo-local
fastmri_dirs.yaml, public checkpoint downloads, or separate pinned environments. The skill distills those workflows into explicit-path, offline-safe guidance instead of depending on original example files. banding_removal/, BART compressed sensing, adaptive VarNet, feature VarNet, RadiologyJohnson2022, notebooks, annotation visualization, external prostate data/code, and raw data manifests are reference or advanced evidence unless a user explicitly asks for those areas and accepts their extra dependencies.
04 同仓库更多 Skills
obsidian-clipper-template-creator
Guide for creating templates for the Obsidian Web Clipper. Use when you want to create a new clipping template, understand available variables, or format clipped content.
obsidian-clipper-template-creator
Guide for creating templates for the Obsidian Web Clipper. Use when you want to create a new clipping template, understand available variables, or format clipped content.
python-api
Programmatic Object-Detection-Metrics API guidance for BoundingBox, BoundingBoxes, Evaluator, enums, coordinate conversion, AP/mAP semantics, and source-style import diagnostics.
file-evaluation
Folder-based PASCAL VOC AP/mAP evaluation from ground-truth and detection text files.
object-detection-metrics
Guides legacy Object-Detection-Metrics PASCAL VOC AP/mAP evaluation from detection text folders and direct Python API classes.
nx-workspace-patterns
Configure and optimize Nx monorepo workspaces. Use when setting up Nx, configuring project boundaries, optimizing build caching, or implementing affected commands.