:py:mod:`vamtoolbox.util.data` ============================== .. py:module:: vamtoolbox.util.data Module Contents --------------- Functions ~~~~~~~~~ .. autoapisummary:: vamtoolbox.util.data.sigmoid vamtoolbox.util.data.clipToCircle vamtoolbox.util.data.filterTargetOSMO vamtoolbox.util.data.filterTargetBCLP vamtoolbox.util.data.filterTarget vamtoolbox.util.data.filterSinogram vamtoolbox.util.data._get_fourier_filter vamtoolbox.util.data.histogramEqualization vamtoolbox.util.data.discretize Attributes ~~~~~~~~~~ .. autoapisummary:: vamtoolbox.util.data.fftmodule vamtoolbox.util.data.fft .. py:data:: fftmodule .. py:data:: fft .. py:function:: sigmoid(x, g) .. py:function:: clipToCircle(x: numpy.ndarray) Sets all data outside the inscribed circle to zero :param x: square array to be modified :type x: np.ndarray :returns: input array with all data outside the inscribed circle set to zero :rtype: x .. py:function:: filterTargetOSMO(x: numpy.ndarray, filter_name: str) :param x: :type x: np.ndarray :param filter_name: type of filter to apply to target, options: "ram-lak", "shepp-logan", "cosine", "hamming", "hanning", "none" :type filter_name: str :returns: **x_filtered** -- direct output of filtering in frequency space :rtype: np.ndarray .. py:function:: filterTargetBCLP(real_space_array: numpy.ndarray, filter_name: str) :param real_space_array: :type real_space_array: np.ndarray :param filter_name: type of filter to apply to target, options: "ram-lak", "shepp-logan", "cosine", "hamming", "hanning", "none" :type filter_name: str :returns: **x_filtered** -- direct output of filtering in frequency space :rtype: np.ndarray .. py:function:: filterTarget(real_space_array: numpy.ndarray, filter_name: str) :param real_space_array: :type real_space_array: np.ndarray :param filter_name: type of filter to apply to target, options: "ram-lak", "shepp-logan", "cosine", "hamming", "hanning", "none" :type filter_name: str :returns: **x_filtered** -- direct output of filtering in frequency space :rtype: np.ndarray .. py:function:: filterSinogram(sinogram: numpy.ndarray, filter_name: str) Filters a set of sinogram for a 2D or 3D target :param sinogram: input sinogram :type sinogram: np.ndarray :param filter_name: type of filter to apply to sinogram, options: "ram-lak", "shepp-logan", "cosine", "hamming", "hanning", "ram-lak_freq", "none" :type filter_name: str :returns: **sinogram_filt** -- filtered sinogram :rtype: np.ndarray .. py:function:: _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. :param size: filter size. Must be even. :type size: int :param filter_name: Filter used in frequency domain filtering. Filters available: ram-lak, shepp-logan, cosine, hamming, hanning. Assign None to use no filter. :type filter_name: str :returns: **fourier_filter** -- The computed Fourier filter. :rtype: np.ndarray .. rubric:: References .. [1] AC Kak, M Slaney, "Principles of Computerized Tomographic Imaging", IEEE Press 1988. .. py:function:: histogramEqualization(x: numpy.ndarray, bit_depth: int, output_dtype: numpy.dtype = float) .. py:function:: 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 :param x: array to digitize :type x: nd.ndarray :param bit_depth: bit depth of output, 2^bit_depth number of bins :type bit_depth: int :param range: [min,max] values to discretize within :type range: list :param output_dtype: data type of resulting digitized array :type output_dtype: np.dtype (optional)