Giter VIP home page Giter VIP logo

image-py / imagepy Goto Github PK

View Code? Open in Web Editor NEW
1.3K 81.0 329.0 6.43 MB

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

Home Page: http://imagepy.org

License: BSD 4-Clause "Original" or "Old" License

Python 99.67% Batchfile 0.01% Shell 0.01% CSS 0.25% M4 0.08%
imagej scikit-image opencv simpleitk

imagepy's Introduction

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

Overview, mouse measurement, geometric transformation, filtering, segmentation, counting, etc.

newdoc02

If you are more a IJ-style user, try `Windows -> Windows Style` to switch

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

Coins

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

Up And Down Watershed

newdoc05

Mask

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

Fill Holes

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

Geometry filtering (the area is over-chosen to emphasize the distinction)

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

Geometry Analysis

newdoc09

Generate the result table (dark to emphasize the ellipse)

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

Table

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

Histograms

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

3D visualisation

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 the macro is running, the recorded commands will be executed sequentially, therefore achieving simplicity and reproducibility.

Macros are saved into .mc files. drag and drop the file to the status bar at the bottom of ImagePy, the macro will be executed automatically. we can also copy the .mc file to the submenu of the menus under the ImagePy file directory. When ImagePy is started, the macro file will be parsed into a menu item at the corresponding location. By clicking the menu, the macro will also be executed.

newdoc13

Macro Recording

Workflow

A macro is a sequence of predefined commands. By recording a series of fixed operations into macros, you can improve your work efficiency. However, the disadvantage is the lack of flexibility. For example, sometimes the main steps are fixed, but the parameter tuning needs human interaction. In this case, the workflow is what you want. A workflow in ImagePy is a flow chart that can be visualized, divided into two levels: chapters and sections. The chapter corresponds to a rectangular area in the flow chart, and the section is a button in the rectangular area, which is also a command and is accompanied by a graphic explanation. The message window on the right will display the corresponding function description, while mousing hovering above. Click on the Detail Document in the top right corner to see the documentation of the entire process.

The workflow is actually written in MarkDown (a markup language), but it needs to be written respecting several specifications, as follows:

Title
=====
## Chapter1
1. Section1
some coment for section1 ...
2. ...
## Chapter 2
	...

newdoc14

Workflow

Report Plugin

Sometimes we need to make a report to print or generate a PDF document. ImagePy can generate report from a xlsx template. We just need put specific mark in some cells, ImagePy will parse the template and generate a parameter dialog, then we can input some information, or give image/table in, the report will be generated! more about how to make template please see here.

newdoc14

generate report

Filter Plugin

We introduced macros and workflows in the last sections, using macros and workflows to connect existing functions is convenient. But sometimes we need to create new features. In this section, we are trying to add a new feature to ImagePy. ImagePy can easily access any Numpy-based function. Let's take the Canny operator of scikit-image as an example.

from skimage import feature
from imagepy.core.engine import Filter

class Plugin(Filter):
    title = 'Canny'
    note = ['all', 'auto_msk', 'auto_snap', 'preview']
    para = {'sigma':1.0, 'low_threshold':10, 'high_threshold':20}

    view = [(float, 'sigma', (0,10), 1, 'sigma', 'pix'),
            ('slide', 'low_threshold', (0,50), 4, 'low_threshold'),
            ('slide', 'high_threshold', (0,50), 4, 'high_threshold')]

def run(self, ips, snap, img, para = None):
    return feature.canny(snap, para['sigma'], para['low_threshold'],
        para['high_threshold'], mask=ips.get_msk())*255

newdoc15

Canny Filter Demo

Steps to create a your own filter:

  1. Import the package(s), often third party.
  2. Inherit the Filter class。
  3. The title will be used as the name of the menu and the title of the parameter dialog, also as a command for macro recording.
  4. Tell the framework what needs to do for you in Note, whether to do type checking, to support the selection, to support UNDO, etc.
  5. Para is the a dictionary of parameters, including needed parameters for the functions.
  6. Define the interaction method for each of the parameters in View, the framework will automatically generate the dialog for parameter tuning by reading these information.
  7. Write the core function run. img is the current image, para is the result entre by user. if auto_snap is set in note, snap will be a duplicate of img. We can process the snap, store the result in img. If the function does not support the specified output, we can also return the result, and the framework will help us copy the result to img and display it.
  8. Save the file as xxx_plg.py and copy to the menu folder, restart ImagePy. It will be loaded as a menu item.

What did the framework do for us?

The framework unifies the complex tasks in a formal manner and helps us to perform:

  • type checking. If the current image type does not meet the requirements in the note, the analysis is terminated.
  • according to the para, generate automatically a dialog box to detect the input legality from the view.
  • Real-time preview
  • automatic ROI support
  • undo support
  • parallelization support
  • image stack support
  • etc.

Table

As mentioned earlier, the table is another very important data type other than the image. Similarly, ImagePy also supports the extension of table. Here we give an example of sorting-by-key used in the previous description.

from imagepy.core.engine import Table
import pandas as pd

class Plugin(Table):
    title = 'Table Sort By Key'
    para = {'major':None, 'minor':None, 'descend':False}

    view = [('field', 'major', 'major', 'key'),
    	    ('field', 'minor', 'minor', 'key'),
    	    (bool, 'descend', 'descend')]

def run(self, tps, data, snap, para=None):
    by = [para['major'], para['minor']]
    data.sort_values(by=[i for i in by if i != 'None'],
        axis=0, ascending = not para['descend'], inplace=True)

newdoc16

Table Sort Demo

How Table works

Same as FilterTable also has parameters such as titlenoteparaview. When the plugin is running, the framework will generate a dialog box according to para and view. After the parameters are chosen, they are passed to the run together with the current table and be processed. The table data is a pandas.DataFrame object in the current table, stored in tps. Other information, such as tps.rowmsk, tps.colmsk can also be retrieved from tps to get the row and column mask of the current selected table.

Other type of plugins

The Filter and Table described above are the two most important plugins, but ImagePy also supports some other types of plugin extensions. There are currently ten, they are:

  1. Filter: mainly for image processing
  2. Simple: similar to Filter, but focus on the overall characteristics of the image, such as the operation of the ROI, the operation of the false color, the area measurement, or the three-dimensional analysis of the entire image stack, visualization, and so on.
  3. Free: operate that are independant of image. Used to open image, close software etc.
  4. Tool: use the mouse to interact on the diagram and show small icons on the toolbar, such as a brush.
  5. Table: operate on the table, such as statistics analysis, sorting, plotting.
  6. Widget: widgets that are displayed in panels, such as the navigation bar on the right, the macro recorder, and others.
  7. Markdown: markup language, when clicked, a separate window will pop up to display the document.
  8. Macros:command sequence file for serially fixed operational procedures.
  9. Workflow: combination of macro and MarkDown to create an interactive guidance process.
  10. Report: a xlsx template with specific mark, rename as .rpt, used to auto generate report.

Motivation & Goal

Python is a simple, elegant, powerful language, and has very rich third-party libraries for scientific computing. Based on the universal matrix structure and the corresponding rules, numpy-based libraries such as scipy, scikit-image, scikit-learn and other scientific computing libraries have brought great convenience to scientific research. On the other hand, more and more problems in biology, material science and other scientific research can be efficiently and accurately solved via scientific computing, image processing.

However there are still many researchers that lack programming skills. Thus it is a crucial to make the Numpy-based scientific computing libraries available to more researchers. ImagePy brings the computing capacities closer to the non-programmer researchers, so that they won't need to be concerned about the UI and interaction design, and focus exclusively on the algorithm itself, and finally, accelerate open-source tool building or even commercial products incubation. These tools, meanwhile, can let more researchers, who are not good at programming, gain, promote and popularize scientific knowledge such as image processing and statistics.

imagepy's People

Contributors

ausk avatar bioinfotongli avatar blink1073 avatar csatizoltan avatar ctrueden avatar czaki avatar dada1437903138 avatar fengzhiheng avatar hzyrc6011 avatar jakirkham avatar junma11 avatar laulauthom avatar pengguanjun avatar prevalenter avatar qixinbo avatar siyemuxu888 avatar weisongzhao avatar yxdragon avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

imagepy's Issues

web out of service

Hello,
I was wondering about the home page - http://imagepy.org but it seems that there is an issue to access this page:

This site can’t be reached imagepy.org’s server IP address could not be found.
Try:
    Checking the connection
    Checking the proxy, firewall, and DNS configuration
ERR_NAME_NOT_RESOLVED

issue on linux

Hello and thank you for your app,

Dependencies (requirement.txt) for Imagepy were installed (in a virtual env) in a linux computer.
ImagePy.bat was renamed into ImagePy.sh

when starting, the program meets an interruption:

./ImagePy.sh 
/home/jeanpat/App/imagepy-master/imagepy
Traceback (most recent call last):
  File "/usr/lib64/python3.6/runpy.py", line 183, in _run_module_as_main
    mod_name, mod_spec, code = _get_module_details(mod_name, _Error)
  File "/usr/lib64/python3.6/runpy.py", line 142, in _get_module_details
    return _get_module_details(pkg_main_name, error)
  File "/usr/lib64/python3.6/runpy.py", line 109, in _get_module_details
    __import__(pkg_name)
  File "/home/jeanpat/App/imagepy-master/imagepy/__init__.py", line 9, in <module>
    from .imageplus import ImagePlus
  File "/home/jeanpat/App/imagepy-master/imagepy/imageplus.py", line 4, in <module>
    from .core.manager import WindowsManager, ColorManager
  File "/home/jeanpat/App/imagepy-master/imagepy/core/manager/__init__.py", line 10, in <module>
    from .languagemanager import *
  File "/home/jeanpat/App/imagepy-master/imagepy/core/manager/languagemanager.py", line 82, in <module>
    LanguageManager.read()
  File "/home/jeanpat/App/imagepy-master/imagepy/core/manager/languagemanager.py", line 26, in read
    for line in pkl_file.readlines():
  File "/home/jeanpat/Developpements/VirtualEnvs/venv3/lib/python3.6/codecs.py", line 321, in decode
    (result, consumed) = self._buffer_decode(data, self.errors, final)
UnicodeDecodeError: 'utf-8' codec can't decode byte 0xb6 in position 24: invalid start byte

File "imagepy.py", line 9, in <module> from .. import IPy ValueError: Attempted relative import in non-package

Hi, I need help when I start image.py by "python -m imagepy", in ubuntu14.04 python2.7 I have the following problem:

caimt @ caimt-desktop ~ / anaconda / pkgs / imagepy-0.17-py_0 / site-packages / imagepy / ui $ python -m imagepy.py
Traceback (most recent call last):
File "/home/caimt/anaconda/lib/python2.7/runpy.py", line 163, in _run_module_as_main
mod_name, _Error)
File "/home/caimt/anaconda/lib/python2.7/runpy.py", line 102, in _get_module_details
loader = get_loader (mod_name)
File "/home/caimt/anaconda/lib/python2.7/pkgutil.py", line 462, in get_loader
return find_loader (fullname)
File "/home/caimt/anaconda/lib/python2.7/pkgutil.py", line 472, in find_loader
for importer in iter_importers (fullname):
File "/home/caimt/anaconda/lib/python2.7/pkgutil.py", line 428, in iter_importers
__import __ (pkg)
File "imagepy.py", line 9, in
from .. import IPy
ValueError: Attempted relative import in non-package

Is there a solution?
Thank you very much.

JPG format file open error, the same problem occurs on different machines

show img
170822 >>> deleted ips
Traceback (most recent call last):
File "C:\Users\MaiBenBen\Python36\lib\site-packages\wx\core.py", line 3240, in
lambda event: event.callable(*event.args, **event.kw) )
File "C:\Users\MaiBenBen\Python36\lib\site-packages\pubsub\core\publisher.py", line 216, in sendMessage
topicObj.publish(**msgData)
File "C:\Users\MaiBenBen\Python36\lib\site-packages\pubsub\core\topicobj.py", line 452, in publish
self.__sendMessage(msgData, topicObj, msgDataSubset)
File "C:\Users\MaiBenBen\Python36\lib\site-packages\pubsub\core\topicobj.py", line 482, in __sendMessage
listener(data, self, allData)
File "C:\Users\MaiBenBen\Python36\lib\site-packages\pubsub\core\listener.py", line 237, in call
cb(**kwargs)
File "C:\Users\MaiBenBen\Desktop\imagepy-master(2)\imagepy-master\imagepy\IPy.py", line 71, in showimg
ips = ImagePlus(imgs, title)
File "C:\Users\MaiBenBen\Desktop\imagepy-master(2)\imagepy-master\imagepy\core\wraper\imageplus.py", line 32, in init
self.set_imgs(imgs)
File "C:\Users\MaiBenBen\Desktop\imagepy-master(2)\imagepy-master\imagepy\core\wraper\imageplus.py", line 42, in set_imgs
self.height, self.width = self.size = self.imgs[0].shape[:2]
ValueError: not enough values to unpack (expected 2, got 1)

FYI, imglib2-imglyb

Hey yxdragon,

ImagePy looks great. I don't know if you're aware of imglib2-imglyb, but that is a native bridge between existing JVM-based ImageJ and ImgLib2 with Python. I believe that you could use this with the existing numpy-based data structures that you have, allowing you to make calls to ImgLib2 and ImageJ2 routines (e.g. from imagej-ops) from ImagePy without having to actually duplicate code. Note that we have regular hackathons (next in US at the end of April) and plenty of us like Python too, so it would be great if you could join in. Some of the imglib2-imglyb folks will probably be there too!

Cheers,
Kyle

add fft and ifft transform plugins

add fft under the process menus:
menue:
> Process:
> FFT
> Inverse FFT
> --------
> Bandpass Filter
> Highpass Filter
> Lowpass Filter

Can’t install python plugin

I have tried to install a python plugin by copying the code in the Gaussian filter example and saving in to a .py file in the menu directory or a sub directory but it won’t show in imagepy after I restart it. I have also
Tried editing the init.py files in the directories but this didn’t help.

Give a list of image formats that Imagepy supports

Does it support image formats similar as ImageJ, such as TIFF, GIF, JPEG, PNG, DICOM, BMP, PGM and FITS?

It is important to me because I am building a pathology detection software that reads whole slide images in TIFF, DICOM formats. It would be nice to provide a list of image formats that Imagepy supports. Thanks.

Dicom image import issues

1. Incorrect display for 16 uint dicom file
When I load a 4D uint16 grey scale dicom file to the software, it displayed the image with some issues like below:
capture1
After converting to 8-bit, it recognizes it as 8-bit RGB.
capture2

**2. Cannot display 3D image
Only displayed the first slice of 3D image.
Is it possible to load the 3D image from dicom or video file instead of using the a sequence of 2D images?

Thanks.

A 4-D dicom example (x, y, channel, z):
test_dicom.zip

How to get stacked Imgs?

emmm,大佬,我现在想用这个库做3D建模,我想Toolkit3D应该就是这个功能的相关模块吧,我是通过序列导入来吧待建模的图像导入到程序中的,但是每次我调用ToolKit3D的时候他总是提示我需要堆叠的3d图像,emm,我看了一下Image菜单下的内容,不是很懂。所以我想知道怎么样才能得到可供3D重建的stacked3d的图像呢
致敬

there is an error when I run imagepy

macos 10.15.1
Python 3.7.5

after run pip install imagepy install imagepy
then run imagepy' or python -m imagepy` I get an error:

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 of your Mac.

PyStackReg missing for Windows on conda

Since (fb0f9a1), using the environnement.yml with Pystackreg as dependency to install imagepy with anaconda fails on windows because the package is only available for Linux on anaconda.

PackageNotFoundError: Packages missing in current channels:

  - pystackreg

I hava some errors when I load ImageJ RoiSet.zip

image

error information is

'self.run(para)
File "C:\Users\XXX\Desktop\ImagePy-64\ImagePy\programs\lib\site-packages\imagepy\menus\File\Import\roi_plg.py", line 30, in run
img[polygon(ls[i]['y'], ls[i]['x'], img.shape)] = int(i)
KeyError: 'y''

magic_tol报错

imagepy\tools\Draw\magic_tol.py报snap() missing 1 required positional argument: 'lim'错误

图片输入点击无反应

大神好:
非常感谢你的工程分享,非常给力。我在使用过程中,出现了一个问题,就是python3 -m imagepy 运行后,点击 file->BMP 或者 file->import 时候,都没有反应。然后无法导入图片进入软件进行分析。大神大致知道是什么原因么?求教了。

Support maths in markdown

ImagePy uses Python-Markdown, which can be extended for maths support using several extensions. I myself tried this one. To enable, you need to append the exts list with 'mdx_math' in the imagepy/ui/mkdownwindow.py file. For instance, markdown("$$x^2$$", extensions=['mdx_math']) results in the HTML code '<p>\n<script type="math/tex; mode=display">x^2</script>\n</p>'. This trick alone is not enough in ImagePy, the documentation writes that some additional steps are needed. Could you implement this? It would be very useful for displaying formulas in help texts.

Bugs in the Network tool

For the network tool to work with Python 3.7.6, we need some changes:

图片未关闭

窗口关闭图片异常。
控制台打印remove, 但是实际上图片并没有关闭。
(windows平台,187e19815c788e49fef551295b62e72674864486版本)

update some function to fit numba4.3

as numba update a lot, many function does not work now.
I want to modify all functions in jit(nopython=True) mode.

But I failed to modify a function (spend two hours)
@jni I think you are aware of numba, can you help to rewrite the function below?
https://github.com/Image-Py/imagepy/blob/master/imagepy/ipyalg/graph/sknw.py

@jit(nopython=True)
def neighbors(shape):
    dim = len(shape)
    block = np.ones([3]*dim)
    block[tuple([1]*dim)] = 0
    idx = np.where(block>0)
    idx = np.array(idx, dtype=np.uint8).T
    idx = np.array(idx-[1]*dim)
    acc = np.cumprod((1,)+shape[::-1][:-1])
    return np.dot(idx, acc[::-1])

in the old version, this function need not jit, but now, if function a call function b and a is a jit function, then b must be jit too.
thanks!

SyntaxError: invalid syntax

hi, i need help, when i start imagepy by "python -m imagepy", ubuntu16.04 python2.7

Traceback (most recent call last):
File "/usr/lib/python2.7/runpy.py", line 163, in _run_module_as_main
mod_name, _Error)
File "/usr/lib/python2.7/runpy.py", line 111, in _get_module_details
import(mod_name) # Do not catch exceptions initializing package
File "/usr/local/lib/python2.7/dist-packages/imagepy/init.py", line 10, in
from .ui.imagepy import ImagePy
File "/usr/local/lib/python2.7/dist-packages/imagepy/ui/imagepy.py", line 9, in
from .. import IPy, root_dir
File "/usr/local/lib/python2.7/dist-packages/imagepy/IPy.py", line 11, in
from wx.lib.pubsub import pub
File "/usr/local/lib/python2.7/dist-packages/wx/lib/pubsub/init.py", line 38, in
from pubsub import *
File "/usr/local/lib/python2.7/dist-packages/pubsub/pub.py", line 146
def getDefaultPublisher() -> Publisher:
^
SyntaxError: invalid syntax

Markdown not shown on Linux

Markdown files are not rendered on Linux. The title of the wxwidgets window is shown but not the content. No exception is thrown. I observed that both the LoadURL method

if url != '': self.wv.LoadURL(url)
and the SetPage method
else: self.wv.SetPage(cont, url)
have no effect.


I am not sure whether it's related but clicking on the icons (Snap, Load, >>, and the user-defined buttons) in a Workflow has no effect, as if the callback was not called. However, the mouse-over works: the documentation box is updated.

Error when opening an image

The lastest version of ImagePy on Linux throws the following error when I open any image:

(__main__.py:330): Gdk-CRITICAL **: 11:41:03.714: IA__gdk_drawable_get_depth: assertion 'GDK_IS_DRAWABLE (drawable)' failed

(__main__.py:330): Gtk-CRITICAL **: 11:41:03.714: IA__gtk_paint_layout: assertion 'style->depth == gdk_drawable_get_depth (window)' failed
show img
Traceback (most recent call last):
  File "/home/zoltan/anaconda3/lib/python3.7/site-packages/wx/core.py", line 3259, in <lambda>
    lambda event: event.callable(*event.args, **event.kw) )
  File "/home/zoltan/anaconda3/lib/python3.7/site-packages/pubsub/core/publisher.py", line 216, in sendMessage
    topicObj.publish(**msgData)
  File "/home/zoltan/anaconda3/lib/python3.7/site-packages/pubsub/core/topicobj.py", line 452, in publish
    self.__sendMessage(msgData, topicObj, msgDataSubset)
  File "/home/zoltan/anaconda3/lib/python3.7/site-packages/pubsub/core/topicobj.py", line 482, in __sendMessage
    listener(data, self, allData)
  File "/home/zoltan/anaconda3/lib/python3.7/site-packages/pubsub/core/listener.py", line 237, in __call__
    cb(**kwargs)
  File "/home/zoltan/anaconda3/lib/python3.7/site-packages/imagepy/IPy.py", line 72, in showimg
    showips(ips)
  File "/home/zoltan/anaconda3/lib/python3.7/site-packages/imagepy/IPy.py", line 47, in showips
    canvasp = CanvasPanel(curapp.canvasnb)
  File "/home/zoltan/anaconda3/lib/python3.7/site-packages/imagepy/ui/canvasframe.py", line 37, in __init__
    self.canvas.set_handler(self.set_info)
AttributeError: 'Canvas' object has no attribute 'set_handler'

I went into debugging mode and self.canvas really doesn't have a set_handler method.

install with Building wheel for pystackreg (setup.py) ... error

Dear Sir

我的系统:MacOS
安装方式 pip3 install imagepy

期望您有空可以帮我看一下 谢谢 !

Building wheel for pystackreg (setup.py) ... error
  ERROR: Complete output from command /usr/local/bin/python3.7 -u -c 'import setuptools, tokenize;__file__='"'"'/private/var/folders/49/lx4dfjcs6dn11kb8cmsw5n600000gn/T/pip-install-4mqurchj/pystackreg/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' bdist_wheel -d /private/var/folders/49/lx4dfjcs6dn11kb8cmsw5n600000gn/T/pip-wheel-d9otnkec --python-tag cp37:
  ERROR: running bdist_wheel
  running build
  running build_py
  creating build
  creating build/lib.macosx-10.6-intel-3.7
  creating build/lib.macosx-10.6-intel-3.7/pystackreg
  copying pystackreg/version.py -> build/lib.macosx-10.6-intel-3.7/pystackreg
  copying pystackreg/__init__.py -> build/lib.macosx-10.6-intel-3.7/pystackreg
  copying pystackreg/pystackreg.py -> build/lib.macosx-10.6-intel-3.7/pystackreg
  running build_ext
  building 'pystackreg.turboreg' extension
  Warning: Can't read registry to find the necessary compiler setting
  Make sure that Python modules winreg, win32api or win32con are installed.
  C compiler: gcc -fno-strict-aliasing -Wsign-compare -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -arch i386 -arch x86_64 -g
  
  creating build/temp.macosx-10.6-intel-3.7
  creating build/temp.macosx-10.6-intel-3.7/src
  compile options: '-Iinc/ -I/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/numpy/core/include -I/Library/Frameworks/Python.framework/Versions/3.7/include/python3.7m -c'
  extra options: '-std=c++11'
  gcc: src/pymain.cpp
  gcc: src/TurboReg.cpp
  gcc: src/TurboRegMask.cppgcc: src/TurboRegImage.cpp
  
  In file included from src/pymain.cpp:11:
  In file included from /Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/numpy/core/include/numpy/arrayobject.h:4:
  In file included from /Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/numpy/core/include/numpy/ndarrayobject.h:12:
  In file included from /Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/numpy/core/include/numpy/ndarraytypes.h:1822:
  /Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/numpy/core/include/numpy/npy_1_7_deprecated_api.h:17:2: warning: "Using deprecated NumPy API, disable it with "          "#define NPY_NO_DEPRECATED_API NPY_1_7_API_VERSION" [-W#warnings]
  #warning "Using deprecated NumPy API, disable it with " \
   ^
  src/pymain.cpp:207:29: error: non-constant-expression cannot be narrowed from type 'unsigned int' to 'npy_intp' (aka 'long') in initializer list [-Wc++11-narrowing]
      npy_intp dims_mat[2] = {rm.mat.nrows(), rm.mat.ncols()};
                              ^~~~~~~~~~~~~~
  src/pymain.cpp:207:29: note: insert an explicit cast to silence this issue
      npy_intp dims_mat[2] = {rm.mat.nrows(), rm.mat.ncols()};
                              ^~~~~~~~~~~~~~
                              static_cast<npy_intp>( )
  src/pymain.cpp:207:45: error: non-constant-expression cannot be narrowed from type 'unsigned int' to 'npy_intp' (aka 'long') in initializer list [-Wc++11-narrowing]
      npy_intp dims_mat[2] = {rm.mat.nrows(), rm.mat.ncols()};
                                              ^~~~~~~~~~~~~~
  src/pymain.cpp:207:45: note: insert an explicit cast to silence this issue
      npy_intp dims_mat[2] = {rm.mat.nrows(), rm.mat.ncols()};
                                              ^~~~~~~~~~~~~~
                                              static_cast<npy_intp>( )
  src/pymain.cpp:208:29: error: non-constant-expression cannot be narrowed from type 'unsigned int' to 'npy_intp' (aka 'long') in initializer list [-Wc++11-narrowing]
      npy_intp dims_pts[2] = {rm.refPts.nrows(), rm.refPts.ncols()};
                              ^~~~~~~~~~~~~~~~~
  src/pymain.cpp:208:29: note: insert an explicit cast to silence this issue
      npy_intp dims_pts[2] = {rm.refPts.nrows(), rm.refPts.ncols()};
                              ^~~~~~~~~~~~~~~~~
                              static_cast<npy_intp>( )
  src/pymain.cpp:208:48: error: non-constant-expression cannot be narrowed from type 'unsigned int' to 'npy_intp' (aka 'long') in initializer list [-Wc++11-narrowing]
      npy_intp dims_pts[2] = {rm.refPts.nrows(), rm.refPts.ncols()};
                                                 ^~~~~~~~~~~~~~~~~
  src/pymain.cpp:208:48: note: insert an explicit cast to silence this issue
      npy_intp dims_pts[2] = {rm.refPts.nrows(), rm.refPts.ncols()};
                                                 ^~~~~~~~~~~~~~~~~
                                                 static_cast<npy_intp>( )
  1 warning and 4 errors generated.
  gcc: src/TurboRegTransform.cpp
  src/TurboRegTransform.cpp:45:9: warning: unknown pragma ignored [-Wunknown-pragmas]
  #pragma warning(disable:4996)
          ^
  gcc: src/TurboRegPointHandler.cpp
  1 warning generated.
  src/TurboRegTransform.cpp:45:9: warning: unknown pragma ignored [-Wunknown-pragmas]
  #pragma warning(disable:4996)
          ^
  1 warning generated.
  error: Command "gcc -fno-strict-aliasing -Wsign-compare -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -arch i386 -arch x86_64 -g -Iinc/ -I/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/numpy/core/include -I/Library/Frameworks/Python.framework/Versions/3.7/include/python3.7m -c src/pymain.cpp -o build/temp.macosx-10.6-intel-3.7/src/pymain.o -std=c++11" failed with exit status 1
  ----------------------------------------
  ERROR: Failed building wheel for pystackreg
  Running setup.py clean for pystackreg
Failed to build pystackreg
Installing collected packages: pystackreg, et-xmlfile, jdcal, openpyxl, xlwt, xlrd, llvmlite, numba, imagepy
  Running setup.py install for pystackreg ... error
    ERROR: Complete output from command /usr/local/bin/python3.7 -u -c 'import setuptools, tokenize;__file__='"'"'/private/var/folders/49/lx4dfjcs6dn11kb8cmsw5n600000gn/T/pip-install-4mqurchj/pystackreg/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /private/var/folders/49/lx4dfjcs6dn11kb8cmsw5n600000gn/T/pip-record-l5_w4xrs/install-record.txt --single-version-externally-managed --compile:
    ERROR: running install
    running build
    running build_py
    creating build
    creating build/lib.macosx-10.6-intel-3.7
    creating build/lib.macosx-10.6-intel-3.7/pystackreg
    copying pystackreg/version.py -> build/lib.macosx-10.6-intel-3.7/pystackreg
    copying pystackreg/__init__.py -> build/lib.macosx-10.6-intel-3.7/pystackreg
    copying pystackreg/pystackreg.py -> build/lib.macosx-10.6-intel-3.7/pystackreg
    running build_ext
    building 'pystackreg.turboreg' extension
    Warning: Can't read registry to find the necessary compiler setting
    Make sure that Python modules winreg, win32api or win32con are installed.
    C compiler: gcc -fno-strict-aliasing -Wsign-compare -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -arch i386 -arch x86_64 -g
    
    creating build/temp.macosx-10.6-intel-3.7
    creating build/temp.macosx-10.6-intel-3.7/src
    compile options: '-Iinc/ -I/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/numpy/core/include -I/Library/Frameworks/Python.framework/Versions/3.7/include/python3.7m -c'
    extra options: '-std=c++11'
    gcc: src/TurboReg.cpp
    gcc: src/pymain.cpp
    gcc: src/TurboRegMask.cpp
    gcc: src/TurboRegImage.cpp
    In file included from src/pymain.cpp:11:
    In file included from /Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/numpy/core/include/numpy/arrayobject.h:4:
    In file included from /Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/numpy/core/include/numpy/ndarrayobject.h:12:
    In file included from /Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/numpy/core/include/numpy/ndarraytypes.h:1822:
    /Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/numpy/core/include/numpy/npy_1_7_deprecated_api.h:17:2: warning: "Using deprecated NumPy API, disable it with "          "#define NPY_NO_DEPRECATED_API NPY_1_7_API_VERSION" [-W#warnings]
    #warning "Using deprecated NumPy API, disable it with " \
     ^
    src/pymain.cpp:207:29: error: non-constant-expression cannot be narrowed from type 'unsigned int' to 'npy_intp' (aka 'long') in initializer list [-Wc++11-narrowing]
        npy_intp dims_mat[2] = {rm.mat.nrows(), rm.mat.ncols()};
                                ^~~~~~~~~~~~~~
    src/pymain.cpp:207:29: note: insert an explicit cast to silence this issue
        npy_intp dims_mat[2] = {rm.mat.nrows(), rm.mat.ncols()};
                                ^~~~~~~~~~~~~~
                                static_cast<npy_intp>( )
    src/pymain.cpp:207:45: error: non-constant-expression cannot be narrowed from type 'unsigned int' to 'npy_intp' (aka 'long') in initializer list [-Wc++11-narrowing]
        npy_intp dims_mat[2] = {rm.mat.nrows(), rm.mat.ncols()};
                                                ^~~~~~~~~~~~~~
    src/pymain.cpp:207:45: note: insert an explicit cast to silence this issue
        npy_intp dims_mat[2] = {rm.mat.nrows(), rm.mat.ncols()};
                                                ^~~~~~~~~~~~~~
                                                static_cast<npy_intp>( )
    src/pymain.cpp:208:29: error: non-constant-expression cannot be narrowed from type 'unsigned int' to 'npy_intp' (aka 'long') in initializer list [-Wc++11-narrowing]
        npy_intp dims_pts[2] = {rm.refPts.nrows(), rm.refPts.ncols()};
                                ^~~~~~~~~~~~~~~~~
    src/pymain.cpp:208:29: note: insert an explicit cast to silence this issue
        npy_intp dims_pts[2] = {rm.refPts.nrows(), rm.refPts.ncols()};
                                ^~~~~~~~~~~~~~~~~
                                static_cast<npy_intp>( )
    src/pymain.cpp:208:48: error: non-constant-expression cannot be narrowed from type 'unsigned int' to 'npy_intp' (aka 'long') in initializer list [-Wc++11-narrowing]
        npy_intp dims_pts[2] = {rm.refPts.nrows(), rm.refPts.ncols()};
                                                   ^~~~~~~~~~~~~~~~~
    src/pymain.cpp:208:48: note: insert an explicit cast to silence this issue
        npy_intp dims_pts[2] = {rm.refPts.nrows(), rm.refPts.ncols()};
                                                   ^~~~~~~~~~~~~~~~~
                                                   static_cast<npy_intp>( )
    1 warning and 4 errors generated.
    gcc: src/TurboRegTransform.cpp
    src/TurboRegTransform.cpp:45:9: warning: unknown pragma ignored [-Wunknown-pragmas]
    #pragma warning(disable:4996)
            ^
    gcc: src/TurboRegPointHandler.cpp
    1 warning generated.
    src/TurboRegTransform.cpp:45:9: warning: unknown pragma ignored [-Wunknown-pragmas]
    #pragma warning(disable:4996)
            ^
    1 warning generated.
    error: Command "gcc -fno-strict-aliasing -Wsign-compare -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -arch i386 -arch x86_64 -g -Iinc/ -I/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/numpy/core/include -I/Library/Frameworks/Python.framework/Versions/3.7/include/python3.7m -c src/pymain.cpp -o build/temp.macosx-10.6-intel-3.7/src/pymain.o -std=c++11" failed with exit status 1
    ----------------------------------------
ERROR: Command "/usr/local/bin/python3.7 -u -c 'import setuptools, tokenize;__file__='"'"'/private/var/folders/49/lx4dfjcs6dn11kb8cmsw5n600000gn/T/pip-install-4mqurchj/pystackreg/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /private/var/folders/49/lx4dfjcs6dn11kb8cmsw5n600000gn/T/pip-record-l5_w4xrs/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /private/var/folders/49/lx4dfjcs6dn11kb8cmsw5n600000gn/T/pip-install-4mqurchj/pystackreg/
WARNING: You are using pip version 19.1.1, however version 19.2.1 is available.
You should consider upgrading via the 'pip install --upgrade pip' command.
StephenFangdeMacBook-Pro:ImagePy stephenfang$ pip3 install imagepy
Collecting imagepy
Collecting pystackreg (from imagepy)
  Using cached https://files.pythonhosted.org/packages/24/60/d845d03364bcb77c4d468c705622061fb4409b773830e01845793ce40d7d/pystackreg-0.2.1.tar.gz
Requirement already satisfied: pydicom in /Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages (from imagepy) (1.3.0)
Requirement already satisfied: wxpython in /Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages (from imagepy) (4.0.6)
Requirement already satisfied: pypubsub in /Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages (from imagepy) (4.0.3)
Requirement already satisfied: pandas in /Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages (from imagepy) (0.24.2)
Collecting openpyxl (from imagepy)
Requirement already satisfied: scikit-image in /Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages (from imagepy) (0.15.0)
Requirement already satisfied: numpy-stl in /Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages (from imagepy) (2.10.1)
Requirement already satisfied: read-roi in /Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages (from imagepy) (1.5.2)
Collecting numba (from imagepy)
  Using cached https://files.pythonhosted.org/packages/bb/0d/db1d84ec79b223dedb72d7f1823a77797494348fea4b1809d92affea720a/numba-0.45.1-cp37-cp37m-macosx_10_9_x86_64.whl
Collecting xlrd (from imagepy)
  Using cached https://files.pythonhosted.org/packages/b0/16/63576a1a001752e34bf8ea62e367997530dc553b689356b9879339cf45a4/xlrd-1.2.0-py2.py3-none-any.whl
Requirement already satisfied: shapely in /Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages (from imagepy) (1.6.4.post2)
Collecting xlwt (from imagepy)
  Using cached https://files.pythonhosted.org/packages/44/48/def306413b25c3d01753603b1a222a011b8621aed27cd7f89cbc27e6b0f4/xlwt-1.3.0-py2.py3-none-any.whl
Requirement already satisfied: markdown in /Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages (from imagepy) (3.1)
Requirement already satisfied: numpy in /Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages (from pystackreg->imagepy) (1.16.2)
Requirement already satisfied: tqdm in /Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages (from pystackreg->imagepy) (4.31.1)
Requirement already satisfied: six in /Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages (from wxpython->imagepy) (1.12.0)
Requirement already satisfied: pillow in /Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages (from wxpython->imagepy) (6.0.0)
Requirement already satisfied: pytz>=2011k in /Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages (from pandas->imagepy) (2019.1)
Requirement already satisfied: python-dateutil>=2.5.0 in /Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages (from pandas->imagepy) (2.8.0)
Collecting et-xmlfile (from openpyxl->imagepy)
Collecting jdcal (from openpyxl->imagepy)
  Using cached https://files.pythonhosted.org/packages/f0/da/572cbc0bc582390480bbd7c4e93d14dc46079778ed915b505dc494b37c57/jdcal-1.4.1-py2.py3-none-any.whl
Requirement already satisfied: imageio>=2.0.1 in /Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages (from scikit-image->imagepy) (2.5.0)
Requirement already satisfied: networkx>=2.0 in /Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages (from scikit-image->imagepy) (2.3)
Requirement already satisfied: scipy>=0.17.0 in /Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages (from scikit-image->imagepy) (1.2.1)
Requirement already satisfied: PyWavelets>=0.4.0 in /Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages (from scikit-image->imagepy) (1.0.3)
Requirement already satisfied: matplotlib!=3.0.0,>=2.0.0 in /Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages (from scikit-image->imagepy) (3.0.3)
Requirement already satisfied: python-utils>=1.6.2 in /Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages (from numpy-stl->imagepy) (2.3.0)
Collecting llvmlite>=0.29.0dev0 (from numba->imagepy)
  Using cached https://files.pythonhosted.org/packages/d7/45/9216cdbf71b94ae8eefe24cfbdf4c1b9045a58f297c6e2eab5cb8d05faf3/llvmlite-0.29.0-cp37-cp37m-macosx_10_9_x86_64.whl
Requirement already satisfied: setuptools>=36 in /Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages (from markdown->imagepy) (40.8.0)
Requirement already satisfied: decorator>=4.3.0 in /Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages (from networkx>=2.0->scikit-image->imagepy) (4.4.0)
Requirement already satisfied: pyparsing!=2.0.4,!=2.1.2,!=2.1.6,>=2.0.1 in /Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages (from matplotlib!=3.0.0,>=2.0.0->scikit-image->imagepy) (2.4.0)
Requirement already satisfied: kiwisolver>=1.0.1 in /Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages (from matplotlib!=3.0.0,>=2.0.0->scikit-image->imagepy) (1.0.1)
Requirement already satisfied: cycler>=0.10 in /Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages (from matplotlib!=3.0.0,>=2.0.0->scikit-image->imagepy) (0.10.0)
Building wheels for collected packages: pystackreg
  Building wheel for pystackreg (setup.py) ... error
  ERROR: Complete output from command /usr/local/bin/python3.7 -u -c 'import setuptools, tokenize;__file__='"'"'/private/var/folders/49/lx4dfjcs6dn11kb8cmsw5n600000gn/T/pip-install-2w_prpxg/pystackreg/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' bdist_wheel -d /private/var/folders/49/lx4dfjcs6dn11kb8cmsw5n600000gn/T/pip-wheel-0ivmq7zr --python-tag cp37:
  ERROR: running bdist_wheel
  running build
  running build_py
  creating build
  creating build/lib.macosx-10.6-intel-3.7
  creating build/lib.macosx-10.6-intel-3.7/pystackreg
  copying pystackreg/version.py -> build/lib.macosx-10.6-intel-3.7/pystackreg
  copying pystackreg/__init__.py -> build/lib.macosx-10.6-intel-3.7/pystackreg
  copying pystackreg/pystackreg.py -> build/lib.macosx-10.6-intel-3.7/pystackreg
  running build_ext
  building 'pystackreg.turboreg' extension
  Warning: Can't read registry to find the necessary compiler setting
  Make sure that Python modules winreg, win32api or win32con are installed.
  C compiler: gcc -fno-strict-aliasing -Wsign-compare -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -arch i386 -arch x86_64 -g
  
  creating build/temp.macosx-10.6-intel-3.7
  creating build/temp.macosx-10.6-intel-3.7/src
  compile options: '-Iinc/ -I/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/numpy/core/include -I/Library/Frameworks/Python.framework/Versions/3.7/include/python3.7m -c'
  extra options: '-std=c++11'
  gcc: src/pymain.cpp
  gcc: src/TurboReg.cpp
  gcc: src/TurboRegMask.cppgcc: src/TurboRegImage.cpp
  
  In file included from src/pymain.cpp:11:
  In file included from /Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/numpy/core/include/numpy/arrayobject.h:4:
  In file included from /Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/numpy/core/include/numpy/ndarrayobject.h:12:
  In file included from /Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/numpy/core/include/numpy/ndarraytypes.h:1822:
  /Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/numpy/core/include/numpy/npy_1_7_deprecated_api.h:17:2: warning: "Using deprecated NumPy API, disable it with "          "#define NPY_NO_DEPRECATED_API NPY_1_7_API_VERSION" [-W#warnings]
  #warning "Using deprecated NumPy API, disable it with " \
   ^
  src/pymain.cpp:207:29: error: non-constant-expression cannot be narrowed from type 'unsigned int' to 'npy_intp' (aka 'long') in initializer list [-Wc++11-narrowing]
      npy_intp dims_mat[2] = {rm.mat.nrows(), rm.mat.ncols()};
                              ^~~~~~~~~~~~~~
  src/pymain.cpp:207:29: note: insert an explicit cast to silence this issue
      npy_intp dims_mat[2] = {rm.mat.nrows(), rm.mat.ncols()};
                              ^~~~~~~~~~~~~~
                              static_cast<npy_intp>( )
  src/pymain.cpp:207:45: error: non-constant-expression cannot be narrowed from type 'unsigned int' to 'npy_intp' (aka 'long') in initializer list [-Wc++11-narrowing]
      npy_intp dims_mat[2] = {rm.mat.nrows(), rm.mat.ncols()};
                                              ^~~~~~~~~~~~~~
  src/pymain.cpp:207:45: note: insert an explicit cast to silence this issue
      npy_intp dims_mat[2] = {rm.mat.nrows(), rm.mat.ncols()};
                                              ^~~~~~~~~~~~~~
                                              static_cast<npy_intp>( )
  src/pymain.cpp:208:29: error: non-constant-expression cannot be narrowed from type 'unsigned int' to 'npy_intp' (aka 'long') in initializer list [-Wc++11-narrowing]
      npy_intp dims_pts[2] = {rm.refPts.nrows(), rm.refPts.ncols()};
                              ^~~~~~~~~~~~~~~~~
  src/pymain.cpp:208:29: note: insert an explicit cast to silence this issue
      npy_intp dims_pts[2] = {rm.refPts.nrows(), rm.refPts.ncols()};
                              ^~~~~~~~~~~~~~~~~
                              static_cast<npy_intp>( )
  src/pymain.cpp:208:48: error: non-constant-expression cannot be narrowed from type 'unsigned int' to 'npy_intp' (aka 'long') in initializer list [-Wc++11-narrowing]
      npy_intp dims_pts[2] = {rm.refPts.nrows(), rm.refPts.ncols()};
                                                 ^~~~~~~~~~~~~~~~~
  src/pymain.cpp:208:48: note: insert an explicit cast to silence this issue
      npy_intp dims_pts[2] = {rm.refPts.nrows(), rm.refPts.ncols()};
                                                 ^~~~~~~~~~~~~~~~~
                                                 static_cast<npy_intp>( )
  1 warning and 4 errors generated.
  gcc: src/TurboRegTransform.cpp
  src/TurboRegTransform.cpp:45:9: warning: unknown pragma ignored [-Wunknown-pragmas]
  #pragma warning(disable:4996)
          ^
  gcc: src/TurboRegPointHandler.cpp
  1 warning generated.
  src/TurboRegTransform.cpp:45:9: warning: unknown pragma ignored [-Wunknown-pragmas]
  #pragma warning(disable:4996)
          ^
  1 warning generated.
  error: Command "gcc -fno-strict-aliasing -Wsign-compare -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -arch i386 -arch x86_64 -g -Iinc/ -I/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/numpy/core/include -I/Library/Frameworks/Python.framework/Versions/3.7/include/python3.7m -c src/pymain.cpp -o build/temp.macosx-10.6-intel-3.7/src/pymain.o -std=c++11" failed with exit status 1
  ----------------------------------------
  ERROR: Failed building wheel for pystackreg
  Running setup.py clean for pystackreg
Failed to build pystackreg
Installing collected packages: pystackreg, et-xmlfile, jdcal, openpyxl, llvmlite, numba, xlrd, xlwt, imagepy
  Running setup.py install for pystackreg ... error
    ERROR: Complete output from command /usr/local/bin/python3.7 -u -c 'import setuptools, tokenize;__file__='"'"'/private/var/folders/49/lx4dfjcs6dn11kb8cmsw5n600000gn/T/pip-install-2w_prpxg/pystackreg/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /private/var/folders/49/lx4dfjcs6dn11kb8cmsw5n600000gn/T/pip-record-_odidbgb/install-record.txt --single-version-externally-managed --compile:
    ERROR: running install
    running build
    running build_py
    creating build
    creating build/lib.macosx-10.6-intel-3.7
    creating build/lib.macosx-10.6-intel-3.7/pystackreg
    copying pystackreg/version.py -> build/lib.macosx-10.6-intel-3.7/pystackreg
    copying pystackreg/__init__.py -> build/lib.macosx-10.6-intel-3.7/pystackreg
    copying pystackreg/pystackreg.py -> build/lib.macosx-10.6-intel-3.7/pystackreg
    running build_ext
    building 'pystackreg.turboreg' extension
    Warning: Can't read registry to find the necessary compiler setting
    Make sure that Python modules winreg, win32api or win32con are installed.
    C compiler: gcc -fno-strict-aliasing -Wsign-compare -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -arch i386 -arch x86_64 -g
    
    creating build/temp.macosx-10.6-intel-3.7
    creating build/temp.macosx-10.6-intel-3.7/src
    compile options: '-Iinc/ -I/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/numpy/core/include -I/Library/Frameworks/Python.framework/Versions/3.7/include/python3.7m -c'
    extra options: '-std=c++11'
    gcc: src/pymain.cpp
    gcc: src/TurboReg.cpp
    gcc: src/TurboRegMask.cpp
    gcc: src/TurboRegImage.cpp
    In file included from src/pymain.cpp:11:
    In file included from /Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/numpy/core/include/numpy/arrayobject.h:4:
    In file included from /Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/numpy/core/include/numpy/ndarrayobject.h:12:
    In file included from /Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/numpy/core/include/numpy/ndarraytypes.h:1822:
    /Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/numpy/core/include/numpy/npy_1_7_deprecated_api.h:17:2: warning: "Using deprecated NumPy API, disable it with "          "#define NPY_NO_DEPRECATED_API NPY_1_7_API_VERSION" [-W#warnings]
    #warning "Using deprecated NumPy API, disable it with " \
     ^
    src/pymain.cpp:207:29: error: non-constant-expression cannot be narrowed from type 'unsigned int' to 'npy_intp' (aka 'long') in initializer list [-Wc++11-narrowing]
        npy_intp dims_mat[2] = {rm.mat.nrows(), rm.mat.ncols()};
                                ^~~~~~~~~~~~~~
    src/pymain.cpp:207:29: note: insert an explicit cast to silence this issue
        npy_intp dims_mat[2] = {rm.mat.nrows(), rm.mat.ncols()};
                                ^~~~~~~~~~~~~~
                                static_cast<npy_intp>( )
    src/pymain.cpp:207:45: error: non-constant-expression cannot be narrowed from type 'unsigned int' to 'npy_intp' (aka 'long') in initializer list [-Wc++11-narrowing]
        npy_intp dims_mat[2] = {rm.mat.nrows(), rm.mat.ncols()};
                                                ^~~~~~~~~~~~~~
    src/pymain.cpp:207:45: note: insert an explicit cast to silence this issue
        npy_intp dims_mat[2] = {rm.mat.nrows(), rm.mat.ncols()};
                                                ^~~~~~~~~~~~~~
                                                static_cast<npy_intp>( )
    src/pymain.cpp:208:29: error: non-constant-expression cannot be narrowed from type 'unsigned int' to 'npy_intp' (aka 'long') in initializer list [-Wc++11-narrowing]
        npy_intp dims_pts[2] = {rm.refPts.nrows(), rm.refPts.ncols()};
                                ^~~~~~~~~~~~~~~~~
    src/pymain.cpp:208:29: note: insert an explicit cast to silence this issue
        npy_intp dims_pts[2] = {rm.refPts.nrows(), rm.refPts.ncols()};
                                ^~~~~~~~~~~~~~~~~
                                static_cast<npy_intp>( )
    src/pymain.cpp:208:48: error: non-constant-expression cannot be narrowed from type 'unsigned int' to 'npy_intp' (aka 'long') in initializer list [-Wc++11-narrowing]
        npy_intp dims_pts[2] = {rm.refPts.nrows(), rm.refPts.ncols()};
                                                   ^~~~~~~~~~~~~~~~~
    src/pymain.cpp:208:48: note: insert an explicit cast to silence this issue
        npy_intp dims_pts[2] = {rm.refPts.nrows(), rm.refPts.ncols()};
                                                   ^~~~~~~~~~~~~~~~~
                                                   static_cast<npy_intp>( )
    1 warning and 4 errors generated.
    gcc: src/TurboRegTransform.cpp
    src/TurboRegTransform.cpp:45:9: warning: unknown pragma ignored [-Wunknown-pragmas]
    #pragma warning(disable:4996)
            ^
    gcc: src/TurboRegPointHandler.cpp
    1 warning generated.
    src/TurboRegTransform.cpp:45:9: warning: unknown pragma ignored [-Wunknown-pragmas]
    #pragma warning(disable:4996)
            ^
    1 warning generated.
    error: Command "gcc -fno-strict-aliasing -Wsign-compare -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -arch i386 -arch x86_64 -g -Iinc/ -I/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/numpy/core/include -I/Library/Frameworks/Python.framework/Versions/3.7/include/python3.7m -c src/pymain.cpp -o build/temp.macosx-10.6-intel-3.7/src/pymain.o -std=c++11" failed with exit status 1
    ----------------------------------------
ERROR: Command "/usr/local/bin/python3.7 -u -c 'import setuptools, tokenize;__file__='"'"'/private/var/folders/49/lx4dfjcs6dn11kb8cmsw5n600000gn/T/pip-install-2w_prpxg/pystackreg/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /private/var/folders/49/lx4dfjcs6dn11kb8cmsw5n600000gn/T/pip-record-_odidbgb/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /private/var/folders/49/lx4dfjcs6dn11kb8cmsw5n600000gn/T/pip-install-2w_prpxg/pystackreg/

ValueError: insecure string pickle

首先非常感谢你分享的这个优秀工具,目前我遇到了一些问题,还没有在本地运行起来

我使用的发行版是Anaconda2 和wxPython,运行命令python main.py遇到了如下错误:

Traceback (most recent call last):
  File "main.py", line 4, in <module>
    from ui.imagepy import ImagePy
  File "C:\apps\imagepy\ui\imagepy.py", line 8, in <module>
    import pluginloader, toolsloader, IPy
  File "C:\apps\imagepy\ui\pluginloader.py", line 3, in <module>
    from core.loader import loader
  File "C:\apps\imagepy\core\loader\loader.py", line 7, in <module>
    import IPy
  File "C:\apps\imagepy\IPy.py", line 8, in <module>
    from ui.panelconfig import ParaDialog
  File "C:\apps\imagepy\ui\panelconfig.py", line 3, in <module>
    from core.managers import WindowsManager, TableLogManager
  File "C:\apps\imagepy\core\managers.py", line 12, in <module>
    from manager.configmanager import *
  File "C:\apps\imagepy\core\manager\configmanager.py", line 34, in <module>
    ConfigManager.read()
  File "C:\apps\imagepy\core\manager\configmanager.py", line 15, in read
    cls.cfg = pickle.load(pkl_file)
  File "C:\ProgramData\Anaconda2\lib\pickle.py", line 1384, in load
    return Unpickler(file).load()
  File "C:\ProgramData\Anaconda2\lib\pickle.py", line 864, in load
    dispatch[key](self)
  File "C:\ProgramData\Anaconda2\lib\pickle.py", line 972, in load_string
    raise ValueError, "insecure string pickle"
ValueError: insecure string pickle

下面是我的环境变量:
['C:\\apps\\imagepy', 'C:\\ProgramData\\Anaconda2\\python27.zip', 'C:\\ProgramData\\Anaconda2\\DLLs', 'C:\\ProgramData\\Anaconda2\\lib', 'C:\\ProgramData\\Anaconda2\\lib\\plat-win', 'C:\\ProgramData\\Anaconda2\\lib\\lib-tk', 'C:\\ProgramData\\Anaconda2', 'C:\\ProgramData\\Anaconda2\\lib\\site-packages', 'C:\\ProgramData\\Anaconda2\\lib\\site-packages\\Sphinx-1.5.1-py2.7.egg', 'C:\\ProgramData\\Anaconda2\\lib\\site-packages\\win32', 'C:\\ProgramData\\Anaconda2\\lib\\site-packages\\win32\\lib', 'C:\\ProgramData\\Anaconda2\\lib\\site-packages\\Pythonwin', 'C:\\ProgramData\\Anaconda2\\lib\\site-packages\\setuptools-27.2.0-py2.7.egg', 'C:\\ProgramData\\Anaconda2\\lib\\site-packages\\wx-3.0-msw']

3D viewer crash with 2 activate window on macos

3D viewer weird crash on macos
2019-09-16 21:55:39.526 python[18460:3280750] This application is modifying the autolayout engine from a background thread after the engine was accessed from the main thread. This can lead to engine corruption and weird crashes.

2019-09-16 21:55:39.576 python[18460:3280750] *** Assertion failure in -[NSDockConnection sendMessage:], /BuildRoot/Library/Caches/com.apple.xbs/Sources/AppKit/AppKit-1671.60.107/FullScreen.subproj/NSDockConnection.m:227
2019-09-16 21:55:39.594 python[18460:3280750] *** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'Can only send messages on the main thread'
*** First throw call stack:
(
0 CoreFoundation 0x00007fff481fd2fd __exceptionPreprocess + 256
1 libobjc.A.dylib 0x00007fff728cda17 objc_exception_throw + 48
2 CoreFoundation 0x00007fff48218016 +[NSException raise:format:arguments:] + 98
3 Foundation 0x00007fff4a4b7791 -[NSAssertionHandler handleFailureInMethod:object:file:lineNumber:description:] + 194
4 AppKit 0x00007fff46085c95 -[NSDockConnection sendMessage:] + 248
5 AppKit 0x00007fff45bd0604 NSFullScreenDockConnectionSendTitleForSpace + 126
6 AppKit 0x00007fff45bf687d -[_NSWindowFullScreenContentController setAsThePrincipalFullScreenWindowInSpace] + 77
7 AppKit 0x00007fff45be2993 -[NSWindow(NSWindowTabbing) _doWindowTabOrderAbove:] + 280
8 AppKit 0x00007fff45fcbbd8 -[NSWindowStackController _doWindowOrderingToSwapPriorWindow:withNewWindow:] + 48
9 AppKit 0x00007fff45fcc0d3 __103-[NSWindowStackController _doTabSelectionAndWindowOrderingAtIndex:makeKeyAndOrderFront:justOrderFront:]_block_invoke + 312
10 AppKit 0x00007fff45775990 NSPerformVisuallyAtomicChange + 132
11 AppKit 0x00007fff45fcbe6b -[NSWindowStackController _doTabSelectionAndWindowOrderingAtIndex:makeKeyAndOrderFront:justOrderFront:] + 627
12 AppKit 0x00007fff45fc8782 -[NSWindowStackController setSelectedWindow:] + 333
13 AppKit 0x00007fff4588eddb -[NSWindow(NSWindowTabbing) _doTabbedWindowOrderFront] + 136
14 AppKit 0x00007fff4588ecb5 -[NSApplication _setKeyWindow:] + 222
15 AppKit 0x00007fff4588e776 -[NSWindow _changeKeyAndMainLimitedOK:] + 760
16 AppKit 0x00007fff4588e369 -[NSWindow _makeKeyRegardlessOfVisibility] + 76
17 AppKit 0x00007fff4588df18 -[NSWindow makeKeyAndOrderFront:] + 40
18 libwx_osx_cocoau_core-3.0.0.4.0.dylib 0x000000010b2df7d4 _ZN25wxNonOwnedWindowCocoaImpl5RaiseEv + 36
19 _core.cpython-36m-darwin.so 0x000000010aca0a86 ZL19meth_wxWindow_RaiseP7_objectS0 + 118
20 python 0x000000010a08e678 _PyCFunction_FastCallDict + 200
21 python 0x000000010a1655ef call_function + 143
22 python 0x000000010a16315c _PyEval_EvalFrameDefault + 46796
23 python 0x000000010a1568c9 _PyEval_EvalCodeWithName + 425
24 python 0x000000010a165a5a fast_function + 362
25 python 0x000000010a16564c call_function + 236
26 python 0x000000010a16315c _PyEval_EvalFrameDefault + 46796
27 python 0x000000010a1659ac fast_function + 188
28 python 0x000000010a16564c call_function + 236
29 python 0x000000010a16315c _PyEval_EvalFrameDefault + 46796
30 python 0x000000010a1568c9 _PyEval_EvalCodeWithName + 425
31 python 0x000000010a057b4d function_call + 125
32 python 0x000000010a0144fe PyObject_Call + 62
33 python 0x000000010a163352 _PyEval_EvalFrameDefault + 47298
34 python 0x000000010a1659ac fast_function + 188
35 python 0x000000010a16564c call_function + 236
36 python 0x000000010a16315c _PyEval_EvalFrameDefault + 46796
37 python 0x000000010a1659ac fast_function + 188
38 python 0x000000010a16564c call_function + 236
39 python 0x000000010a16315c _PyEval_EvalFrameDefault + 46796
40 python 0x000000010a1660ff _PyFunction_FastCallDict + 175
41 python 0x000000010a00ceb0 _PyObject_FastCallDict + 320
42 python 0x000000010a0345b8 method_call + 136
43 python 0x000000010a0144fe PyObject_Call + 62
44 python 0x000000010a1d9b6a t_bootstrap + 122
45 libsystem_pthread.dylib 0x00007fff7428f2eb _pthread_body + 126
46 libsystem_pthread.dylib 0x00007fff74292249 _pthread_start + 66
47 libsystem_pthread.dylib 0x00007fff7428e40d thread_start + 13
)
libc++abi.dylib: terminating with uncaught exception of type NSException
/Users/jysjiang/anaconda3/envs/medical/bin/pythonw: line 3: 18460 Abort trap: 6 /Users/jysjiang/anaconda3/envs/medical/python.app/Contents/MacOS/python "$@"

Testing and CI

Would be good to have some unit tests and regression tests. Also would be good to setup CI. Probably Travis CI for Linux would be a good start. Happy to provide more pointers if needed.

Macos install imagepy readme for review

conda create -n medical python=3.6
conda activate medical
conda install -c conda-forge wxpython
conda install -c conda-forge python.app no need

git clone [email protected]:Image-Py/imagepy.git
conda install -c conda-forge matplotlib
pip install scikit-image
pip install openpyxl
pip install numba ### very important
pip install Shapely

打包imagepy成exe文件

我在使用pyinstaller打包imagepy后,点击exe文件闪退,分析原因应该是没有将需要的文件都打包进去,由于imagepy是以插件的形式管理的,我想是不是因为启动时管理器去扫描插件然后再加载插件导致打包不进去

Import sequence and 3D reconstruction

Hi, about your fifth example, I was wondering whether I can use a series of different angles jpg or png images to do the 3D reconstruction? If could, how should I do this? Thank you.

BSD 4-Clause

Noticed that the license is BSD 4-Clause. Was curious if the intent was to have a BSD 4-Clause or simply some BSD license was desired and this one was picked.

If it was the latter, it's worth noting that the advertising clause was deemed problematic by GNU and Berkeley eventually removed it. Usually people wanting a BSD license go with BSD 3-Clause or BSD 2-Clause when picking a BSD license these days to avoid these issues.

If choosing BSD 4-Clause was intentional, would be curious to know why BSD 4-Clause was picked in this case.

Note: IANAL

wxpython-installer in requirements

I try to install imagepy with pip and fail because cannot install wxpython-installer. I also do not found it on pypi. Could you update requirements in setup.py file?

Command "python setup.py egg_info" failed with error code 1

Win10
Python2.7 or 3.7
get this error on pip install imagepy
updated everything possible but can't figure out why getting this error. Been all over GitHub and every message board found when searching with this error message .
Right before the error there is this: OSError: [WinError 126] The specified module could not be found

Error with save on linux

Exception in thread Thread-5: Traceback (most recent call last): File "/home/customer/anaconda3/lib/python3.6/threading.py", line 916, in _bootstrap_inner self.run() File "/home/customer/anaconda3/lib/python3.6/threading.py", line 864, in run self._target(*self._args, **self._kwargs) File "/home/customer/Data/imagepy/imagepy/core/engine/simple.py", line 64, in runasyn self.run(ips, imgs, para) File "/home/customer/Data/imagepy/imagepy/core/util/fileio.py", line 75, in run write2 = write or WriterManager.get(fe[1:], 'imgs') File "/home/customer/Data/imagepy/imagepy/core/manager/iomanager.py", line 50, in get if ext.lower() in cls.writer[tag]: KeyError: 'imgs'

That's a big bug,please fix it ...

How to run it in PyCharm?

The PyCharm IDE is more powerfull than "Develop tool suite -> command line" or the PyAlaCarte. Is it any way to use PyCharm as code editor and the command line while openning ImagePy window to show result images?

Missing imports? 23 undefined names

flake8 testing of https://github.com/Image-Py/imagepy on Python 3.7.1

$ flake8 . --count --select=E901,E999,F821,F822,F823 --show-source --statistics

./imagepy/ui/tablewindow.py:289:10: F821 undefined name 'TableFrame'
    tf = TableFrame()
         ^
./imagepy/ui/mainframe.py:136:43: F821 undefined name 'waui'
        self.auimgr.AddPane( self.devpan, waui.AuiPaneInfo() .Bottom() .CaptionVisible( False ).PinButton( True ).Dock()
                                          ^
./imagepy/ui/canvas.py:304:24: F821 undefined name 'TestTool'
    canvas.set_handler(TestTool())
                       ^
./imagepy/ui/widgets/curvepanel.py:105:28: F821 undefined name 'x1'
        self.x1, self.x2 = x1, x2
                           ^
./imagepy/ui/widgets/curvepanel.py:105:32: F821 undefined name 'x2'
        self.x1, self.x2 = x1, x2
                               ^
./imagepy/ui/widgets/normal.py:15:68: F821 undefined name 'key'
        self.ctrl.Bind(wx.EVT_KEY_UP, lambda x : self.para_changed(key))
                                                                   ^
./imagepy/ui/widgets/cmappanel.py:127:28: F821 undefined name 'x1'
        self.x1, self.x2 = x1, x2
                           ^
./imagepy/ui/widgets/cmappanel.py:127:32: F821 undefined name 'x2'
        self.x1, self.x2 = x1, x2
                               ^
./imagepy/menus/Plugins/Games/drawstep_plg.py:14:30: F821 undefined name 'ColorManager'
    if color == None:color = ColorManager.get_front()
                             ^
./imagepy/menus/Plugins/Games/drawstep_plg.py:21:30: F821 undefined name 'ColorManager'
    if color == None:color = ColorManager.get_front()
                             ^
./imagepy/menus/File/open_plg.py:45:11: F821 undefined name 'Plugin'
    print(Plugin.title)
          ^
./imagepy/menus/File/open_plg.py:47:5: F821 undefined name 'Plugin'
    Plugin().run()    ^
./imagepy/menus/File/GIF/animate_plgs.py:30:10: F821 undefined name 'Image'
		imgs = Image.open(para['path'])
         ^
./imagepy/menus/File/GIF/animate_plgs.py:31:10: F821 undefined name 'ImageSequence'
		imgs = ImageSequence.Iterator(imgs)
         ^
./imagepy/core/manager/languagemanager.py:83:5: F821 undefined name 'ShotcutManager'
    ShotcutManager.rm('c')
    ^
./imagepy/core/manager/languagemanager.py:84:11: F821 undefined name 'ShotcutManager'
    print(ShotcutManager.shotcuts)
          ^
./imagepy/core/manager/languagemanager.py:85:5: F821 undefined name 'ShotcutManager'
    ShotcutManager.write()
    ^
./imagepy/core/engine/mkdown.py:15:8: F821 undefined name 'wx'
	app = wx.App()
       ^
./imagepy/core/engine/mkdown.py:16:2: F821 undefined name 'show_help'
	show_help('title', 'abc', '')
 ^
./imagepy/core/roi/pointroi.py:96:9: F821 undefined name 'Polygon'
    p = Polygon(seq)
        ^
./imagepy/core/roi/pointroi.py:97:10: F821 undefined name 'toSegment'
    mp = toSegment(seq)         ^
./imagepy/core/myvi/manager.py:275:2: F821 undefined name 'build_surf2d'
	build_surf2d(img) ^
./imagepy/tools/Measure/profile_tol.py:159:13: F821 undefined name 'PlotFrame'
    frame = PlotFrame(None)
            ^
23    F821 undefined name 'wx'
23

E901,E999,F821,F822,F823 are the "showstopper" flake8 issues that can halt the runtime with a SyntaxError, NameError, etc. Most other flake8 issues are merely "style violations" -- useful for readability but they do not effect runtime safety.

  • F821: undefined name name
  • F822: undefined name name in __all__
  • F823: local variable name referenced before assignment
  • E901: SyntaxError or IndentationError
  • E999: SyntaxError -- failed to compile a file into an Abstract Syntax Tree

API documentation

Following this post on the forum.
I duplicate the proposal here to make a gh-pages branch to the repo and to use it to host the API documentation generated by some tool like Doxygen,
See here for a preview.

ImagePy.org website offline?

The ImagePy.org website, linked from this repository, seems to be unavailable. There is a DNS error when visiting the link.

16 bits tiff image (moiré)

hello,
When loading via File>TIF>TIF Open a 16 bits tiff image, the image is displayed as a 8 bits image modulo 256 (I guess) yielding a nice moiré effect.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.