# Breakthrough and Challenging Application: Mixed Reality-Assisted Intracardiac Surgery
## 2 Materials and Methods
### Heart Segmentation  
The starting point for crafting the 3D heart model is derived from Digital Imaging and Communications in Medicine (DICOM) images obtained from CT scans. A subject with aortic stenosis undergoing cardiac CT was considered. The _MicroDicom Viewer_ program was downloaded and utilized to visualize the CT images (in DICOM format). The selection of the slices relative to the heart facilitates their transfer to segmentation software. The professional software called _Materialise Mimics_ was used to process the CT data. This platform is employed by researchers and users seeking to customize production processes to meet specific requirements. Generally, open-source software only identifies the external surface of an anatomic part. Instead, _Materialise Mimics_ overcomes these technological limitations, allowing to segment and visualize internal cardiac structures. So, _Materialise Mimics_ was chosen for this project because it allows to exhibit a realistic mesh of infrastructures and both the external and internal surface of the anatomic portion. To ascertain the suitability of this platform, the first step was to segment the heart and then dissect it with a plane to examine its interior presentation and verify the realistic mesh, distinct from the surface mesh. Two segmentation approaches were employed: (i) region-based segmentation and (ii) edge-based segmentation. The edge-based approach facilitates segmentation by studying and identifying edges. It partitions an image based on abrupt changes in local grayscale levels, which must be sufficiently distinct from each other. Conversely, the region-based segmentation method relies on similarities between regions, excluding edges and considering regions within the anatomical region of interest. The first procedure is the region-based segmentation. The objective is to identify the region, which could be an anatomical district within the organ or the organ itself. However, region-based segmentation alone is not sufficient to obtain a comprehensive 3D model, because of its tendency to be approximate in edge detection. Therefore, both segmentation methods were applied to ensure an accurate delineation. Herein are delineated the primary algorithms employed in the construction of the 3D model:  
_Threshold_--This tool is employed at the onset of the segmentation process. It selects pixels within a specified intensity range contained within a chosen bounding box. The outcome is a preliminary mask that typically necessitates further refinement using additional tools. Multiple Slice EditOperating on one of the principal CT views, this tool interpolates masks drawn on a limited number of slices. Users segment the most significant slices, resulting in a mask for each section within the selected interval. It can be paired with threshold definition to confine the interpolation to pixels within a specified intensity range. It is particularly effective for structures exhibiting a distinct and consistent section across principal planes, enabling the creation of a comprehensive segmentation mask with minimal errors from manually built slices. Region GrosBeginning with the selection of a seed pixel (or series of seeds), this tool isolates individual portions of a pre-existing mask through connectivity analysis. It is useful for refining a threshold-derived mask by eliminating isolated parts. It can be utilized to isolate major volumes of the left ventricle/left atrium, right ventricle/right atrium, and connected vascular system. Level Tracingdefines a contour in which all pixels share the same background value as the selected pixel. Hollowerex the selected segment with a uniformly thick shell. SmoothingSmooths the segments by filling holes and/or removing extrusions. Various smoothing methods (Joint, Median, Closing-Filling Holes) with a kernel size of 3 mm were applied, followed by an additional smoothing factor of 0.5.