resomapper.processing.preprocessing =================================== .. py:module:: resomapper.processing.preprocessing Functions --------- .. autoapisummary:: resomapper.processing.preprocessing.denoise resomapper.processing.preprocessing.select_denoising_filter resomapper.processing.preprocessing.info_and_ask_denoising_params resomapper.processing.preprocessing.show_denoised_output resomapper.processing.preprocessing.non_local_means_denoising resomapper.processing.preprocessing.non_local_means_2_denoising resomapper.processing.preprocessing.ascm_denoising resomapper.processing.preprocessing.local_pca_denoising resomapper.processing.preprocessing.mp_pca_denoising resomapper.processing.preprocessing.patch2self_denoising resomapper.processing.preprocessing.gibbs_suppress resomapper.processing.preprocessing.show_bias_field_correction_ask resomapper.processing.preprocessing.n4_bias_field_correct Module Contents --------------- .. py:function:: denoise(nifti_file_path, modality, output_folder, params=None, selected_filter=None) .. py:function:: select_denoising_filter(modality) .. py:function:: info_and_ask_denoising_params(filter_name, params) Print a message indicating the selected filter and ask the user to input the neccesary parameters. :param filter_name: Name of the selected filter. :type filter_name: str :param params: Dictionary containing the parameter names along with a list that contains the predetermined value and a brief description :type params: dict :returns: Dictionary containing the selected values for each parameter name. :rtype: dict .. py:function:: show_denoised_output(original_image, denoised_image, ask_user='Denoising') Display the denoised output and residuals of the denoising process. This method takes the original image and its denoised counterpart and displays them side by side along with the residual image obtained by computing the element-wise squared difference between the original and denoised images. A middle slice is shown. :param original_image: The original 3D or 4D image to be denoised. :type original_image: numpy.ndarray :param denoised_image: The denoised version of the original image. :type denoised_image: numpy.ndarray :returns: A boolean value indicating whether the user wants to change the denoising parameters. :rtype: bool .. py:function:: non_local_means_denoising(image, params, check_params=True) Apply non local means denoising to an image using specified parameters. This version uses the skimage library implementation of this filter. :param image: Input 3D/4D image array to be denoised. :type image: numpy.ndarray :param params: Dictionary containing the denoising parameters to be used. If None, the user will be prompted to select the parameters. :type params: dict or None :returns: A tuple containing the denoised image and the selected denoising parameters. :rtype: tuple .. py:function:: non_local_means_2_denoising(image, params, check_params=True) Apply non local means denoising to an image using specified parameters. This version uses Dipy's implementation of this filter. :param image: Input 3D/4D image array to be denoised. :type image: numpy.ndarray :param params: Dictionary containing the denoising parameters to be used. If None, the user will be prompted to select the parameters. :type params: dict or None :returns: A tuple containing the denoised image and the selected denoising parameters. :rtype: tuple .. py:function:: ascm_denoising(image, params, check_params=True) Apply Adapative Soft Coefficient Matching denoising to an image using specified parameters. :param image: Input 3D/4D image array to be denoised. :type image: numpy.ndarray :param params: Dictionary containing the denoising parameters to be used. If None, the user will be prompted to select the parameters. :type params: dict or None :returns: A tuple containing the denoised image and the selected denoising parameters. :rtype: tuple .. py:function:: local_pca_denoising(image, gtab, params, check_params=True) Apply local PCA denoising to the given image using specified parameters. :param image: Input 3D/4D image array to be denoised. :type image: numpy.ndarray :param gtab: B-values and gradient directions associated with the input image. :type gtab: numpy.ndarray :param params: Dictionary containing the denoising parameters to be used. If None, the user will be prompted to select the parameters. :type params: dict or None :returns: A tuple containing the denoised image and the selected denoising parameters. :rtype: tuple .. py:function:: mp_pca_denoising(image, params, check_params=True) Apply Marcenko-Pastur PCA denoising to an image using specified parameters. :param image: Input 3D/4D image array to be denoised. :type image: numpy.ndarray :param params: Dictionary containing the denoising parameters to be used. If None, the user will be prompted to select the parameters. :type params: dict or None :returns: A tuple containing the denoised image and the selected denoising parameters. :rtype: tuple .. py:function:: patch2self_denoising(image, bvals, params, check_params=True) Apply patch2self denoising to the given image using specified parameters. :param image: Input 3D/4D image array to be denoised. :type image: numpy.ndarray :param bvals: B-values associated with the input image. :type bvals: numpy.ndarray :param params: Dictionary containing the denoising parameters to be used. If None, the user will be prompted to select the parameters. :type params: dict or None :returns: A tuple containing the denoised image and the selected denoising parameters. :rtype: tuple .. py:function:: gibbs_suppress(nifti_file_path, unringed_nii_output_path=None, check_params=True) .. py:function:: show_bias_field_correction_ask(original_image, corrected_image, log_bias_field) .. py:function:: n4_bias_field_correct(nifti_file_path, corrected_nii_output_path=None, params=None, check_params=True)