Ticket #1945 (closed defect: moved)

Opened 6 years ago

Last modified 6 years ago

Add infrastructure for typed dataset plugins

Reported by: bdezonia Owned by: bdezonia
Priority: major Milestone: imagej2-b8-analysis
Component: Plugin Framework Version:
Severity: serious Keywords:
Cc: curtis Blocked By:
Blocking: #1519

Description

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.

One approach Curtis mentioned is to add annotations to an @Parameter and have the input harvester (?) do the type checking. He thought this was clunky but maybe we should keep this in mind.

(Note that some typed conversion code is now present in the DefaultDatasetService of the data-types branch. This could be used in the case where the plugin checks in the run() method and aborts if needed)

Change History

comment:1 Changed 6 years ago by bdezonia

In regards to the parenthetical comment at the end of the description: recently I also made a TypedDataset class with constructors on the data-types branch. If merged to master it could be used instead of the DefaultDatasetService code.

comment:2 Changed 6 years ago by bdezonia

The TypedDataset approach was eliminated in favor of an ImgPlusService that is merged to master. See commit be9c777fcec78e992b6a15585acdd6b04be754e0

Last edited 6 years ago by bdezonia (previous) (diff)

comment:3 Changed 5 years ago by curtis

  • Status changed from new to closed
  • Resolution set to moved
Note: See TracTickets for help on using tickets.