YongchengYAO commited on
Commit
cf836c8
·
1 Parent(s): 72a5419
Files changed (1) hide show
  1. OAIZIB-CM.py +12 -38
OAIZIB-CM.py CHANGED
@@ -15,46 +15,16 @@ from datasets import (
15
  logger = datasets.logging.get_logger(__name__)
16
 
17
  _CITATION = """\
18
- @article{YAO2024103035,
19
- title = {CartiMorph: A framework for automated knee articular cartilage morphometrics},
20
- journal = {Medical Image Analysis},
21
- author = {Yongcheng Yao and Junru Zhong and Liping Zhang and Sheheryar Khan and Weitian Chen},
22
- volume = {91},
23
- pages = {103035},
24
- year = {2024},
25
- issn = {1361-8415},
26
- doi = {https://doi.org/10.1016/j.media.2023.103035}
27
- }
28
-
29
- @InProceedings{10.1007/978-3-031-82007-6_16,
30
- author = {Yao, Yongcheng and Chen, Weitian},
31
- editor = {Wu, Shandong and Shabestari, Behrouz and Xing, Lei},
32
- title = {Quantifying Knee Cartilage Shape and Lesion: From Image to Metrics},
33
- booktitle = {Applications of Medical Artificial Intelligence},
34
- year = {2025},
35
- publisher = {Springer Nature Switzerland},
36
- address = {Cham},
37
- pages = {162--172}
38
- }
39
  """
40
 
41
  _DESCRIPTION = """\
42
  This is the official release of the OAIZIB-CM dataset.
43
-
44
- OAIZIB-CM is based on the OAIZIB dataset.
45
- OAIZIB paper: Automated Segmentation of Knee Bone and Cartilage combining Statistical Shape Knowledge
46
- and Convolutional Neural Networks: Data from the Osteoarthritis Initiative.
47
- In OAIZIB-CM, tibial cartilage is split into medial and lateral tibial cartilages.
48
- OAIZIB-CM includes CLAIR-Knee-103R, consisting of:
49
- - a template image learned from 103 MR images of subjects without radiographic OA,
50
- - a corresponding 5-ROI segmentation mask for cartilages and bones, and
51
- - a corresponding 20-ROI atlas for articular cartilages.
52
-
53
- This dataset is released under the CC BY-NC 4.0 license.
54
  """
55
 
56
- _HOMEPAGE_URL = "https://github.com/YongchengYAO/CartiMorph"
57
-
58
 
59
  class OAIZIBCMDataset(GeneratorBasedBuilder):
60
  VERSION = datasets.Version("1.0.0")
@@ -80,21 +50,25 @@ class OAIZIBCMDataset(GeneratorBasedBuilder):
80
  "mask_path": Value("string"),
81
  }
82
  ),
83
- homepage=_HOMEPAGE_URL,
84
  citation=_CITATION,
85
  )
86
 
87
  def _split_generators(self, dl_manager):
88
  # Download dataset metadata and data files
89
  base_url = "https://huggingface.co/datasets/YongchengYAO/OAIZIB-CM/resolve/load_dataset-support"
90
- train_csv_url = f"{base_url}/train.csv"
91
- test_csv_url = f"{base_url}/test.csv"
 
 
92
  csv_paths = dl_manager.download({"train": train_csv_url, "test": test_csv_url})
93
  logger.info(f"Downloaded CSV paths: {csv_paths}")
94
 
95
  # Extract main dataset archive
 
 
 
96
  data_root_dir = dl_manager.download_and_extract(
97
- "https://huggingface.co/datasets/YongchengYAO/OAIZIB-CM/resolve/load_dataset-support/data/OAIZIB-CM.zip"
98
  )
99
  data_dir = os.path.join(data_root_dir, "OAIZIB-CM")
100
  logger.info(f"Data directory set to {data_dir}")
 
15
  logger = datasets.logging.get_logger(__name__)
16
 
17
  _CITATION = """\
18
+ Please cite these papers when using this dataset:
19
+ - CartiMorph: A framework for automated knee articular cartilage morphometrics
20
+ - Quantifying Knee Cartilage Shape and Lesion: From Image to Metrics
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
21
  """
22
 
23
  _DESCRIPTION = """\
24
  This is the official release of the OAIZIB-CM dataset.
25
+ (https://huggingface.co/datasets/YongchengYAO/OAIZIB-CM/blob/load_dataset-support/README.md)
 
 
 
 
 
 
 
 
 
 
26
  """
27
 
 
 
28
 
29
  class OAIZIBCMDataset(GeneratorBasedBuilder):
30
  VERSION = datasets.Version("1.0.0")
 
50
  "mask_path": Value("string"),
51
  }
52
  ),
 
53
  citation=_CITATION,
54
  )
55
 
56
  def _split_generators(self, dl_manager):
57
  # Download dataset metadata and data files
58
  base_url = "https://huggingface.co/datasets/YongchengYAO/OAIZIB-CM/resolve/load_dataset-support"
59
+ # train_csv_url = f"{base_url}/train.csv"
60
+ # test_csv_url = f"{base_url}/test.csv"
61
+ train_csv_url = f"train.csv"
62
+ test_csv_url = f"test.csv"
63
  csv_paths = dl_manager.download({"train": train_csv_url, "test": test_csv_url})
64
  logger.info(f"Downloaded CSV paths: {csv_paths}")
65
 
66
  # Extract main dataset archive
67
+ # data_root_dir = dl_manager.download_and_extract(
68
+ # "https://huggingface.co/datasets/YongchengYAO/OAIZIB-CM/resolve/load_dataset-support/data/OAIZIB-CM.zip"
69
+ # )
70
  data_root_dir = dl_manager.download_and_extract(
71
+ "data/OAIZIB-CM.zip"
72
  )
73
  data_dir = os.path.join(data_root_dir, "OAIZIB-CM")
74
  logger.info(f"Data directory set to {data_dir}")