## 2 Materials and Methods
### Soft Clustering for Covariance Matrices  
In soft clustering, data points can belong to more than one cluster with a specified membership for each cluster. One of the most widely used algorithms for soft clustering is Fuzzy c-means (FCM). The FCM algorithm aims to minimize the sum of _weighted_ square distances within each cluster (WCSS). For a set of vectors \(x=\{\mathbf{x}_{1},\ldots,\mathbf{x}_{n}\}\), this is defined as follows [19]. Let \(m\in\mathbb{R}\) with \(m\geq 1\) be the fuzzification parameter. Then,  
\[\text{WCSS}=\sum_{j=1}^{n}\sum_{i=1}^{c}w_{ij}^{m}\big{\|}\mathbf{x}_{j}-\bar {\mathbf{x}}_{i}\big{\|}^{2},\text{where}\ \|\mathbf{x}\|=\sqrt{trace(\mathbf{x}^{ \intercal}\mathbf{x})}, \tag{2}\]  
\[w_{ij}=\frac{1}{\sum_{k=1}^{c}\left(\frac{\big{\|}\mathbf{x}_{j}-\bar{\mathbf{ x}}_{i}\big{\|}}{\big{\|}\mathbf{x}_{j}-\bar{\mathbf{x}}_{k}\big{\|}}\right)^{ \frac{2}{m-1}}},\text{and}\ \bar{\mathbf{x}}_{i}=\frac{\sum\limits_{j=1}^{n}w_{ij}^{m}\mathbf{x}_{j}}{ \sum\limits_{j=1}^{n}w_{ij}^{m}}. \tag{3}\] \begin{table}
\begin{tabular}{c c} \hline \hline
**Metric** & **Mean** \\ \hline Euclidean & \(\sum\limits_{\begin{subarray}{c}\vec{\xi}\\ \vec{\xi}\\ \vec{\xi}\\ \vec{\xi}\\ \vec{\xi}\\ \vec{\xi}\\ \vec{\xi}\\ \end{subarray}}^{\vec{\xi}}\) \\ Log Euclidean & \(\exp\left(\frac{\sum\limits_{\begin{subarray}{c}\vec{\xi}\\ \vec{\xi}\\ \vec{\xi}\\ \vec{\xi}\\ \vec{\xi}\\ \end{subarray}}^{\vec{\xi}}w_{ij}^{m}\mathbf{A}_{i}}{\sum\limits_{i=1}^{c}w_{ ij}^{m}}\right)\) \\ Root Euclidean & \(\left(\frac{\sum\limits_{\begin{subarray}{c}\vec{\xi}\\ \vec{\xi}\\ \vec{\xi}\\ \vec{\xi}\\ \vec{\xi}\\ \end{subarray}}^{\vec{\xi}}w_{ij}^{\mathbf{A}_{i}/2}}{\sum\limits_{i=1}^{c}w_{ ij}^{m}}\right)\left(\frac{\frac{\sum\limits_{i=1}^{c}w_{ij}^{m}\mathbf{A}_{i} ^{1/2}}{\sum\limits_{i=1}^{c}w_{ij}^{m}}}{\sum\limits_{i=1}^{c}w_{ij}^{m}} \right)^{\top}\) \\ \hline \hline \end{tabular}
\end{table} 
Table 2: Weighted mean \(\bar{\mathbf{A}}\) using the Euclidean, log, and root Euclidean. The membership (or weight) \(w_{ij}\) represents the probability of \(\mathbf{x}_{j}\) belonging to cluster \(i\), \(i\in\{1,\ldots,c\}\) and it satisfies \(0\leq w_{ij}\leq 1\) and \(\sum_{i=1}^{c}w_{ij}=1\). The K-means algorithm can be recovered from FCM by appropriately setting the membership \(w_{ij}\) values to \(0\) s or \(1\) s.  
In this paper, the natural generalisation is proposed for the use of covariance matrices, by replacing the vectors \(x=\{\mathbf{x}_{1},\ldots,\mathbf{x}_{n}\}\) with covariance matrices \(A=\{\mathbf{A}_{1},\ldots,\mathbf{A}_{n}\}\) and using \(D(\mathbf{A}_{j},\bar{\mathbf{A}}_{i})^{2}\) in place of \(\left\|\mathbf{x}_{j}-\bar{\mathbf{x}}_{i}\right\|^{2}\) as follows:  
\[\text{WCSS}=\sum_{j=1}^{n}\sum_{i=1}^{c}w_{ij}^{m}D(\mathbf{A}_{j},\bar{ \mathbf{A}}_{i})^{2},\text{ where} \tag{4}\]  
\[w_{ij}=\frac{1}{\sum_{k=1}^{c}\left(\frac{D(\mathbf{A}_{j},\mathbf{A}_{i})}{D (\mathbf{A}_{j},\mathbf{A}_{k})}\right)^{\frac{2}{n-1}}}. \tag{5}\]  
The sFCM algorithm [16] uses the neighbouring information to improve clustering and reduce noise. The current paper's generalised version for covariance matrices is provided directly. If \(\mathbf{A}_{j}\) is the covariance matrix for a voxel \(v\), then let \(\text{NB}(\mathbf{A}_{j})\) denote the set of covariance matrices of \(v\)'s neighbouring voxels. Define \(h_{ij}\) as follows [16]:  
\[h_{ij}=\sum_{k\in\text{NB}(\mathbf{A}_{j})}w_{ik}. \tag{6}\]  
Therefore, \(h_{ij}\) represents the sum of the memberships of the neighbouring voxels \(\text{NB}(\mathbf{A}_{j})\). The size of the neighbourhood can vary. For 2D segmentation, a reasonable choice is to take \(\text{NB}(\mathbf{A}_{j})\) as either a \(3\times 3\) or a \(5\times 5\) window around \(\mathbf{A}_{j}\), whilst, for 3D segmentation, take a \(3\times 3\times 3\) or a \(5\times 5\times 5\) window.