Skip to main content

T2-only fastMRI prostate coil-selection and real-vs-complex classification pipeline.

Project description

fastMRI Prostate T2 Coil Classification

This project builds a T2-only classification experiment for the fastMRI prostate dataset. It follows the dataset paper's slice-level PI-RADS classification setup and official patient split, but replaces the released RSS images with selected coil images from the middle T2 acquisition.

The experiment compares:

  • a real-valued CNN that receives only coil image amplitudes;
  • a complex-valued CNN that receives the same selected coils as complex images.

PI-RADS labels are binarized as in the paper: PI-RADS > 2 is clinically significant prostate cancer.

Install

From PyPI:

python -m pip install prost-t2-classification

Confirm the console command is available:

prost-t2 --help

For development from a local checkout:

python -m venv .venv
.\.venv\Scripts\python -m pip install -U pip
.\.venv\Scripts\python -m pip install -e ".[dev]"

For CUDA training, install the PyTorch build that matches your GPU/driver before or after the editable install.

Full Pipeline

The full command prompts for storage locations if you omit them:

prost-t2 run --download-script .\prostate_download_script.txt

Equivalent non-interactive form:

prost-t2 run `
  --download-script .\prostate_download_script.txt `
  --download-dir D:\fastmri_prostate\archives `
  --extract-dir D:\fastmri_prostate\raw `
  --recon-dir D:\fastmri_prostate\recon_t2 `
  --npz-dir D:\fastmri_prostate\npz_t2_coils `
  --runs-dir D:\fastmri_prostate\runs

To stop after downloading, reconstruction, and NPZ preparation, skip training:

prost-t2 run `
  --download-script .\prostate_download_script.txt `
  --download-dir D:\fastmri_prostate\archives `
  --extract-dir D:\fastmri_prostate\raw `
  --recon-dir D:\fastmri_prostate\recon_t2 `
  --npz-dir D:\fastmri_prostate\npz_t2_coils `
  --skip-train

Individual Stages

Download labels and T2 tarballs only:

prost-t2 download --download-script .\prostate_download_script.txt --download-dir D:\fastmri_prostate\archives --no-extract

Download and extract labels plus T2 tarballs:

prost-t2 download --download-script .\prostate_download_script.txt --download-dir D:\fastmri_prostate\archives --extract-dir D:\fastmri_prostate\raw

Run GRAPPA/IFFT reconstruction with fastmri-tools:

prost-t2 reconstruct --raw-root D:\fastmri_prostate\raw --recon-dir D:\fastmri_prostate\recon_t2

Create compact NPZ samples from the middle acquisition and top-energy coils:

prost-t2 make-npz --labels D:\fastmri_prostate\raw --recon-dir D:\fastmri_prostate\recon_t2 --npz-dir D:\fastmri_prostate\npz_t2_coils

Prepare NPZ files from extracted raw data without training:

prost-t2 prepare-npz `
  --raw-root D:\fastmri_prostate\raw `
  --recon-dir D:\fastmri_prostate\recon_t2 `
  --npz-dir D:\fastmri_prostate\npz_t2_coils

Train both models:

prost-t2 train --manifest D:\fastmri_prostate\npz_t2_coils\manifest.csv --runs-dir D:\fastmri_prostate\runs --mode both

Data Decisions

  • The official data_split column is used directly, and patient leakage across train/validation/test is checked before training.
  • T2 kspace is reconstructed through fastmri-tools, producing complex image_complex arrays.
  • The acquisition dimension is reduced by selecting the middle acquisition (shape[0] // 2).
  • Up to five coils are selected per patient volume using highest image-space energy, measured on the selected acquisition across all slices.
  • NPZ files store image_complex with shape (coils, height, width) plus patient, slice, split, and coil metadata.

Publishing

Releases are published to PyPI by GitHub Actions using PyPI Trusted Publishing, so the repository does not need a long-lived PyPI API token.

Create a pending publisher on PyPI with these values:

  • PyPI project name: prost-t2-classification
  • GitHub owner: meis-01
  • GitHub repository: prost_t2_classification
  • Workflow file: publish.yml
  • GitHub environment: pypi

Then bump __version__ in src/prost_t2_classification/__init__.py, commit the change, and push a matching tag:

git tag v0.1.0
git push origin v0.1.0

The publish workflow checks that the tag matches the package version before it uploads the wheel and source distribution.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

prost_t2_classification-0.1.0.tar.gz (17.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

prost_t2_classification-0.1.0-py3-none-any.whl (18.9 kB view details)

Uploaded Python 3

File details

Details for the file prost_t2_classification-0.1.0.tar.gz.

File metadata

  • Download URL: prost_t2_classification-0.1.0.tar.gz
  • Upload date:
  • Size: 17.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for prost_t2_classification-0.1.0.tar.gz
Algorithm Hash digest
SHA256 8339cf07d7757005081ef830e7dad99674ec11b38db21dc48b16d7257f9ece44
MD5 1356cc5cf00b5ef45c1f069e94e4926f
BLAKE2b-256 5a800ee5ab6ce732d1bb53556b333cffe3778cf588fe1dd85f246986165b2067

See more details on using hashes here.

Provenance

The following attestation bundles were made for prost_t2_classification-0.1.0.tar.gz:

Publisher: publish.yml on meis-01/prost_t2_classification

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file prost_t2_classification-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for prost_t2_classification-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 a6c6273d3bc05f1eed93af30da18035d18408feb3dc16a9663cda17e9b5cffc2
MD5 3e06d249094aca8e08db46337b2298f6
BLAKE2b-256 c8497ecbf396b832d4b3ca9f5064ac8275b4449e2f1876d6c1a966fa82af67b1

See more details on using hashes here.

Provenance

The following attestation bundles were made for prost_t2_classification-0.1.0-py3-none-any.whl:

Publisher: publish.yml on meis-01/prost_t2_classification

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page