# Whole-Heart Assessment of Turbulent Kinetic Energy in the Repaired Tetralogy of Fallot
## 2 Materials and Methods
### 4D-Flow Data Analysis  
As shown in Figure 1, after acquisition, 4D-flow data were corrected for eddy currents, i.e., linear phase drift according to static tissues, noise masking, and velocity aliasing using \"Velomap_tool\", a Matlab tool developed by [PERSON] et al. in 2007 and that is broadly used by the flow MRI community [24]. Our in-house tool \"4D-Flow Analysis Tool\" was developed in MATLAB 2020b (Mathworks, Natick, MA, USA) and integrates the Velomap tool for data pre-processing. After data correction, an individual phase-contrast magnetic resonance angiogram (PC-MRA) throughout the entire cardiac cycle was used to segment the following vessels: Aorta, Pulmonary Artery (PA), Left Atria (LA), Left Ventricle (LV), Right Atria (RA), and Right Ventricle (RV). The PC-MRA is given by \(I_{i}^{\mathrm{PC-MRA}}(\overset{\rightarrow}{r})=I_{i}^{\mathrm{Mag}}( \overset{\rightarrow}{r})\sqrt{\sum_{j=x,y,z}v_{j,\overset{\rightarrow}{r}}^{2} \overset{\rightarrow}{r}}\), where \(I_{i}^{\mathrm{Mag}}\) is the magnitude image, \(\overset{\rightarrow}{r}\) is the spatial location within the volume, \(v\) is the velocity-encoded image with \(j\) representing the velocity encoding direction in image coordinates (\(x\), \(y\), \(z\)), and \(i\) is the measured time frame in the cardiac cycle. This segmentation approach has been previously reported [25; 26]. Furthermore, each vessel was divided into several regional volumes for facilitating data analysis. The Aorta was divided into the following 4 segments: aortic root, arch, ascending aorta, and descending aorta. The PA was divided into the following 3 segments: left pulmonary artery (LPA), right pulmonary artery (RPA), and mid pulmonary artery (MPA). Lastly, the LA, LV, RA, and RV were divided into the following 2 segments: inferior and superior. After segmentation, an in-house Matlab tool \"YYC 4D Flow TKE Tool\" was used to calculate TKE throughout the entire cardiac cycle for each segmentation, as demonstrated in Figure 2. The magnitude of the individual velocity-encoding directions was reconstructed to compute TKE. TKE is defined as \(TKE=\frac{1}{2}\rho\sum_{i=1}^{3}\sigma_{i}^{2}\), where \(\rho\) is the fluid density, and \(\sigma_{i}\) is the fluctuation intensity in the three orthogonal directions [21]. TKE has been validated in vitro and in vivo by several groups [27; 28; 29; 30; 21]. Our implementation is based on the original code from [PERSON] et al. [21]. Our TKE tool facilitates the integration of individual segmentations and TKE calculation to generate standardized analysis reports using regions of interest and templates. TKE is calculated using the magnitude information from the 4D-flow dataset and taking the intervoxel velocity standard deviation in all 3 spatial directions throughout the cardiac cycle [27]. A variety of hemodynamic parameters were computed for the entire segmentation along with each volumetric segment for each vessel, including maximum TKE (TKEmax), minimum TKE (TKEmin), mean TKE (TKEmean), and standard deviation TKE (TKEstdv). TKEmax was defined as the maximum TKE in any voxel in each region. Similarly, TKEmin was defined as the minimum TKE in any voxel in each region. While TKEmean was defined as the mean TKE in each region. Lastly, TKEstdv was defined as the standard deviation in each region. In addition, simplified standardized templates were created to compare TKE between the two cohorts. Figure 1: Postprocessing of 4D-flow data. First, 4D-flow velocity data in each direction (Vi, Vi, and Vk) were corrected for eddy currents, noise, and aliasing (Panel **(A)**). Followed by correcting the data, a phase contrast-magnetic resonance angiogram (PC-MRA) was created (Panel **(B)**) and was used to isolate the following vessels (Panel **(C)**): Aorta, Pulmonary Artery (PA), Left Atria (LA), Left Ventricle (LV), Right Atria (RA), and Right Ventricle (RV). After segmentation, each vessel was subdivided into various sections. The Aorta is subdivided into the root, ascending, arch, and descending.