-
Notifications
You must be signed in to change notification settings - Fork 3
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
Create plug-ins to convert well-known text to bitmasks and vice versa #14
Create plug-ins to convert well-known text to bitmasks and vice versa #14
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, @charismatic-claire, for the awesome contribution!
I left some comments, mostly clarifying licensing, and cosmetic changes (menu path, README, etc.).
If you're fine with it, I'll probably merge this within the next days.
| [`AnalyzeSkeleton_`](https://github.com/fiji/AnalyzeSkeleton/) | [`AnalyzeSkeleton_-3.4.2.jar`](http://maven.imagej.net/service/local/repositories/releases/content/sc/fiji/AnalyzeSkeleton_/3.4.2/AnalyzeSkeleton_-3.4.2.jar) | | ||
| [`Descriptor_based_registration`](https://github.com/fiji/Descriptor_based_registration) | [`Descriptor_based_registration-2.1.7.jar`](http://maven.imagej.net/service/local/repositories/releases/content/sc/fiji/Descriptor_based_registration/2.1.7/Descriptor_based_registration-2.1.7.jar) | | ||
| [`Fiji_Plugins`](https://github.com/fiji/Fiji_Plugins) | [`Fiji_Plugins-3.1.1.jar`](http://maven.imagej.net/service/local/repositories/releases/content/sc/fiji/Fiji_Plugins/3.1.1/Fiji_Plugins-3.1.1.jar) | | ||
| [`fmi-trackmate-addons`](https://github.com/fmi-faim/fmi-trackmate-addons) | [`fmi-trackmate-addons-0.1.2.jar`](http://maven.imagej.net/service/local/repositories/releases/content/ch/fmi/fmi-trackmate-addons/0.1.2/fmi-trackmate-addons-0.1.2.jar) | | ||
| [`guava`](https://github.com/google/guava) | [`guava-21.0.jar`](http://maven.imagej.net/service/local/repositories/central/content/com/google/guava/guava/21.0/guava-21.0.jar) | | ||
| `jdom2` | [`jdom2-2.0.6.jar`](http://maven.imagej.net/service/local/repositories/bedatadriven/content/org/jdom/jdom2/2.0.6/jdom2-2.0.6.jar) | | ||
| [`jgrapht-core`](https://github.com/jgrapht/jgrapht) | [`jgrapht-core-1.3.0.jar`](http://maven.imagej.net/service/local/repositories/central/content/org/jgrapht/jgrapht-core/1.3.0/jgrapht-core-1.3.0.jar) | | ||
| [`jgrapht-core`](https://github.com/jgrapht/jgrapht) | [`jgrapht-core-1.4.0.jar`](http://maven.imagej.net/service/local/repositories/central/content/org/jgrapht/jgrapht-core/1.4.0/jgrapht-core-1.4.0.jar) | | ||
| [`jts-core`](https://github.com/locationtech/jts) | [`jts-core-1.18.1.jar`](https://repo.maven.apache.org/maven2/org/locationtech/jts/jts-core/1.18.1/jts-core-1.18.1.jar) | | ||
| [`legacy-imglib1`](https://github.com/fiji/legacy-imglib1) | [`legacy-imglib1-1.1.9.jar`](http://maven.imagej.net/service/local/repositories/releases/content/sc/fiji/legacy-imglib1/1.1.9/legacy-imglib1-1.1.9.jar) | | ||
| [`mpicbg`](https://github.com/axtimwalde/mpicbg/tree/master/mpicbg) | [`mpicbg-1.3.0.jar`](http://maven.imagej.net/service/local/repositories/releases/content/mpicbg/mpicbg/1.3.0/mpicbg-1.3.0.jar) | | ||
| [`SPIM_Registration`](https://github.com/fiji/SPIM_Registration) | [`SPIM_Registration-5.0.19.jar`](http://maven.imagej.net/service/local/repositories/releases/content/sc/fiji/SPIM_Registration/5.0.19/SPIM_Registration-5.0.19.jar) | | ||
| [`TrackMate_`](https://github.com/fiji/TrackMate) | [`TrackMate_-4.0.0.jar`](http://maven.imagej.net/service/local/repositories/releases/content/sc/fiji/TrackMate_/4.0.0/TrackMate_-4.0.0.jar) | | ||
| [`mpicbg`](https://github.com/axtimwalde/mpicbg/tree/master/mpicbg) | [`mpicbg-1.4.1.jar`](http://maven.imagej.net/service/local/repositories/releases/content/mpicbg/mpicbg/1.4.1/mpicbg-1.4.1.jar) | | ||
| [`SPIM_Registration`](https://github.com/fiji/SPIM_Registration) | [`SPIM_Registration-5.0.21.jar`](http://maven.imagej.net/service/local/repositories/releases/content/sc/fiji/SPIM_Registration/5.0.21/SPIM_Registration-5.0.21.jar) | | ||
| [`TrackMate_`](https://github.com/fiji/TrackMate) | [`TrackMate_-6.0.1.jar`](http://maven.imagej.net/service/local/repositories/releases/content/sc/fiji/TrackMate_/6.0.1/TrackMate_-6.0.1.jar) | |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for updating these. I think I should remove this listing entirely from the README, since it gets out of sync too easily. The versions shipped via the FMI KNIME update site are defined in this other repository here:
So this README is only in case you manually install the jar file into the ImageJ integration. Leaving away the versions is probably fine.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah sure, I'm fine with that. So I'll just leave it as is and it can be updated with the next release on master
, right?
* #%L | ||
* Plug-in to convert a 2D binary to a polygon geometry serialized to | ||
* well-known text (wkt). | ||
* %% | ||
* @author Charismatic Claire | ||
* %% |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We usually generate the license headers by running mvn license:update-file-header
before each release, which will replace the copyright statement by the content from the pom.xml
. I hope you're ok if this information gets replaced? The Friedrich Miescher Institute (FMI) legally is the copyright owner of this software, as it is being developed as part of my work at FMI.
Your authorship is of course unaffected, and will be visible from the git history. We can also add a class javadoc containing an @author
tag. Would you be ok adding your real name in such a tag?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, I changed that accordingly. I haven't decided about my real name being put somewhere in the code. So I think I just skip that part for now.
else throw new Exception( | ||
String.format("Your envelop <%s> stems from another world!", envelope.toText())); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🙂 maybe throw a more specific RuntimeException
(or IllegalArgumentException
) here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah sure, I added an IllegalArgumentException
.
output = image; | ||
} catch (ParseException e) { | ||
logService.warn(String.format("Could not create a polygon from input <{}>", text)); | ||
} catch(Exception e) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we catch a more specific Exception
here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah sure, I added an IllegalArgumentException
.
import org.scijava.plugin.Parameter; | ||
import org.scijava.plugin.Plugin; | ||
|
||
@Plugin(type = Command.class, headless = true, menuPath = "FMI>2D Binary Mask To Text") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I might take the opportunity and refine the menu structure a bit. Currently, all plugins from this repository are listed under a single FMI menu. It would make sense to create sub-menus for working with shapes, tracks, segmentations etc.
I will probably work on this before the next release, but if you have ideas or comments, I'm open for suggestions 😉
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think I'll leave that to you since I only know what 3 plug-ins are doing :-)
Any news on when the new version of the KNIME plug-in will be released? We are already using my new plug-in but it would be much easier to deploy if we had it upstream, of course ^^ |
Sorry for the delay, @charismatic-claire, I'll try to cut a new release within the next couple of days! |
* also add regression test for WKT > bitmask > WKT
66e1a29
to
b06e5e6
Compare
@charismatic-claire when trying to add a regression test doing the round-trip See also the discussion in imagej/imagej-ops#439 and on this forum topic. Changing the Note that I also changed the package of your two new plugins, and renamed the classes, so the KNIME nodes from this repository will differ from what you might have used locally already. This will require some changes to existing KNIME workflows relying on your local version. (I'll take care that future refactoring of this component won't affect the use of these nodes in KNIME, once it got released.) After cutting a new release version, I'll update the |
This pull request has been mentioned on Image.sc Forum. There might be relevant details there: |
@imagejan I'm glad to hear that. Great! What you mentioned about the use of the Renaming packages and classes and what not is fine too. I'll change my workflows, no problem. So thrilled that this will soon be available via KNIME update. |
This pull request has been mentioned on Image.sc Forum. There might be relevant details there: |
I think there is a little issue related to this merge and the recently published new version of this plug-in, especially when it comes to running it within KNIME. See here: FMI KNIME Plugins version 0.19.0.202104201635 introduces imglib2 dependency issue #13 |
Suppose you created a segmentation using the Image Processing environment in KNIME. You can extract all the segments from your segmentation and get a list of bitmasks. Wouldn't it be great to convert this bitmask representation of the segments to a well-known text (*.wkt) representation. Why? Because it,s more universal.
And why not go the other way round too? Suppose you have an image and a list of segments in well-known text (*.wkt) format. It should be possible to convert those to bitmasks that can be used to assemble an image segmentation using KNIME's GroupBy node.
Here is the corresponding thread in the KNIME forum: Convert Well-Known Text (WKT) To Labeling