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

Migrate tables from imagej-common #2

merged 42 commits into from Aug 11, 2018


None yet
3 participants
Copy link

imagejan commented Jul 17, 2018

This PR migrates the classes in the net.imagej.table package from imagej-common into the org.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 by DoubleTable in another commit, and an ImageJ-specific implementation of ResultsTable can remain in imagej-common.

This PR supersedes #1 that didn't contain the git history of the affected files.

imagejan and others added some commits Jul 17, 2018

DefaultTableDisplay: handle double array as table
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.
POM: update to the ImgLib2 2.0.1 release
This makes the necessary code changes to account for backwards

It also updates several dependencies to their latest versions,
and removes the obsolete imglib2-ops dependency.
Eliminate deprecated net.imglib2.meta usages
There is still much work to be done cleaning up the ImgPlus class and
related interfaces. However, this is an important first step.
Use the diamond syntax
Thanks, Java 7!
Initialize appended/inserted Column backing arrays
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
Fix insert rows/columns operations
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.
Fix removeRows to start at specified row
Prior to this change the removal would end at the specified row, instead
of starting from it.

awalter17 and others added some commits Jun 27, 2016

Aggregate display of simple outputs into a table
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.
ResultsPostprocessor: handle Object outputs better
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.
ResultsPostprocessor: do not require UIService
If there isn't one, we simply do nothing.

This avoids "Required service is missing" injection
errors when instantiating this postprocessor.
Update to imglib2 5.0.0
This updates the code to use the revised ImgFactory API.
Remove ImageJ-specific table classes
Also remove temporary imagej-common dependency

This comment has been minimized.

Copy link
Member Author

imagejan commented Jul 17, 2018

@ctrueden please let me know if you're fine with this.

My next steps would be:

@imagejan imagejan force-pushed the migrate-tables-with-history branch from da7499a to 0f80ce4 Jul 17, 2018

@imagejan imagejan merged commit 7848f15 into master Aug 11, 2018

1 check passed

continuous-integration/travis-ci/pr The Travis CI build passed

@imagejan imagejan deleted the migrate-tables-with-history branch Aug 11, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment