Beispiel #1
0
 def testLoad(self):
     xtekReader = XTEKReader(self.filename)
     self.assertEqual(xtekReader.geometry.pixel_num_h, 500, "Detector pixel X size is not correct")
     self.assertEqual(xtekReader.geometry.pixel_num_v, 500, "Detector pixel Y size is not correct")
     self.assertEqual(xtekReader.geometry.dist_source_center, -80.6392412185669, "Distance from source to center is not correct")
     self.assertEqual(xtekReader.geometry.dist_center_detector, (1007.006 - 80.6392412185669), "Distance from center to detector is not correct")
Beispiel #2
0
 def testReadAngles(self):    
     xtekReader = XTEKReader(self.filename)
     angles = xtekReader.readAngles()
     self.assertEqual(angles.shape, (63,), "Angles doesn't match")
     self.assertAlmostEqual(angles[46], -085.717, 3, "46th Angles doesn't match")
Beispiel #3
0
# the central slice using the CGLS method. The SophiaBeads dataset with 256
# projections is used as test data and can be obtained from here:
# https://zenodo.org/record/16474
# The filename with full path to the .xtekct file should be given as string
# input to XTEKReader to  load in the data.

# Do all imports
from ccpi.io.reader import XTEKReader
import numpy as np
import matplotlib.pyplot as plt
from ccpi.framework import ImageGeometry, AcquisitionGeometry, AcquisitionData, ImageData
from ccpi.astra.ops import AstraProjectorSimple
from ccpi.optimisation.algs import CGLS

# Set up reader object and read the data
datareader = XTEKReader(
    "REPLACE_THIS_BY_PATH_TO_DATASET/SophiaBeads_256_averaged.xtekct")
data = datareader.get_acquisition_data()

# Extract central slice, scale and negative-log transform
sino = -np.log(data.as_array()[:, :, 1000] / 60000.0)

# Apply centering correction by zero padding, amount found manually
cor_pad = 30
sino_pad = np.zeros((sino.shape[0], sino.shape[1] + cor_pad))
sino_pad[:, cor_pad:] = sino

# Extract AcquisitionGeometry for central slice for 2D fanbeam reconstruction
ag2d = AcquisitionGeometry(
    'cone',
    '2D',
    angles=-np.pi / 180 * data.geometry.angles,