def fit(self, X, y=None):
        """
        X : ANTsImage | string | list of ANTsImage types | list of strings
            images to register to fixed image

        y : string | list of strings
            labels for images
        """
        moving_images = X if isinstance(X, (list,tuple)) else [X]
        moving_labels = y if y is not None else [i for i in range(len(moving_images))]
        fixed_image = self.fixed_image

        self.fwdtransforms_ = {}
        self.invtransforms_ = {}
        self.warpedmovout_ = {}
        self.warpedfixout_ = {}
        
        for moving_image, moving_label in zip(moving_images, moving_labels):
            fit_result = interface.registration(fixed_image,
                                                moving_image,
                                                type_of_transform=self.type_of_transform,
                                                initial_transform=None,
                                                outprefix='',
                                                mask=None,
                                                grad_step=0.2,
                                                flow_sigma=3,
                                                total_sigma=0,
                                                aff_metric='mattes',
                                                aff_sampling=32,
                                                syn_metric='mattes',
                                                syn_sampling=32,
                                                reg_iterations=(40,20,0),
                                                verbose=False)

            self.fwdtransforms_[moving_label] = fit_result['fwdtransforms']
            self.invtransforms_[moving_label] = fit_result['invtransforms']
            self.warpedmovout_[moving_label]  = fit_result['warpedmovout']
            self.warpedfixout_[moving_label]  = fit_result['warpedfixout']

        return self
X : ANTsImage | string | list of ANTsImage types | list of strings
            images to register to fixed image

        y : string | list of strings
            labels for images