def find_coregistration(self, mean_seg=None, transfo_type='Affine', first=True):

        # Coregistraion of the white matter segmentations
        for dic_slice in self.slices:
            name_j_transform = 'transform_slice_' + str(dic_slice.id) + find_ants_transfo_name(transfo_type)[0]
            new_reg_list = dic_slice.reg_to_M.append(name_j_transform)
            dic_slice.set(reg_to_m=new_reg_list)

            if first:
                seg_m = apply_ants_transfo(mean_seg, dic_slice.wm_seg,  transfo_name=name_j_transform, path=self.param.model_dir + '/', transfo_type=transfo_type, metric=self.param.reg_metric)
            else:
                seg_m = apply_ants_transfo(mean_seg, dic_slice.wm_seg_M,  transfo_name=name_j_transform, path=self.param.model_dir + '/', transfo_type=transfo_type, metric=self.param.reg_metric)
            dic_slice.set(wm_seg_m=seg_m.astype(int))
            dic_slice.set(wm_seg_m_flat=seg_m.flatten().astype(int))

        mean_seg = compute_majority_vote_mean_seg([dic_slice.wm_seg_M for dic_slice in self.slices])

        return mean_seg

    # ------------------------------------------------------------------------------------------------------------------
Check for valid bundle format
dataset/ETHPy150Open neuropoly/spinalcordtoolbox/dev/sct_segment_gray_matter_asman/2015-08-17-full_scripts_before_cleaning/sct_asman.py/ModelDictionary.find_coregistration--crossover with--dataset/ETHPy150Open TheTorProject/gettor/gettor/utils.py/valid_format