resomapper.core.utils ===================== .. py:module:: resomapper.core.utils Functions --------- .. autoapisummary:: resomapper.core.utils.select_directory resomapper.core.utils.select_file resomapper.core.utils.select_modalities_to_process resomapper.core.utils.close_window resomapper.core.utils.ask_user_parameters resomapper.core.utils.ask_user resomapper.core.utils.ask_user_options resomapper.core.utils.is_folder_and_not_occult resomapper.core.utils.is_folder_or_zip_and_not_occult resomapper.core.utils.is_nii resomapper.core.utils.get_modality_nii_acq resomapper.core.utils.get_modality_nii_map resomapper.core.utils.get_acq resomapper.core.utils.get_nifti_filenames resomapper.core.utils.rename_associated_files resomapper.core.utils.create_readme Module Contents --------------- .. py:function:: select_directory() Allows selection of root directory showing a file explorer window. :returns: full path to the selected directory. :rtype: Path .. py:function:: select_file() Allows selection of a file showing a file explorer window. :returns: full path to the selected file. :rtype: Path .. py:function:: select_modalities_to_process() Select from a checklist those modalities to be processed. :returns: list of str with the selected modalities. :rtype: list .. py:function:: close_window(root) .. py:function:: ask_user_parameters(parameter_dict) Select values for different parameters in an emergent window. If a new value is selected it has to be of the same class as the predetermined value. :param parameter_dict: Dictionary containing the name of the different parameters as keys, along with a list containing the predetermined value for each one and a brief description. :type parameter_dict: dict :returns: Dictionary containing the selected values for each parameter name. :rtype: dict .. py:function:: ask_user(question) Prompts the user with a question and expects a 'y' or 'n' answer. :param question: The question to be displayed to the user. :type question: str :returns: True if the user answers 'y', False if the user answers 'n'. :rtype: bool .. py:function:: ask_user_options(question, options) Prompt a question to the user, display options with meanings, and return the selected option. :param question: The question to ask the user. :type question: str :param options: A dictionary containing the available options as keys and their meanings as values. :type options: dict :returns: The selected option. :rtype: str .. py:function:: is_folder_and_not_occult(path) .. py:function:: is_folder_or_zip_and_not_occult(path) .. py:function:: is_nii(filename) .. py:function:: get_modality_nii_acq(nii_file) .. py:function:: get_modality_nii_map(nii_file) .. py:function:: get_acq(filename) .. py:function:: get_nifti_filenames(sourcedata_dir, study, acq) .. py:function:: rename_associated_files(nifti_filename) .. py:function:: create_readme(output_dir)