vamtoolbox.util.data#
Module Contents#
Functions#
|
|
|
Sets all data outside the inscribed circle to zero |
|
|
|
|
|
|
|
Filters a set of sinogram for a 2D or 3D target |
|
Construct the Fourier filter. |
|
|
|
Digitizes a variable to requested bit depth and output data type |
Attributes#
- vamtoolbox.util.data.fftmodule#
- vamtoolbox.util.data.fft#
- vamtoolbox.util.data.sigmoid(x, g)#
- vamtoolbox.util.data.clipToCircle(x: numpy.ndarray)#
Sets all data outside the inscribed circle to zero
- Parameters:
x (np.ndarray) – square array to be modified
- Returns:
input array with all data outside the inscribed circle set to zero
- Return type:
x
- vamtoolbox.util.data.filterTargetOSMO(x: numpy.ndarray, filter_name: str)#
- Parameters:
x (np.ndarray) –
filter_name (str) – type of filter to apply to target, options: “ram-lak”, “shepp-logan”, “cosine”, “hamming”, “hanning”, “none”
- Returns:
x_filtered – direct output of filtering in frequency space
- Return type:
np.ndarray
- vamtoolbox.util.data.filterTargetBCLP(real_space_array: numpy.ndarray, filter_name: str)#
- Parameters:
real_space_array (np.ndarray) –
filter_name (str) – type of filter to apply to target, options: “ram-lak”, “shepp-logan”, “cosine”, “hamming”, “hanning”, “none”
- Returns:
x_filtered – direct output of filtering in frequency space
- Return type:
np.ndarray
- vamtoolbox.util.data.filterTarget(real_space_array: numpy.ndarray, filter_name: str)#
- Parameters:
real_space_array (np.ndarray) –
filter_name (str) – type of filter to apply to target, options: “ram-lak”, “shepp-logan”, “cosine”, “hamming”, “hanning”, “none”
- Returns:
x_filtered – direct output of filtering in frequency space
- Return type:
np.ndarray
- vamtoolbox.util.data.filterSinogram(sinogram: numpy.ndarray, filter_name: str)#
Filters a set of sinogram for a 2D or 3D target
- Parameters:
sinogram (np.ndarray) – input sinogram
filter_name (str) – type of filter to apply to sinogram, options: “ram-lak”, “shepp-logan”, “cosine”, “hamming”, “hanning”, “ram-lak_freq”, “none”
- Returns:
sinogram_filt – filtered sinogram
- Return type:
np.ndarray
- vamtoolbox.util.data._get_fourier_filter(size: int, filter_name: str)#
Construct the Fourier filter. This computation lessens artifacts and removes a small bias as explained in [1], Chap 3. Equation 61.
- Parameters:
size (int) – filter size. Must be even.
filter_name (str) – Filter used in frequency domain filtering. Filters available: ram-lak, shepp-logan, cosine, hamming, hanning. Assign None to use no filter.
- Returns:
fourier_filter – The computed Fourier filter.
- Return type:
np.ndarray
References
- vamtoolbox.util.data.histogramEqualization(x: numpy.ndarray, bit_depth: int, output_dtype: numpy.dtype = float)#
- vamtoolbox.util.data.discretize(x: numpy.ndarray, bit_depth: int, range: list, output_dtype: numpy.dtype = float)#
Digitizes a variable to requested bit depth and output data type
- Parameters:
x (nd.ndarray) – array to digitize
bit_depth (int) – bit depth of output, 2^bit_depth number of bins
range (list) – [min,max] values to discretize within
output_dtype (np.dtype (optional)) – data type of resulting digitized array