get_trans_fit

pysaber.get_trans_fit(rad, sod, odd, pix_wid, src_pars, det_pars, tran_pars, edge, pad=[3, 3])

Function to compute the blur model prediction and ideal transmission function for a radiograph with a single straight edge or two mutually perpendicular edges.

For a measured radiograph consisting of a straight sharp edge or two mutually perpendicular edges, get the ideal transmission function and the predicted radiograph from the blur model. Here, the blur model is used to model the impact of blur due to X-ray source and detector.

Parameters
  • rad (numpy.ndarray) – Normalized radiograph of a straight sharp edge or two mutually perpendicular edges.

  • sod (float) – Source to object distance (SOD) for the radiograph rad.

  • odd (float) – Object to detector distance (SDD) for the radiograph rad.

  • 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_axis is the full width half maximum (FWHM) of the source PSF along the x-axis (i.e., second numpy.ndarray dimension). The value for key source_FWHM_y_axis is 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 key cutoff_FWHM_multiplier decides 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 of src_pars['cutoff_FWHM_multiplier'] times src_pars['source_FWHM_x_axis']/2 and src_pars['cutoff_FWHM_multiplier'] times src_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_1 is 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 key detector_FWHM_2 is 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 key detector_weight_1 is between 0 and 1 and is a measure of the amount of contribution of the first density function to the detector blur. The values for keys cutoff_FWHM_1_multiplier and cutoff_FWHM_2_multiplier decide 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 of det_pars['cutoff_FWHM_1_multiplier'] times det_pars['detector_FWHM_1']/2 and det_pars['cutoff_FWHM_2_multiplier'] times det_pars['detector_FWHM_2']/2.

  • tran_pars (list) – List containing the estimated parameters of the transmission function for the input radiograph. It consists of two parameters of type float. These float values give the low and high values respectively of the transmission function. Note that the transmission function is the normalized radiograph image that would have resulted in the absence of blur and noise. If not specified (or specified as None), then the best fitting transmission function parameters are estimated using RANSAC regression.

  • edge (str) – Used to indicate whether there is a single straight edge or two mutually perpendicular edges in each radiograph. If edge is perpendicular, then each radiograph is assumed to have two mutually perpendicular intersecting edges. If it is straight, then each radiograph is assumed to have a single straight edge. Only perpendicular and straight are legal choices for edge.

  • pad (list) – List of two integers that determine the amount of padding that must be applied to the radiographs to reduce aliasing during convolution. The number of rows/columns after padding is equal to pad_factor[0]/pad_factor[1] times the number of rows/columns in each radiograph before padding. For example, if the first element in pad_factor is 2, then the radiograph is padded to twice its size along the first dimension.

Returns

Tuple of two arrays of type numpy.ndarray. The first array is blurred radiograph as predicted by the blur model. The second array is transmission function, which is the ideal readiograph in the absence of source and detector blur.

Return type

tuple