<commit_before>"""This modules contains utility functions and classes for the access of the file system."""
import os
import typing as t

import pymia.data.loading as load

import mialab.data.structure as structure


class BrainImageFilePathGenerator(load.FilePathGenerator):
    """Represents a brain image file path generator.

    The generator is used to convert a human readable image identifier to an image file path,
    which allows to load the image.
    """

    def __init__(self):
        """Initializes a new instance of the BrainImageFilePathGenerator class."""
        pass

    @staticmethod
    def get_full_file_path(id_: str, root_dir: str, file_key, file_extension: str) -> str:
        """Gets the full file path for an image.

        Args:
            id_ (str): The image identification.
            root_dir (str): The image' root directory.
            file_key (object): A human readable identifier used to identify the image.
            file_extension (str): The image' file extension.

        Returns:
            str: The images' full file path.
        """

        # the commented file_names are for the registration group

        if file_key == structure.BrainImageTypes.T1w:
            file_name = 'T1mni_biasfieldcorr_noskull'
        elif file_key == structure.BrainImageTypes.T2w:
            file_name = 'T2native_biasfieldcorr_noskull'
        elif file_key == structure.BrainImageTypes.GroundTruth:
            file_name = 'labels_mniatlas'
        elif file_key == structure.BrainImageTypes.BrainMask:
            file_name = 'Brainmaskmni'
        elif file_key == structure.BrainImageTypes.RegistrationTransform:
            return os.path.join(root_dir, 'transform.txt')<commit_msg>refactor(BrainImageFilePathGenerator): file names for loading<commit_after>"""This modules contains utility functions and classes for the access of the file system."""
import os
import typing as t

import pymia.data.loading as load

import mialab.data.structure as structure


class BrainImageFilePathGenerator(load.FilePathGenerator):
    """Represents a brain image file path generator.

    The generator is used to convert a human readable image identifier to an image file path,
    which allows to load the image.
    """

    def __init__(self):
        """Initializes a new instance of the BrainImageFilePathGenerator class."""
        pass

    @staticmethod
    def get_full_file_path(id_: str, root_dir: str, file_key, file_extension: str) -> str:
        """Gets the full file path for an image.

        Args:
            id_ (str): The image identification.
            root_dir (str): The image' root directory.
            file_key (object): A human readable identifier used to identify the image.
            file_extension (str): The image' file extension.

        Returns:
            str: The images' full file path.
        """

        # the commented file_names are for the registration group

        if file_key == structure.BrainImageTypes.T1w:
            file_name = 'T1native'
        elif file_key == structure.BrainImageTypes.T2w:
            file_name = 'T2native'
        elif file_key == structure.BrainImageTypes.GroundTruth:
            file_name = 'labels_native'
        elif file_key == structure.BrainImageTypes.BrainMask:
            file_name = 'Brainmasknative'
        elif file_key == structure.BrainImageTypes.RegistrationTransform:
            return os.path.join(root_dir, 'affine.txt')
{'fraction_non_alphanumeric': 0.07301587301587302, 'fraction_numerical': 0.002308802308802309, 'mean_word_length': 2.796276013143483, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6803328', 'n_tokens_mistral': 935, 'n_tokens_neox': 905, 'n_words': 319}