Skip to content

MPR-UKD/shortCardiac

Repository files navigation

shortCardiac

plot

standardized, simplified and accelerated - cardiac evaluation of tomorrow


Please note that shortCardiac is not a medical product and should not be used as a substitute for professional medical advice or diagnosis. --


Overview

I. What is shortCardiac?

shortCardiac is an open-source framework implemented in Python that standardizes, simplifies, and accelerates the analysis of short-axis view cardiac magnetic resonance images (MRI). The framework is provided as Python source code, JupyterNotebook, and user-friendly Graphical User Interface (GUI). Based on the segmentation of the heart, length, area, and centroid measurements are performed. In addition, pyradiomics is implemented to allow the extraction of additional image features based on DICOM gray values. Calculations have been validated by manual reference measurements and all mathematical measurements as well as transformations to SI units were checked by Unittests.

Hint: shortCardiac allows the import of Circle Cvi42 coordinates / segmentations, which enables an easy implementation in current research projects.

For queries and suggestions: E-Mail; Linkedin; ResearchGate

If you use shortCardiac please cite our paper:

Coming soon (hopefully)

plot

II. Step-by-Step Installation

Source Code

Please note that shortCardiac Source Code requires Python 3.7.

1. Clone shortCardiac.

git clone https://github.com/MPR-UKD/shortCardiac

2. In the following, the cloned directory is called shortCardiac.

cd shortCardiac

3. install requirements.txt

pip install -r requirements.txt

Standalone executable (.exe)

1. Click one of the two links below to download the EXE

onedir - one-folder bundle containing an executable

onefile - a bundled executable file (note: starting the exe file takes time, because the file has to be unpacked first)

III. Step-by-Step Usage

1. Start Graphical User Interface (GUI)

python GUIshortCardiac.py

or

GUIshortCardiac.exe

plot

Alternatively: The framework can also be started via a separate main script or as JupyterNotebook. In demo.py, you will find a template how such a script should look and the Jupyternotebook is located in shortCardiac.ipynb.

plot

2. Choice coordinate format

  • In the top left corner, you can select the format of coordinates.
  • currently implemented: CVI42, ITKSnap and all other frameworks which safe segmentation as nii.gz.

3. Load coordinates

  • With the bottom "Load coordinates" a file dialog started. Now you can select the coordinate file.

4. Select the DICOM root folder

  • Analog to Point 3, with the bottom "Load DICOM Folder" a dialog will open. Please select the directory where the DICOM files are stored.
  • Hint: DICOM files could be saved in subfolders. Short cardiacStarted in root search all DICOM files in the directory and all subdirectories.

5. optional - Customize calculation

6. Start Calculation

  • push the "Run" bottom to start the calculation
  • Now, shortCardiac search all DICOM images, merge DICOM images and segmentation, start the calculation of Parameters and save overlayed Images with Parameters (if selected) and write all calculations in a CSV-File for further evaluations

7. Publish your next Paper with shortCardiac :)

Alternative: You can also change the SoruceCode directly or use the Jupyter notebook.

Notes: Python version 3.7 is required to use the Jupyternotebook (specifically the pyradiomics package). The easiest way is to use a virtual interpreter. Here is described how to set one up: venv-in-JupyterLab

IV. Contributing

Pull requests, requests to implement more calculations, and to integrate other segmentation frameworks are welcome. Please open an issue to discuss what you want to change for significant changes.

Expanding new parameter as example for the calc_radiomics function

To include more Radiomics features in the 'calc_radiomics' function, you can follow these steps:

  1. Update the cf dictionary: Add new keys for additional features you want to include, setting their values to True. For example:
cf = {
   ...
   "new_feature": True,
}
  1. Implement the extraction for the new feature: Create an instance of the corresponding extractor class from the PyRadiomics library and execute it. For example:
if cf["new_feature"]:
    new_feature_extractor = new_feature_module.RadiomicsNewFeature(dcm_sitk, mask_sitk)
    new_feature_results = new_feature_extractor.execute()
    feature, feature_names = extract_results(new_feature_results, "new_feature")
    feature_list.append(feature)
    feature_names_list.append(feature_names)
  1. Update the return statement: The function will automatically return the updated feature and feature names lists after adding the new feature extraction code.

With these modifications, you can customize the calc_radiomics function to include any Radiomics features supported by the PyRadiomics library. Make sure to consult the library's documentation for a comprehensive list of available features and their respective modules.


V. License

GNU General Public License 3

The GNU General Public License is a free, copyleft license for software and other kinds of works.

Git hocks

Install "pre-commit"

pip install pre-commit

then run:

pre-commit install

About

Open -Source Framework for standardized, simplified and accelerated analysis of cardiac MRIs in short-axis view.

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors