csatizoltan / grainsegmentation Goto Github PK
View Code? Open in Web Editor NEWIdentification of individual grains in microscopic images
License: GNU General Public License v3.0
Identification of individual grains in microscopic images
License: GNU General Public License v3.0
ImagePy supports dropdown menus. I can use them to select from a set of user-defined options. This is a generalization of the img
variable used in the view
variable in the RagThreshold
class, see also #7 (comment).
A particular use case: choose among several label images saved in the data
attribute of the ImagePlus
object.
If the user opens a new image, show a confirmation dialogue that this way the previous segmentation steps will be lost.
A simple GUI with edit boxes, sliders, etc. would be useful to help filtering grains based on their properties (area, diameter, etc.), or to change visualization settings. I could use either the image viewer from scikit-image or ImagePy.
Do not close this issue until I get used to documenting everything as soon as they are declared.
For an example implementation, see here.
Data exchange among multiple plugins can be carried out in ImagePy in different ways. As an example, see this. Those solutions are better than the currently used module-level global object.
Also see the related issue #7.
As grain_segmentation.py is not a test file, rather use exceptions for error handling than the assert
keyword, which can be disabled at compile time.
Perform type checking for the inputs of all the methods of class GrainSegmentation
. Consider using type annotations. For numpy, see nptyping.
The installation instructions are pure shell commands. Put them into a shell script.
Overriding the the load
or the check
method of the Filter
or Simple
classes is a good way to implement error checking. For an example, see this.
Reproducing the menu structure for an ImagePy plugin works successfully if I directly put the implementation to the run
method. Actually, in the existing projects I found (seaice, skimg, ITK, IBook), the implementation of an algorithm is always in the same file (i.e. in the plugin file: xxx_plgs.py
) as the classes containing the run
method. E.g. the showice
function is in result_plgs.py, just as the run
methods of the classes inheriting from the Simple
class.
In my case, the algorithms can be found in the GrainSegmentation
class in grain_segmentation.py. So what I want is:
segmentation_plgs.py
, which contains classes such as OpenImage
, Filter
, etc. The OpenImage
class would call the constructor of the class GrainSegmentation
, while the Filter
class would call the method filter_image
from GrainSegmentation
.filter_image
) should be the input for another method (e.g. initial_segmentation
). My problem is that the run
method does not have output arguments. So how can I pass the output to the run
method of another class?My project will consist of multiple functions. I read in the demo document how to organize them. What I want is the following:
I have the following directory structure in mind.
README.md
LICENSE
.gitignore
requirements.txt (so that ImagePy handles the dependencies)
data
|--- samples (sample images to segment)
| |--- image1.png
| |--- ...
|--- icons (icons related to the ImagePy GUI)
| |--- icon1.svg
| |--- ...
doc
|--- ...
|--- ...
src
|--- grain_segmentation.py
|--- ... (some other files used by grain_segmentation.py)
menus (a new menu will appear in ImagePy)
|--- Grain-Segment (this will be the name of the new menu)
| |--- __init__.py
| |--- workflow_plgs.py (contains multiple classes to call the functions of grain_segmentation.py)
| |--- workflow.wf (Workflow file, invokes the GUI elements from workflow_plgs.py)
| |--- demos
| | |--- __init__.py
| | |--- demo1.mc (also uses grain_segmentation.py)
| | |--- ...
tools (optional, similar structure as for menus)
widgets (optionalm similar structure as for menus)
The grain_segmentation.py
file is a module containing a bunch of functions, responsible for the main steps of the segmentation process (reading image, filtering, initial segmentation, skeletonization, final segmentation, etc.). The functions in this module should not know anything about the GUI (ImagePy) and can be used in any Python project once the basic dependencies (numpy, scipy, scikit-image) are fulfilled.
To help experimenting with the parameters of the image processing functions residing in grain_segmentation.py
and to perform some tasks manually, ImagePy is used -- its code being in the GUI/
directory.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.