SimpleITKSnap is a 3D-image visualization tool. SimpleITKSnap is developed to bridge the gap between 3D-image process programming and its visualization. Comparing to the existing method, SimpleITKSnap have these advantage:
- Matplotlib-style display:
SimpleITKSnap.imshow(yourArray)
. You don't need to save your processed result to disk, open ITK-SNAP, find the file and load it again. - Extension-based design, meet your visualization demand by writing your own extension. The extension development requires minimal code and is super easy to √evelop.
First, clone this repo to your local environment:
git clone https://github.com/JamesQFreeman/simpleITK-Snap.git
Then use pip to install the dependency package:
pip install -r requirements.txt
Then you are ready to go!
You can open 3D image in python code.
import SimpleITKSnap as sis
from SimpleITKSnap.Extension import histogram
array = np.arange(0,256*256*256).reshape(256,256,256)
sis.imshow(array, histogram)
Let's see an example of a brain CT image: To open an image, simply type:
python simpleITK-Snap -f YourFile.nii.gz
You can develop your own extension in two ways:
- Matplotlib-style:
@pltExtension
def yourExtension(array3d:ndarray, x:int, y:int, z:int) -> str:
plt.whateverYouWant()
return "Extention display test at {}, {}, {}".format(x,y,z)
- Array-style:
@imgExtension
def yourExtention(array3d:ndarray, x:int, y:int, z:int) -> Tuple[ndarray,str]:
processed_2d_image = whateverYouWant()
return processed_2d_image, "Extention display test at {}, {}, {}".format(x,y,z)
SimpleITKSnap is based on:
- python3
- SimpleITK
- numpy
- opencv-python
- PyQt5
Compatibility Test Status:
Windows 10 | OS X | Linux | |
---|---|---|---|
Build | |||
PyPI |
At release 0.1.3, jupyter notebook is supported
- Pypi support
- A doc
- More extension examples
This project is started by JamesQFreeman([email protected]) and supported by SJTU MIC lab.