@staticmethod
    def get_permutation_from_orientations(orientation_in, orientation_out):
        """
        This function return the permutation necessary to convert a coordinate/image from orientation_in
        to orientation_out
        :param orientation_in: string (ex: AIL)
        :param orientation_out: string (ex: RPI)
        :return: two lists: permutation list (int) and inversion list (-1 if need to inverse)
        """
        opposite_character = {'L': 'R', 'R': 'L', 'A': 'P', 'P': 'A', 'I': 'S', 'S': 'I'}

        # change the orientation of the image
        perm = [0, 1, 2]
        inversion = [1, 1, 1]
        for i, character in enumerate(orientation_in):
            try:
                perm[i] = orientation_out.index(character)
            except __HOLE__:
                perm[i] = orientation_out.index(opposite_character[character])
                inversion[i] = -1

        return perm, inversion
dataset/ETHPy150Open neuropoly/spinalcordtoolbox/scripts/msct_image.py/Image.get_permutation_from_orientations