JamesQFreeman / simpleITK-Snap

A qt-based 3D data visualization tool.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool


Overview

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:

  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:

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!

Usage

In-place Mode

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)

Application Mode

Let's see an example of a brain CT image: To open an image, simply type:

python simpleITK-Snap -f YourFile.nii.gz

A CTA image opened in simpleITK-Snap

Extension

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)

Dependency & Compatibility

SimpleITKSnap is based on:

  • python3
  • SimpleITK
  • numpy
  • opencv-python
  • PyQt5

Compatibility Test Status:

Windows 10 OS X Linux
Build Build Status Build Status Build Status
PyPI Build Status

Release note and what's coming next

At release 0.1.3, jupyter notebook is supported

release 0.1.4

  • Pypi support

release 0.1.5

  • A doc
  • More extension examples

Developer

This project is started by JamesQFreeman(wsheng@sjtu.edu.cn) and supported by SJTU MIC lab.

About

A qt-based 3D data visualization tool.

License:MIT License


Languages

Language:Python 100.0%