<commit_before>import os
import logging
import envoy
from .ants_error import ANTSError

class WarpTransform:
    """An ANTS WarpTransform applies a deformation field and affine transform to an image."""
    
    def __init__(self, moving, fixed, metric):
        """
        :param moving: the file name of the image to transform
        :param fixed: the file name of the reference image
        :parm metric: the similarity metric
        :return: the new transform
        :rtype: WarpTransform
        """
        MAP = "ANTS 2 -m {metric} -i 100x100x10 -r Gauss[0,3] -t SyN[0.25] -o {output}"
        FIELD = "{output}Warp.nii.gz"
        AFFINE = "{output}Affine.txt"
<commit_msg>Add warp facade method.<commit_after>import os
import logging
import envoy
from .ants_error import ANTSError

def warp(moving, fixed, metric):
    """
    Warps to the given moving image to fit the fixed image. The result is a new image
    named by the moving image name without extension followed by 'Registered.nii.gz',
    e.g. 'image0004Registered.nii.gz'.
    
    :param moving: the file name of the image to transform
    :param fixed: the file name of the reference image
    :parm metric: the similarity metric
    :return: the name of the new image file
    """
    return WarpTransform(moving, fixed, metric).apply()

class WarpTransform:
    """An ANTS WarpTransform applies a deformation field and affine transform to an image."""
    
    def __init__(self, moving, fixed, metric):
        """
        :param moving: the file name of the image to transform
        :param fixed: the file name of the reference image
        :parm metric: the similarity metric
        :return: the new transform
        :rtype: WarpTransform
        """
        MAP = "ANTS 2 -m {metric} -i 100x100x10 -r Gauss[0,3] -t SyN[0.25] -o {output}"
        FIELD = "{output}Warp.nii.gz"
        AFFINE = "{output}Affine.txt"

{'fraction_non_alphanumeric': 0.08937960042060988, 'fraction_numerical': 0.016824395373291272, 'mean_word_length': 2.760869565217391, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '6333892', 'n_tokens_mistral': 591, 'n_tokens_neox': 552, 'n_words': 227}