‘‘shortCardiac’’ — An open-source framework for fast and standardized assessment of cardiac function

In medicine, especially in radiology, artificial intelligence has sparked a growing interest in automated systems, image analysis, and acquisition standardization. In the wake of this standardization, the research field of ‘‘radiomics’’ has gained importance. Using computer-aided analysis, image data and contours can be evaluated to determine numerical values for shape, size, and gray-scale texture, which can then be examined in a clinical context. Especially in cardiovascular imaging, data acquisition and analysis in different cardiac and respiratory phases are of great interest. However, most research studies use parameters that have been laboriously calculated by hand. ‘‘ShortCardiac’’ is a Python-based framework with a user-friendly GUI for the quantitative determination of cardiac MR parameters. This allows researchers to utilize quantitative MR research for their studies without programming knowledge, with just a few clicks. All calculated parameters can be displayed graphically. ‘‘shortCardiac’’ allows the visualization of segmentation contours, the angle-dependent length measurement, the center of gravity and much more, in addition, the background can be hidden, and the images can be cropped automatically. In addition, ‘‘shortCardiac’’ can also be called via python and due to the object-oriented design, it is possible to integrate new segmentation frameworks with little effort in the future as well as to determine additional parameters. However, ‘‘ShortCardiac’’ comes with certain limitations. It only assesses cardiac short-axis data and functions merely as a postprocessing framework for determining surrogate parameters based on segmentation and image information. Manual segmentations or usage of fully automated segmentations, such as Circle cvi42, require additional software tools. Regardless of these restrictions, ‘‘ShortCardiac’’ provides an efficient, user-friendly tool, enabling researchers to capitalize on the expanding domain of radiomics. © 2023 The Authors. Published by Elsevier B.V. This is an open access article under the CC BY license (http://creativecommons.org/licenses/by/4.0/).


Motivation and significance
In recent years, technological advances have led to the development of a variety of new biosensitive imaging techniques provide radiologists with a comprehensive basis for evaluation [5,12,13,17,18].
The advantages of standardized evaluation pipelines and analysis algorithms are well known [15,19,20], and have been used and improved for years in quantitative MR studies, including Chemical Exchange Saturation Transfer (CEST) [21,22], Quantitative Susceptibility Mapping (QSM) [23], Diffusion tensor imaging (DTI) [24,25], and diffusion-weighted imaging (DWI) [26].However, medical diagnostics, as well as numerous studies in which pathologies are analyzed exclusively without biosensitive imaging, are still based solely on visual analysis.This includes cardiac imaging.As a result, commercial software solutions such as Circle Cvi42 (Circle Cardiovascular Imaging Inc. Calgary, Canada) have been developed in recent years to improve visual representation of the heart.However, clinical research has also made progress in developing automatic methods for segmenting cardiac structures [27][28][29].For example, Shaaf et al. proposed a fully convolutional neural network for automatic segmentation of the left ventricle from short-axis MRI images, which showed better segmentation performance compared to the standard U-mesh model [29].However, segmentations alone are not of clinical utility, not until clinical surrogate parameters are determined based on them.
Therefore, this work aimed to develop an open-source framework for fast and standardized evaluation of cardiac short-axis magnetic resonance imaging (MRI) based on various surrogate parameters from previous studies, as well as the implementation of additional image contrast parameters, which enables a fully comprehensive quantification of MR data.The focus of the application is mainly on medical researchers without programming skills to allow entry into quantitative cardiac MRI using a few clicks, as well as a modular python pipeline for advanced users.We demonstrate the application of our tool to standard clinical MRI with an electrocardiogram (ECG) triggering and non-triggered real-time MRI of the beating heart, which allows comprehensive analysis of cardiac function under physiological conditions and is of research interest.In addition, we validate ''shortCardiac'' against manual references from an experienced radiologist.

Software description
The ''shortCardiac'' framework enables the semi-automatic determination of surrogate parameters for quantitative assessment of cardiac functionality based on short-axis MRI and is intended for scientific research only, especially it is not a medical product.It is distributed as a Jupyter notebook, Python source code (v3.7,Python Software Foundation, Wilmington, DE, USA), and userfriendly, stand-alone executable (.exe) graphical user interface (GUI) under the GNU General Public License (GPU GPL) license (GitHub: https://github.com/MPR-UKD/shortCardiac)and can be freely used and modified (Fig. 1 and Supplementary Figure S1).
The GUI allows a workflow adapted to the clinical work environment through easy navigation and graphical configuration of the evaluation pipeline (Fig. 1) and was developed in consultation with radiologists and cardiologists to facilitate operation.In addition, all calculations can be graphically visualized and saved between steps (Fig. 2).

Software architecture
As described above, ''shortCardiac'' is primarily designed for GUI operation.Nevertheless, ''shortCardiac'' follows a simple object-based architecture.There are four phases in the backend, whereby the actual calculation takes place in the fourth phase, and the other phases are used for preprocessing.The evaluation steps can be modified and extended via GUI and Source code.For this, no advanced programming knowledge is required; users only need to change the values using clicks within the GUI or modify the configuration file.For users with basic Python knowledge, our modular evaluation design allows for the straightforward addition of custom functions that return values and value names to be included in the saved CSV files (for more information, please see the GitHub Repository).
In the first phase, the coordinates and the corresponding DI-COM images (cardiac MR images, X-ray images or computed tomography images in short-axis view) are read in, merged, and stored as a dictionary in Python pickle file format.In the subsequent second fully automated pre-processing step, the segmentations, which can be derived from any software that saves segmentations as NIFTI, such as ITK-SNAP; are checked, and consistent segmentation contours are ensured.This is done by determining polygon segmentations at a user-variable increased resolution as well as smoothing the contours, allowing for more accurate angle-based evaluation.In the third preprocessing step, the anatomical landmarks of the cranial and caudal transition of the interventricular septum into the RV are determined based on the endocardial contours of the right (RV) and left ventricle (LV) (Fig. 2a).The cardiac axis is vertically aligned (Fig. 2b  and c) to allow calculation independent of the acquisition angle and thus standardized [7].The fourth and final step (Fig. 2df) is divided into multiple independent functions to determine additional surrogate parameters.
In addition, ''shortCardiac'' has a debug mode in which individual intermediate steps can be visualized graphically.Furthermore, the functionality can be checked by unit tests.With the current default settings, 351 parameters are calculated per image.A detailed description of the individual post-processing methods can be found in the Jupyter notebook and source code.

Software functionalities
''shortCardiac'' can be used for the evaluation of real-time MR recordings as well as for the evaluation of conventional MR recordings.''shortCardiac'' supports two main functionalities: a user-friendly GUI, which can be executed either in a local Python environment or simply as *.exe, and the source-code-based evaluation.Here the use of the source code does not require advanced knowledge.As demonstrated in Figure S1, users can easily call ''shortCardiac'' using a simple script; they only need to define the DICOM folder and the coordinate file or NIFTI mask file.The evaluation as well as the reading, is executed fully automatically by the generation of class objects.The user only has to navigate independently through the file directory of his research project to evaluate larger amounts of data as well as to merge the patients \volunteers and the associated segmentations.Finally, all calculations are saved as a CSV file and can thus be easily analyzed subsequently.

Illustrative examples
To illustrate the use of ''shortCardiac'', a descriptive single-case observational study was designed with a healthy, 27-year-old male volunteer.The precipitant gave written informed consent and had no abnormalities of cardiac function after medical examination by D.K. (pediatric radiologist with 16 years of experience in cardiovascular MRI) and F.P. (clinical cardiologist with 20 years of experience).Approval from the local review board (Ethics Committee of the Medical Faculty of Heinrich Heine University, Düsseldorf, Germany 6176R) was obtained before the study.In addition, parts of the recorded data with anonymization of all nonrequired DICOM tags are deposited as a sample dataset in the GitHub repository.

Data acquisition
For the cardiac example MR measurements, the volunteer was positioned centrally in the MR scanner (1.5 T MAGNETOM Avanto fit, Siemens Healthineers, Erlangen, Germany) in the supine position, analogous to previous studies [6,7].The MR protocol included a conventional retrospective ECG-gated cross-sectional MR measurement with a slice thickness of 8 mm, repetition time (TR) \echo time (TE) = 56.98/1.1 ms, and a flip angle of 73 • with 14 slices along the short axis of the heart, as described in previous studies [6,7].We also used a real-time gradient echo MRI sequence with pronounced radial undersampling and balanced steady-state free precession (bSSFP) contrast [6,11].Acquisitions at the same slice positions as the conventional sequence provided a temporal resolution of 33.3 ms and a flip angle of 60 • based on only 9 radial spokes.

Evaluation
For our data, we used the automatic segmentation tool of cvi42 (version 5.10.1.(1241); Circle Cardiovascular Imaging Inc. Calgary, Canada).While the automatic segmentation performed well in the middle slices, inaccuracies were observed towards the apex of the heart.To ensure accurate evaluation in all slices, all segmentations were subsequently checked (D.K.) and manually corrected using the freehand contouring tool.The GitHub repository also contains segmentations such as Nifti, such as those generated in the open-source ITK-Snap framework with the freehand polygon tool.Following the segmentation, the data were loaded into our tool and evaluated fully automatically.We used the GUI as well as the default settings for all calculations.Here, we had both the straight lines necessary for calculating the EI and the angle-dependent measurements saved as images (Figs. 3  and 4).As demonstrated in the figures, ''shortCardiac'' not only streamlines the calculation process but also offers an accessible way to visually verify the results.As depicted in Fig. 4, the background can be displayed with transparency, and 3D images can be generated as well.
For our healthy volunteer, in a midventricular slice of the RV and LV endocardium, we observed a periodic dependence of angle-dependent parameters, as expected.For the RV, we observed that different angular segments changed differently (Fig. 5a), and for the LV, the opposite lengths changed simultaneously (Fig. 5b).Compared with EI determination, angle-dependent evaluation allows more specific measurement of segments, which enables accurate mapping of elliptical shape (end-diastole) to a circular shape (end-systole) during cardiac phases of the LV.Similarly, we observed periodic changes in the other numerous radiomic features determined based on both contour and grayscale image information, allowing quantitative analysis of cardiac phases (Fig. 5c).

Validation and accuracy of ''shortCardiac''
One of the most important criteria for tool applicability, besides the ease of use shown in the previous one, is the accuracy compared to the current gold standard, i.e., time-consuming manual reference measurements.Using our real-time MRI data, we, therefore, performed statistical analyses to check the agreement between ''shortCardiac'' and an experienced radiologist.As described above, more than 1400 images were acquired using real-time analysis; because manual analysis of all images would be too time-consuming, 30 MR images were randomly selected and manually measured using the image analysis toolbox of the in-house image archiving and communication system (Sectra Workstation101, IDS7, Linköping, Sweden).
All subsequent statistical analyses were performed in R (v4.1.3,R Foundation for Statistical Computing) (K.L.R.).Both Bland-Altman plots and the intraclass correlation coefficient (ICC(2,1)) with a 95% confidence interval were used to assess the reliability of the automated analysis compared with the parameters [39]: (1) heart angle or septal alignment, (2) septal length corresponding to the length between reference points, and (3) left ventricular (LV-EI(endo)) and right ventricular eccentricity index (RV-EI(endo)) of the endocardium as well as left ventricular epicardium (LV-EI(epi)) as defined in previous studies.
The ICC was classified as poor (ICC < 0.5), moderate (0.5 ≤ ICC < 0.75), good (0.75 ≤ ICC < 0.9), and excellent (ICC ≥ 0.9), according to Koo et al. [40].Due to the experimental design of this study and the small sample size, the significance level of p ≤ 0.05 was corrected to an adjusted significance level of p ≤  For the left ventricle, it was found that at the end of systole, all angular segments are approximately the same distance from the center of gravity.Thus, the ventricle is circular.In contrast, at the end of diastole, there are significant differences in length between the angular segments, suggesting an elliptical shape.(c) In radiometric features, we observed analogous periodic changes that can be further investigated in later studies, possibly leading to different changes depending on disease or stage.0.0125 using the conservative Bonferroni alpha adjustment [41].This ''low'' significance level prevented inflation of the alpha error while maintaining statistical power.
However, it should be emphasized that the evaluation by the radiologist took about 1 h, while ''shortCardiac'' required only 12 s for a complete evaluation.
Although very good accuracy was demonstrated in our validation dataset when evaluated with ''shortCardiac'', it is crucial to consider the impact of the DICOM data resolution on the accuracy of the calculated geometric parameters in ''shortCardiac''.Our software incorporates a scaling factor to enhance and stabilize angular measurements.However, it is worth noting that scaling results in contour smoothing, so images with too low resolution may yield deviating results in accuracy.''ShortCardiac'' thus enables the user to save all calculated parameters graphically to visually verify the accuracy of the results.Moreover, the resolution of the DICOM data may also affect the precision of automatic segmentation methods in ITK-SNAP and other open-source as well as commercial programs.Consequently, segmentation contours should always be visually inspected by a user before evaluation, and if necessary, the contours should be manually corrected within the respective evaluation tools.

Impact
''ShortCardiac'' enables fast and standardized evaluation of both real-time physiological MR measurements and ECG-triggered MR measurements.Using the Bland-Altmann plot and ICC, we validated the performance and accuracy of the presented framework compared to manual evaluation by an experienced radiologist.We can significantly reduce the evaluation time by parallelizing the image processing steps.While an experienced radiologist needs about one hour to acquire five clinically relevant features from a series of 30 images, ''shortCardiac'' needs only 12 s for the same images with the same accuracy.In addition, ''shortCardiac'' determines 351 parameters.The accelerated and computer-aided evaluation supports the analysis of large datasets, the acquisition of quantitative MR values as well as the reproducibility between research groups.
Analogous to the angle-dependent length measurements, which showed periodicity to cardiac phases in our study and in previous studies [7,[30][31][32][33][34], we observed that periodic changes also occurred in parameters determined based on grayscale information.This allows a quantitative description of the image information and may lead to a better understanding and higher detection accuracy of pathologies in subsequent studies.In this regard, previous studies have successfully demonstrated that the determining features can provide additional clinically relevant information [35][36][37][38]42,43].Among others, the study by Pinamonti et al. demonstrated the application of quantitative radiomics feature analysis of echocardiography data for the diagnosis of myocardial amyloidosis [44].However, the radiomics approach also showed promise in feature analysis of cardio-computed tomography data [45,46].In initial proof-of-concept studies, Baessler et al. and other studies have shown that radiomic feature analysis of cardio MR data is able to accurately discriminate between myocardial disease and healthy hearts [45][46][47].Compared with sophisticated biosensitive MR methods, radiomics allows easy application to routinely acquired data [42].Further, this extraction of quantitative information enables a wide range of machine learning analyses, such as cluster analysis and regression algorithms.
In addition, evaluation using ''shortCardiac'' enables the full potential of real-time MRI, i.e., the temporal resolution of physiological processes [5][6][7].Compared to conventional MRI, real-time imaging acquires too many images that can no longer be analyzed manually.Therefore, there is a great interest in automatic analysis tools such as ''shortCardiac''.In an earlier study, this made it possible, among other things, to perform a fully automatic and angle-dependent evaluation of wrists [5].''shortCardiac'' can be operated not only via GUI but also like an API interface, which supports the integration of ''shortCardiac'' into larger pipelines, in which, for example, the data is not segmented using a conventional software solution such as Circle, but by a deep-learning network optimized for its own application.
In addition, ''shortCardiac'' could be particularly useful in the analysis of large CMR datasets, as in the study of Raisi-Estabragh et al. in which the UK Biobank's cardiovascular magnetic resonance imaging data was explored by standardizing the analysis in an efficient way to gain valuable insights for the further development of cardiovascular research [18].Furthermore, the application of ''shortCardiac'' can be extended to various clinical scenarios, as demonstrated by the study of Chen et al. highlighting the prognostic significance of left atrial and biventricular strain analysis in suspected myocarditis using cardiac magnetic resonance imaging in short axis view.Here, ''shortCardiac'' would provide more accurate analysis through fine angle-dependent measurement [43].

Conclusions
The open-source framework ''ShortCardiac'' offers a significant contribution to the field of clinical research by enabling fast, standardized evaluation of both real-time physiological MR measurements and ECG-triggered MR measurements.Our study has demonstrated the impressive performance and accuracy of this framework when compared to manual evaluation by an experienced radiologist, making it an invaluable tool for analyzing large datasets and ensuring reproducibility between research groups.
''ShortCardiac'' not only reduces evaluation time through parallelized image processing steps but also provides an extensive range of 351 parameters, allowing for a more comprehensive understanding of pathologies in subsequent studies.The framework's potential for quantitative description of image information opens up opportunities for machine learning analyses, such as cluster analysis and regression algorithms.
Furthermore, ''ShortCardiac'' allows researchers to harness the full potential of real-time MRI and its temporal resolution of physiological processes.As conventional MRI is limited by the vast number of images that cannot be analyzed manually, the demand for automatic analysis tools like ''ShortCardiac'' is growing.The framework's versatility extends to its operation, supporting both GUI and API interfaces, thus facilitating its integration into larger pipelines.
In conclusion, the open-source framework ''ShortCardiac'', distributed under the GNU GPL license, provides an ideal working environment for clinical research.It allows for the extraction of surrogate parameters that can be used in subsequent studies to examine their changes and relevance to clinical questions.This powerful tool is freely available for use and modification, further promoting its widespread adoption in the field of quantitative cardiac MRI research.

Fig. 1 .
Fig. 1. ''ShortCardiac'' framework with default settings.(Blue Box, 1) Main widget: In the pop-down widget at the top left, you can select how the coordinates have been segmented and which function is to be used to transfer the coordinates to a standardized file format.The ''Load coordinates'' and ''Load DICOM-folder'' buttons can then be used to read the coordinates and the DICOM images.The actual calculation is performed via the ''Execute'' button, and finally, the results are saved in a CSV file.(Red Box, 2) Widget for changing the configuration settings.(2.1)The parallelization can be adapted to the respective hardware and personnel requirements via the number of workers.The coordinates are scaled up with the rescaling factor for more accurate angle measurements.Furthermore, it can be activated that the heart angle should be corrected and whether the coordinates should be smoothed during rescaling.(2.2) Possibility to modify the angle-dependent measurements to the specific problem.(2.3) Determination of which texture analyses are to be performed.(2.4) Possibility to save the calculations as images to adapt them to individual personal requirements.(For interpretation of the references to color in this figure legend, the reader is referred to the web version of this article.)

Fig. 2 .
Fig. 2. Overview of specific surrogate parameters and standardized correction of cardiac alignment for a mid-ventricular slice of the real-time MRI.(a) Cranial (P1) and caudal (P2) reference points for cardiac alignment.(b) MR image before standardized cardiac alignment overlaid with the cardiac angle (green angle) of the septal axis (red) to the y-axis (blue) and after standardized correction of cardiac alignment (c).(d) Center of gravity of the endocardial contour of the right (P3, red) and left (P4, blue) ventricle, the epicardial contour of the left ventricle (P5, green), and the center point of the septal axis (P6, black).(e) Plotted straight lines for eccentricity index determination (red, blue, green).(f) Angle-dependent measurement of the cardiac contours. .(For interpretation of the references to color in this figure legend, the reader is referred to the web version of this article.)

Fig. 3 .Fig. 4 .
Fig.3.Graphical visualization of 2D vector measurement using ''shortCardiac''.Shown are exemplary eight real-time MR images (a-h) presenting a complete cardiac cycle.The upper image shows the superimposed straight line of the RV-EI(endo) (red), the LV-EI(endo) (blue), the LV-EI(epi) (green), and the largest distance of the dorsal contour of the RV to the septum axis (yellow).The lower image shows in color the different segmented ROIs endocardium of the RV (red) and LV (green) as well as the epicardium of the LV (blue) and the angle-dependent length measurements (step size 15 • ).In addition, the red dot in the lower ECG signal shows the current time point in the cardiac cycle (ECG signals and time points are not to be scaled and are only for visualization purposes).In the supplementary Video S1, the same cardiac slice is shown as a video.(For interpretation of the references to color in this figure legend, the reader is referred to the web version of this article.)

Fig. 5 .
Fig. 5. Plot of some angle-dependent length parameters of the endocardial contours of the right (a) and left (b) ventricles and a selection of radiometric features as a function of time (cardiac phases), determined with ''shortCardiac'' and the first 100 real-time MR images.(a) For the right ventricle, different relative changes were observed as a function of the angular segments examined, indicating a change in ventricular shape during different cardiac phases.(b)For the left ventricle, it was found that at the end of systole, all angular segments are approximately the same distance from the center of gravity.Thus, the ventricle is circular.In contrast, at the end of diastole, there are significant differences in length between the angular segments, suggesting an elliptical shape.(c) In radiometric features, we observed analogous periodic changes that can be further investigated in later studies, possibly leading to different changes depending on disease or stage.

Fig. 6 .
Fig.6.Bland-Altman diagrams to evaluate the reliability between ''shortCardiac'' and the manual reference measurements of an experienced radiologist.Shown are the values of 30 randomly selected images from real-time MRI.The y-axes indicate the differences between ''shortCardiac'' and the reference measurement, while the x-axes indicate the mean value of the measures.The black lines indicate the mean values of the differences, and the gray dashed lines indicate the 95% confidence intervals.