toupy.resolution package

Submodules

toupy.resolution.FSC module

FOURIER SHELL CORRELATION modules

class toupy.resolution.FSC.FSCPlot(img1, img2, threshold='halfbit', ring_thick=1, apod_width=20)[source]

Bases: FourierShellCorr

Upper level object to plot the FSC and threshold curves

Parameters
  • img1 (ndarray) – A 2-dimensional array containing the first image

  • img2 (ndarray) – A 2-dimensional array containing the second image

  • threshold (str, optional) – The option onebit means 1 bit threshold with SNRt = 0.5, which should be used for two independent measurements. The option halfbit means 1/2 bit threshold with SNRt = 0.2071, which should be use for split tomogram. The default option is half-bit.

  • ring_thick (int, optional) – Thickness of the frequency rings. Normally the pixels get assined to the closest integer pixel ring in Fourier Domain. With ring_thick, each ring gets more pixels and more statistics. The default value is 1.

  • apod_width (int, optional) – Width in pixel of the edges apodization. It applies a Hanning window of the size of the data to the data before the Fourier transform calculations to attenuate the border effects. The default value is 20.

Returns

  • fn (ndarray) – A 1-dimensional array containing the frequencies normalized by the Nyquist frequency

  • FSC (ndarray) – A 1-dimensional array containing the Fourier Shell correlation curve

  • T (ndarray) – A 1-dimensional array containing the threshold curve

plot()[source]
class toupy.resolution.FSC.FourierShellCorr(img1, img2, threshold='halfbit', ring_thick=1, apod_width=20)[source]

Bases: object

Computes the Fourier Shell Correlation 1 between image1 and image2, and estimate the resolution based on the threshold funcion T of 1 or 1/2 bit.

Parameters
  • img1 (ndarray) – A 2-dimensional array containing the first image

  • img2 (ndarray) – A 2-dimensional array containing the second image

  • threshold (str, optional) – The option onebit means 1 bit threshold with SNRt = 0.5, which should be used for two independent measurements. The option halfbit means 1/2 bit threshold with SNRt = 0.2071, which should be use for split tomogram. The default option is half-bit.

  • ring_thick (int, optional) – Thickness of the frequency rings. Normally the pixels get assined to the closest integer pixel ring in Fourier Domain. With ring_thick, each ring gets more pixels and more statistics. The default value is 1.

  • apod_width (int, optional) – Width in pixel of the edges apodization. It applies a Hanning window of the size of the data to the data before the Fourier transform calculations to attenuate the border effects. The default value is 20.

Returns

  • FSC (ndarray) – Fourier Shell correlation curve

  • T (ndarray) – Threshold curve

Note

If 3D images, the first axis is the number of slices, ie., [slices, rows, cols]

References

1

M. van Heel, M. Schatzb, Fourier shell correlation threshold criteria, Journal of Structural Biology 151, 250-262 (2005)

apodization()[source]

Compute the Hanning window of the size of the data for the apodization

Note

This method does not depend on the parameter apod_width from the class

circle()[source]

Create circle with apodized edges

fouriercorr()[source]

Method to compute FSC and threshold

nyquist()[source]

Evaluate the Nyquist Frequency

ringthickness()[source]

Define indexes for ring_thick

transverse_apodization()[source]

Compute a tapered Hanning-like window of the size of the data for the apodization

toupy.resolution.FSCtools module

FOURIER SHELL CORRELATION

toupy.resolution.FSCtools.compute_2tomograms(sinogram, theta, **params)[source]

Split the tomographic dataset in 2 datasets and compute 2 tomograms from them.

Parameters
  • sinogram (ndarray) – A 2-dimensional array containing the sinogram

  • theta (ndarray) – A 1-dimensional array of thetas

Returns

  • recon1 (ndarray) – A 2-dimensional array containing the 1st reconstruction

  • recon2 – A 2-dimensional array containing the 2nd reconstruction

toupy.resolution.FSCtools.compute_2tomograms_splitted(sinogram1, sinogram2, theta1, theta2, **params)[source]

Compute 2 tomograms from already splitted tomographic dataset

Parameters
  • sinogram1 (ndarray) – A 2-dimensional array containing the sinogram 1

  • sinogram2 (ndarray) – A 2-dimensional array containing the sinogram 2

  • theta1 (ndarray) – A 1-dimensional array of thetas for sinogram1

  • theta2 (ndarray) – A 1-dimensional array of thetas for sinogram2

Returns

  • recon1 (ndarray) – A 2-dimensional array containing the 1st reconstruction

  • recon2 – A 2-dimensional array containing the 2nd reconstruction

toupy.resolution.FSCtools.split_dataset(sinogram, theta)[source]

Split the tomographic dataset in 2 datasets

Parameters
  • sinogram (ndarray) – A 2-dimensional array containing the sinogram

  • theta (ndarray) – A 1-dimensional array of thetas

Returns

  • sinogram1 (ndarray) – A 2-dimensional array containing the 1st sinogram

  • sinogram2 – A 2-dimensional array containing the 2nd sinogram

  • theta1 (ndarray) – A 1-dimensional array containing the 1st set of thetas

  • theta2 (ndarray) – A 1-dimensional array containing the 2nd set of thetas