Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Watershed workflow #1437

Open
wants to merge 113 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
113 commits
Select commit Hold shift + click to select a range
a5a3c8b
documentationsfehler reduziert
shaker6691 Oct 4, 2016
b3bc422
part 1: creating workflow and applet
shaker6691 Oct 4, 2016
fb3a532
eigenes Threshold hinzugefuegt
shaker6691 Oct 5, 2016
676bf04
watershedsegmentation workflow 0.0
shaker6691 Oct 6, 2016
7aba097
watershedSegmentation workflow 0.1
shaker6691 Oct 6, 2016
3fda882
applets bessr verstanden
shaker6691 Oct 7, 2016
38b239c
channel selection applet vorbereiten
shaker6691 Oct 11, 2016
85b2e89
channel selection klappt schon recht gut
shaker6691 Oct 11, 2016
bc0c5c1
channel Selection gemacht und geht
shaker6691 Oct 12, 2016
3a4f01d
visibility completed for channel selection
shaker6691 Oct 13, 2016
a534387
channel Selection output is left
shaker6691 Oct 13, 2016
8771874
troubleshooting included
shaker6691 Oct 19, 2016
d7a8845
savety copy and changement
shaker6691 Oct 26, 2016
bd4177b
aufgeraeumt und nun auf der suche nach der position
shaker6691 Oct 26, 2016
f7d54da
pixel value works for 3d images with x,y,z tags
shaker6691 Oct 27, 2016
1f2fea2
channel selection integrated with pixel value update
shaker6691 Oct 27, 2016
b6f21bc
preparation for cursor, brusher, eraser; Brushvalue Spinbox finished
shaker6691 Oct 28, 2016
a8f13b1
fehler gefunden
shaker6691 Nov 2, 2016
6ceaf97
jetzt geht es nicht mehr weil ganz viel rüberkopiert wurde von
shaker6691 Nov 3, 2016
8d8d766
pixelclassification kopiert zum herumprobieren
shaker6691 Nov 3, 2016
1c95f07
brushing statt labeling eingefuehrt, welches meinen zwecken mehr dienen
shaker6691 Nov 3, 2016
701006a
alles rausgeschmissen was man nicht braucht. als naechstes: ein label
shaker6691 Nov 4, 2016
430824c
am brushing label dran, dass es nicht von anfang alles schwarz ist
shaker6691 Nov 4, 2016
1a713db
watershed mit pixelvalue zurueck gesetzt ohne brushing aber lauffaehig
shaker6691 Nov 4, 2016
d83fa17
direkt vor fixing von export. noch alles ohne Fehler
shaker6691 Nov 4, 2016
8a5e802
export klappt an sich. nur gibt es jetzt beim anklicken von prediciton
shaker6691 Nov 7, 2016
493c0dc
Direkt vor Umsetzung und Integration von LabelingGui (Labels) in Wate…
shaker6691 Nov 9, 2016
68cdc94
labelingDrawer ist integriert. Schritt 3 steht an
shaker6691 Nov 10, 2016
6d94390
watershedLabeling erstellt aber nichts hinzugefuegt
shaker6691 Nov 10, 2016
a3dc5da
Enabled to show the value of each label
shaker6691 Nov 11, 2016
88f95de
8bit colortable (random 256 diffrent colors) for labels
shaker6691 Nov 11, 2016
e2a5f52
vixel value integrated into watershedLabelingGui and functionality added
shaker6691 Nov 11, 2016
9e7c7fe
tried to integrate CorrectedSeedsIn and ...Out (still didn't work)
shaker6691 Nov 14, 2016
c25b126
integrated the import of seeds with labels und resetting them. TODO:
shaker6691 Nov 17, 2016
24484f6
ColorProblem solved; labels adding and deleting works fine except; if
shaker6691 Nov 18, 2016
ec67332
fixing the bug. now draw with correct number after label deletion
shaker6691 Nov 23, 2016
0b9ddd2
pixelValueDisplaying as separate class
shaker6691 Nov 23, 2016
8291d61
export of 'importAndResetLabels' as class nearly finished
shaker6691 Nov 23, 2016
c33fd3e
importAndResetLabels successfully exported into class
shaker6691 Nov 24, 2016
730c019
clean up a little bit
shaker6691 Nov 24, 2016
08df591
tidied up the setup layer
shaker6691 Nov 24, 2016
5e3c50a
introduction of the watershed-algorithm itself. doesn't work yet
shaker6691 Nov 24, 2016
6e98c90
watershed works for one particular dataset
shaker6691 Nov 25, 2016
91668af
cleaned up the watershedLabeling folder a little bit
shaker6691 Nov 25, 2016
92ed012
removed unneccesary applets and workflows with test data.
shaker6691 Nov 25, 2016
1d7dec2
data export works
shaker6691 Nov 25, 2016
80e19ee
preparation for automatic controll of watershed, whether 2D, 3D, with or
shaker6691 Nov 25, 2016
dcdbf3a
included automatic slicing (when time is used) in watershed algorithm
shaker6691 Nov 29, 2016
5fe1dc7
parameterinput via slots works
shaker6691 Nov 30, 2016
468268b
bug fixes. now it should work better
shaker6691 Nov 30, 2016
1a1a2f9
another bug
shaker6691 Nov 30, 2016
6dedc9d
saved the watershed calculations in cache
shaker6691 Dec 1, 2016
e80af7d
new todo tasks
shaker6691 Dec 1, 2016
89a9f3c
serializer doesn't work. try some things with the pixelclassification…
shaker6691 Dec 2, 2016
4e5d08d
serializer worked on
shaker6691 Dec 8, 2016
f9957de
SerialListSlot with slot level = 1 or higher implemented
shaker6691 Dec 9, 2016
d4195c0
serialization of labelsNames and LabelCache with Level 1
shaker6691 Dec 9, 2016
d40804e
2 bug fixes for saving and resetting
shaker6691 Dec 12, 2016
12acf6f
1 bug fix for getting the higher dimension right
shaker6691 Dec 12, 2016
ae5f70b
documentation errors solved with pyqt 4 vs pyqt5
shaker6691 Dec 19, 2016
3729dcb
applet_api.RST and applet_library.RST have a compiling error, therefore
shaker6691 Dec 19, 2016
2f5d98e
fixing 2 bugs in the documentation, where classes that didn't exist
shaker6691 Dec 20, 2016
7be6712
removed all warnings and bugs
shaker6691 Dec 20, 2016
e2cd7a9
documentation for a single applet
shaker6691 Dec 20, 2016
53bfb40
added interesting 'nice to know' facts
shaker6691 Dec 21, 2016
6f15c8c
expanded the docu with labelingGui
shaker6691 Dec 22, 2016
b7d3fb2
Merge branch 'watershed_workflow'
shaker6691 Jan 9, 2017
7c64a97
seeds new applet; not working right now
shaker6691 Jan 9, 2017
4f95b56
layout for seeds applet added
shaker6691 Jan 10, 2017
e5ba2a7
Added all seeds parameter to sync and broadcasting. Still no computation
shaker6691 Jan 10, 2017
d6ab9a9
working on the smoothing and generating of seeds
shaker6691 Jan 11, 2017
9f50923
main thing works but distance transform needs to be used from anna
shaker6691 Jan 11, 2017
1a9a6e6
cleaned up seedgeneration and connected to gui
shaker6691 Jan 11, 2017
04f8834
seeds and watershed together with slots and with bugs
shaker6691 Jan 12, 2017
4387246
corrected dt and make reset seeds faster.
shaker6691 Jan 13, 2017
e6a2d7c
applet Seeds working with execute right now, but not perfect
shaker6691 Jan 16, 2017
9a0359f
directly before reorderaxis. seeds works with propagate dirty
shaker6691 Jan 17, 2017
6f3b30b
before: integrate z,t in generateSeeds
shaker6691 Jan 18, 2017
69e6469
before reorderaxis and execute in watershed
shaker6691 Jan 18, 2017
962c869
watershed applet works with execute. now the reset and reload of the
shaker6691 Jan 18, 2017
b602e6c
made all ready
shaker6691 Jan 19, 2017
5566fa7
reorderaxis in the workflow in the data selection
shaker6691 Feb 1, 2017
b224f14
OpSeeds: Removed unused slot
stuarteberg Feb 1, 2017
ce55bfa
OpSeeds: Use 'ready' notifications instead of 'metaChanged' notificat…
stuarteberg Feb 1, 2017
a10ec08
OpSeeds: Remove unnecessary calls to setDirty()
stuarteberg Feb 1, 2017
71ee653
SeedsGui: Initialize combo boxes BEFORE initializing their callbacks.
stuarteberg Feb 1, 2017
40a516f
WatershedSegmentationGui: Clean up notification callbacks during shut…
stuarteberg Feb 1, 2017
2d81500
OpWatershedSegmentation: Removed an unnecessary call to setDirty()
stuarteberg Feb 1, 2017
749bd74
Use OpCompressedCache, not _OpCacheWrapper
stuarteberg Feb 1, 2017
6875b42
OpSeeds: Minor clean up in execute()
stuarteberg Feb 1, 2017
3f7987d
SeedsGui: Fix initial seeds display
stuarteberg Feb 1, 2017
ef3bbb9
OpWatershedSegmentation: Moved Seeds dirty handling from a notifyDirt…
stuarteberg Feb 1, 2017
efc1ab9
OpWatershedSegmentationCalculation: Simplify propagateDirty()
stuarteberg Feb 1, 2017
8c49497
wasn't that important
shaker6691 Feb 2, 2017
3fdb9c6
time problem with cache solved by setting the blocksize for cache
shaker6691 Feb 3, 2017
1105c11
time cache fixed in ws applet as well
shaker6691 Feb 3, 2017
7eacaef
fixed the reset bug, so that the ws labels are reset only when applet is
shaker6691 Feb 3, 2017
df484d8
fixed some bugs
shaker6691 Feb 3, 2017
bc1c093
changed ResetLabelsToSlot to InputSeedsChanged
shaker6691 Feb 7, 2017
7033aad
changed seeds gui
shaker6691 Feb 13, 2017
0bb7286
implemented the clear label functionality
shaker6691 Feb 14, 2017
7841381
labeling always in the seeds applet
shaker6691 Feb 14, 2017
dfbe597
serializer tests added
shaker6691 Feb 20, 2017
52cfdee
watershed segmentation test serializer corrected
shaker6691 Feb 20, 2017
524bfd5
Begin of the pixel classification workflow
shaker6691 Feb 24, 2017
9400b16
removed all unused applets and workflows as well as some ununsed code
shaker6691 Mar 6, 2017
606f47e
added license header to all watershed files
shaker6691 Mar 9, 2017
1494598
Tests for OpSeeds created and all are successful
shaker6691 Mar 9, 2017
8ece064
beginning of OpWSCalculation tests and some corrections
shaker6691 Mar 10, 2017
ff39494
tests for opWSCalc for 3D, 2 is outstanding
shaker6691 Mar 10, 2017
e8f7567
completed test for opWatershedSegmentationCalculation
shaker6691 Mar 10, 2017
ce98b4f
removed all print statements; watershed workflow is finished
shaker6691 Mar 10, 2017
0464937
Merge branch 'master' of githubL:ilastik/ilastik into watershed_workflow
shaker6691 Mar 24, 2017
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Expand Up @@ -5,6 +5,7 @@ tests/*.h5
!tests/data/inputdata/smallVideoSimpleSegmentation.h5
!tests/data/inputdata/mitocheck_2d+t/mitocheck_small_2D+t.h5
!tests/data/inputdata/mitocheck_2d+t/mitocheck_small_2D+t_export.h5
session.vim

*.pyc
*.goutputstream
Expand Down
2 changes: 2 additions & 0 deletions docs/.gitignore
@@ -0,0 +1,2 @@
session.vim
_build
5 changes: 3 additions & 2 deletions docs/Makefile
Expand Up @@ -3,14 +3,15 @@

# You can set these variables from the command line.
SPHINXOPTS =
SPHINXBUILD = sphinx-build
SPHINXBUILD = sphinx-build2
PAPER =
BUILDDIR = _build

# Internal variables.
PAPEROPT_a4 = -D latex_paper_size=a4
PAPEROPT_letter = -D latex_paper_size=letter
ALLSPHINXOPTS = -d $(BUILDDIR)/doctrees $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) .
#ALLSPHINXOPTS = -d $(BUILDDIR)/doctrees $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) .
ALLSPHINXOPTS = -d $(BUILDDIR)/doctrees $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) . -D graphviz_dot=/user/bin/dot
# the i18n builder cannot share the environment and doctrees with the others
I18NSPHINXOPTS = $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) .

Expand Down
159 changes: 159 additions & 0 deletions docs/appletExample.rst
@@ -0,0 +1,159 @@
================================================================================
Building your own applet using the watershedSegmentation applet
================================================================================

This applet gets images for RawData, Boundaries and Seeds and
returns the calculated watershed segmentation and the used Labels.

More information on how you can use this applet can be found in
`Link <http://ilastik.org/documentation/>`_ under ILASTIK WORKFLOWS.


Basic File Structure
========================================

#. __init__.py

.. literalinclude:: ../ilastik/applets/watershedSegmentation/__init__.py
:linenos:
:language: python

#. opWatershedSegmentation.py

* This file includes the InputSlots and OutputSlots and how they are used internally.

* The main calculations can be found here as well.

* more Information, how you can implement or use operators can be looked up in the lazyflow
documentation under the point of 'operator overview' and 'advanced concepts'
which is worth reading for a better understanding

#. watershedSegmentationApplet.py

* Handles what happens when the applet is created.

* Mainly only the function broadcastingSlots should be changed, in particular only the return value.
Look at the function description for more information.

.. currentmodule:: ilastik.applets.watershedSegmentation.watershedSegmentationApplet
.. autoattribute:: WatershedSegmentationApplet.broadcastingSlots


#. watershedSegmentationSerializer.py

* Handles which OutputSlots shall be serialized. This means, that these slots have the same content
after project restart.

* For more information see the following documentation and the code and the comments in its __init__ function.

.. currentmodule:: ilastik.applets.watershedSegmentation.watershedSegmentationSerializer
.. autoclass:: WatershedSegmentationSerializer
:members: __init__


#. watersehdSegmentationGui.py

* handles the graphical user interface and the slots, that are

* handles the views of the layer

* this file is discussed in more detail in :ref:`the Gui <applet_gui>`.


#. addtional files:

Normally these files above are sufficient. Sometimes classes or cached versions of operators are
excluded into addtional files. This is only for a better overview and maintenance.


.. _applet_gui:

Basic Structure in watershedSegmentationGui
====================================================

.. currentmodule:: ilastik.applets.watershedSegmentation.watershedSegmentationGui

#. Inheritance

The Gui inherits from the WatershedLabelingGui which handles all about the labels.

Inheritance-tree:

LayerViewerGui->LabelingGui->WatershedLabelingGui

More information can be found in the :ref:`watershed labeling gui <applet_labeling_gui>` section.


The Gui uses mainly these functions:

#. setupLayers

.. automethod:: WatershedSegmentationGui.setupLayers
.. currentmodule:: ilastik.applets.layerViewer.layerViewerGui
.. automethod:: LayerViewerGui._initLayer
.. currentmodule:: ilastik.applets.watershedSegmentation.watershedSegmentationGui

#. __init__

Includes all the functionality that you can use with the side panel within your applet.
Some parts can be used of existing classes, some need to be done manually.

* The slots for the base class for the labels are initialized here.
Only needed for LabelingGui or WatershedLabelingGui.

Otherwise you have to supply your own userinterface and their functionality.


* Handling what happens when you push a button, click on a checkbox or any other action.



.. _applet_labeling_gui:

Basic Structure in watershedLabelingGui (gui base class)
==============================================================

The whole functionality of everything that depends on labeling
is handled within this class.

The labeling gui is an applet itself, so it has a serializer, an operator and so on.
But most of the things can be used from the superclass.

For other applets, another base class like LayerViewerGui can be sufficient, e.g. see the seeds applet.


WatershedLabelingGui inherits from LabelingGui. First of all it is sufficient to understand what happens in the LabelingGui.


LabelingGui
----------------------------------------------------


.. currentmodule:: ilastik.applets.labeling.labelingGui

#. In the beginning, there are lots of properties and setters.


#.
.. automethod:: LabelingGui.__init__
:noindex:
.. automethod:: LabelingGui._initLabelUic

#. The rest is more or less the structure and methods that make this class work well.
It is not essential for the main understanding of this class but for detailed information.



Changes in WatershedLabelingGui compared to the LabelingGui
--------------------------------------------------------------------

All changes in the WatershedLabelingGui compared to the LabelingGui:

.. currentmodule:: ilastik.applets.watershedLabeling.watershedLabelingGui
.. autoclass:: WatershedLabelingGui
:members: _defineModel, _changeInteractionMode, _onLabelSelected, _defineLabel, _beforeLabelRemoved, _onLabelRemoved, getNextLabelName, getNextLabelColor, getNextLabelNumber



To supply the WatershedLabelingGui with a LabelListModel that displays the value of the labels, a new class was necessary, the LabelListModelWithNumber.

5 changes: 3 additions & 2 deletions docs/applet_api.rst
Expand Up @@ -82,8 +82,9 @@ Applet Base Class

.. automethod:: __init__

.. autoclass:: ControlCommand
:members:
.. TODO this class isn't existing anymore
.. autoclass:: ControlCommand
:members:

.. autoclass:: ShellRequest
:members:
Expand Down
20 changes: 12 additions & 8 deletions docs/applet_library.rst
Expand Up @@ -110,9 +110,10 @@ Batch Output
:scale: 100 %
:alt: Batch Output Top-Level Operator

.. currentmodule:: ilastik.applets.batchIo.batchIoApplet
.. autoclass:: BatchIoApplet
:members:
.. TODO doesn't work in the original docu as well
.. currentmodule:: ilastik.applets.batchIo.batchIoApplet
.. autoclass:: BatchIoApplet
:members:


Workflow-specific Applets
Expand Down Expand Up @@ -174,9 +175,11 @@ with object features can be found in the $ILASTIK/examples directory.
To get your plugins discovered by ilastik, you have to add their path
to the .ilastikrc file in your home directory. The file should look
as follows:
[ilastik]

plugin_directories: /path/to/cool_features
.. code::

[ilastik]

plugin_directories: /path/to/cool_features

The cool_features directory in this case should contain the .py and the .yapsy-plugin files.

Expand All @@ -201,8 +204,9 @@ The cool_features directory in this case should contain the .py and the .yapsy-p
.. autoclass:: OpRegionFeatures
:members:

.. autoclass:: OpRegionFeatures3d
:members:
.. TODO this class isn't existing anymore
.. autoclass:: OpRegionFeatures3d
:members:

.. autoclass:: OpObjectCenterImage
:members:
Expand Down
33 changes: 27 additions & 6 deletions docs/conf.py
Expand Up @@ -11,12 +11,32 @@
# All configuration values have a default; values that are commented out
# serve to show the default.

# caution, don't remove this from here
# matplotlib needs to use the qt4 version, otherwise there are about 20 errors in the compiling
from PyQt4 import QtGui, QtCore
import matplotlib #new line
matplotlib.use("Qt4Agg") #new line

import sys, os

# If extensions (or modules to document with autodoc) are in another directory,
# add these directories to sys.path here. If the directory is relative to the
# documentation root, use os.path.abspath to make it absolute, like shown here.
sys.path.insert(0, os.path.abspath('..'))
sys.path.append(os.path.abspath('../../lazyflow'))
sys.path.append(os.path.abspath('../../volumina'))
#sys.path.append(os.path.abspath('../../lazyflow/lazyflow'))
#sys.path.append(os.path.abspath('../../lazyflow/lazyflow/utility'))
# necessary for the 'ImportError: No module named ilastik_feature_selection'
# adjust this to your own needs
sys.path.append('/home/andreas/miniconda2/envs/ilastik-devel/lib/python2.7/site-packages')


# necessary for ImportError: No module named qimage2ndarray
# adjust this to your own needs
sys.path.append('/home/andreas/qimage2ndarray/qimage2ndarray-master')

#print sys.path

# -- General configuration -----------------------------------------------------

Expand All @@ -25,7 +45,8 @@

# Add any Sphinx extension module names here, as strings. They can be extensions
# coming with Sphinx (named 'sphinx.ext.*') or your custom ones.
extensions = ['sphinx.ext.viewcode', 'sphinx.ext.autodoc']
#extensions = ['sphinx.ext.viewcode', 'sphinx.ext.autodoc']
extensions = ['sphinx.ext.viewcode', 'sphinx.ext.autodoc', 'sphinx.ext.graphviz']

autodoc_member_order = 'bysource'

Expand All @@ -43,7 +64,7 @@

# General information about the project.
project = u'ilastik'
copyright = u'2012, Christoph Straehle, Bernhard X. Kausler, Thorben Kröger, Ullrich Köthe , Fred A. Hamprecht, Anna Kreshuk, Luca Fiaschi, Stuart Berg'
copyright = u'2012-2017, Christoph Straehle, Bernhard X. Kausler, Thorben Kröger, Ullrich Köthe , Fred A. Hamprecht, Anna Kreshuk, Luca Fiaschi, Stuart Berg, Andreas Haller'

# The version info for the project you're documenting, acts as replacement for
# |version| and |release|, also used in various other places throughout the
Expand All @@ -52,7 +73,7 @@
# The short X.Y version.
version = '1.0'
# The full version, including alpha/beta/rc tags.
release = '1.0.0'
release = '1.0.1'

# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.
Expand Down Expand Up @@ -188,7 +209,7 @@
# (source start file, target name, title, author, documentclass [howto/manual]).
latex_documents = [
('index', 'ilastik.tex', u'ilastik Documentation',
u'Christoph Sommer \\and Christoph Straehle \\and Bernhard X. Kausler \\and Thorben Kröger \\and Ullrich Köthe \\and Fred A. Hamprecht \\and Anna Kreshuk \\and Luca Fiaschi \\and Stuart Berg',
u'Christoph Sommer \\and Christoph Straehle \\and Bernhard X. Kausler \\and Thorben Kröger \\and Ullrich Köthe \\and Fred A. Hamprecht \\and Anna Kreshuk \\and Luca Fiaschi \\and Stuart Berg \\and Andreas Haller',
'manual'),
]

Expand Down Expand Up @@ -219,7 +240,7 @@
# (source start file, name, description, authors, manual section).
man_pages = [
('index', 'ilastik', u'ilastik Documentation',
[u'Christoph Sommer, Christoph Straehle, Bernhard X. Kausler, Thorben Kröger, Ullrich Köthe , Fred A. Hamprecht, Anna Kreshuk, Luca Fiaschi, Stuart Berg'], 1)
[u'Christoph Sommer, Christoph Straehle, Bernhard X. Kausler, Thorben Kröger, Ullrich Köthe , Fred A. Hamprecht, Anna Kreshuk, Luca Fiaschi, Stuart Berg, Andreas Haller'], 1)
]

# If true, show URL addresses after external links.
Expand All @@ -233,7 +254,7 @@
# dir menu entry, description, category)
texinfo_documents = [
('index', 'ilastik', u'ilastik Documentation',
u'Christoph Sommer, Christoph Straehle, Bernhard X. Kausler, Thorben Kröger, Ullrich Köthe , Fred A. Hamprecht, Anna Kreshuk, Luca Fiaschi, Stuart Berg', 'ilastik', 'One line description of project.',
u'Christoph Sommer, Christoph Straehle, Bernhard X. Kausler, Thorben Kröger, Ullrich Köthe , Fred A. Hamprecht, Anna Kreshuk, Luca Fiaschi, Stuart Berg, Andreas Haller', 'ilastik', 'One line description of project.',
'Miscellaneous'),
]

Expand Down