You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Ensure simplification framework is robust enough to support ij.ImagePlus #109
It would be nice to have converter implementations between the core image data structures in ImageJ. The hope would be to give potential uses of typing requests the best chance of success out-of-the-box.
As part of implementing these converters let's also build up the documentation with uses of image typing requests in op calls.
Okay, I had some fun with type variables and made some lifting Ops that are super general, working on any RAI implementations so long as there is a create Op that satisfies. I was actually able to remove some adaptors that became obsolete because of these, and I'm hoping to do Computers, etc. along these lines.
@hinerm can you elaborate on what you mean, though, by "common image types"? Do you mean just lifting Ops, like you had on the branch you linked, or do you mean somethign else?
ImageJ2: net.imagej.Dataset and net.imagej.ImgPlus
ImageJ: ij.ImagePlus
ImgLib2: RandomAccessibleInterval and IterableInterval and Img
This touches on the simplification work: all of the above should boil down to some canonical simple "image" type. Note that (1) is really just a case of (3), because those types extend ImgLib2 types. (For Dataset, the imagej2-legacy module has a type extractor that reifies the generic type properly despite the broken compile-time typing.)
So the main issue is (2): how do we support passing ImagePlus objects directly to Ops matching attempts, and have it "just work" matching op implementations designed for ImgLib2?
changed the title [-]Add converters for common image types[/-][+]Ensure simplification framework is robust enough to support ij.ImagePlus[/+]on Sep 26, 2023
As far as running Ops on ImagePluses goes, here's what we tried:
Using imagej-legacy: Theoretically, we could create a set of Ops that know how to access the LegacyImageMap using the LegacyService. Unfortunately, this is very prone to the following exception, which was not solved by any of the theories @ctrueden , @hinerm or I had:
using imglib2-ij: This doesn't work because the needed package, net.imglib2.img, exists in imglib2 as well, and duplicate packages seems to be forbidden by JPMS. We will probably need to wait for imglib2-ij to be JPMS-ified by @tpietzsch to pursue this route.
Fortunately, if someone really wants to run an Op on an ImagePlus, they could always use the ConvertService or just ask for an Img in their script (instead of an ImagePlus), so I think for now we should just not worry about this.
Activity
ctrueden commentedon Jan 18, 2023
See also:
hinerm commentedon Jan 20, 2023
See this branch for manual examples.
Ideally we would auto-generate these for all arities and desired image types.
gselzer commentedon Aug 18, 2023
Okay, I had some fun with type variables and made some
lifting Ops that are super general, working on anyRAIimplementations so long as there is acreateOp that satisfies. I was actually able to remove someadaptors that became obsolete because of these, and I'm hoping to doComputers, etc. along these lines.@hinerm can you elaborate on what you mean, though, by "common image types"? Do you mean just lifting Ops, like you had on the branch you linked, or do you mean somethign else?
ctrueden commentedon Sep 26, 2023
By "core image data structures" here we mean:
net.imagej.Datasetandnet.imagej.ImgPlusij.ImagePlusRandomAccessibleIntervalandIterableIntervalandImgThis touches on the simplification work: all of the above should boil down to some canonical simple "image" type. Note that (1) is really just a case of (3), because those types extend ImgLib2 types. (For
Dataset, the imagej2-legacy module has a type extractor that reifies the generic type properly despite the broken compile-time typing.)So the main issue is (2): how do we support passing
ImagePlusobjects directly to Ops matching attempts, and have it "just work" matching op implementations designed for ImgLib2?[-]Add converters for common image types[/-][+]Ensure simplification framework is robust enough to support ij.ImagePlus[/+]hinerm commentedon Oct 26, 2023
This work looks like it was already done and merged. That branch was done and I think should have been deleted
gselzer commentedon Oct 26, 2023
As far as running Ops on
ImagePluses goes, here's what we tried:imagej-legacy: Theoretically, we could create a set of Ops that know how to access theLegacyImageMapusing theLegacyService. Unfortunately, this is very prone to the following exception, which was not solved by any of the theories @ctrueden , @hinerm or I had:imglib2-ij: This doesn't work because the needed package,net.imglib2.img, exists inimglib2as well, and duplicate packages seems to be forbidden by JPMS. We will probably need to wait for imglib2-ij to be JPMS-ified by @tpietzsch to pursue this route.Fortunately, if someone really wants to run an Op on an
ImagePlus, they could always use theConvertServiceor just ask for anImgin their script (instead of anImagePlus), so I think for now we should just not worry about this.Merge pull request #109 from scijava/scijava/incubator/prune-unused-m…