Australian SynchrotronΒΆ

This section contains a script to read the Australian Synchrotron Facility tomography dataset and reconstruct it with tomoPy.

Download file: rec_australian.py

 1#!/usr/bin/env python
 2# -*- coding: utf-8 -*-
 3
 4"""
 5TomoPy example script to reconstruct the Australian Synchrotron Facility
 6data as original tiff.
 7"""
 8
 9from __future__ import print_function
10import tomopy
11import dxchange
12
13if __name__ == '__main__':
14
15    # Set path to the micro-CT data to reconstruct.
16    fname = 'data_dir/'
17
18    proj_start = 0
19    proj_end = 1801
20    flat_start = 0
21    flat_end = 10
22    dark_start = 0
23    dark_end = 10
24
25    ind_tomo = range(proj_start, proj_end)
26    ind_flat = range(flat_start, flat_end)
27    ind_dark = range(dark_start, dark_end)
28
29    # Select the sinogram range to reconstruct.
30    start = 290
31    end = 294
32
33    # Read the Australian Synchrotron Facility data
34    proj, flat, dark = dxchange.read_aus_microct(fname, ind_tomo, ind_flat, ind_dark, sino=(start, end))
35
36    # Set data collection angles as equally spaced between 0-180 degrees.
37    theta = tomopy.angles(proj.shape[0])
38
39    # Flat-field correction of raw data.
40    proj = tomopy.normalize(proj, flat, dark)
41
42    # Find rotation center.
43    rot_center = tomopy.find_center(proj, theta, init=1024, ind=0, tol=0.5)
44    print("Center of rotation: ", rot_center)
45
46    proj = tomopy.minus_log(proj)
47
48    # Reconstruct object using Gridrec algorithm.
49    rec = tomopy.recon(proj, theta, center=rot_center, algorithm='gridrec')
50
51    # Mask each reconstructed slice with a circle.
52    rec = tomopy.circ_mask(rec, axis=0, ratio=0.95)
53
54    # Write data as stack of TIFs.
55    dxchange.write_tiff_stack(rec, fname='recon_dir/aus_')