datasets¶
datasets
¶
Lightweight, generic dataset wrappers for radiograph collections.
CephalometricDataset
¶
CephalometricDataset(root, image_size=None, transform=None, landmarks_file=None, normalize_landmarks=True)
Bases: RadiographDataset
Lateral cephalometric radiographs (e.g. ISBI2015).
Source code in deltaflow/datasets/radiograph.py
ChestXrayDataset
¶
ChestXrayDataset(root, image_size=None, transform=None, landmarks_file=None, normalize_landmarks=True)
Bases: RadiographDataset
Frontal chest radiographs (e.g. Shenzhen, NIH ChestX-ray14).
Source code in deltaflow/datasets/radiograph.py
HandRadiographDataset
¶
HandRadiographDataset(root, image_size=None, transform=None, landmarks_file=None, normalize_landmarks=True)
Bases: RadiographDataset
Hand/wrist radiographs (e.g. DHA).
Source code in deltaflow/datasets/radiograph.py
ISBI2015CephalometricDataset
¶
ISBI2015CephalometricDataset(root, image_size=None, transform=None, landmarks_file=None, landmarks_file_2=None, normalize_landmarks=True, n_landmarks=19)
Bases: CephalometricDataset
ISBI2015 "Automatic Cephalometric X-Ray Landmark Detection" benchmark.
Wang et al., "A benchmark for comparison of dental radiography analysis
algorithms", Medical Image Analysis (2016). 400 lateral cephalograms
(1935x2400 px, 0.1 mm/px), each with 19 anatomical landmarks
annotated independently by a senior and a junior rater.
Two annotation layouts are recognised, picked automatically from
landmarks_file:
- Per-image text files (the original figshare release). Point
landmarks_fileat a directory of.txtfiles named after each image stem (e.g.001.txt), onex,ypixel pair per line in a fixed anatomical order. Some releases append extra classification lines after the 19th point, which are ignored. Passlandmarks_file_2for a second rater directory to average the two raters into one ground truth. - Consolidated CSV (common on Kaggle mirrors, e.g.
jiahongqian/cephalometric-landmarks). Pointlandmarks_fileat a.csvwhose header isimage_path,1_x,1_y,2_x,2_y,...and whose rows give one image's filename followed by the landmark pixel coordinates. Only the images listed in the CSV are kept, which is how the dataset's official train/test splits (separate CSV files) are honoured while every image lives in one directory.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
root
|
Union[str, Path]
|
directory of radiograph images (searched recursively). |
required |
image_size
|
Optional[int]
|
images (and landmarks) are rescaled to this square size. |
None
|
landmarks_file
|
Optional[Union[str, Path]]
|
a directory of per-image |
None
|
landmarks_file_2
|
Optional[Union[str, Path]]
|
optional second rater's |
None
|
n_landmarks
|
int
|
landmarks per image (19 for the ISBI2015 challenge). |
19
|
Source code in deltaflow/datasets/radiograph.py
RadiographDataset
¶
RadiographDataset(root, image_size=None, transform=None, landmarks_file=None, normalize_landmarks=True)
Bases: Dataset
Base dataset over a flat directory of grayscale radiographs.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
root
|
Union[str, Path]
|
directory containing image files. |
required |
image_size
|
Optional[int]
|
if given, images are resized to |
None
|
transform
|
Optional[Callable]
|
optional callable applied to the loaded PIL image before conversion to a tensor. Receives and must return a PIL image. |
None
|
landmarks_file
|
Optional[Union[str, Path]]
|
optional path to a landmark annotation file, parsed
by |
None
|
normalize_landmarks
|
bool
|
if |
True
|