code: def get_template(self, R):
          
  
          centers, widths = self.init_centers_widths(R)
          template_prior =\
              np.zeros(self.K * (self.n_dim + 2 + self.cov_vec_size))
          # template centers cov and widths var are const
          template_centers_cov = np.cov(R.T) * math.pow(self.K, -2 / 3.0)
          template_widths_var = self._get_max_sigma(R)
          centers_cov_all = np.tile(from_sym_2_tri(template_centers_cov), self.K)
          widths_var_all = np.tile(template_widths_var, self.K)
          # initial mean of centers' mean
          self.set_centers(template_prior, centers)
          self.set_widths(template_prior, widths)
          self.set_centers_mean_cov(template_prior, centers_cov_all)
          self.set_widths_mean_var(template_prior, widths_var_all)
          return template_prior, template_centers_cov, template_widths_var
docs: Compute a template on latent factors
  
          Parameters
          ----------
          R : 2D array, in format [n_voxel, n_dim]
              The scanner coordinate matrix of one subject's fMRI data
  
          Returns
          -------
          template_prior : 1D array
              The template prior.
  
          template_centers_cov:  2D array,  in shape [n_dim, n_dim]
              The template on centers' covariance.
  
          template_widths_var: float
              The template on widths' variance