SkillAgentSearch skills...

Imagepy

Image process framework based on plugin like imagej, it is esay to glue with scipy.ndimage, scikit-image, opencv, simpleitk, mayavi...and any libraries based on numpy

Install / Use

/learn @Image-Py/Imagepy
About this skill

Quality Score

0/100

Supported Platforms

Universal

README

Introduction

ImagePy is an open source image processing framework written in Python. Its UI interface, image data structure and table data structure are wxpython-based, Numpy-based and pandas-based respectively. Furthermore, it supports any plug-in based on Numpy and pandas, which can talk easily between scipy.ndimage, scikit-image, simpleitk, opencv and other image processing libraries.

newdoc01

<div align=center>Overview, mouse measurement, geometric transformation, filtering, segmentation, counting, etc.</div><br>

newdoc02

<div align=center>If you are more a IJ-style user, try `Windows -> Windows Style` to switch</div><br>

ImagePy:

  • has a user-friendly interface
  • can read/save a variety of image data formats
  • supports ROI settings, drawing, measurement and other mouse operations
  • can perform image filtering, morphological operations and other routine operations
  • can do image segmentation, area counting, geometric measurement and density analysis.
  • is able to perform data analysis, filtering, statistical analysis and others related to the parameters extracted from the image.

Our long-term goal of this project is to be used as ImageJ + SPSS (although not achieved yet)

Installation

OS support:windows, linux, mac, with python3.x

  1. ImagePy is a ui framework based on wxpython, which can not be installed with pip on Linux. You need download the whl according to your Linux system.
  2. On Linux and Mac, there may be permission denied promblem, for ImagePy will write some config information, so please start with sudo. If you install with pip, please add --user parameter like this: pip install --user imagepy
  3. If you install ImagePy in an Anaconda virtual environment, you may get a error when starting like this: This program needs access to the screen. Please run with a Framework build of python, and only when you are logged in on the main display, if so, please start with pythonw -m imagepy.

- Pre-compiled package

This is the simplest option to run ImagePy.
A precompiled archive can be downloaded from the release tab of the repository.
Simply unzip the archive and run the ImagePy.bat file.
This will open a command line window and open the GUI of ImagePy.

- Using pip

In a command-prompt type pip install imagepy. ~~On Windows you currently need to first install shapely using conda.~~ This should also work for windows, now that shapely is available via pip. Once installed, ImagePy can be run by typing python -m imagepy in a command prompt.

Citation:

ImagePy: an open-source, Python-based and platform-independent software package for bioimage analysis

Forum

ImagePy is a community partner of forum.image.sc, Anything about the usage and development of ImagePy could be discussed in https://forum.image.sc.

Contribute

Contribute Manual: All markdown file under doc folder be parsed as manual. Plugins and manual are paired by plugins's title and manual's file name. We can browse document from the parameter dialog's Help button. We need more manual contributors, just pull request markdown file here.

Contribute Plugins: Here is a demo plugin repositories with document to show how to write plugins and publish on ImagePy. You are wellcom and feel free to contact with us if you need help.

Improve Main Framework: Just fork ImagePy, then give Pull Request. But if you want to add some new feature, Please have a issue with us firstly.

Basic operations:

ImagePy has a very rich set of features, and here, we use a specific example to show you a glimpse of the capacity of ImagePy. We choose the official coin split of scikit-image, since this example is simple and comprehensive.

Open image

menu: File -> Local Samples -> Coins to open the sample image within ImagePy. PS: ImagePy supports bmp, jpg, png, gif, tif and other commonly used file formats. By installing ITK plug-in,dicom,nii and other medical image formats can also be read/saved. It is also possible to read/write wmv, avi and other video formats by installing OpenCV.

newdoc03

<div align=center>Coins</div><br>

Filtering & Segmentation

menu:Process -> Hydrology -> Up And Down Watershed Here, a composite filter is selected to perform sobel gradient extraction on the image, and then the upper and lower thresholds are used as the mark, and finally we watershed on the gradient map. Filtering and segmentation are the crucial skills in the image processing toolkit, and are the key to the success or failure of the final measurement. Segmentation methods such as adaptive thresholds, watersheds and others are also supported.

newdoc04

<div align=center>Up And Down Watershed</div><br>

newdoc05

<div align=center>Mask</div><br>

Binarization

menu:Process -> Binary -> Binary Fill Holes After the segmentation, we obtained a relatively clean mask image, but there is still some hollowing out, as well as some impurities, which will interfere with counting and measurement. ImagePy supports binary operations such as erode, dilate, opening and closing, as well as skeletonization, central axis extraction, and distance transformation.

newdoc06

<div align=center>Fill Holes</div><br>

Geometry filtering

menu:Analysis -> Region Analysis -> Geometry Filter ImagePy can perform geometric filtering based on :the area, the perimeter, the topology, the solidity, the eccentricity and other parameters. You can also use multiple conditions for filtering. Each number can be positive|negative, which indicates the kept object will have the corresponding parameter greater|smaller than the value respectively. The kept objects will be set to the front color, the rejected ones will be set to the back color. In this demo, the back color is set to 100 in order to see which ones are filtered out. Once satisfied with the result, set the back color to 0 to reject them. In addition, ImagePy also supports gray density filtering, color filtering, color clustering and other functions.

newdoc07

<div align=center>Geometry filtering (the area is over-chosen to emphasize the distinction)</div><br>

Geometry Analysis

menu:Process -> Region Analysis -> Geometry Analysis Count the area and analyze the parameters. By choosing the cov option, ImagePy will fit each area with an ellipse calculated via the covariance. The parameters such as area, perimeter, eccentricity, and solidity shown in the previous step are calculated here. In fact, the filtering of the previous step is a downstream analysis of this one.

newdoc08

<div align=center>Geometry Analysis</div><br>

newdoc09

<div align=center>Generate the result table (dark to emphasize the ellipse)</div><br>

Sort Table by area

menu:Table -> Statistic -> Table Sort By Key Select the major key as area, and select descend. The table will be sorted in descending order of area. A table is another important piece of data other than an image. In a sense, many times we need to get the required information on the image and then post-process the data in the form of a table. ImagePy supports table I/O (xls, xlsx, csv), filtering, slicing, statistical analysis, sorting and more. (Right click on the column header to set the text color, decimal precision, line style, etc.)

newdoc10

<div align=center>Table</div><br>

Charts

menu:Table -> Chart -> Hist Chart From tabular data, we often need to draw a graph. Here, we plot the histograms of the area and the perimeter columns. ImagePy's tables can be used to draw common charts such as line charts, pie charts, histograms, and scatter plots (matplotlib-based). The chart comes with zooming, moving and other functions. The table can also be saved as an image.

newdoc11

<div align=center>Histograms</div><br>

3D chart

menu:Kit3D -> Viewer 3D -> 2D Surface Surface reconstruction of the image. This image shows the three reconstructed results including, sobel gradient map, high threshold and low threshold. It shows how the Up And Down Watershed works:

  • calculate the gradient.
  • mark the coin and background through the high and low thresholds,
  • simulate the rising water on the dem diagram to form the segmentation.

ImagePy can perform 3D filtering of images, 3D skeletons, 3D topological analysis, 2D surface reconstruction, and 3D surface visualization. The 3D view can be freely dragged, rotated, and the image results can be saved as a .stl file.

newdoc12

<div align=center>3D visualisation</div><br>

Macro recording and execution

menu:Window -> Develop Tool Suite Macro recorder is shown in the develop tool panel. We have manually completed an image segmentation. However, batch processing more than 10 images can be tedious. So, assuming that these steps are highly repeatable and robust for dealing with such problems, we can record a macro to combine several processes into a one-click program. The macro recorder is similar to a radio recorder. When it is turned on, each step of the operation will be recorded. We can click the pause button to stop recording, then click the play button to execute. When th

View on GitHub
GitHub Stars1.4k
CategoryDevelopment
Updated8d ago
Forks331

Languages

Python

Security Score

100/100

Audited on Mar 23, 2026

No findings