{
"cells": [
{
"cell_type": "markdown",
"metadata": {},
"source": [
"Belgian Fieldstone Sample\n",
"=========================\n",
"\n",
"This sample is a micro-CT scan of a 4 mm diameter glauconite-rich sandstone sample, by Tom Bultreys and Wesley De Boever, \n",
"acquired with 4.98 micrometer voxel length at Ghent University's Centre for X-ray Tomography\n",
"and hosted at [Digital Rocks Portal](https://www.digitalrocksportal.org/).\n",
"\n",
".. note::\n",
" If you plan to use this data, please remember to [cite the data](https://www.digitalrocksportal.org/projects/297/cite/)\n",
" and the\n",
" [related publications](https://www.digitalrocksportal.org/projects/297/publications/).\n",
"\n",
"\n",
"\n",
"Go to the Belgian Fieldstone project in the Digital Rocks Portal:\n",
"https://www.digitalrocksportal.org/projects/297. Click on `Micro-CT scan`.\n",
"\n",
"
\n",
"\n",
" \n",
"Pay attention to the metadata! We'll need it later. An extra piece of information: this raw data is in Fortran file order.\n",
"Click `Action->Download File`.\n",
"\n",
"
\n",
"\n",
"Let's import the raw file into a RockVerse voxel image. In this example we'll use 8 chunks, halving the total number of voxels in each direction:"
]
},
{
"cell_type": "code",
"execution_count": 1,
"metadata": {},
"outputs": [
{
"name": "stderr",
"output_type": "stream",
"text": [
"[2025-01-09 12:29:43] (Attenuation) Importing raw file: 100%|>>>>>>>>>>| 8/8 [00:21<00:00, 2.75s/chunk]\n"
]
}
],
"source": [
"import rockverse as rv\n",
"\n",
"belgian_fieldstone_data = rv.voxel_image.import_raw(\n",
" rawfile='/path/to/rawdata/BelgianFieldstone/Fieldstone_1000x1000x861_16b.raw',\n",
" store='/path/to/imported/BelgianFieldstone/original', #<- path to the imported the voxel image\n",
" shape=(1000, 1000, 861), #<- From metadata, image size\n",
" dtype='>u2', #<- From metadata, big-endian 16-bit unsigned integer\n",
" offset=0, #<- From metadata\n",
" voxel_length=(4.98, 4.98, 4.98), #<- From metadata\n",
" voxel_unit='um', #<- From metadata, micrometer\n",
" raw_file_order='F', #<- Fortran file order\n",
" chunks=(500, 500, 431), #<- Our choice of chunk size will give a 2x2x2 chunk grid\n",
" field_name='Attenuation', #<- Our choice for field name (X-ray attenuation)\n",
" field_unit='a.u.', #<- Our choice for field units (arbitrary units)\n",
" description='Belgian Fieldstone original X-ray CT',\n",
" overwrite=True #<- Overwrite if file exists in disk\n",
" )"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"The image now is available as a RockVerse voxel image in disk, at the path given in the ``store`` parameter. Remember: RockVerse voxel images are modified Zarr arrays, so you can use all the original properties and methods. Let's take a look at the general structure:"
]
},
{
"cell_type": "code",
"execution_count": 2,
"metadata": {},
"outputs": [
{
"data": {
"text/html": [
"
| Type | rockverse.voxel_image.VoxelImage |
|---|---|
| Data type | uint16 |
| Shape | (1000, 1000, 861) |
| Chunk shape | (500, 500, 431) |
| Order | C |
| Read-only | False |
| Compressor | Blosc(cname='lz4', clevel=5, shuffle=SHUFFLE, blocksize=0) |
| Store type | zarr.storage.DirectoryStore |
| No. bytes | 1722000000 (1.6G) |
| No. bytes stored | 1323693972 (1.2G) |
| Storage ratio | 1.3 |
| Chunks initialized | 8/8 |