SiddiqueAkhonda
commited on
Commit
•
0140f09
1
Parent(s):
422bc15
Update README.md
Browse files
README.md
CHANGED
@@ -96,6 +96,61 @@ Simulation-based testing is constrained to the parameter variability represented
|
|
96 |
There is a risk of misjudging model performance if the simulated examples do not capture the variability in real patients. Please
|
97 |
see the paper for a full discussion of biases, risks, and limitations.
|
98 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
99 |
|
100 |
## Citation
|
101 |
```
|
|
|
96 |
There is a risk of misjudging model performance if the simulated examples do not capture the variability in real patients. Please
|
97 |
see the paper for a full discussion of biases, risks, and limitations.
|
98 |
|
99 |
+
## How to use it
|
100 |
+
The msynth dataset is a very large dataset so for most use cases it is recommended to make use of the streaming API of `datasets`.
|
101 |
+
The msynth dataset has three configurations: 1) device_data, 2) segmentation_mask, and 3) metadata
|
102 |
+
You can load and iterate through the dataset using the configurations with the following lines of code:
|
103 |
+
|
104 |
+
```python
|
105 |
+
from datasets import load_dataset
|
106 |
+
ds = load_dataset("didsr/msynth", 'device_data') # For device data for all breast density, mass redius, mass density, and relative dose, change configuration to 'segmentation_mask' and 'metadata' to load the segmentation masks and bound information
|
107 |
+
print(ds_data["device_data"])
|
108 |
+
|
109 |
+
# A sample data instance
|
110 |
+
|
111 |
+
{'Raw': '~\\.cache\\huggingface\\datasets\\downloads\\extracted\\59384cf05fc44e8c0cb23bb19e1fcd8f0c39720b282109d204a85561fe66bdb1\\SIM\\P2_5.0_fatty.8336179.1\\1\\projection_DM1.raw',
|
112 |
+
'mhd': '~/.cache/huggingface/datasets/downloads/extracted/59384cf05fc44e8c0cb23bb19e1fcd8f0c39720b282109d204a85561fe66bdb1/SIM/P2_5.0_fatty.8336179.1/1\\projection_DM1.mhd',
|
113 |
+
'loc': '~/.cache/huggingface/datasets/downloads/extracted/59384cf05fc44e8c0cb23bb19e1fcd8f0c39720b282109d204a85561fe66bdb1/SIM/P2_5.0_fatty.8336179.1/1\\projection_DM1.loc',
|
114 |
+
'dcm': '~/.cache/huggingface/datasets/downloads/extracted/59384cf05fc44e8c0cb23bb19e1fcd8f0c39720b282109d204a85561fe66bdb1/SIM/P2_5.0_fatty.8336179.1/1\\DICOM_dm\\000.dcm',
|
115 |
+
'density': 'fatty',
|
116 |
+
'mass_radius': 5.0}
|
117 |
+
```
|
118 |
+
Msynth dataset can also be loaded using custom breast density, mass redius, mass density, and relative dose information
|
119 |
+
|
120 |
+
```python
|
121 |
+
from datasets import load_dataset
|
122 |
+
|
123 |
+
# Dataset properties. change to 'all' to include all the values of breast density, mass redius, mass density, and relative dose information
|
124 |
+
config_kwargs = {
|
125 |
+
"lesion_density": ["1.0"],
|
126 |
+
"dose": ["20%"],
|
127 |
+
"density": ["fatty"],
|
128 |
+
"size": ["5.0"]
|
129 |
+
}
|
130 |
+
|
131 |
+
# Loading device data
|
132 |
+
ds_data = load_dataset("didsr/msynth", 'device_data', **config_kwargs)
|
133 |
+
# Loading segmentation-mask
|
134 |
+
ds_seg = load_dataset("didsr/msynth", 'segmentation_mask', **config_kwargs)
|
135 |
+
```
|
136 |
+
The meta data can also be loaded using the datasets API. An example of using metadata is given in **Demo:** [https://github.com/DIDSR/msynth-release/tree/master/examples](https://github.com/DIDSR/msynth-release/tree/master/examples)
|
137 |
+
|
138 |
+
```python
|
139 |
+
from datasets import load_dataset
|
140 |
+
# Loading metadata
|
141 |
+
ds_meta = load_dataset("didsr/msynth", 'metadata')
|
142 |
+
|
143 |
+
# A sample data instance
|
144 |
+
ds_meta['metadata'][0]
|
145 |
+
|
146 |
+
# Output
|
147 |
+
|
148 |
+
{'fatty': '~\\.cache\\huggingface\\datasets\\downloads\\extracted\\3ea85fc6b3fcc253ac8550b5d1b21db406ca9a59ea125ff8fc63d9b754c88348\\bounds\\bounds_fatty.npy',
|
149 |
+
'dense': '~\\.cache\\huggingface\\datasets\\downloads\\extracted\\3ea85fc6b3fcc253ac8550b5d1b21db406ca9a59ea125ff8fc63d9b754c88348\\bounds\\bounds_dense.npy',
|
150 |
+
'hetero': '~\\.cache\\huggingface\\datasets\\downloads\\extracted\\3ea85fc6b3fcc253ac8550b5d1b21db406ca9a59ea125ff8fc63d9b754c88348\\bounds\\bounds_hetero.npy',
|
151 |
+
'scattered': '~\\.cache\\huggingface\\datasets\\downloads\\extracted\\3ea85fc6b3fcc253ac8550b5d1b21db406ca9a59ea125ff8fc63d9b754c88348\\bounds\\bounds_scattered.npy'}
|
152 |
+
|
153 |
+
```
|
154 |
|
155 |
## Citation
|
156 |
```
|