Datasets: the DataSet module

This module has some implementations of the DataSet interface that is used in PyNN-FBP. A dataset should be an iterable object, that returns a tuple of numpy.ndarray (image, sinogram, angles). A dataset should also define the int nImages, that gives the number of images in the set. A user can write other implementations suitable to their datasets.

class nnfbp.DataSet.EDFSet(imgfiles, sinofiles, angles, nproj=None)[source]

Bases: object

class nnfbp.DataSet.HDF5Set(fn, nproj=None, nameArray='names', globalAngles='angles', normalize=True)[source]

Bases: object

Dataset defined by a HDF5 file. The HDF5 file should contain an array with the name nameArray (default:'names'), which has a row for each image. The first column gives the name of the array with the image data, the second column the name of the array with sinogram data, and the optional third column should give the name of the array with angle data. One can also define an array with the name globalAngles (default:'angles'), that gives the angle data for all images.

Example HDF5 file:

  • /names: [ ['img01','sino01'],['img02','sino02']]
  • /img01: numpy.ndarray with an image
  • /sino01: numpy.ndarray with a sinogram
  • /img02: numpy.ndarray with an image
  • /sino02: numpy.ndarray with a sinogram
  • /angles: numpy.ndarray with angle data
  • fn (string) – Filename of the HDF5 file
  • nproj (int) – Optional number of angles to downsample to
  • nameArray (string) – Array name of the nameArray (default:'names')
  • globalAngles (string) – Array name of the globalAngles (default:'angles')
  • normalize (boolean) – Whether to normalize images to (0,1) range (default:True)
class nnfbp.DataSet.MATSet(files, angles, nproj=None, sinoname='sino', recname='rec')[source]

Bases: object

class nnfbp.DataSet.PhantomSet(proj, phantom, nImages, reduceFactor=None, I0=None, recP=None, fwP=None)[source]

Bases: object

Data set of phantom simulation data.

  • proj (Projector) – A projector.
  • phantom (Phantom) – A phantom (see nnfbp.Phantoms).
  • nImages (int) – Number of images in the set.
  • reduceFactor (int) – Factor to reduce the number of detectors by.
  • I0 (int) – Number of virtual photon counts during Poisson noise addition.
  • recP (Projector) – Projector to use for reconstructing the sinogram.
  • fwP (Projector) – Projector to use for forward projecting the sinogram.

Previous topic

Reducing the data size: the Reductors module

Next topic

Phantom images: the Phantoms module

This Page