- concurrent load_dataset workers (force_install_code defaults to true) all ran
`pip install .` in the shared src/ tree; setuptools builds in-tree, so the
builds clobbered each other (Errno 17 / Errno 2) and raced pip's
site-packages writes, surviving only via caller-side retries
- take a FileLock on src/.build.lock — the same file the medvision_bm wheel
builder flocks, so the two installers also exclude each other — and re-check
the tracker under the lock so a waiter skips a just-finished install (unless
an install was forced), refreshing its import caches either way
[script,doc] restructure the v1.4.0 recall notes, drop the median-floor table
- 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
This reverts commit 4ef185479b86aa4e23d0b3c73033bc395ef78482.
Removes _quiet_snapshot_byte_bars and both of its call sites, so the codebase
and QC-figure downloads again end with the "Download complete" / "Reconstruction
complete" bars. Those lines are emitted by huggingface_hub >= 1.0, which
relabels a pair of aggregate byte bars at the close of every snapshot_download
whether or not anything was transferred; MedVision.py returns to leaving that
output alone.
[src] fix: stop the codebase and QC-figure downloads signing off with two empty progress bars
Background
The codebase install step and the QC-figure fetch each ended by printing a pair
of progress bars that had measured nothing:
Download complete: : | 0.00B
Reconstruction complete: | | 0.00B / 0.00B
Neither string occurs anywhere in this repo.
Root cause
huggingface_hub >= 1.0 opens every snapshot_download with two aggregate byte
bars -- one for network transfer, one for on-disk reconstruction -- and closes
it by relabelling them "Download complete" and "Reconstruction complete",
unconditionally. Only bytes actually moved ever feed those bars, so a call
served entirely from cache, or one whose allow_patterns match no file at all,
relabels a pair still sitting at zero and prints the result. Observed on
huggingface_hub 1.28.0 with hf-xet 1.6.0.
Fix
The two bars form a NAMED tqdm bar group, so they can be silenced on their own;
the per-file "Fetching N files" bar belongs to the unnamed root group and is
unaffected.…
[script,doc] feat: stratify TL recall by physical area, add cumulative twins for all three ladders
- 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…
[src] fix: fetch QC figures on every load and track them per annotation version
The fetch used to sit in _split_generators, which made it unreachable after a
config's first build: datasets consults the Arrow cache after _info() and skips
_split_generators on a hit, so a machine whose figures had gone stale could not
obtain the current ones by any means short of deleting that cache.
QC figures:
- move the fetch into _ensure_qc_figures and call it from BOTH _info() and
_split_generators. _info() is the only hook a warm-cache load reaches, since
DatasetBuilder.__init__ runs it before the cache directory is consulted --
the same reasoning that put the paused-annotation gate there
- defer in _info() while the dataset's files are absent, so a first install is
served by the _split_generators call site instead. That one runs after step
3.3, whose reorientation pass globs "<dataset_dir>/**/*.nii.gz" recursively and
would otherwise walk hundreds of thousands of freshly extracted PNGs per
dataset for nothing. The two conditions are complementary: a warm cache …
- the per-slice QC figures were 298 GB of a 301 GB annotation payload, against 3 GB of
actual annotation, and nothing in MedVision.py reads them. At v1.4.0 they carried
BraTS24.zip to 72.58 GB and MSD.zip to 51.35 GB, past HuggingFace's 50 GB per-file
limit: both were rejected with HTTP 422 and took the whole push down with them
- Datasets/<name>.zip now carries annotations only, so a default download is 3 GB rather
than 301 GB. The figures ship as Datasets/<name>_fig.zip, sharded to
<name>_fig.partNN.zip below 40 GB where a single archive would again clear the limit
(BraTS24 -> 40.19 + 31.99 GB, MSD -> 40.12 + 10.98 GB). Shards are independent zips,
not `zip -s` volumes, so each one extracts on its own and in any order
- MedVision.py gains step 3.5, gated on MedVision_DOWNLOAD_QC_FIGURES (default False).
It sits OUTSIDE the _needs_download block deliberately: a machine that already holds
the annotations takes the "using existing dataset" branch above and would otherw…
[release] v1.4.0: floor tumour/lesion measurements on physical major axis, not pixel count
[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…
[src,script] fix: pause A/D annotation loading for AFIDs, PDDCA and VerSe
An audit of the angle/distance biometry plans found that the planner records
each measurement against a slice index taken from its FIRST landmark only, with
no co-planarity check, while the value itself is a full 3-D length or angle.
1652 of the 2064 released items (80.0%) therefore name a slice that does not
contain the measurement, which makes them unanswerable from the single slice
the model is shown. All 10 A/D configs of the three datasets are refused until
a corrected annotation exists; the other 24 configs of those datasets are not.
- Scope _PAUSED_ANNOTATIONS by plan kind (dataset -> kind -> versions),
mirroring _ANNOTATION_INDEX. All three datasets publish segmentation and
detection at the same v1.2.0, so a dataset-level pause would have withheld
24 configs the defect cannot reach.
- Thread the kind through _paused_versions and _fully_paused; the _info() and
_split_generators call sites already had it in scope.
- Check a paused version against the versio…
[src,script] refactor: opt-in parallel per-case profiling for the detection and biometry planners
- add a module-level worker facade (_CASE_WORKER / _init_case_worker) so a pool worker
carries only the attributes a per-case method declares via _case_worker_attrs, rather
than pickling a planner whose bm_plan grows with every profiled case
- hoist the per-case loop bodies of the detection and fromSeg-biometry planners into pure
functions dispatched through _run_cases; serial stays the default and
MedVision_PLANNER_WORKERS>1 opts in
- pre-create the landmark output dirs once instead of per case: exists-then-makedirs is a
race under workers, and the serial final state is unchanged
- add scripts/test_planner_parallel_identity.py -- old-serial / new-serial / new-parallel
must produce byte-identical artifacts after gunzip. This is the licence the
annotation-identity rule requires for touching generation code at all; 10/10 against
--baseline HEAD, detection and biometry both unchanged
- build_dataset.py: timestamped per-stage progress lines and PYTHONUNBUFFERED for the
ch…
[src] fix: pin huggingface_hub as a floor so the load-time reinstall stops rewriting eval environments
- huggingface_hub==0.36.0 -> >=0.35.3,<2.0: the loader runs `pip install .` on this
package at dataset-load time, so an exact pin mutated huggingface_hub inside a live
eval process
- that downgraded hub 1.20.1 -> 0.36.0 mid-task in GLM-4.6V evals, breaking transformers
5.12.1 with "ImportError: cannot import name 'is_offline_mode'" in every process
spawned afterwards (vLLM workers, the next task)
- floor set to 0.35.3, the lowest version any launcher pins: a higher floor would instead
upgrade the 13 transformers-4.x stacks (which require hub<1.0) to the newest 1.x
- also ends the silent drift where stacks pinning 0.35.3 actually ran 0.36.0 after every
dataset load
- only snapshot_download / hf_hub_download are used here, both stable across the range
[src] fix: window stones on bone HU via a new Calculus group, backfill 7 missing label groups
- give "gallstone"/"kidney stone" their own "Calculus" group on the bone window
(1800/400), instead of "Gallbladder"/"Kidney Tumor/Lesion". A calculus is neither a
neoplasm nor the organ containing it, and calcium at 200-1000+ HU is clipped to a flat
white blob by the 400/40 soft-tissue window. Not "Others" either — that group is the
guard's opt-out from HU windowing (group.lower() != "others"), so it would fall back to
percentile normalization
- backfill 7 labels the benchmark map already grouped but this one did not: MAMA-MIA's
"breast tumor", PI-CAI's "clinically significant prostate cancer lesion" (plus the
"prostate cancer lesion" canonical form emitted by label_map_rename), ToothFairy2's
maxillary sinuses, TotalSegmentator's "pulmonary vein" and DEEP-PSMA's "total tumor
burden". Only the ToothFairy2 and TotalSegmentator ones were reachable — the rest are
MRI/PET, where the CT branch never runs
- add the "Prostate Tumor/Lesion" and "Breast Tumor/Lesion" HU wind…
- 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…
[src] fix: cut reorientation peak memory 1.7x to stop OOM kills on large volumes
- _to_dtype takes an opt-in may_mutate so a caller that owns the array rounds in
place; np.rint(arr) otherwise allocates a second full-size float64 purely to
hold a temporary the next .astype consumes
- _reorient_niigz_RASplus passes caching="unchanged", so nibabel stops retaining
that float64 array on the image for the life of the reference; nothing reads it
twice
- opt-in rather than automatic: rounding in place is visible to anyone else
holding a reference to arr, and _to_dtype cannot know who does
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
- add _to_dtype: rounds when casting float -> integer, so a label de-scaled to
1.99995422 becomes 2 rather than truncating to 1 and decrementing every label
in the volume
- _copy_img_header_to_mask writes the mask's own integer dtype instead of
float64, which is why callers have had to follow it with
convert_mask_to_uint16_per_dir to repair the dtype
- _reorient_niigz_RASplus casts via _to_dtype; a bare .astype truncated on
scaled input
- _convert_mask_to_uint16 routed through _to_dtype; behaviour unchanged, it
already rounded
- verified byte-identical to the previous code on real masks across
float64/float32/int16/uint16 and through the full copy -> convert pipeline;
scaled input now round-trips exactly
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
[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…
[src] fix: pause loading of corrupt MAMA-MIA and PI-CAI v1.2.0 annotations
MAMA-MIA and PI-CAI shipped their v1.2.0 plans without the RAS+ reorientation
their download scripts now perform, so the recorded coordinates sit in the
source frame (DUKE L,A,I / ISPY1 P,S,L / PI-CAI L,P,S) while step 3.3 reorients
the images to RAS+ - the voxels move out from under the annotation. All 36
configs of the two datasets are refused until a corrected annotation exists;
the other 914 are unaffected.
- Add _PAUSED_ANNOTATIONS (dataset -> withheld versions), the
_paused_versions/_fully_paused helpers, and an error banner that names the
affected datasets from the table and points at the release notes.
- Refuse in _info() rather than _split_generators: datasets calls it from
DatasetBuilder.__init__ before the cache directory is consulted, so a warm
Arrow cache built from the defective plan is caught too.
- Re-check the resolved target in _split_generators, so a pin to a withheld
version stays refused once the correction ships and the _info() gate lift…
[label-name] chore: change the KiPA22 label 'tumor' to 'kidney tumor'
- 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>
[src,doc] fix: move DICOM deps to [raw] extra to unblock medvision_ds install
- move pydicom<3, pydicom-seg, pylidc and setuptools<81 into a [raw] extra;
pydicom-seg requires numpy<2, which made the v1.2.0 dependency set
unsatisfiable against the modern stack and aborted `pip install .` mid-resolve
- raise on install failure instead of logging at info level, where the error was
invisible and resurfaced later as a misleading ModuleNotFoundError for
medvision_ds
- install via sys.executable -m pip, and invalidate_caches() afterwards so the
freshly installed package is importable in the same process
- raise a pointed ImportError from the LNQ2023 and LIDC_IDRI download_raw
scripts when the raw extra is missing, and document the extra in the README
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…
- notice hardcoded "v1.1.0 annotation updates" but fires for any requested
version, so a v1.1.1 request printed a message naming the wrong release
- reword version-agnostically ("every update after v1.0.0") and name the
actual taskType instead of listing all non-TL task types
- print once per task type per process via _FALLBACK_NOTICE_SHOWN; the notice
carries no per-dataset detail yet repeated for every config in a run
- annotation file resolution unchanged: the fallback assignment stays outside
the print guard
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
- MedVision.py: include disable_sample_filtering in the builder config fingerprint when
MedVision_DISABLE_SAMPLE_FILTERING is set, so toggling it no longer reuses a cache built
under the other setting; added only when enabled to keep the default config id (and
existing caches) byte-identical
- TopCoW24: repoint dataset_data/download URLs from the dead switch.ch host to the Zenodo
DOI (10.5281/zenodo.15692629)
- autoPET-III: point dataset_data to the grand-challenge site and document the dead LMU
raw-archive URL as a provenance-only record (loader uses download_fast.py instead)
- README: replace Docker link with Data Explorer, update sample counts (29K 3D / 11.2M 2D /
24.3M single- / 45.3M multi-instance), fix autoPEI-III -> autoPET-III and CrossModDA ->
CrossMoDA dataset names
Add env var MedVision_DISABLE_SAMPLE_FILTERING (default "False"; filtering
enabled, unchanged behavior). When set to "true", the three quality/size
exclusion filters in _generate_examples are bypassed so every sample in the
planner is returned:
- Mask-Size: pixel_count < 200
- Box-Size: multiple bounding boxes / bbox dimension < 10 px
- Tumor-Lesion-Size: n_total_clusters > 1 (v1.1.0+) / >1 profile (v1.0.0)
The distance/angle metric_type split (task partitioning, not a quality filter)
is intentionally preserved in both modes.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
- Fix label 4 "right internal carotid arterr" -> "right internal carotid artery"
in TopCoW24/preprocess_detection.py (labels_map)
- Apply the same correction to the packaged plans in Datasets/TopCoW24.zip
(benchmark_plan_detection + benchmark_plan_segmentation json.gz); no other
archive content changed
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
- 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] fix: minor off-by-one in flipped Ceph landmark mirror (no effect on released annotations)
- When a Ceph image is flipped during import, each landmark's coordinate has to be
flipped to match. The old formula placed every flipped landmark one pixel off,
and produced an invalid `-1` for a landmark sitting on the very last row.
- Corrected the flip so each landmark lands on the right pixel.
- Minor, with no data impact: the released benchmark stores only the measured
angles and distances, and those don't change when every landmark moves by the
same single pixel. Only the locally rebuilt landmark files and preview overlays
are affected — the published annotations are untouched, so no re-release.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
- preprocess_biometry templates (type1/type2): pass dataset_dir/bm_plan/dataset_name
as keyword args to the keyword-only planner constructors, which previously raised
TypeError when a template was run
- _reorient_niigz_RASplus: read the on-disk dtype via get_data_dtype() instead of
get_fdata().dtype (always float64), so integer masks are no longer silently
rewritten as float64
- data_conversion converters (nrrd/mha/nii/bmp/jpg) and the FeTA24 landmark loop:
collect per-file failures and raise RuntimeError at the end instead of swallowing
exceptions and exiting 0, matching the existing multiprocess error-handling pattern
- _split_niigz_dataset: sort the file list before the seeded shuffle so the 70/30
train/test split is reproducible across machines (glob order is filesystem-dependent)
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
- Frontmatter: license field corrected from cc-by-nc-4.0 to cc-by-4.0
- License section: replace Do / Do not / Requirement subsections with a
single paragraph covering permitted use, meta-dataset notice, and
source dataset compliance
- Models link: update collection from medvision-sft-models to medvision-v0
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
[src] fix: fall back to v1.0.0 annotations for non-TL tasks when v1.1.0 file is missing
v1.1.0 only regenerated annotation files for Tumor-Lesion-Size tasks,
so Mask-Size, Box-Size, and Biometrics-From-Landmarks tasks have no
v1.1.0.json.gz on disk. Setting MedVision_PLANNER_VERSION=1.1.0 for
these tasks previously caused a bare FileNotFoundError. The loader now
detects the missing file, falls back to v1.0.0, and prints a clear
explanation. TL tasks are excluded from the fallback so a missing
v1.1.0 file there is still a hard error.
[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).
[src] fix: include planner_version in builder cache fingerprint
load_dataset() raised NonMatchingSplitsSizesError when switching
MedVision_PLANNER_VERSION between 1.0.0 and 1.1.0. The two planner
versions produce different sample sets (e.g. 391 vs 303 for the
KiPA22 TL test split), but both resolved to the same builder cache
folder: BuilderConfig.version is intentionally pinned to "1.1.0",
and the planner version was read only inside _split_generators, so
it never participated in cache fingerprinting.
Override MedVisionConfig.create_config_id to thread the current
MedVision_PLANNER_VERSION through config_kwargs. The parent
BuilderConfig.create_config_id then encodes it as a suffix on the
config name (e.g. <config>-planner_version=1.0.0), so different
annotation versions resolve to distinct cache folders and never
share dataset_info.json. "latest" is normalised to self.version to
match the existing semantics in _split_generators.
The env-var enforcement in _split_generators is unchanged.
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…
[chore]: change image_description for KiPA22 dataset