Python code for medical image segmentation using U-Net architecture. This repository is organized into three modules, each serving a specific purpose in the segmentation process.
- Load medical image volumes and masks (NIfTI format).
- Normalize image intensity and slice volumes.
- Save 2D slices as PNG images.
- Implement U-Net for semantic segmentation.
- TensorFlow and Keras used for training.
- Save model checkpoints and allow continuation.
- Visualize training data with niwidgets.
- Load trained U-Net model for predictions.
- Visualize original, scaled, and predicted slices.
- Generate 3D mesh with marching cubes algorithm.
- Save resulting mesh as STL file.
- Install dependencies:
pip install -r requirements.txt
- Execute modules based on your requirements.
- nibabel
- numpy
- matplotlib
- opencv-python
- tensorflow
- keras
- niwidgets
- scikit-image
- meshplot
- numpy-stl
-
Clone the repository:
git clone https://github.com/chiragJoshi24/NIfTI-to-3D-Model-Converter.git cd NIfTI-to-3D-Model-Converter
-
Install dependencies:
pip install -r requirements.txt
To train the model, you can download the dataset from Cancer Imaging Archive.
Contributions are welcome! Feel free to report issues or suggest improvements.