# Generation of a Virtual Cohort of Patients for in Silico Trials of Acute Ischemic Stroke Treatments
## 2 Materials and Methods
### Generation of Virtual Patients  
A statistical shape modeling (SSM) approach was used for the generation of virtual patients. SSM generally relies on the application of a principal component analysis (PCA) to a set of anatomic representations to identify a mean anatomy and a number of modes of shape variation [23]. In this work, the training dataset was made of the cerebral anatomies of 88 patients, described by the vascular centerlines and the associated lumen diameter for each point of the centerline. The whole processing of the data was performed through a developed MATLAB (Math-Works, Natick, MA, USA) code. The centerlines were first smoothed and resampled such that each vascular segment was made of the same number of points for each patient. Linear interpolation was used to associate the diameter values to the new points. Segmentation artifacts frequently occurred at the extreme points. If a diameter value at the extreme point of a centerline was more than 50% bigger or smaller than the previous diameter, it was corrected by assigning the same diameter of the previous point. To have homogeneous anatomies, and without evidence of significant anatomic differences between the two sides of the intracranial cerebral vasculature [24; 25; 26; 27], the left-side anatomies were mirrored to obtain a right-side cerebrovascular for all the training data. Subsequently, rigid registration was performed to align the anatomies. A PCA was conducted on the aligned centerlines with associated diameters to identify the principal modes of shape variation. The \(N\) modes which cumulatively represented 95% of the anatomy information were selected. The description of each vascular anatomy was then reduced to the first \(N\) principal dimensions. One hundred virtual patients were generated by randomly sampling the values of the \(N\) principal dimensions following normal distributions fitted to each principal dimension in the training dataset. The Lilliefors test was used to test normality. An acceptance criterion was defined to reject unphysiological anatomic realizations. For this purpose, the vascular anatomies were analyzed to extract geometric parameters with the method described in [9]. Briefly, each ICA was divided into 4 bends (from the T-junction: superior, anterior, posterior, and inferior), and each bend was analyzed to extract the average diameter (D\({}^{\text{sup}}\), D\({}^{\text{mat}}\), D\({}^{\text{pos}}\), and D\({}^{\text{inf}}\)), the curvature expressed as the radius of the fitting circle (r\({}^{\text{sup}}\), r\({}^{\text{mat}}\), r\({}^{\text{pos}}\), and r\({}^{\text{inf}}\)), and the tortuosity, calculated as the ratio between the bend length along the centerline and the distance between the bend extremes (t\({}^{\text{sup}}\), t\({}^{\text{ant}}\), t\({}^{\text{pos}}\), and t\({}^{\text{inf}}\)) (Figure 1). In addition, the three angles formed at the T-junction (\(\alpha^{\text{ICA-ACA}}\), \(\alpha^{\text{ICA-M1}}\), and \(\alpha^{\text{M1-ACA}}\)) and the threeangles at the M1 bifurcation (\(\alpha^{\text{M1-M2a}}\), \(\alpha^{\text{M1-M2b}}\), and \(\alpha^{\text{M2a-M2b}}\)) were calculated. Finally, the average diameters of the ACA, M1, and M2 segments (D\({}^{\text{ACA}}\), D\({}^{\text{M1}}\), and D\({}^{\text{M2}}\)) were stored. Since the inferior bend did not show significant variability among the analyzed cerebrovascular anatomies, r\({}^{\text{inf}}\) and t\({}^{\text{inf}}\) were excluded from the acceptance criteria. A total of 19 geometric parameters were calculated both for the anatomies in the training dataset to define their admissible ranges, and for the generated virtual patients, to evaluate the acceptability of the anatomy. If any of the parameters had a value outside the minimum-maximum range of the training dataset, the generated virtual patient was discarded.