Skip to content

PangHaowen-hub/Medical-Image-Processing

Repository files navigation

Medical Image Processing

A comprehensive toolkit for medical image processing, including various functions for format conversion, processing, analysis, and evaluation of medical images.

Project Structure

Medical-Image-Processing/
├── calculation/              # Calculation utilities
│   ├── calculate_HU.py      # HU value calculation
│   ├── calculate_volume.py  # Volume calculation
│   └── calculates_foreground_HU_range.py  # Foreground HU range calculation
│
├── data_augmentation/        # Data augmentation
│   ├── batchgenerators_test.py
│   ├── imgaug_img.py        # Image data augmentation
│   └── imgaug_img_mask.py   # Image and mask data augmentation
│
├── edge_detection/           # Edge detection
│   ├── edge_detection.py    # 2D edge detection
│   └── edge_detection_3d.py # 3D edge detection
│
├── fft_wavelet/              # FFT and wavelet transform
│   ├── nii_fft_2D_difference.py
│   ├── nii_fft_3D_*.py      # Various 3D FFT operations
│   └── wavelet_2d.py
│
├── format_conversion/        # Format conversion
│   ├── dcm2nii.py           # DICOM to NIfTI
│   ├── nii2dcm.py           # NIfTI to DICOM
│   ├── nii2png_*.py         # NIfTI to PNG related
│   ├── png2nii.py           # PNG to NIfTI
│   └── ...                  # Other format conversion tools
│
├── generation_metrics/       # Generation metrics evaluation
│   ├── dose_metrics.py
│   ├── image_mae.py
│   └── image_metrics.py
│
├── lung_processing/          # Lung processing
│   ├── extract_lung.py      # Lung extraction
│   ├── lung_box.py          # Lung bounding box
│   └── lung_bigbox.py       # Lung large bounding box
│
├── MIP/                      # Maximum Intensity Projection
│   ├── MIP_2d.py            # 2D MIP
│   ├── MIP_3d.py            # 3D MIP
│   └── lung_box.py
│
├── models/                   # Model related
│   └── ModelsGenesis.py
│
├── nii_processing/           # NIfTI image processing
│   ├── nii_crop.py          # Cropping
│   ├── nii_resize.py        # Resizing
│   ├── nii_resample.py      # Resampling
│   ├── nii_norm.py          # Normalization
│   ├── nii_zscore.py        # Z-score normalization
│   └── ...                  # Other NIfTI processing tools
│
├── png_processing/           # PNG image processing
│   ├── png_resize.py        # PNG resizing
│   ├── png_padding.py       # PNG padding
│   ├── png_mask_*.py        # PNG mask processing
│   └── ...
│
├── read_file/                # File reading
│   ├── read_dicom_metadata.py  # DICOM metadata reading
│   ├── read_nii_*.py        # NIfTI file reading related
│   └── ...
│
├── rotate_transpose/         # Rotation and transpose
│   ├── nii_reorient.py
│   ├── Transpose_Mask_nii.py
│   └── Transpose_Mask.py
│
├── segmentation/             # Segmentation
│   ├── brain_mask_otsu.py   # Brain mask Otsu segmentation
│   └── Segment_Vessels_hessian.py  # Vessel segmentation
│
├── segmentation_metrics/     # Segmentation metrics evaluation
│   ├── Dice_3d.py           # 3D Dice coefficient
│   ├── IoU_3d.py            # 3D IoU
│   ├── Hausdorff_Distance_3d.py  # 3D Hausdorff distance
│   └── ...
│
└── tools/                    # Utility scripts
    ├── find_file.py
    ├── mkdir.py
    ├── move_*.py
    ├── tree_parse.py
    └── ...

Usage

  1. Path Configuration: All hardcoded paths in the scripts have been removed. Please configure the corresponding paths in the if __name__ == '__main__': section of each script before use.

  2. Dependencies: Main dependencies include:

    • SimpleITK
    • nibabel
    • numpy
    • opencv-python (cv2)
    • scipy
    • PIL/Pillow
    • xlwt (Excel writing)
    • Other libraries required by specific tools
  3. Notes:

    • Please read the comments in each script carefully before use
    • Ensure input and output paths are correctly configured
    • Some scripts may require specific data formats

Main Function Modules

  • Format Conversion: Supports conversion between various formats including DICOM, NIfTI, PNG, NPY, H5, etc.
  • Image Processing: Cropping, resizing, resampling, normalization, noise addition, etc.
  • Segmentation Evaluation: Calculation of segmentation metrics such as Dice, IoU, Hausdorff distance, etc.
  • Visualization: Histogram plotting, MIP generation, etc.
  • Data Augmentation: Data augmentation using imgaug and batchgenerators

About

Medical image processing code

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages