Git Product home page Git Product logo

imagej-common's Introduction

This is the ImageJ common library, containing ImageJ2's core image data model, based on ImgLib2. This is the primary mechanism by which image data is managed internally by ImageJ2. This component also provides the corresponding core image display logic for user interfaces.

For further details, see:

imagej-common's People

Contributors

awalter17 avatar axtimwalde avatar bdezonia avatar ctrueden avatar dietzc avatar dscho avatar frauzufall avatar gselzer avatar hinerm avatar imagejan avatar kephale avatar maarzt avatar mpinkert avatar skalarproduktraum avatar squareys avatar stelfrich avatar tinevez avatar tpietzsch avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

imagej-common's Issues

About ImageJ text can render incorrectly

Originally ImageJ About images were specified to be RGB images. Recently this specification was relaxed. There are text files associated with about images that specify how to render the attribution text. One field is the rendering color. For backdrop images that are not RGB this color is no longer respected. We need to determine whether to ditch the color text support or not and update IJ2 as needed. Alternatively we could create the attribution as a color text overlay instead of stamping it into the Dataset. However text overlay code is not really in place yet.

Migrated-From: http://trac.imagej.net/ticket/1954

Table API change: require unique column headers

In IJ1 the ResultsTable API deprecates accessing arbitrary cell values by (col,row). All data access is meant to work by (columnName,row).

Currently IJ2 allows unnamed columns (or even two columns with the same name). We should change the table API to allow them to index via column name rather than column number. And we should put in checks so that setting column headers only allows unique column names (they could default to "1", "2", "3", etc.).

These changes would allow us to simplify the code in ResultsTableHarmonizer and also make it more correct.

Migrated-From: http://trac.imagej.net/ticket/1601

Migrate some non-central classes out of core net.imagej package

From issue #44, @dietzc writes:

Besides FloodFiller it would also think about moving/replacing Extents, Position, maybe PositionByAxis, ImageGrabber and DrawingTool. ChannelCollection.

Especially Extents and Position are probably unnecessary duplication of constructs already in ImgLib2 core. The others should be moved to subpackages.

Saving an image should preserve more metadata

When saving an image, there is some view-related metadata that is currently not being recorded. Specifically, knowing the composite mode of an image would be useful, as well as other display properties, such as the current index for each axis.

One way to handle it would be for DatasetService#save to add (key, value) pairs to the ImgPlus's properties, which SCIFIO then preserves. This would work around the fact that SCIFIO knows nothing about ImageJ DatasetViews.

Migrated-From: http://trac.imagej.net/ticket/1081

Improve undo/redo functionality

A difficult problem common to many applications is that of the undo history. Ideally, we would like ImageJ to support multiple undo and redo as efficiently as possible. There are two major kinds of undoable operations:

  1. Some operations such as adding a ROI are simple to invert efficiently (just delete it). We can use a command recorder system to keep track of such workflows both backwards and forwards to allow undo and redo.
  2. Other operations such as dithering are more destructive, and ImageJ must somehow cache the prior state of the image in order to successfully undo the change.
    As such, support for a hybrid undo history supporting both types of operations may be the way to go.

Migrated-From: http://trac.imagej.net/ticket/13

Add BigInteger and BigDecimal numerical types

The ImgLib2 library has type-agnostic support for numerical data processing. As such, it would be great to have numerical types based on Java's BigInteger and BigDecimal, for arbitrary-precision integer- and real-valued numbers, respectively.

Implementing this feature will first require the types to exist within ImgLib2. Then we will need to write additional converter plugins (for the Image > Type menu) as well as ensure that ImageJ2's core numerical commands are well-tested with the new types. Right now, many plugins "cheat" by operating on doubles, which would defeat the purpose of the new types.

Migrated-From: http://trac.imagej.net/ticket/1653

Support rotation of overlays

JHotDraw7 has built-in support for rotation of selections. Press space bar to change the mode and the blue grippers become purple, with an extra little circle on top, for rotation.

We should support this too. This will prevent the need for separate tools for things like oval and ellipse.

Migrated-From: http://trac.imagej.net/ticket/1048

Be able to pull data out of a Dataset without precision loss

In the long run it would be nice to pull numbers out of a Dataset at a given location. At the time this ticket was written there is a method in Dataset called getDoubleValue() that can do this. And it may have made its way into the ProbeTool. However using this method would result in some precision loss if the backing image is of type long. Come up with a way to pull numbers out of Imglib images and/or Datasets that can keep from losing precision.

Migrated-From: http://trac.imagej.net/ticket/389

ImgPlus should wrap any RandomAccessibleInterval

Currently, ImgPlus wraps an Img, but the same metadata it attaches would be useful to associate with any RandomAccessibleInterval, even if it is not also an IterableInterval. However, exactly how to proceed with this change requires some thought.

This change would enable the ImgSaver to work with non-Img objects such as those produced by Views, which would be very powerful.

Migrated-From: http://trac.imagej.net/ticket/1063

Problem in OSGi with net.imglib2 package

In plain OSGi, bundles define their dependencies as so called imports. A bundle states that it requires another by package name (e.g. import net.imglib2). However, this implies that the package names have to be unique, i.e. a package is not split across several bundles. At the moment the package net.imglib2 is split into imglib2-core and imagej-commons. In our OSGi world this doesn't work. So what are the plans to refactor the packages in imagej-commons?

Thanks!!

Christian

Utilize unit conversions in imglib2-meta

Now that there is a unit conversion facility in imglib2-meta we should utilize it as possible. For instance we need to finish writing CombinedCalibratedRealInterval such that you can define axes and modify underlying axes by scaling utilizing unit conversion code. And also unit code can be used for pulling data out of interval.

Migrated-From: http://trac.imagej.net/ticket/2004

Support slice labels

In IJ1 an ImageStack can get tagged with slice labels (programmatically by plugins or importers). These labels are displayed in the image window label and Image > Stacks > Tools > Remove Slice Labels clears them out.

IJ2 does not handle slice labels at all. Nothing is displayed in the image window label and remove slice labels is unnecessary.

We need to tag each plane with metadata on the IJ2 side and harmonize that info across the legacy layer. Note that restructuring plugins (add/del axis, add/del data, reorder data, etc.) need to maintain this metadata.

Migrated-From: http://trac.imagej.net/ticket/1301

Support in ImgLib2 for per-plane metadata

The restructure plugins maintain existing color tables, but the code needs to make some assumptions, because Dataset currently keeps its per-plane color tables in a separate data structure from the ImgPlus itself.

More generally, things like Views cannot properly preserve per-plane metadata since there is no such thing at the moment. (We have per-axis metadata, but not per-plane.)

Ultimately, we probably need something like AnnotatedSpace but for intervals, so that each position of the interval can have some Metadata... although that would be per-pixel metadata if implemented naively. To handle it per-plane in a general way will require further consideration...

Migrated-From: http://trac.imagej.net/ticket/917

Support tabular data in drag and drop

If you drag a set of table cell data from a LibreOffice spreadsheet onto the app frame, the data is pasted into a text pane. One of the flavors supported by LibreOffice is text/html and the data is an HTML table. It would be nice if we could see it's a table of values and make a results table window rather than a text window.

Migrated-From: http://trac.imagej.net/ticket/1673

Add infrastructure for typed dataset plugins

It would be nice if we provided a template class for designing plugins that only work with certain types of Datasets. For instance the user might make a plugin that only works with unsigned byte type data. (This is similar to IJ1's DOES_RGB, DOES_ALL, etc.) We need to provide ways to get the type of a Dataset for checking. If we could make the template class check parameters at init time (and not when run() is called) that would be great. This would simplify plugin developers lives.

However a template class approach may be too limiting in that we really need multiple inheritance to cover the flexibility of our other plugin base class implementations. So maybe instead we provide interfaces and helper methods.

Another possibility is to have all plugins have a precheck() method with current abstract base classes providing empty ones. And plugin developers could provide their own implementation. The precheck would happen after @parameters assignment and maybe after initializers were run but before run() is ever called.

(See also ImgPlusService.)

Migrated-From: http://trac.imagej.net/ticket/1945

Opening image using DefaultDatasetService causes ReflectException

When attempting to open an image using the DefaultDatasetService, the following exception is thrown:

java.io.IOException: org.scijava.util.ReflectException: No such class: io.scif.config.SCIFIOConfig;
at net.imagej.DefaultDatasetService.open(DefaultDatasetService.java:256)
at ImageScanner.main(ImageScanner.java:11)

Sample code:

DefaultDatasetService dss = new DefaultDatasetService();
try {
dss.open(filename);
}catch ...

Improve Table API

I believed the Table API (e.g., for Results tables) was pretty thorough, but when trying to use it to implement a new IJ2 List Shortcuts command, I discovered that there are no appendRow methods. These would be a nice convenience, rather than having to explicitly call set(String colHeader, int row, Object value) for each cell of the row.

Actually, there are appendRow methods, but none that take the actual row data. So the current ListShortcuts implementation does:

shortcuts.appendRow();
shortcuts.set(hotKeyHeader, row, shortcut.toString());
shortcuts.set(commandHeader, row, info.getTitle());

When what would be nicer would be:

shortcuts.appendRow(shortcut.toString(), info.getTitle());

Of course, while this is more succinct, it also loses the column-safety, assuming columns are in a particular order.

Migrated-From: http://trac.imagej.net/ticket/1646

Improve how the Display framework handles large images

Currently AWTDisplayController is responsible for creating BufferedImages that are displayed in an ImageCanvas. The call to AWTDisplayController::update() creates a BufferedImage from the Dataset that is 1:1 scale in X & Y. For large Datasets this will be a problem.

Barry and Aivar discussed this some and noted some possible design changes.

We'd like to support the ability of the ImageCanvas to just display a BufferedImage that is made by AWTDisplayController. The ImageCanvas would pan and zoom on the given BufferedImage. The AWTDisplayController could make a BufferedImage from a number of tiles (allowing much less memory use).

After a certain zoom level is reached (1:1) then any zoom within ImageCanvas would just scale and pan on the last BufferedImage it was given. If panning or zooming out would cause a boundary of the current BufferedImage to become visible the ImageCanvas could say "hey, display controller, now I need to see region (x1,y1,x2,y2) of the image". The AWTDisplayController could then recalculate a new BufferedImage that represents that region of the Dataset building from some tiles as needed. ImageCanvas would display the new BufferedImage.

Migrated-From: http://trac.imagej.net/ticket/444

Consider which objects to register with the ObjectService

Right now, any Data objects get stored in the ObjectService as long as their reference count (number of things displaying them, essentially) is > 0. And when the ref count hits zero, they are removed from the ObjectService. This is because the ObjectService keeps hard references.

We could:

  • Add a feature to the ObjectService to support weak or phantom references. This can eat memory though and delay garbage collection of otherwise-obsolete data.
  • Consider making more things extend Data, particularly Table implementations, which would be nice to have a multiple-choice selection for when they are used as inputs.
  • Generalize the reference counting thing beyond Data if needed.
  • Forget all this reference counting stuff, and enhance the ObjectWidget to look for Display objects in the ObjectService that are currently displaying the needed type—and populate the multiple choices with those objects.

That last option is how I'm currently leaning, without having thought or investigated thoroughly enough to be sure I'm remembering how everything works 100% correctly. Would need to be sure things still work headless, though, if nothing is being displayed.

More Converter null fun

java.lang.NullPointerException
    at net.imagej.convert.ConvertIntArrayToFinalInterval.convert(ConvertIntArrayToFinalInterval.java:53)
    at org.scijava.convert.AbstractConvertService.convert(AbstractConvertService.java:62)
    at org.scijava.script.ScriptModule.run(ScriptModule.java:196)
    at org.scijava.module.ModuleRunner.run(ModuleRunner.java:167)
    at org.scijava.module.ModuleRunner.call(ModuleRunner.java:126)
    at org.scijava.module.ModuleRunner.call(ModuleRunner.java:65)
    at org.scijava.thread.DefaultThreadService$2.call(DefaultThreadService.java:181)
    at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
    at java.util.concurrent.FutureTask.run(FutureTask.java:138)
    at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:895)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:918)
    at java.lang.Thread.run(Thread.java:695)
java.util.concurrent.ExecutionException: java.lang.NullPointerException
    at java.util.concurrent.FutureTask$Sync.innerGet(FutureTask.java:222)
    at java.util.concurrent.FutureTask.get(FutureTask.java:83)
    at net.imagej.ui.swing.script.TextEditor.evalScript(TextEditor.java:2476)
    at net.imagej.ui.swing.script.TextEditor.access$400(TextEditor.java:158)
    at net.imagej.ui.swing.script.TextEditor$Tab$6.execute(TextEditor.java:1488)
    at net.imagej.ui.swing.script.TextEditor$Executer$1.run(TextEditor.java:1977)
Caused by: java.lang.NullPointerException
    at net.imagej.convert.ConvertIntArrayToFinalInterval.convert(ConvertIntArrayToFinalInterval.java:53)
    at org.scijava.convert.AbstractConvertService.convert(AbstractConvertService.java:62)
    at org.scijava.script.ScriptModule.run(ScriptModule.java:196)
    at org.scijava.module.ModuleRunner.run(ModuleRunner.java:167)
    at org.scijava.module.ModuleRunner.call(ModuleRunner.java:126)
    at org.scijava.module.ModuleRunner.call(ModuleRunner.java:65)
    at org.scijava.thread.DefaultThreadService$2.call(DefaultThreadService.java:181)
    at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
    at java.util.concurrent.FutureTask.run(FutureTask.java:138)
    at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:895)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:918)
    at java.lang.Thread.run(Thread.java:695)

And here's the script that caused it:

# @DatasetService data
# @DisplayService display
# @OpService ops
# @net.imagej.Dataset inputData

from net.imglib2.meta import ImgPlus
from net.imglib2.img.display.imagej import ImageJFunctions

from jarray import array
from ij import IJ

# create a log kernel
logKernel=ops.logKernel(2, 1.0)

# convolve with log kernel
logFiltered=ops.convolve(inputData, logKernel)

# display log filter result
display.createDisplay("log", ImgPlus(logFiltered))

# otsu threshold and display
thresholded = ops.run("otsu", logFiltered)
display.createDisplay("thresholded", ImgPlus(thresholded))

# convert to imagej1 imageplus so we can run analyze particles
impThresholded=ImageJFunctions.wrap(thresholded, "wrapped")

# convert to mask and analyze particles
IJ.run(impThresholded, "Convert to Mask", "")
IJ.run(impThresholded, "Analyze Particles...", "display add")
IJ.run("Close")

@hinerm Can you take a look? On cursory inspection it seems that AbstractConverter accepts null sources in canConvert now (maybe due to my recent changes to ConversionUtils?), but downstream converters are not expecting this and their convert method blows up in that scenario. We'll need to be more consistent about this...

Fix calibration metadata to use imglib2-realtransform

The imglib2-realtransform package is a robust transform-based way of supporting coordinate system transformations, including per-axis transformations but also much more.

We should retire the calibrated portions of the net.imagej.axis package, in favor of using imglib2-realtransform. There is probably code of value in net.imagej.axis that can be retooled in some way, but what we want to avoid is limiting ourselves to only per-axis calibration support, since it is not powerful enough for many use cases.

Support for multiple datasets in the same display

In theory, the ImageJ2 display model supports multiple datasets in the same display. However, support for it is not exposed in the GUI, and there are surely some architectural problems with the current design. These problems must be resolved, so that we can start using ImageJ2 displays as flexibly as intended.

Blocked-By: #12
See-Also: #23
Migrated-From: http://trac.imagej.net/ticket/579

Support general text specified axis class

There are good reasons to support one kind of axis that has its equation defined by a string. I have mocked up a class below. This is not a simple endeavor but would eliminate a lot of (sometimes redundant) concrete CalibratedAxis implementations. See notes in code below for pointers.

package net.imglib2.meta.axis;

import net.imglib2.meta.AxisType;

/**
 * A very general text driven axis class.
 * 
 * @author Barry DeZonia
 */
public class UberAsciiAxis extends VariableAxis {

    // I might be getting carried away but think it would be nice to define axes
    // by equation alone. IJ1 has lots of one off definitions in CurveFitter that
    // have offsets or not or powers or not. I've generalized some of this by
    // always having an offset that can be 0. But really we'd like the flexibility
    // of not needing a new concrete axis class every time someone comes up with a
    // new formula. This class would parse the equation and build an appropriate
    // function that can scale coords as needed. The nice thing here is that the
    // parsed axis can be queried for variables and then a curve fitting algo can
    // determine appropriate variable values. Curtis' idea of the EditAxes plugin
    // directly tweaking the variables of a displayed equation is correct. There
    // remains the trick of determining when an axis is linear. This can be done
    // by testing that an axis.equals(some general linear axis string) as noted
    // below.

    // TODO - bad name: Equation is more general than our 1d case

    private interface Equation {

        // This might be involved to determine but it would be fun to write!
        Equation inverse(); // if doesn't exist we will return a NullEquation

        double eval(double input);

        // TODO - maybe one String method rather than two.

        String generalEquation();

        String particularEquation(); // likely in an abstract class
    }

    // equation string can be things like:
    // y = m*x + b
    // y = 74*x + b
    // y = q*sin(slope*x+19.4)^(33*power)+fred (here only x & y are predefined)
    // constants and vars automatically detected

    private final String equationString;
    private final Equation eqn;
    private final Equation eqnInverse;

    public UberAsciiAxis(AxisType type, String unit, String equationString) {
        super(type, unit);
        this.eqn = parse(equationString);
        this.eqnInverse = eqn.inverse();
        this.equationString = equationString;
    }

    public UberAsciiAxis(AxisType type, String unit, Equation equation) {
        super(type, unit);
        this.eqn = equation;
        this.eqnInverse = eqn.inverse();
        this.equationString = equation.generalEquation(); // or particular?
    }

    @Override
    public double calibratedValue(double rawValue) {
        return eqn.eval(rawValue);
    }

    @Override
    public double rawValue(double calibratedValue) {
        return eqnInverse.eval(calibratedValue);
    }

    @Override
    public String generalEquation() {
        return equationString;
    }

    @Override
    public UberAsciiAxis copy() {
        return new UberAsciiAxis(type(), unit(), equationString);
    }

    @Override
    public boolean equals(Object o) {
        if (!(o instanceof UberAsciiAxis)) return false;
        UberAsciiAxis other = (UberAsciiAxis) o;

        // TODO: do something really cool. compare syntax trees and variables of the
        // two UberAxes. Even trickier: detect when vars of two eqns are the same
        // due to coeffs being 1 or 0. For example y = 1*x + 0 is same as y = x
        // though they would have different syntax trees.

        // TEMP: only equal to self
        return other == this;
    }

    // For generality and reuse elsewhere maybe make parser return multidim
    // equation. We'd need to test that it has a single dim of input to qualify as
    // a valid axis equation

    private Equation parse(String equationString) {
        // TODO
        return new NullEquation();
    }

    // return one of these as an Equation::inverse() when it is not invertible

    private class NullEquation implements Equation {

        @Override
        public double eval(double input) {
            return Double.NaN;
        }

        @Override
        public Equation inverse() {
            return this;
        }

        @Override
        public String generalEquation() {
            return "y = NaN";
        }

        @Override
        public String particularEquation() {
            return "y = NaN";
        }

    }
}

Migrated-From: http://trac.imagej.net/ticket/2012

Overlay serialization is broken

Overlays currently can be serialized and restored via a writeExternal() and readExternal() approach. However this approach requires that the serialized object has a no arg constructor. Currently the Data constructors all require at least 1 argument to the constructor. Until recently we were passing null as an argument safely. But with recent changes to the data type hierarchy this fake no arg approach fails and the test code in TestBinaryMaskOverlay began failing. I have commented out this test for now as we are not sure how we want to handle serialization going forward. We should figure out how we will support serialization of overlays and restore the commented out test,

Migrated-From: http://trac.imagej.net/ticket/1991

AIOOB when displaying a dataset with one dimension

Illustrated in this sample python script:

# @OpService ops
# @DisplayService display

blank = ops.createimg(100)

display.createDisplay(blank)

Which causes the following exception:

Caused by: java.lang.ArrayIndexOutOfBoundsException: 1
    at net.imagej.display.DefaultDatasetView.xyPlane(DefaultDatasetView.java:340)
    at net.imagej.display.DefaultDatasetView.autoscale(DefaultDatasetView.java:169)
    at net.imagej.display.DefaultDatasetView.initializeView(DefaultDatasetView.java:515)
    at net.imagej.display.DefaultDatasetView.rebuild(DefaultDatasetView.java:399)
    at net.imagej.display.DefaultImageDisplay.rebuild(DefaultImageDisplay.java:136)
    at net.imagej.display.DefaultImageDisplay.display(DefaultImageDisplay.java:274)
    at org.scijava.display.DefaultDisplayService.createDisplay(DefaultDisplayService.java:221)
    at org.scijava.display.DefaultDisplayService.createDisplay(DefaultDisplayService.java:207)

Which makes sense, since there is no "Y" for a y plane.

Fix Dataset image typing

Dataset has a ImgPlus<? extends RealType<?>>. This is wrong for multiple reasons:

  1. RealType is not general enough. We need to support at least ComplexType as well, if not all Types. See ImageJ Trac ticket #845 for related discussion.
  2. ? extends RealType<?> causes many issues with the compiler. We might need to bite the bullet and have Dataset be generically typed. See also #12.

Questions concerning Converters

Hi @hinerm @ctrueden,

I started working on some simple Converters from ImgLib2 NumericTypes to native Java types, RandomAccessibleInterval to IterableInterval or RandomAccessibleInterval to ImgView. I ran into some problems/questions:

  • Creating converters for ImgLib2 types is something we can solve with code-generation and therefore I suggest to do it in ops.
  • I don't actually understand the Converter interface and the AbstractConverter from SciJava:
  • Converting RandomAccessibleInterval to ImgView requires that we have an heuristic which ImgFactoryor to be more general which RandomAccessibleIntervalFactory (we don't have this concept, yet) is chosen and returned by the ImgView. We started implementing these heuristics in https://github.com/imagej/imagej-ops/tree/img-creators), but of course I can't use them here as imagej-common has no dependency on ops. So should I implement this single Converter in ops then?

Thanks for your help!

Christian

Decouple data events from display classes

Some of the display classes (AbstractImageDisplay, SwingImageDisplay) listen to data events and update their views. This is sort of backwards and poorly coupled.

Make views listen for data events and change their state appropriately. They should generate view events. Displays should listen for view events and update their state accordingly.

Migrated-From: http://trac.imagej.net/ticket/884

Add ability to label individual positions along an axis

It would be nice if rather than only an index, each position along each dimensional axis could be labeled with a string as well. A very common use case is to have multiple wavelengths labeled with the stain used; e.g., labeling a GFP fluorescence channel as "GFP" or "509nm".

In ImageJ 1.x these are called "slice labels" and you can have one per image plane.

Right now, SCIFIO has some hacks to read and propagate them. But ImgPlus et. al needs to properly support it.

Migrated-From: http://trac.imagej.net/ticket/1567

AxisType: add flag for continuous vs. discrete

For some axis types, it makes sense to interpolate between values, since they are intended to represent continuous axes. For others, they may be discrete—e.g., if each sample along that axis is a different computed feature. It would be nice if the AxisType interface had isDiscrete and/or isContinuous methods reporting that.

Table row sizing bug

There is a bug in the Table implementation, as illustrated by the following code:

import imagej.data.table.DefaultGenericTable;
import imagej.data.table.GenericTable;

public class TableBug {

    public static void main(final String[] args) throws Exception {
        final String first = "First";
        final String second = "Second";
        final int rowCount = 10;

        final GenericTable table = new DefaultGenericTable();
        table.setRowCount(rowCount);
        table.appendColumn(first);
        table.appendColumn(second);

        for (int row = 0; row < rowCount; row++) {
            table.set(first, row, "1st:" + row);
            table.set(second, row, "2nd:" + row);
        }

        System.out.println(table);
    }

}

It throws the following exception:

Exception in thread "main" java.lang.IndexOutOfBoundsException: Index: 0, Size: 0
    at java.util.ArrayList.RangeCheck(ArrayList.java:547)
    at java.util.ArrayList.set(ArrayList.java:337)
    at imagej.data.table.AbstractTable.set(AbstractTable.java:408)
    at TableBug.main(TableBug.java:18)

But if you move the setRowCount call after the two appendColumn calls, the code works.

Migrated-From: http://trac.imagej.net/ticket/1647

Options - Memory & Threads inaccurate

When you launch IJ2 when no ImageJ.cfg file exists (or no memory constraint exists within it) the dialog shows 256 mb. But the actual ram allocated might differ substantially depending upon how IJ2 was launched. Have the dialog default to the currently allocated number of megabytes. Also warn user that memory setting won't apply if they launched IJ2 by some method other than the launcher. We can detect this state via lookup of the property ij.executable that the launcher sets.

Migrated-From: http://trac.imagej.net/ticket/1089

DefaultPrefService can throw NPE

The following exception can be thrown by the DefaultPrefService when persisting values:

java.lang.NullPointerException
    at java.util.prefs.AbstractPreferences.put(AbstractPreferences.java:241)
    at org.scijava.prefs.DefaultPrefService.put(DefaultPrefService.java:183)
    at org.scijava.module.DefaultModuleService.save(DefaultModuleService.java:280)
    at org.scijava.module.process.SaveInputsPreprocessor.saveValue(SaveInputsPreprocessor.java:74)
    at org.scijava.module.process.SaveInputsPreprocessor.process(SaveInputsPreprocessor.java:65)
    at org.scijava.module.ModuleRunner.preProcess(ModuleRunner.java:104)
    at org.scijava.module.ModuleRunner.run(ModuleRunner.java:156)
    at org.scijava.module.ModuleRunner.call(ModuleRunner.java:126)
    at org.scijava.module.ModuleRunner.call(ModuleRunner.java:65)
    at org.scijava.thread.DefaultThreadService$2.call(DefaultThreadService.java:164)
    at java.util.concurrent.FutureTask.run(FutureTask.java:266)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
    at java.lang.Thread.run(Thread.java:745)

To reproduce, open the SingleInputPreprocessorTest, remove the persist = false attribute from the private T thing parameter of HasASingleInput, and run the tests.

Remove requirement that Axes[0] == X && Axes[1] == Y

There are a number of places in IJ2 where an algorithm assumes the x coordinate of a position array is at index 0 and the y coordinate of a position array is at index 1. Remove this assumption.

Might need to have a Dataset cache the xIndex & yIndex (or more appropriately uIndex & vIndex) and allow them to be queried. One could supply methods somewhere such as:
fillPosition(uAxisIndex, vAxisIndex, uVal , vVal, planePosVals)
getU(position)
getV(position)
getPlanePos(position)

Migrated-From: http://trac.imagej.net/ticket/432

Should we consolidate SaveAsImage with SaveDataset

First of all, SaveDataset should be moved to imagej-plugins-commands.

Second, do we even want a SaveDataset? It should really be modified as is to use an appropriately styled File chooser for selecting an output destination, and do all the validation that we are already doing in SaveAsImage... so is SaveAsImage sufficient?

If so we may want to create a legacy menu entry for File > Export > Image... that calls SaveAsImage, if we want to be consistent with File > Import.

Don't use increment (++) in multi-threaded environments

The DefaultMinMaxMethod uses a single progress variable that multiple threads increment. However, this operation is not actually thread safe. In tests of a dataset with 1000000 pixels, only ~900000 progress updates were actually being checked.

When progress is tracked in this way, each thread needs its own variable to be incremented.

Improve Display-DisplayView-Data hierarchy

Currently, a Display consists of a list of DisplayViews, each of which links to a Data object. After talking with a few people about use cases, it seems that this approach is too simplistic, while also being too complex.

For example, if you have a Dataset with a collection of Overlays intended to correspond to that Dataset, it would be nice for the data structures to indicate that they are specifically linked somehow, rather than just implicitly so by being in the same display.

A tree-like hierarchy of data objects would provide more explicit linkage between related objects, as well as easy duplication of the same structures across multiple displays. (TrakEM2 and Endrov both support tree-like hierarchies of data objects.)

Another problem is that we currently have no UI-agnostic mechanism to create DisplayView instances from a given Dataset or Overlay. Many plugins need to return a DatasetView or an OverlayView, but must avoid invoking e.g. "new SwingDatasetView" in code.

Further, for plugins that wish to return more complex data structures (e.g., a Dataset together with some Overlays), it would be nice to have the aforementioned tree structure, so that it can be used by those plugins.

To address these issues, I propose the following changes:

  1. Create a third type of DisplayView called a CompositeView that consists of a list of other DisplayViews.
  2. Provide a helper/factory that can generically create DatasetViews and OverlayViews.
  3. Potentially, for simplicity, change Display to take a single CompositeView.

See also: scijava/scijava-common#157

Migrated-From: http://trac.imagej.net/ticket/660

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.