Ticket #563 (closed defect: fixed)
Opened 2011-06-02T17:22:01-05:00
Last modified 2011-10-13T09:46:42-05:00
Improve how legacy layer handles data that cannot be represented in IJ1
Reported by: | bdezonia | Owned by: | bdezonia |
---|---|---|---|
Priority: | major | Milestone: |
|
Component: | Legacy Compatibility | Version: | |
Severity: | serious | Keywords: | |
Cc: | Blocked By: | ||
Blocking: |
Description (last modified by bdezonia)
Right now if you pass a Dataset to the legacy layer that has some axis not allowed in ImageJ 1.x (say FREQUENCY or SPECTRUM) an exception is thrown. Start catching exceptions appropriately and not passing these images through the legacy layer. Perhaps do a preregistration check that does not register a Dataset if its incompatible. This includes all exceptions currently thrown in LegacyUtils (dimensions too big, too many planes, unsupported axis, etc.).
Change History
comment:2 Changed 2011-07-11T15:48:06-05:00 by bdezonia
Mostly addressed in f4e5525e0b75fe1adb1677ec1edc9adc80ab2eb1. Calling a plugin with incompatible data now skips running the plugin and Log.warn()'s about the issue. Error messages could be more direct (a message dialog) and more precise (laying out the nature of the problem).
comment:3 Changed 2011-07-11T15:49:13-05:00 by bdezonia
Another thing that could now be done: remove all the dimension checking and axis checking code in the LegayUtils class. That code should now be irrelevant.
comment:4 Changed 2011-09-14T10:48:56-05:00 by bdezonia
- Milestone changed from imagej-2.0-final to imagej-2.0-beta1
After discussions the approach to this problem is changing.
Right now if you load a sample image (so IJ2 data shadowed by IJ1 ImagePlus) and add a SPECTRUM axis it fails. This is because IJ1 does not support that kind of axis and the legacy layer does nothing.
So two approaches could be taken here. One approach is to still fail to translate to IJ1 but remove the current mapping so that data is not out of sync.
Another approach (which sounds better) is to treat each new axis as a set of channels in an ImagePlus. Translation would involve rasterizing and unrasterizing these nonIJ1 axes.
comment:5 Changed 2011-09-14T11:24:45-05:00 by bdezonia
Implementation detail: legacy layer could maintain a axis map which describes how the IJ2 data axes are represented in the shadow ImagePlus. Then upon plugin return the data can be retranslated into IJ2 as appropriate. Note that plugins could rewrite plane counts etc. so translation back needs to know when to abandon mapping.
comment:6 Changed 2011-10-05T11:44:22-05:00 by bdezonia
The code to encode axes as channels when necessary is in place.
TODO:
- minor: eliminate redundant error checking in LegacyUtils
- major: make sure incompatible data (dimensions too big) is gracefully handled by LegacyPlugin
comment:7 Changed 2011-10-12T16:30:16-05:00 by bdezonia
In 2092b07bed3190777c6c23ee6d679ceba6c7960e eliminated redundant error checking
TODO - make sure incompatible data (dimensions too big) is gracefully handled by LegacyPlugin
comment:8 Changed 2011-10-13T09:46:42-05:00 by bdezonia
- Status changed from new to closed
- Resolution set to fixed
- Summary changed from In the legacy layer gracefully handle passing incompatible data to IJ1 to Improve how legacy layer handles data that cannot be represented in IJ1
Opening remaining part of ticket as new one: #824