Algorithm
The original algorithm used to analyze small artery PC-MRI data as described in previous work2, 26, 28 was developed in MATLAB (version R2015b, the MathWorks, Natick, MA). These MATLAB scripts have been rewritten in Python 3.7 to develop SELMA for analysis of the cerebral perforating arteries at the level of the basal ganglia or the white matter at the semioval center (Fig. 1). SELMA was developed to be compatible with all 2D PC-MRI DICOM data, regardless of MRI vendor or field strength. The implementation of the algorithm in SELMA follows that of the original codes2, 26, 28, but includes several updates and improvements, which will be detailed below.
Analysis in SELMA can be started by drawing a region of interest (ROI) on the 2D PC-MRI images using the software interface or loading such mask from the disk. The first step of the analysis is the estimation of the noise level in the phase and magnitude frames, which is computed on a voxel-wise basis using the standard deviation of the complex signal (constructed from the phase and magnitude data) over the cardiac cycle. The root mean square of the standard deviations of the imaginary and complex parts of the constructed complex signal are computed next. A median filter with a user-defined kernel size (default 10 mm) is then applied to the root mean square maps. The temporal signal-to-noise ratio of the magnitude frames (SNRmag) is computed by dividing the magnitude frames with the median filtered root mean square maps. The phase maps are scaled to velocity maps with the pre-defined velocity encoding (venc) of the scan protocol parameters available from the DICOM header. The velocity frames are averaged over the cardiac cycle and median-filtered with a 10 mm kernel. The median filtered velocity map is subtracted from the raw velocity maps at each point in the cardiac cycle to remove the background phase of static tissue and to center the velocity around zero. Next, using SNRmag, the standard deviation of the corrected velocity maps (σv) can be computed using the following formula30:
$$\:{\sigma\:}_{v}=\frac{{v}_{enc}}{\pi\:}\frac{1}{{SNR}_{mag}}$$
The corrected velocity maps are divided by σv to obtain the temporal signal-to-noise ratio of the velocity frames (SNRv). Based on the SNRmag and SNRv, voxels in the 2D PC-MRI image can be clustered into several profiles (Table 1). For the detection of vessels in the basal ganglia, clusters of voxels with an SNRmag and SNRv above a positive noise threshold (Tn) are detected as potential arteries. Clusters of voxels in the semioval center are identified as arteries only if SNRv is lower than the negative Tn, regardless of SNRmag. The sign for SNRv in the semioval center is changed due to the opposite directionality of the blood flow of the perforating arteries at the semioval center compared to the basal ganglia. Tn can be changed by the user by changing the significance level in the settings (default 0.05, in which case Tn = 1.96). A new addition in SELMA is the scaling of Tn based on the number of acquired heart phases and the temporal resolution of the data. Estimation of the SNR in the magnitude and velocity frames are dependent on the heart rate, which affects the number of acquired heart phases, and on the number of k-space lines acquired per heartbeat and TR of the acquisition, which affects the temporal resolution.
After identification of the arteries that exceed Tn, operators of SELMA can select the options to automatically filter out arteries whose orientation is far from being perpendicular to the scanning plane and/or to deduplicate arteries that are too close to each other. The blood flow velocity in arteries that are not perpendicular to the scanning plane will be underestimated2. SELMA considers the artery's roundness to determine whether the artery can be considered as perpendicular to the scanning plane, at least in first approximation, in which case it should be included in the analysis. An ellipse is fitted to the artery's circumference, and the axes ratio of the ellipse is computed, which discards the artery from further analysis if the axes ratio exceeds a user-set threshold (default 2). Artery detections that are too close to each other might be multiple detections on a single artery oriented parallel to the scanning plane or might be caused by ghosting artefacts. In such cases, SELMA discards all arteries except the one with the highest velocity if detected within a user-set distance (default 1.2 mm) from each other. These options can be applied both to basal ganglia and semioval center focussed PC-MRI scans. Additional options can be selected to erode the outer region of the ROI and/or filter out ghosting artefacts from the scans. Arteries in the outer edges of the ROI in the semioval center are more prone to motion artifacts. Users can specify how many voxels from the edges of the ROI can be eroded (default 80). Ghosting of larger arteries in the phase encoding direction can lead to erroneous artery detections. SELMA incorporates the automatic ghosting censoring method as previously described26. First, SELMA identifies the large blood arteries by applying a relative intensity threshold on the magnitude images. Only clusters of voxels in the top magnitude percentile defined by the user (default 0.3%) and larger than a minimum size are included as potential large arteries. Depending on the size of the bright voxel cluster, an exclusion zone will be drawn around the cluster. Undesired detections in these zones will be discarded from further analysis. Ghosting artefacts are a larger issue in the semioval center when automatically segmented ROIs are used compared to the basal ganglia where they can be avoided when manually delineating a ROI. In the options, users can define custom values for the thresholds, voxel sizes of the arteries or length and width of the exclusion zones.
Another addition to SELMA is the ability for operators to censor artery detections in the basal ganglia manually. Selecting this option will override the in-plane artery censoring and deduplication steps. SELMA will visualize all detected arteries and guide the user systematically through every artery prompting the user if it should be discarded for analysis. The user can see the proximity of the artery to others in the user interface, and the axes ratio of the artery is provided to aid the user in this process. The user can opt to keep or discard the highlighted artery, and is then guided to the next one. After all detected arteries have been evaluated, SELMA prompts the user to either save their results, or to restart the manual vessel censoring process again from the beginning. All parts of the manual vessel censoring functionality can be directly performed in the GUI.
After final artery selection, the number of perforating arteries (Ndetected), their mean blood flow velocity (vmean) and the velocity PI are assessed. The PI is generally defined as \(\:\frac{{v}_{max}-{v}_{min}}{{v}_{mean}}\), where vmax, vmin, and vmean, are the maximum, minimum, and mean of the velocity trace over the cardiac cycle in cm/s. We calculated the PI from the averaged velocity trace of all final included arteries, while the individual velocity traces were normalized before averaging (hence, vmean in the PI formula was 1.0 by definition). During the development of SELMA, an approach using the median of the normalized velocity trace was also considered, however during internal testing, we found that the blood flow velocity distribution over all arteries for each time point in the cardiac cycle followed a normal distribution and that using a median estimator had a higher uncertainty than the mean estimator, which led to inflated values of the PI19. Thus, we opted to use the mean of the normalized velocity trace to compute the PI. During internal testing, we observed similar group differences in blood flow velocity and velocity PI using the mean versus median normalized velocity trace.
User interface
Analysis of small vessel 2D PC-MRI data has been made more user friendly with the addition of a GUI in SELMA (Fig. 1). 2D PC-MRI scans of either the basal ganglia or the semioval center in DICOM format can be loaded into SELMA via the menu in the top bar. ROIs that were either manually drawn in SELMA or segmented with external software, such as white matter masks, can also be loaded from the disk with this menu. Analysis can be started with the 'Analyse' option in the menu for single scans or, if masks are already provided, entire folders containing scans. The batch analysis option in SELMA allows for automatic analysis of multiple scans without any user input, drastically speeding up the analysis process. Two default voxel clustering settings have been defined, tailored to acquisitions at the basal ganglia and semioval center, respectively. Before the analysis, the actual slice location must be selected in the bottom right-hand corner to ensure that the corresponding predefined voxel clustering settings are applied in SELMA. Custom clustering options can also be selected in this menu for analysis of data that do not fall into the standard profiles for basal ganglia or semioval center scans. The remaining options in the top menu allow for changing the contrast or zoom of the image, which can also be directly manipulated in the user interface using the mouse. In the settings menu, the operator can change several options and thresholds as described in the 'Algorithm' section.
SELMA was developed specifically with the goal of an easy to maintain code base. To this end, the GUI and the processing parts of the code are intentionally separated in different classes that can only talk to each other using the Signal-and-Slot paradigm. This should enable future developers to easily understand the code, and make small changes to either the processing algorithms or the GUI without accidentally introducing unwanted behavior elsewhere in the program.
Test data
The implementation of the analysis algorithm in SELMA was validated with 7T MRI (Achieva 7T, Philips Medical Systems, Best, The Netherlands) data from previous work29. These 2D PC-MRI data were acquired with a 32-channel receive head coil (Nova Medical, Wilmington, NC, United States) in 14 patients with coarctation of the aorta and 15 control subjects with no history of cardiovascular disease, neurological disease, or intellectual disability. The 2D PC sequence was planned on a 3D T1-weighted image at the level of the basal ganglia (Fig. 2) and was retrospectively gated using a peripheral pulse oximeter for triggering. The following scan parameters were used: 250 × 250 mm2 field of view; acquired spatial resolution 0.3 × 0.3 × 2.0 mm3, reconstructed spatial resolution (through zero-filling in k-space) 0.2 × 0.2 × 2.0 mm3; TR/TE = 28/14.7–15.1 ms; flip angle = 50°; TFE factor = 2 (i.e. number of k-lines acquired per cardiac frame, per heart beat); velocity encoding = 20 cm/s; acquired temporal resolution = 112 ms; 13–15 reconstructed heart phases, depending on the heart rate; SENSE factor = 1.5; scan duration was about 5 minutes for a heart rate of 60 beats/min.
Inter-rater reliability was assessed with data from 8 different scanning sites comprising three different MRI vendors: Philips (Achieva 7T, Philips Healthcare, Best, The Netherlands), Siemens (MAGNETOM 7T, Siemens Healthineers, Erlangen, Germany) and General Electric (GE) (Discovery MR950, GE Healthcare, Chicago, Illinois, USA). All MRI data were acquired with a 32-channel receive head coil (Nova Medical, Wilmington, NC, United States), except for one site where a 24-channel receive head coil (Nova Medical, Wilmington, NC, United States) was used. All scanning sites participated in the European Ultrahigh-Field Imaging Network for Neurodegenerative Diseases (EUFIND)31. EUFIND comprises researchers from 22 7T MRI sites in Europe with the common aim of identifying opportunities and challenges of 7T MRI for clinical and research applications in neurodegeneration. Each site included healthy elderly subjects aged between 50 and 70 years with an equal gender distribution and attempted to include an equal number of volunteers between 50 and 60 years and between 60 and 70 years to allow for secondary analysis of age and gender effects on the outcome parameters. All institutions performed the scanning under the approval of the institution's local ethical review board, and all subjects provided written informed consent.
The 2D PC-MRI sequence was originally developed for the Philips 7T MRI and the protocol was harmonized across all sites with the parameters in Table 2. Harmonization was limited by the vendor-specific implementation of the 2D PC sequence and parameter ranges. The acquisition slice was planned in the basal ganglia, targeting the perforating lenticulostriate arteries that branch from the circle of Willis. Representative basal ganglia scans per vendor are shown in Fig. 2.
Data analysis
The differences in the outcome measures between SELMA and the previously published results on the validation data were quantified on a group level with a Bland-Altman analysis. Inter-rater reliability of the ROIs drawn in SELMA was assessed using the Dice similarity coefficient (DSC) between ROIs drawn by two trained operators. Inter-rater reliability of the outcome measures using manual artery selection was assessed by calculating the Intra-class Correlation Coefficient (ICC) between two operators. An ICC above 0.75 was considered to be an excellent correlation between operators32. The coefficient of variation (CV) of all outcome measures and the SNRv of the included arteries averaged over all subjects within each site were used to assess inter-site differences. The CV for all sites within a single vendor was computed and subsequently averaged over all vendors to assess the inter-vendor differences. The relation of age and sex with the outcome measures was assessed using a linear mixed model corrected with site and vendor as random effects. All statistical analyses were performed in MATLAB (version R2021a, the MathWorks, Natick, MA) except for the linear mixed modelling, which was performed in R (version 4.2.1, R Foundation for Statistical Computing, Vienna, Austria) with the 'lme4' package.