Distortion-correction data#

This example reconstructs a 180-degree scan from Tomographic data for demonstrating distortion correction methods, published on Zenodo by Nghia T. Vo, Robert C. Atwood and Michael Drakopoulos.

Detector optics can displace image features and introduce shape errors and streak artefacts in a reconstruction. Dark/flat-field correction adjusts intensities; distortion correction adjusts the positions at which those intensities are sampled. Both corrections are needed in this example.

Prepare the data#

Download the following files from the Zenodo dataset and save them together in a local directory named dist_corr:

  • tomographic_projections.hdf (19.9 GB): the projection images;

  • darks.hdf (221.2 MB): the dark-field images; and

  • flats.hdf (553.0 MB): the flat-field images.

The record also provides metadata.nxs, dot_pattern.zip and reconstruction.zip. These additional files are not required by the pipeline below, which supplies rotation angles and distortion coefficients directly in its YAML configuration.

Each HDF file stores its images at /entry/data/data. The loader therefore uses explicit dataset paths, with darks and flats in separate files. Rotation angles are supplied explicitly from 0 to 180 degrees for 1801 projections.

GPU reconstruction pipeline#

This pipeline requires a CUDA-enabled GPU and the HTTomolibGPU, ToMoBAR and HTTomolib backends. See Processing libraries and Run your first pipeline for setup and execution options.

Download distortion_correction_data.yaml into dist_corr, or copy the pipeline below into a file with that name.

GPU pipeline for the distortion-correction dataset
# 180-degree distortion-correction data: https://zenodo.org/records/3339629
# Run from the dist_corr directory, which contains all three HDF5 files.
- method: standard_tomo
  module_path: httomo.data.hdf.loaders
  parameters:
    data_path: /entry/data/data
    image_key_path: null
    rotation_angles:
      user_defined:
        start_angle: 0.0
        stop_angle: 180.0
        angles_total: 1801
    preview:
      detector_y:
        start: 1000
        stop: 1050
    darks:
      file: darks.hdf
      data_path: /entry/data/data
    flats:
      file: flats.hdf
      data_path: /entry/data/data

- method: dark_flat_field_correction
  module_path: httomolibgpu.prep.normalize
  parameters: {}

# Apply the supplied calibration to the normalised projections.
- method: distortion_correction_proj_discorpy
  module_path: httomolibgpu.prep.alignment
  parameters:
    metadata_path: null
    order: 1
    mode: reflect
    xcenter: 1230.99353849
    ycenter: 1018.86666868
    list_fact:
      - 1.00015857686
      - -1.00246012274e-06
      - -8.9859016203e-10
      - -2.31488898858e-12
      - 7.6288191801e-16

- method: remove_stripe_based_sorting
  module_path: httomolibgpu.prep.stripe
  parameters:
    size: 11
    dim: 1

- method: find_center_vo
  module_path: httomolibgpu.recon.rotation
  parameters:
    ind: mid
    average_radius: 3
    cor_initialisation_value: 1390
    smin: -100
    smax: 100
    srad: 6.0
    step: 0.5
    ratio: 0.5
    drop: 20
  id: centering
  side_outputs:
    cor: centre_of_rotation

- method: minus_log
  module_path: httomolibgpu.prep.normalize
  parameters: {}

- method: LPRec3d_tomobar
  module_path: httomolibgpu.recon.algorithm
  parameters:
    center: ${{centering.side_outputs.centre_of_rotation}}
    detector_pad: true
    filter_type: shepp
    filter_freq_cutoff: 1.0
    recon_size: null
    recon_mask_radius: 2.0

- method: save_to_images
  module_path: httomolib.misc.images
  parameters:
    subfolder_name: images
    axis: auto
    file_format: tif
    asynchronous: true

The pipeline loads detector rows 1000:1050 to reconstruct a preview of 50 slices, retaining the full detector width and all projection angles. The processing order is:

  1. Correct the projections using the dark and flat fields.

  2. Apply distortion_correction_proj_discorpy with the supplied calibration.

  3. Reduce stripes that would produce ring artefacts.

  4. Estimate the centre of rotation using find_center_vo.

  5. Apply minus_log and reconstruct with LPRec3d_tomobar.

  6. Save the reconstructed slices as TIFF images.

Note

Calibration is performed separately, for example using Discorpy. These coefficients belong to this detector configuration; use the appropriate calibration for other data. A narrow vertical preview can limit the source rows available for interpolation near its boundaries. Use a wider preview or the full detector height when assessing the final reconstruction.

Dataset and method references#

When using these data, cite the dataset: Vo, N. T., Atwood, R. C. and Drakopoulos, M. (2019). Tomographic data for demonstrating distortion correction methods, version v1. Zenodo. DOI: 10.5281/zenodo.3339629.

The associated paper describes the preprocessing methods: Vo, N. T., Atwood, R. C. and Drakopoulos, M. (2019). Preprocessing techniques for removing artifacts in synchrotron-based tomographic images. Proceedings of SPIE 11113, 111131I. DOI: 10.1117/12.2530324.