项目作者: JamesQFreeman

项目描述 :
A qt-based 3D data visualization tool.
高级语言: Python
项目地址: git://github.com/JamesQFreeman/simpleITK-Snap.git
创建时间: 2020-07-14T15:26:13Z
项目社区:https://github.com/JamesQFreeman/simpleITK-Snap

开源协议:MIT License

下载







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:

  1. git clone https://github.com/JamesQFreeman/simpleITK-Snap.git

Then use pip to install the dependency package:

  1. pip install -r requirements.txt

Then you are ready to go!

Usage

In-place Mode

You can open 3D image in python code.

  1. import SimpleITKSnap as sis
  2. from SimpleITKSnap.Extension import histogram
  3. array = np.arange(0,256*256*256).reshape(256,256,256)
  4. sis.imshow(array, histogram)

Application Mode

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

  1. 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:

    1. @pltExtension
    2. def yourExtension(array3d:ndarray, x:int, y:int, z:int) -> str:
    3. plt.whateverYouWant()
    4. return "Extention display test at {}, {}, {}".format(x,y,z)
  • Array-style:

    1. @imgExtension
    2. def yourExtention(array3d:ndarray, x:int, y:int, z:int) -> Tuple[ndarray,str]:
    3. processed_2d_image = whateverYouWant()
    4. 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.