def compute_sigma(self, beta, mu):
        """
        Compute the weighted standard deviation of the dictionary slices projection weights

        :param beta: similarities vector for one target slice

        :param mu: weighted mean of the dictionary slices projection weights for one target slice

        :return sigma:
        """
        '''
        sigma = []
        for beta_slice, mu_slice in zip(beta, mu):

            sigma.append([beta_slice.dot((self.model.pca.dataset_coord[v, :] - mu_slice[v]) ** 2)
                          for v in range(len(mu_slice))])

        return np.asarray(sigma)
        '''
        return np.asarray([beta.dot((self.model.pca.dataset_coord[v, :] - mu[v]) ** 2) for v in range(len(mu))])

    # ------------------------------------------------------------------------------------------------------------------
dataset/ETHPy150Open neuropoly/spinalcordtoolbox/dev/sct_segment_gray_matter_asman/sct_asman_old.py/TargetSegmentationGroupwise.compute_sigma/original