drd-Digital_Rocks_Data

drd-Digital_Rocks_Data

drd-Digital_Rocks_Data

drd-pypi

digital_rocks_data_github

简介

Digital Rock Images are three-dimensional datasets of rocks and other porous media.
数字岩石图像是岩石和其他多孔介质的三维数据集。

These are typically acquired using three-dimensional imaging techniques such as Micro-Computer Tomography (MicroCT).
这些图像通常使用三维成像技术(例如微型计算机断层扫描 (MicroCT))获取。

They represent a rich dataset that form a basis for characterization of physical processes involving porous media.
它们代表了丰富的数据集,为表征涉及多孔介质的物理过程奠定了基础。

Digital Rock Images are scattered throughout the web on various hosting sites such as the Digital Rocks Portal, Zenodo, or university specific sites. This library aims to make downloading these datasets easy through a python interface so they can be used in automated image processing workflows, reproducible research, or data science and machine learning worfklows.
数字岩石图像分散在网络上的各种托管网站上,例如 Digital Rocks Portal、Zenodo 或大学专用网站。该库旨在通过 Python 界面轻松下载这些数据集,以便它们可用于自动图像处理工作流程、可重复研究或数据科学和机器学习工作流程。

Furthermore, these images are associated with metadata about their spatial dimensions which should be considered when loading these image datasets.
The library therefore requires these metadata to be available and creates an xarray DataArray which can keep spatial scale information when loading an image dataset.
此外,这些图像与有关其空间维度的元数据相关联,在加载这些图像数据集时应考虑这些元数据。
因此,该库要求这些元数据可用,并创建一个 xarray DataArray,它可以在加载图像数据集时保留空间尺度信息。

Each dataset is linked in this library i.e. no hosting is done by the library itself.
每个数据集都链接到此库中,即库本身不进行任何托管。

Digital Rocks Portal
Eleven Sandstones Dataset

  • Berea
  • Bandera Brown
  • Bandera Gray
  • Bentheimer
  • Berea Sister Gray
  • Berea Upper Gray
  • Buff Berea
  • Castle Gate
  • Kirby
  • Leopard
  • Parker

Imperial College London

使用说明

  • 安装使用
1
pip install drd
  • plot_eleven_sandstones_dataset_example.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
"""
Eleven Sandstones Plotting Example
=========================

This example shows how we can load an image from the eleven sandstones dataset.
这个例子展示了如何从十一块砂岩数据集中加载图像。
"""
from drd.datasets.eleven_sandstones import load_eleven_sandstones
import matplotlib.pyplot as plt

# %%
# Loading the Image
# ------------------------
# 我们将使用名为“load_eleven_sandstones”的实用函数来生成 xarray DataArray
# We will use one of the utility functions called `load_eleven_sandstones` to generate an xarray DataArray
# 它已经包含所有预先配置的空间轴信息和缩放比例。
# which already contains all the spatial axis information and scaling preconfigured.
# 这样,我们将根据空间坐标系对图像数据有一个适当的定义。
# This way we will have a proper definition of the image data in terms of a spatial coordinate system.

img = load_eleven_sandstones("Berea", "Berea_2d25um_grayscale.raw")

# 这是“代码块”的结尾(如果使用上述 IDE)。
# This is the end of the 'code block' (if using an above IDE). All code within
# 此块可轻松一次性执行。
# this block can be easily executed all at once.

# %%
# 使用 xarray 绘制图像数据
# Plotting the Image Data using xarray
# ------------------------
# 我们将使用 xarray 的功能来汇总或选择我们的数据以绘制 z 维度的平均值。
# We will use xarray's ability to summarize or select our data to plot an average over the z dimension.

img.mean(dim='z').plot()
plt.tight_layout()
plt.show()

# %%
# 我们可以清楚地看到我们如何首先从网络下载图像数据,然后计算微型 CT 图像数据集的平均值。
# We can clearly see how we first downloaded the image data from the web and subsequently compute an average over the micro-ct image dataset.
  • plot_icl_sandstones_carbonates_2009_example.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
"""
Imperial College London Sandstones & Carbonates 2009 Dataset
=========================

This example shows how we can load an image from the Imperial College London Sandstones & Carbonates 2009 dataset.

"""
from drd.datasets.icl_sandstones_carbonates_2009 import load_icl_sandstones_carbonates_2009
import matplotlib.pyplot as plt

# %%
# Loading the Image
# ------------------------
# 我们将使用名为“load_icl_sandstones_carbonates_2009”的实用函数来生成 xarray DataArray
# We will use one of the utility functions called `load_icl_sandstones_carbonates_2009` to generate an xarray DataArray
# 它已经包含所有预先配置的空间轴信息和缩放比例。
# which already contains all the spatial axis information and scaling preconfigured.
# 这样,我们将根据空间坐标系对图像数据有一个适当的定义。
# This way we will have a proper definition of the image data in terms of a spatial coordinate system.

img = load_icl_sandstones_carbonates_2009("Berea")

# 这是“代码块”的结尾(如果使用上述 IDE)。
# This is the end of the 'code block' (if using an above IDE). All code within
# 此块可轻松一次性执行。
# this block can be easily executed all at once.

# %%
# Plotting the Image Data using xarray
# ------------------------
# We will use xarray's ability to summarize or select our data to plot an average over the z dimension.

img.mean(dim='z').plot()
plt.tight_layout()
plt.show()

# %%
# We can clearly see how we first downloaded the image data from the web and subsequently compute an average over the micro-ct image dataset.

数据集

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
DATASET_METADATA = {
"Berea": {
"Berea_2d25um_grayscale.raw": {
"url": "https://www.digitalrocksportal.org/projects/317/images/223451/download/",
"voxel_length": [2.25, 2.25, 2.25],
"metric_voxel_length_unit": 1e-6,
"width": 1000,
"height": 1000,
"number_of_slices": 1000,
"byte_order": "little-endian",
"image_type": np.uint8
},
"Berea_2d25um_grayscale_filtered.raw": {
"url": "https://www.digitalrocksportal.org/projects/317/images/223452/download/",
"voxel_length": [2.25, 2.25, 2.25],
"metric_voxel_length_unit": 1e-6,
"width": 1000,
"height": 1000,
"number_of_slices": 1000,
"byte_order": "little-endian",
"image_type": np.uint8
},
"Berea_2d25um_binary.raw": {
"url": "https://www.digitalrocksportal.org/projects/317/images/223453/download/",
"voxel_length": [2.25, 2.25, 2.25],
"metric_voxel_length_unit": 1e-6,
"width": 1000,
"height": 1000,
"number_of_slices": 1000,
"byte_order": "little-endian",
"image_type": np.uint8
}
},
"BanderaBrown": {
"BanderaBrown_2d25um_grayscale.raw": {
"url": "https://www.digitalrocksportal.org/projects/317/images/223448/download/",
"voxel_length": [2.25, 2.25, 2.25],
"metric_voxel_length_unit": 1e-6,
"width": 1000,
"height": 1000,
"number_of_slices": 1000,
"byte_order": "little-endian",
"image_type": np.uint8
},
"BanderaBrown_2d25um_grayscale_filtered.raw": {
"url": "https://www.digitalrocksportal.org/projects/317/images/223454/download/",
"voxel_length": [2.25, 2.25, 2.25],
"metric_voxel_length_unit": 1e-6,
"width": 1000,
"height": 1000,
"number_of_slices": 1000,
"byte_order": "little-endian",
"image_type": np.uint8
},
"BanderaBrown_2d25um_binary.raw": {
"url": "https://www.digitalrocksportal.org/projects/317/images/223455/download/",
"voxel_length": [2.25, 2.25, 2.25],
"metric_voxel_length_unit": 1e-6,
"width": 1000,
"height": 1000,
"number_of_slices": 1000,
"byte_order": "little-endian",
"image_type": np.uint8
}
},
"BanderaGray": {
"BanderaGray_2d25um_grayscale.raw": {
"url": "https://www.digitalrocksportal.org/projects/317/images/223459/download/",
"voxel_length": [2.25, 2.25, 2.25],
"metric_voxel_length_unit": 1e-6,
"width": 1000,
"height": 1000,
"number_of_slices": 1000,
"byte_order": "little-endian",
"image_type": np.uint8
},
"BanderaGray_2d25um_grayscale_filtered.raw": {
"url": "https://www.digitalrocksportal.org/projects/317/images/223457/download/",
"voxel_length": [2.25, 2.25, 2.25],
"metric_voxel_length_unit": 1e-6,
"width": 1000,
"height": 1000,
"number_of_slices": 1000,
"byte_order": "little-endian",
"image_type": np.uint8
},
"BanderaGray_2d25um_binary.raw": {
"url": "https://www.digitalrocksportal.org/projects/317/images/223458/download/",
"voxel_length": [2.25, 2.25, 2.25],
"metric_voxel_length_unit": 1e-6,
"width": 1000,
"height": 1000,
"number_of_slices": 1000,
"byte_order": "little-endian",
"image_type": np.uint8
}
},
"Bentheimer": {
"Bentheimer_2d25um_grayscale.raw": {
"url": "https://www.digitalrocksportal.org/projects/317/images/223461/download/",
"voxel_length": [2.25, 2.25, 2.25],
"metric_voxel_length_unit": 1e-6,
"width": 1000,
"height": 1000,
"number_of_slices": 1000,
"byte_order": "little-endian",
"image_type": np.uint8
},
"Bentheimer_2d25um_grayscale_filtered.raw": {
"url": "https://www.digitalrocksportal.org/projects/317/images/223462/download/",
"voxel_length": [2.25, 2.25, 2.25],
"metric_voxel_length_unit": 1e-6,
"width": 1000,
"height": 1000,
"number_of_slices": 1000,
"byte_order": "little-endian",
"image_type": np.uint8
},
"Bentheimer_2d25um_binary.raw": {
"url": "https://www.digitalrocksportal.org/projects/317/images/223463/download/",
"voxel_length": [2.25, 2.25, 2.25],
"metric_voxel_length_unit": 1e-6,
"width": 1000,
"height": 1000,
"number_of_slices": 1000,
"byte_order": "little-endian",
"image_type": np.uint8
}
},
"BSG": {
"BSG_2d25um_grayscale.raw": {
"url": "https://www.digitalrocksportal.org/projects/317/images/223464/download/",
"voxel_length": [2.25, 2.25, 2.25],
"metric_voxel_length_unit": 1e-6,
"width": 1000,
"height": 1000,
"number_of_slices": 1000,
"byte_order": "little-endian",
"image_type": np.uint8
},
"BSG_2d25um_grayscale_filtered.raw": {
"url": "https://www.digitalrocksportal.org/projects/317/images/223465/download/",
"voxel_length": [2.25, 2.25, 2.25],
"metric_voxel_length_unit": 1e-6,
"width": 1000,
"height": 1000,
"number_of_slices": 1000,
"byte_order": "little-endian",
"image_type": np.uint8
},
"BSG_2d25um_binary.raw": {
"url": "https://www.digitalrocksportal.org/projects/317/images/223466/download/",
"voxel_length": [2.25, 2.25, 2.25],
"metric_voxel_length_unit": 1e-6,
"width": 1000,
"height": 1000,
"number_of_slices": 1000,
"byte_order": "little-endian",
"image_type": np.uint8
}
},
"BUG": {
"BUG_2d25um_grayscale.raw": {
"url": "https://www.digitalrocksportal.org/projects/317/images/223467/download/",
"voxel_length": [2.25, 2.25, 2.25],
"metric_voxel_length_unit": 1e-6,
"width": 1000,
"height": 1000,
"number_of_slices": 1000,
"byte_order": "little-endian",
"image_type": np.uint8
},
"BUG_2d25um_grayscale_filtered.raw": {
"url": "https://www.digitalrocksportal.org/projects/317/images/223468/download/",
"voxel_length": [2.25, 2.25, 2.25],
"metric_voxel_length_unit": 1e-6,
"width": 1000,
"height": 1000,
"number_of_slices": 1000,
"byte_order": "little-endian",
"image_type": np.uint8
},
"BUG_2d25um_binary.raw": {
"url": "https://www.digitalrocksportal.org/projects/317/images/223469/download/",
"voxel_length": [2.25, 2.25, 2.25],
"metric_voxel_length_unit": 1e-6,
"width": 1000,
"height": 1000,
"number_of_slices": 1000,
"byte_order": "little-endian",
"image_type": np.uint8
}
},
"BB": {
"BB_2d25um_grayscale.raw": {
"url": "https://www.digitalrocksportal.org/projects/317/images/223470/download/",
"voxel_length": [2.25, 2.25, 2.25],
"metric_voxel_length_unit": 1e-6,
"width": 1000,
"height": 1000,
"number_of_slices": 1000,
"byte_order": "little-endian",
"image_type": np.uint8
},
"BB_2d25um_grayscale_filtered.raw": {
"url": "https://www.digitalrocksportal.org/projects/317/images/223471/download/",
"voxel_length": [2.25, 2.25, 2.25],
"metric_voxel_length_unit": 1e-6,
"width": 1000,
"height": 1000,
"number_of_slices": 1000,
"byte_order": "little-endian",
"image_type": np.uint8
},
"BB_2d25um_binary.raw": {
"url": "https://www.digitalrocksportal.org/projects/317/images/223472/download/",
"voxel_length": [2.25, 2.25, 2.25],
"metric_voxel_length_unit": 1e-6,
"width": 1000,
"height": 1000,
"number_of_slices": 1000,
"byte_order": "little-endian",
"image_type": np.uint8
}
},
"CastleGate": {
"CastleGate_2d25um_grayscale.raw": {
"url": "https://www.digitalrocksportal.org/projects/317/images/223473/download/",
"voxel_length": [2.25, 2.25, 2.25],
"metric_voxel_length_unit": 1e-6,
"width": 1000,
"height": 1000,
"number_of_slices": 1000,
"byte_order": "little-endian",
"image_type": np.uint8
},
"CastleGate_2d25um_grayscale_filtered.raw": {
"url": "https://www.digitalrocksportal.org/projects/317/images/223474/download/",
"voxel_length": [2.25, 2.25, 2.25],
"metric_voxel_length_unit": 1e-6,
"width": 1000,
"height": 1000,
"number_of_slices": 1000,
"byte_order": "little-endian",
"image_type": np.uint8
},
"CastleGate_2d25um_binary.raw": {
"url": "https://www.digitalrocksportal.org/projects/317/images/223475/download/",
"voxel_length": [2.25, 2.25, 2.25],
"metric_voxel_length_unit": 1e-6,
"width": 1000,
"height": 1000,
"number_of_slices": 1000,
"byte_order": "little-endian",
"image_type": np.uint8
}
},
"Kirby": {
"Kirby_2d25um_grayscale.raw": {
"url": "https://www.digitalrocksportal.org/projects/317/images/223476/download/",
"voxel_length": [2.25, 2.25, 2.25],
"metric_voxel_length_unit": 1e-6,
"width": 1000,
"height": 1000,
"number_of_slices": 1000,
"byte_order": "little-endian",
"image_type": np.uint8
},
"Kirby_2d25um_grayscale_filtered.raw": {
"url": "https://www.digitalrocksportal.org/projects/317/images/223477/download/",
"voxel_length": [2.25, 2.25, 2.25],
"metric_voxel_length_unit": 1e-6,
"width": 1000,
"height": 1000,
"number_of_slices": 1000,
"byte_order": "little-endian",
"image_type": np.uint8
},
"Kirby_2d25um_binary.raw": {
"url": "https://www.digitalrocksportal.org/projects/317/images/223478/download/",
"voxel_length": [2.25, 2.25, 2.25],
"metric_voxel_length_unit": 1e-6,
"width": 1000,
"height": 1000,
"number_of_slices": 1000,
"byte_order": "little-endian",
"image_type": np.uint8
}
},
"Leopard": {
"Leopard_2d25um_grayscale.raw": {
"url": "https://www.digitalrocksportal.org/projects/317/images/223479/download/",
"voxel_length": [2.25, 2.25, 2.25],
"metric_voxel_length_unit": 1e-6,
"width": 1000,
"height": 1000,
"number_of_slices": 1000,
"byte_order": "little-endian",
"image_type": np.uint8
},
"Leopard_2d25um_grayscale_filtered.raw": {
"url": "https://www.digitalrocksportal.org/projects/317/images/223480/download/",
"voxel_length": [2.25, 2.25, 2.25],
"metric_voxel_length_unit": 1e-6,
"width": 1000,
"height": 1000,
"number_of_slices": 1000,
"byte_order": "little-endian",
"image_type": np.uint8
},
"Leopard_2d25um_binary.raw": {
"url": "https://www.digitalrocksportal.org/projects/317/images/223481/download/",
"voxel_length": [2.25, 2.25, 2.25],
"metric_voxel_length_unit": 1e-6,
"width": 1000,
"height": 1000,
"number_of_slices": 1000,
"byte_order": "little-endian",
"image_type": np.uint8
}
},
"Parker": {
"Parker_2d25um_grayscale.raw": {
"url": "https://www.digitalrocksportal.org/projects/317/images/223482/download/",
"voxel_length": [2.25, 2.25, 2.25],
"metric_voxel_length_unit": 1e-6,
"width": 1000,
"height": 1000,
"number_of_slices": 1000,
"byte_order": "little-endian",
"image_type": np.uint8
},
"Parker_2d25um_grayscale_filtered.raw": {
"url": "https://www.digitalrocksportal.org/projects/317/images/223483/download/",
"voxel_length": [2.25, 2.25, 2.25],
"metric_voxel_length_unit": 1e-6,
"width": 1000,
"height": 1000,
"number_of_slices": 1000,
"byte_order": "little-endian",
"image_type": np.uint8
},
"Parker_2d25um_binary.raw": {
"url": "https://www.digitalrocksportal.org/projects/317/images/223484/download/",
"voxel_length": [2.25, 2.25, 2.25],
"metric_voxel_length_unit": 1e-6,
"width": 1000,
"height": 1000,
"number_of_slices": 1000,
"byte_order": "little-endian",
"image_type": np.uint8
}
}
}

案例

创建conda环境,通过pip安装drd

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
from drd.datasets.eleven_sandstones import load_eleven_sandstones
import matplotlib.pyplot as plt

# xarray DataArray with image data
img = load_eleven_sandstones("Berea", "Berea_2d25um_grayscale.raw", "/home/daijin/data/drd_data/")
#img = load_eleven_sandstones("Berea", "Berea_2d25um_grayscale_filtered.raw", "/home/daijin/data/drd_data/")
#img = load_eleven_sandstones("Berea", "Berea_2d25um_binary.raw", "/home/daijin/data/drd_data/")

# Plot average over z dimension
img.mean(dim='z').plot()
#img.mean(dim='x').plot()
#img.mean(dim='y').plot()

plt.tight_layout()
plt.show()

程序运行会检查文件是否下载,下载完成后进行文件校验,校验完成后进行数据读取。

文章作者: HibisciDai
文章链接: http://hibiscidai.com/2024/08/12/drd-Digital_Rocks_Data/
版权声明: 本博客所有文章除特别声明外,均采用 CC BY-NC-SA 4.0 许可协议。转载请注明来自 HibisciDai
好用、实惠、稳定的梯子,点击这里