apply_blur_psfs¶
- pysaber.apply_blur_psfs(rad, sod, odd, pix_wid, src_pars, det_pars, padded_widths=[0, 0], pad_type='constant', pad_constant=0)¶
Function to blur the input radiograph with point spread functions (PSF) of X-ray source and detector blurs.
This function blurs the input radiograph with X-ray source blur and detector blur with the specified point spread function (PSF) parameters. This function is useful to observe the effect of source and detector blurs on a simulated radiograph.
- Parameters
rad (numpy.ndarray) – Radiograph of type numpy.ndarray that is normalized using the bright-field (also called flat-field) and dark-field images.
sod (float) – Source to object distance (SOD) of radiograph.
odd (float) – Object to detector distance (ODD) of radiograph.
pix_wid (float) – Effective width of each detector pixel. Note that this is the effective pixel size given by dividing the physical width of each detector pixel by the zoom factor of the optical lens.
src_pars (dict) – Dictionary containing the estimated parameters of X-ray source PSF. It consists of several key-value pairs. The value for key
source_FWHM_x_axisis the full width half maximum (FWHM) of the source PSF along the x-axis (i.e., second numpy.ndarray dimension). The value for keysource_FWHM_y_axisis the FWHM of source PSF along the y-axis (i.e., first numpy.ndarray dimension). All FWHMs are for the source PSF in the plane of the X-ray source (and not the plane of the detector). The value for keycutoff_FWHM_multiplierdecides the non-zero spatial extent of the source PSF. The PSF is clipped to zero beginning at a distance, as measured from the PSF’s origin, equal to the maximum ofsrc_pars['cutoff_FWHM_multiplier']timessrc_pars['source_FWHM_x_axis']/2andsrc_pars['cutoff_FWHM_multiplier']timessrc_pars['source_FWHM_y_axis']/2.det_pars (dict) – Dictionary containing the estimated parameters of detector PSF. It consists of several key-value pairs. The value for key
detector_FWHM_1is the FWHM of the first density function in the mixture density model for detector blur. The first density function is the most dominant part of detector blur. The value for keydetector_FWHM_2is the FWHM of the second density function in the mixture density model. This density function has the largest FWHM and models the long running tails of the detector blur’s PSF. The value for keydetector_weight_1is between0and1and is a measure of the amount of contribution of the first density function to the detector blur. The values for keyscutoff_FWHM_1_multiplierandcutoff_FWHM_2_multiplierdecide the non-zero spatial extent of the detector PSF. The PSF is clipped to zero beginning at a distance, as measured from the PSF’s origin, equal to the maximum ofdet_pars['cutoff_FWHM_1_multiplier']timesdet_pars['detector_FWHM_1']/2anddet_pars['cutoff_FWHM_2_multiplier']timesdet_pars['detector_FWHM_2']/2.padded_widths (list) – List of two integers that specifies the amount of padding already applied to input radiograph. The first integer specifies the padding applied along the first dimension of radiograph. The second integer specifies the padding applied along the second dimension of radiograph. Assumes
padded_widths[k]/2amount of padding is applied at both the left and right extremities of dimensionk, wherekis0or1.pad_type (str) – Type of additional padding that must be used if amount of padding specified in
padded_widthsis insufficient. Supported values areedgeandconstant.pad_constant (float) – If
pad_typeis constant, specify the constant value that must be padded.
- Returns
Radiograph that is blurred using X-ray source and detector blurs.
- Return type
numpy.ndarray