Volume Filters and Transforms

leapctype.tomographicModels.allocate_volume(self, val=0.0, astensor=False)

Allocates reconstruction volume data

It is not necessary to use this function. It is included simply for convenience.

Parameters:

val (float) – value to fill the array with

Returns:

numpy array/ pytorch tensor if numAngles, numRows, and numCols are all positive, None otherwise

leapctype.tomographicModels.down_sample_volume(self, factors, f=None)

down-samples the given volume data

This function applies an anti-aliasing filter and down-samples volume data and updates the CT volume parameters accordingly. This anti-aliasing filter is the same one used in the LowPassFilter function.

Parameters:
  • factors – 3-element array of down-sampling factors

  • f (C contiguous float32 numpy array or torch tensor) – volume data to down-sample

Returns:

down-sampled array (if volume data was provided in the arguments)

leapctype.tomographicModels.up_sample_volume(self, factors, f=None, dims=None)

up-samples the given volume data

This function up-samples volume data and updates the CT volume parameters accordingly. The up-sampling is performed using trilinear interpolation.

Parameters:
  • factors – 3-element array of up-sampling factors

  • f (C contiguous float32 numpy array or torch tensor) – volume data to up-sample

Returns:

up-sampled array (if volume data was provided in the arguments)

leapctype.tomographicModels.AzimuthalBlur(self, f, FWHM)

Applies an low pass filter to the volume data in the azimuthal direction, f, for each z-slice

The CT volume parameters must be set prior to running this function.

Parameters:
  • f (C contiguous float32 numpy array or torch tensor) – volume data

  • FWHM (float) – full width at half maximum of the filter (in degrees)

Returns:

f, the same as the input with the same name

leapctype.tomographicModels.convertToRhoeZe(self, f_L, f_H, sigma_L, sigma_H)

transforms a low and high energy pair to electron density and effective atomic number

Parameters:
  • f_L (3D C contiguous float32 numpy array or torch tensor) – low energy volume in LAC units

  • f_H (3D C contiguous float32 numpy array or torch tensor) – high energy volume in LAC units

  • sigma_L (3D C contiguous float32 numpy array or torch tensor) – mass cross section values for elements 1-100 at the low energy

  • sigma_H (3D C contiguous float32 numpy array or torch tensor) – mass cross section values for elements 1-100 at the high energy

Returns:

the Ze and rho volumes