- release note: parallel takeaway + unmeasured-stats subsections for all three ladders (pixel takeaway now 0.961 >10 px / 0.986 >20 px, area stats now 83.5% ≤10 mm² / 89.0% ≤20 mm²); overall-recall column added and every value cited in prose bolded in its table; anisotropy section rewritten concisely with explicit sagittal/coronal naming; "Area is set by the floor" subsection and its median-floor table removed; release date stamped
- tl-stats README: the median-floor section now stands alone as the analysis record instead of describing the removed release-note table
[script,doc] feat: add the above-threshold recall figure, fold TL methodology into the tl-stats README
- tl_plots.py: new overview_recall_above_threshold figure — the same area/length panels with recall pooled over every cluster above each bin edge (the ">t" reading); empty bins keep their edge so thresholds never shift, and a zero-total tail goes NaN instead of a fake zero
- scripts/tl-stats/README.md: document the Feret length stratification (definition, provenance, both caveats), the release note's median-floor analysis, and the landmark-entry fields behind per-cluster attribution
- doc/release-v1.4.0.md: add >10 mm columns to the per-dataset recall table (corpus 0.967, none below 0.872); replace in-line methodology with pointers to the README; spell out the MedVision_DISABLE_SAMPLE_FILTERING opt-out
- doc/tl-annotation-stats-v1.4.0.md: all 12 datasets carry a detection plan; state how each plan vintage cross-checks the denominator
- regenerate the overview_major_axis and overview_recall figures alongside the new one
- tl_stats.py: bin every cluster by area in mm2 (pixel count x the in-plane
voxel area of its own case, resolved per plane) alongside the pixel ladder;
bin_sizes generalises to bin_clusters over any column
- warn when a case carries no mask_file_info.voxel_size instead of letting it
drop out of the area grouping and shrink the denominator silently
- new cumulative_recall writes a corpus-level twin of each ladder reading the
same counts three ways: per bin, pooled <= threshold, pooled > threshold;
emitted for size, area, and length when tl_recall_by_length.csv is present
- tl_plots.py: left recall panel moves from pixels to mm2, and the overview box
plot widens to mirror full label names on a secondary right-hand axis
- doc: release note and stats report carry the three-way tables, gain the area
section relating recall to the resolution-adjusted floor rather than to area,
and are rewritten in a plain report register
- regenerate overview_recall and overview_major_axis (.…
[script,doc] feat: swap the TL recall figure to size and length panels, ship figures vector-only
- Replace the per-label/plane recall scatter in `overview_recall` with recall against
physical cluster length in mm from `tl_recall_by_length.csv`; recall vs cluster size
in pixels keeps the left panel
- Bin the length panel on the max Feret diameter of a cluster's pixel centres, not the
fitted major axis: an unmeasured cluster has no fitted axis, so only a mask-side
quantity can carry the denominator of a recall
- Pin `LENGTH_BIN_ORDER` locally — nothing in this repo writes `tl_recall_by_length.csv`,
so there is no producer to import the order from, and first-appearance ordering folds
the curve back on itself when a dataset is missing a bin
- Share one legend across the pair; both panels key colour on the same 12 datasets
- Drop `.png` output: `save_fig` writes `.svg` and `.pdf` for every figure from one place
so the formats cannot drift apart, and the stale PNGs are removed
- Record in the README that `tl_stats.py` does not write `tl_recall_by_length.csv`, so a
fresh …
[info,script,doc] chore: re-cut the config lists as a usable-config roster, add the v1.4.0 snapshot
- add info/v1.4.0/ (1002 configs), the snapshot the v1.4.0 release never shipped;
generated from BUILDER_CONFIGS so the 12 DEEP-PSMA/LNQ2023 tumour/lesion
sagittal+coronal configs interleave in catalogue order rather than appending
- re-cut every list on one rule: a config is listed only when it resolves at that
pin and yields at least one row there. v1.0.0-v1.1.1 820 -> 818, v1.2.0 950 ->
920, v1.3.0 992 -> 998, v1.4.0 1004 -> 1002
- the only row-based casualties are MSD_MaskSize_Task08_{Sagittal,Coronal}_Test,
empty in every annotation version; their Train halves survive, so this is a
property of that test split rather than annotation drift
- drop the 36 MAMA-MIA/PI-CAI configs from v1.2.0: the withdrawal of their v1.2.0
annotations leaves them unresolvable at that pin, so they raise on load rather
than yielding few rows
- backfill the 8 DEEP-PSMA/LNQ2023 configs missing from v1.2.0 and v1.3.0; both
datasets resolve biometry at those pins and every other tumour/lesi…
[Code]
- add --cluster_filter_method {major_axis,pixel_count} to the fromSeg biometry planner and
to all 12 T/L preprocess_biometry.py; default major_axis
- major_axis measures a cluster when its FITTED major axis clears
max(MIN_MAJOR_AXIS_MM, 2 x coarser in-plane spacing). A pixel count is not a physical
size: sagittal and coronal are reconstructed across the slice axis, so on a
0.977/0.977/3.0 mm case a 20 px floor discards below ~4.9 mm axially but ~8.6 mm
sagittally.
- MIN_MAJOR_AXIS_MM = 2.0 uniformly across every dataset and target label: it admits nearly
every annotated lesion and binds only where in-plane spacing is under 1 mm. Clinical
floors (RECIST 10 mm, Fleischner 6 mm, BI-RADS 5 mm) are per-LESION thresholds on one
largest cross-section whereas this filter is per-slice, so they are left to downstream
consumers rather than encoded here
- guard the fit itself, now that major_axis removes the pre-fit size test. cv2.fitEllipse
is a least-squares conic in f…
- new package medvision_ds.datasets.MSWAL — download_raw.py builds from upstream HF zhaodongwu/MSWAL @62c286b0 (484 imagesTr cases; the 210-case test split in dataset.json was never uploaded): header-copy -> uint16 -> RAS+ in the downloader, planner re-split seed 1024 / 0.7 -> 338/146; download_fast.py fetches the preprocessed private mirror YongchengYAO/MSWAL-Lite @39fb50b6
- biometry: 5 fromSeg tasks for labels 3-7 (liver/kidney tumor, pancreatic cancer, liver/kidney cyst); stone labels 1-2 are segmentation/detection-only; all 3 planes survive the single-cluster filter (weakest: liver-cyst sagittal test, 27 slices)
- register 42 configs in MedVision.py (6 Mask-Size + 6 Box-Size + 30 Tumor-Lesion-Size), plus _ANNOTATION_INDEX, _BIOMETRY_FAMILY, DATASETS_NAME2PACKAGE, _VERSION_NOTES, and the release frontier version -> 1.3.0
- add MSWAL's label names to LABEL_MAP_REGROUP so T/L figures use the soft-tissue HU window: "pancreatic cancer" and "liver cyst" were missing (map only knew "panc…
[release] v1.2.1: correct MAMA-MIA and PI-CAI to RAS+, withdraw their v1.2.0; new reproducibility and fast download scripts
MAMA-MIA and PI-CAI recorded their v1.2.0 annotations in the source image
orientation instead of RAS+: neither download_raw.py reoriented and no
preprocessing run passed --reorient2RAS, so the planner wrote coordinates in
the ('L','A','I') / ('P','S','L') / ('L','P','S') frames while the loader
reoriented the images to RAS+ without renumbering the *.json.gz. Both
downloaders now reorient before any annotation is computed, and both datasets
were regenerated as v1.2.1. No other dataset is affected. Full note:
doc/release-v1.2.1.md.
The correction:
- Withdraw v1.2.0 for both datasets: de-listed from _ANNOTATION_INDEX and
recorded in a new _WITHDRAWN_ANNOTATIONS table, so the banner reports a
withdrawal instead of claiming the annotations never existed. The
_PAUSED_ANNOTATIONS gate that withheld them is kept, empty, for next time.
- Splits and all segmentation/detection entry counts are unchanged; 65,195 of
65,195 detection boxes reproduce from the reoriented masks. On…
[doc] chore: add dataset-search notes for the v1.2.0 expansion
- dataset-candidates.md: the candidate survey behind the expansion — 103
datasets discovered across MICCAI / ISBI / grand-challenge / TCIA, 31 passed
the eligibility gates, 8 shipped, with the rejection reason recorded for each
of the rest so the next expansion does not re-do the work
- dataset_pants.md: the PanTS deep-dive, dropped despite passing every gate
because 57.3% of its pancreatic tumours sit on scans already in the catalogue
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
[release] v1.2.0: add 8 datasets, resolve annotation versions per dataset
v1.2.0 adds 8 datasets and changes no existing annotation. Every dataset
released before this version loads exactly the same annotation files it did at
v1.1.1, byte for byte. Full note: doc/release-v1.2.0.md.
What you gain:
- 8 new datasets — AFIDs, DEEP-PSMA, LIDC-IDRI, LNQ2023, MAMA-MIA, PDDCA,
PI-CAI, VerSe. The catalogue grows from 820 to 950 configs.
- Every plane that has loadable data has a config. Tumor-Lesion-Size covers
sagittal and coronal as well as axial for MAMA-MIA, LIDC-IDRI and PI-CAI, and
DEEP-PSMA covers all three planes for Mask-Size and Box-Size across both
tracers. LNQ2023 stays axial-only on purpose: its lesions fragment on reslice,
so the single-cluster filter empties the other planes (0 of 36 sagittal and 3
of 53 coronal slices survive) — declaring them would ship empty splits.
What was wrong, and is now fixed:
- Cached data could be stale. load_dataset keeps a local copy of the rows it
built last time, and decided whether that copy was still go…
- Add _enforce_release_ack(planner_version, latest_version) in MedVision.py:
loading any annotation version older than the dataset's latest
(self.config.version) raises EnvironmentError for ALL tasks unless
MedVision_ACK_RELEASE equals the latest version. latest/current/newer are
never gated; bumping the dataset version auto-invalidates old acknowledgements.
- Call the gate in _split_generators right after version resolution, before any
download/install, so it fails fast.
- Document MedVision_ACK_RELEASE in the README env-var block and add an
"Using an older version requires acknowledgement" subsection to
doc/release-v1.1.1.md; add a changelog entry.
- Add scripts/test_tl_ack_gate.py (5-case pass/block matrix, all passing).
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
v1.1.1 corrects the Tumor-Lesion-Size (TL) biometry ellipse fit. Across the
6 TL datasets the accepted sample set drops ~22% (71884 -> 56033; range -13.7%
to -43.1%) and 14880 mislabelled major<minor cases are eliminated; isotropic
data (e.g. KiPA22) is essentially unchanged. Only the TL task changes — every
other task falls back to identical v1.0.0 annotations.
Core bugfixes (src/medvision_ds/utils/benchmark_planner.py, __fit_ellipses):
- A1 transposed in-plane voxel spacing: cv2 returns contour points as
(x=col=dim1, y=row=dim0) but pixel_sizes is (dim0, dim1), so each coordinate
was scaled by the wrong axis's spacing. The fit was always in real (mm) space;
v1.1.1 pairs each coordinate (and the center/endpoint back-mapping) with its
own axis spacing. Distorts axis lengths and major/minor labels on anisotropic
in-plane slices only; isotropic slices unaffected.
- A2 major/minor labelled and measured from the continuous real-space axes
(max/min of axes_real), persisted as `…
[src] feat: skip raw redownload when cached version >= requested planner
Switching MedVision_PLANNER_VERSION from 1.1.0 to 1.0.0 used to
trigger a full raw-data re-download in _split_generators (annotations
zip, per-dataset download scripts, NIfTI re-orientation), because the
trigger condition was "cached != requested" — fires on any mismatch,
including downgrades. But MedVision annotation zips are fully
backward compatible: a v1.1.0 zip contains everything needed to
satisfy v1.0.0 planner requests, so the downgrade can safely reuse
the on-disk data.
Replace the \`!=\` check with \`<\` so re-download only fires on a true
upgrade. Also handle a missing tracker entry explicitly (incidentally
fixes a latent bug where _version_tuple(None) collapsed to (1, 0, 0)
and silently equaled a requested "1.0.0", skipping the first-time
download).
TL sample filtering
- Replace `len(biometric_profile) > 1` filter with `n_total_clusters > 1`, using
the raw connected-component count captured before any pixel-size threshold.
Slices with sub-threshold (but visible) clusters are now correctly rejected.
- Backward compat: old v1.0.0 JSON files lack n_total_clusters; the loader falls
back to the original filter automatically.
- Fix TypeError in _find_scaled_bounding_boxes_2D: cast bool cluster mask to int32
before passing to scipy.ndimage.find_objects.
Annotation generation
- Reduce CLUSTER_SIZE_THRESHOLD 200 to 20 px in all six preprocess_biometry.py
scripts (BraTS24, autoPET-III, KiTS23, KiPA22, HNTSMRG24, MSD).
- Versioned output folders: landmark_folder / landmark_figure_folder now carry
-v{version} suffix so generated files are traceable to the producing version.
Image normalization
- Add src/medvision_ds/utils/image_normalization.py: HU window normalization for
CT (per-anatomy presets), percentile (0.5-99.5) for MR…