Skip to content

A desktop application for performing fat and water suppression on MRI Dicom images of 2 echo times (in-phase/out-of-phase instances)

License

Notifications You must be signed in to change notification settings

nouran-19/Fat-and-Water-Suppression-Dixon-Technique-Dicom-Images

Repository files navigation

Advanced Dixon MRI Viewer

License: MIT Python 3.8+ PyQt5

A medical imaging application designed for processing and analyzing Dixon MRI sequences, with a focus on fat-water separation techniques. This tool provides researchers and clinicians with an intuitive interface for viewing and processing Dixon MRI data.

Application Screenshot

Table of Contents

Features

Core Functionality

  • Dixon fat-water separation algorithm implementation
  • Real-time image processing and visualization
  • Support for DICOM format
  • Customizable window adjustments

Image Processing

  • Multiple noise reduction methods:
    • Gaussian filtering
    • Median filtering
    • Bilateral filtering
  • Customizable fat threshold selection

User Interface

  • Dark mode optimized for clinical environments
  • Quadrant view showing all processing stages
  • Intuitive navigation between scans
  • Comprehensive settings management

Installation

Prerequisites

# Python dependencies
pip install -r requirements.txt

Setup

  1. Clone the repository:
git clone https://github.com/nouran-19/Fat-and-Water-Suppression-Dixon-Technique-Dicom-Images.git
cd Fat-and-Water-Suppression-Dixon-Technique-Dicom-Images
  1. Install dependencies:
pip install -r requirements.txt
  1. Run the application:
python app.py

Usage

Loading Data

The application expects these specific directory structures, dicom files should be paired in order, i.e. the first dicom image in the 'inphase' directory should be paired with the first dicom image in the 'outphase' directory, and so on and so forth. Dataset sample is already uploaded.

main_folder/
    any_name/
        any_other_name/
            inphase/
                *.dcm
            outphase/
                *.dcm

# or

main_folder/
    random_name/
        inphase/
            *.dcm
        outphase/
            *.dcm

# or even

main_folder/
    inphase/
        *.dcm
    outphase/
        *.dcm

This gif shows the loading dataset process

Play images and navigate right and left

This gif shows the process of navigating the images (if there are more than one)

Navigate

Processing and Visualization Parameters

Key parameters that affect fat-water separation and visualization:

Parameter Default Range/Options Description
Fat Threshold 0.1 0.0-1.0 Minimum fat signal intensity
Noise Reduction None Gaussian, Median, Bilateral Smooting and denoising
Contrast and Brightness 0 -50 : 50 Brightness and contrast control

These gifs show the processing and visualization in the app

These gifs show the processing and visualization in the app visualization

Exporting

Supported export formats are: ["DICOM", "PNG", "JPEG", "TIFF", "GIF"], with loop option and frame duration for "GIF" type. Additionally, there's a 'compress' option for all the formats.

These gifs show the exporting process.
First, exporting in dicom format, and opening the exported files to test the output.

Dicom exporting process

Second, exporting in gif and PNG formats shows the compression effect.

Export gif Export PNG

Technical Details

Dixon Method Implementation

The software implements both basic and advanced Dixon methods:

  1. Basic Dixon:
water = (in_phase + out_phase) / 2.0
fat = (in_phase - out_phase) / 2.0

Image Processing Pipeline

  1. DICOM loading and validation
  2. Noise reduction (optional)
  3. Fat-water separation
  4. Post-processing and enhancement
  5. Display optimization

Contributing

Development Setup

  1. Fork the repository
  2. Create a virtual environment:
python -m venv venv
source venv/bin/activate  # Linux/Mac
venv\Scripts\activate     # Windows
  1. Install development dependencies:
pip install -r requirements.txt

Pull Request Process

Check the open issues 🚩 for suggestions.

  1. Create a feature branch:
git checkout -b feature/your-feature-name
  1. Commit your changes:
git commit -m "add new feature"
  1. Push to your fork and submit a pull request

  2. Ensure your PR:

  • Is bugs free
  • Updates documentation
  • Includes test coverage

Research Background

This implementation is based on the Dixon method for fat-water separation in MRI, first proposed by Thomas Dixon in 1984.

Key References

  1. Dixon, W.T. (1984). Simple proton spectroscopic imaging. Radiology, 153(1), 189-194.
  2. Elster, A.D. (2024). Dixon Method. In Questions and Answers in MRI. ELSTER LLC. Retrieved from https://mriquestions.com/dixon-method.html

Citing This Software

If you use this software in your research, please cite:

@software{advanced_dixon_mri_viewer,
  author       = {Yasmin ElGamal, Salma Ashraf, Rana Hany, Sarah Ibrahim, Nouran Khatab},
  title        = {Advanced Dixon MRI Viewer},
  year         = {2024},
  publisher    = {GitHub},
  url          = {https://github.com/nouran-19/Fat-and-Water-Suppression-Dixon-Technique-Dicom-Images}
}

License

This project is licensed under the MIT License - see the LICENSE file for details.

Acknowledgments

  • PyQt5 team for the GUI framework
  • Pydicom contributors for DICOM handling
  • NumPy community for numerical computing support
  • Research community for Dixon method improvements

Special thanks to Siemens Healthineers Subzone Egypt and SBME Faculty

  • Special thanks to Eng. Amr El Ghorab Head of Service Department at Siemens Healthineers Subzone Egypt and MRI lectures instructor.
Eng. Amr El Ghorab
Dr. Ahmed M. Ehab Mahmoud Eng. Ola Sarhan

Made with ❤️ for the course: SBE4120 Medical Imaging, Fall 2024, Co-Instructed by Siemens Healthineers, Subzone Egypt.

Contributors:

About

A desktop application for performing fat and water suppression on MRI Dicom images of 2 echo times (in-phase/out-of-phase instances)

Resources

License

Stars

Watchers

Forks

Contributors 4

  •  
  •  
  •  
  •