Sandstone data#

This example reconstructs experimental tomography data from a sandstone rock sample collected at the I12 beamline at Diamond Light Source. The dataset is available from the Sandstone rock tomographic data Zenodo record.

sandstone reconstruction

Fig. 16 Reconstructed slice of the sandstone dataset#

Download the data#

The Zenodo record provides two datasets:

  • dataset_sandstone1.zip (17.9 GB); and

  • dataset_sandstone2.zip (17.8 GB).

Download either archive from Zenodo and extract it to a directory with enough space for both the archive and its extracted contents. The instructions below apply to either dataset.

Note

These are large downloads. Make sure that sufficient storage is also available for the reconstruction and TIFF images produced by HTTomo.

After extraction, identify the HDF5 or NeXus tomography file that will be passed to HTTomo as INPUT_FILE.

GPU reconstruction pipeline#

The LPRec3d pipeline uses GPU-accelerated methods for correction, centre finding, stripe removal and reconstruction. It reconstructs the volume with LPRec3d_tomobar and saves the result as TIFF images.

This pipeline requires a CUDA-enabled GPU and the HTTomolibGPU and ToMoBAR backends. See Processing libraries for the available processing libraries.

Copy the following pipeline into a file named LPRec3d_tomobar.yaml:

LPRec3d GPU pipeline for the sandstone dataset
# This pipeline should be supported by the latest developments of HTTomo. Use module load httomo/latest module at Diamond.
# --- Standard tomography loader for NeXus files. ---
- method: standard_tomo
  module_path: httomo.data.hdf.loaders
  parameters:
    data_path: auto
    image_key_path: auto
    rotation_angles: auto
    preview:
      detector_x:   # horizontal data previewing/cropping.
        # when null, the full data dimension is used, i.e., no previewing
        start: null
        stop: null
      detector_y:   # vertical data previewing/cropping.
        # when null, the full data dimension is used, i.e., no previewing
        start: null
        stop: null
    darks: null
    flats: null
    continuous_scan_subset: null
# --- Removing unresponsive/dead pixels in the data, aka zingers. Use if sharp streaks are present in the reconstruction. To be applied before normalisation. ---
- method: remove_outlier
  module_path: httomolibgpu.misc.corr
  parameters:
    kernel_size: 3  # The size of the 3D neighbourhood surrounding the voxel. Odd integer.
    dif: 1000 # A difference between the outlier value and the median value of neighbouring pixels.
# --- Flat-field and dark-field projection correction. --- 
- method: dark_flat_field_correction
  module_path: httomolibgpu.prep.normalize
  parameters:
    flats_multiplier: 1.0
    darks_multiplier: 1.0
    upper_bound: null
    lower_bound: null
# --- Center of Rotation auto-finding. Required for reconstruction bellow. ---
- method: find_center_vo
  module_path: httomolibgpu.recon.rotation
  parameters:
    ind: null  # A vertical slice (sinogram) index to calculate CoR, 'mid' can be used for middle
    average_radius: 0 # Average several sinograms to improve SNR, one can try 3-5 range
    cor_initialisation_value: null  # Use if an approximate CoR is known
    smin: -50
    smax: 50
    srad: 6.0
    step: 0.5
    ratio: 0.5
    drop: 20
  id: centering
  side_outputs:
    cor: centre_of_rotation  # An estimated CoR value provided as a side output
# --- Method to remove stripe artefacts in the data that lead to ring artefacts in the reconstruction. --- 
- method: remove_all_stripe
  module_path: httomolibgpu.prep.stripe
  parameters:
    snr: 3.0
    la_size: 61
    sm_size: 21
    dim: 1
# --- Negative log is required for reconstruction to convert raw intensity measurements into the line integrals of attenuation. --- 
- method: minus_log
  module_path: httomolibgpu.prep.normalize
  parameters: {}
# --- Reconstruction method. ---
- method: LPRec3d_tomobar
  module_path: httomolibgpu.recon.algorithm
  parameters:
    center: ${{centering.side_outputs.centre_of_rotation}}  # Reference to center of rotation side output, a float number or 'null' for a middle of the horizontal dimension.
    detector_pad: false # Horizontal detector padding to minimise circle/arc-type artifacts in the reconstruction. Set to 'true' to enable automatic padding or an integer
    filter_type: shepp
    filter_freq_cutoff: 1.0
    recon_size: null
    recon_mask_radius: 0.95 # Zero pixels outside the mask-circle radius. Make radius equal to 2.0 to remove the mask effect.
# --- Calculate global statistics on the reconstructed volume, required for data rescaling. ---
- method: calculate_stats
  module_path: httomo.methods
  parameters: {}
  id: statistics
  side_outputs:
    glob_stats: glob_stats
# --- Rescaling the data using min/max obtained from `calculate_stats`. ---
- method: rescale_to_int
  module_path: httomolib.misc.rescale
  parameters:
    perc_range_min: 0.0
    perc_range_max: 100.0
    bits: 8
    glob_stats: ${{statistics.side_outputs.glob_stats}}
# --- Saving data into images. ---
- method: save_to_images
  module_path: httomolib.misc.images
  parameters:
    subfolder_name: images
    axis: auto
    file_format: tif  # `tif` or `jpeg` can be used.
    asynchronous: true

The standard loader in this pipeline uses automatic dataset discovery. If the downloaded file does not follow the NXtomo layout, replace the loader’s data_path, image_key_path and rotation_angles values with the corresponding paths in the input file. See Loading data for loader configuration details.

Warning

On a memory-limited workstation, use Previewing to reconstruct a small vertical range first. For example, select ten detector rows in the loader:

preview:
  detector_y:
    start: 1000
    stop: 1010