# simpleITK-Snap **Repository Path**: E3D/simpleITK-Snap ## Basic Information - **Project Name**: simpleITK-Snap - **Description**: No description available - **Primary Language**: Unknown - **License**: MIT - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2022-02-10 - **Last Updated**: 2022-02-10 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README
1. 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.
2. Extension-based design, meet your visualization demand by writing your own extension.
The extension development requires minimal code and is super easy to √evelop.
## Install
First, clone this repo to your local environment:
```bash
git clone https://github.com/JamesQFreeman/simpleITK-Snap.git
```
Then use pip to install the dependency package:
```bash
pip install -r requirements.txt
```
Then you are ready to go!
## Usage
### In-place Mode
You can open 3D image in python code.
```python
import SimpleITKSnap as sis
from SimpleITKSnap.Extension import histogram
array = np.arange(0,256*256*256).reshape(256,256,256)
sis.imshow(array, histogram)
```
### Application Mode
Let's see an example of a brain CT image:
To open an image, simply type:
```bash
python simpleITK-Snap -f YourFile.nii.gz
```

## Extension
You can develop your own extension in two ways:
- Matplotlib-style:
```python
@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:
```python
@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)
```
## Dependency & Compatibility
SimpleITKSnap is based on:
- python3
- SimpleITK
- numpy
- opencv-python
- PyQt5
Compatibility Test Status:
| | Windows 10 | OS X | Linux |
|-------|-------------|------|-------|
| Build |  |  |  |
| PyPI | |  | |
## Coming Soon
#### release 0.1.3
- Acceleration using `lru_cache`.
#### release 0.1.4
- Package the project to a `.wheel`
#### release 0.1.5
- Add jupyter notebook support.
## Developer
This project is started by JamesQFreeman(wsheng@sjtu.edu.cn) and supported by SJTU MIC lab.