-
Notifications
You must be signed in to change notification settings - Fork 1
Migrate tables from imagej-common #2
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
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
In this specific case (double[] and double[][]), it is easy to wrap the data in DoubleColumn objects. Ideally, we want to support all types of primitive 1D and 2D arrays, or even all Collection<N extends Number>, but that will require a little more infrastructural work to accomplish. This approach is good enough for now, for MATLAB matrix support, which always uses doubles.
This makes the necessary code changes to account for backwards incompatibilities. It also updates several dependencies to their latest versions, and removes the obsolete imglib2-ops dependency.
There is still much work to be done cleaning up the ImgPlus class and related interfaces. However, this is an important first step.
Thanks, Java 7!
When appending or inserting a new column into a table, the backing arrays for those columns will now be initialized. This prevents null pointer exceptions when attempting to modify appended or inserted columns.
The loops for shifting the rows/columns now loop backwards. This was done because if the loops go forwards it doesn't shift the rows/columns, it instead repeats the column/row following the insert.
Prior to this change the removal would end at the specified row, instead of starting from it.
This change is an attempt to address two related problems: 1. There are no Display plugins (and hence no DisplayViewers) for numbers or booleans. 2. The DisplayPostprocessor tries to handle each output using its own Display, which is pretty clunky when there are several simple (text/number/boolean) outputs and several windows pop up. This postprocessor acts just before the display postprocessor, aggregating all simple outputs into a single GenericTable, which is then shown to the user via the UIService. The heuristic on whether and how to use a table is as follows: - Only simple outputs are included: text, numbers and booleans. - If there is only a single simple output, and it is text, no table is created. This minimizes negative impact on certain existing plugins which produce a large amount of text output and expect it to be displayed in a TextDisplay.
If the output type is Object, let's look at the actual object value when deciding whether to lump it into the table. We use this heuristic here because an Object output is very often the default "result" output, and we want that value to show in the table if its type is compatible.
If there isn't one, we simply do nothing. This avoids "Required service is missing" injection errors when instantiating this postprocessor.
This updates the code to use the revised ImgFactory API.
Also remove temporary imagej-common dependency
@ctrueden please let me know if you're fine with this. My next steps would be:
|
da7499a
to
0f80ce4
Compare
This was referenced Aug 12, 2018
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR migrates the classes in the
net.imagej.table
package fromimagej-common
into theorg.scijava.table
package of this repository, keeping their git commit history.The ImageJ-specific classes (that had references to
Img
) were removed.ResultsTable
will be replaced byDoubleTable
in another commit, and an ImageJ-specific implementation ofResultsTable
can remain inimagej-common
.This PR supersedes #1 that didn't contain the git history of the affected files.