--- license: cc-by-4.0 pretty_name: Radiograph DICOM Ingest (GRAZPEDWRI-DX and FracAtlas subset) tags: - medical - radiology - radiograph - x-ray - fracture - pediatric - musculoskeletal - object-detection - verifiers task_categories: - object-detection - image-classification size_categories: - 1K`, so the image size must come from the PNG or from the Supervisely `size`. They always agree in this subset. - Every VOC file is pretty-printed with whitespace-padded text nodes (for example `\n text\n `). Strip the whitespace before use. - In `5467_0365242890_01_WRI-R1_M010`, VOC and Supervisely have a `metal` box covering the full image height that YOLO omits. This image is not in the subset. - VOC and YOLO differ by at most 1.000005 px across all files, in one `text` box of `2047_0885653401_01_WRI-R2_M013` (not in the subset). The cause is the integer truncation described above. - 491 YOLO boxes (32 in the subset) overshoot [0, 1] by at most 5e-7 because of 6-decimal rounding. They are clipped. - `dataset.csv` starts with a UTF-8 BOM (`filestem`). `yolov5/meta.yaml` has `FILL IN` placeholder paths. FracAtlas: - `IMG0003375.jpg` and `IMG0003376.jpg` exist in both `images/Fractured/` and `images/Non_fractured/`. The copies are byte-identical, and `dataset.csv` marks both as fractured. This is why `Non_fractured/` has 3,366 files for 3,364 non-fractured CSV rows. This dataset reads each image from the folder its CSV flag names. `IMG0003375` is in the subset. - 59 JPEGs are truncated (all non-fractured, IMG0004028 to IMG0004347) and were excluded. - 25 images carry EXIF Orientation 3, 6 or 8 and were excluded. For IMG0002628 (orientation 8, fractured), the VOC and COCO width and height are swapped relative to the stored JPEG. Three selected images carry Orientation 1 (identity) and were kept. - `Annotations/YOLO/` contains an extra `labels.txt` (`fractured\r\n`), so it has 4,084 files against 4,083 VOC files. - VOC `` is 3 for every selected image, including the 74 single-channel (L) JPEGs. ## Usage ```python from datasets import load_dataset, Image ds = load_dataset("path/or/repo", split="train") row = ds[0] row["image"] # PIL image; GRAZPEDWRI-DX PNGs decode as mode "I;16" x1, y1, x2, y2 = row["objects"]["box"][0] pixel_box = (x1 * row["width"], y1 * row["height"], x2 * row["width"], y2 * row["height"]) raw = ds.cast_column("image", Image(decode=False))[0]["image"]["bytes"] # original file bytes ``` ## Reproduce The build uses Python 3.12 with datasets 5.0.1, pyarrow 25.0.1, pandas 3.0.6, numpy 2.5.3 and Pillow 12.3.0. `scripts/build_dataset.py` downloads nothing except the ranged reads of the selected GRAZPEDWRI-DX PNGs. ```bash mkdir -p /tmp/rr-src /tmp/rfd/src curl -L -o /tmp/rr-src/graz_dataset.csv https://ndownloader.figshare.com/files/35026432 curl -L -o /tmp/rr-src/graz_folder.zip https://ndownloader.figshare.com/files/34268819 curl -L -o /tmp/rfd/src/FracAtlas.zip https://ndownloader.figshare.com/files/65518038 python scripts/build_dataset.py --graz-csv /tmp/rr-src/graz_dataset.csv \ --graz-labels /tmp/rr-src/graz_folder.zip --fracatlas-zip /tmp/rfd/src/FracAtlas.zip \ --work /tmp/rfd/work --out /tmp/rfd/hf python scripts/build_dataset.py --verify-only --work /tmp/rfd/work --out /tmp/rfd/hf ``` The build writes `data/` and `scripts/` and leaves this README in place. `--work` receives the PNG cache, `report.json` (selection, statistics and source audit) and `rows.jsonl`, which holds one summary per row including the SHA-256 of each image. Verification resolves the splits from this README with `datasets` and checks that the stored features match. It then streams every row group and checks each row: the image SHA-256, the size decoded by `datasets.Image` against `width` and `height`, and that each box lies within the unit square. ## Citation ```bibtex @article{nagy2022grazpedwri, title = {A pediatric wrist trauma X-ray dataset (GRAZPEDWRI-DX) for machine learning}, author = {Nagy, Eszter and Janisch, Michael and Hr{\v{z}}i{\'c}, Franko and Sorantin, Erich and Tschauner, Sebastian}, journal = {Scientific Data}, volume = {9}, pages = {222}, year = {2022}, doi = {10.1038/s41597-022-01328-z} } @article{abedeen2023fracatlas, title = {FracAtlas: A Dataset for Fracture Classification, Localization and Segmentation of Musculoskeletal Radiographs}, author = {Abedeen, Iftekharul and Rahman, Md. Ashiqur and Prottyasha, Fatema Zohra and Ahmed, Tasnim and Chowdhury, Tareque Mohmud and Shatabda, Swakkhar}, journal = {Scientific Data}, volume = {10}, pages = {521}, year = {2023}, doi = {10.1038/s41597-023-02432-4} } ```