-
Notifications
You must be signed in to change notification settings - Fork 0
Refactor classes #6
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
Conversation
This pull request has been mentioned on Image.sc Forum. There might be relevant details there: https://forum.image.sc/t/fiji-friends-weekly-dev-update-thread/103718/71 |
Great! I have started moving from ImagePlus to imglib2 classes. So this is very relevant to me.
I have some tests written, and Ill gladly adapt to a more unified library. Especially if it means there is better agreement on how the Calibration relates to imglib2 associated values. MeshImageStack2 is an imglib2 version of a class that was originally built on an ImagePlus. So this class converts List<Source<?>> to ImagePlus. This class SaveImageToZarr is going the other direction and changing an ImagePlus to an RandomAccesssibleInterval to be saved with the N5 library. |
Yeah...it's unfortunate that this project is necessary in the first place, but at least it gives us an opportunity to clean - imglib/imglib2-ij#37 gives some rationale if you hadn't seen it. The best thing we can do is file PRs wherever imglib2-ij was used (I started that, but then I got annoyed with the public API, hence this PR 😅), and there will of course be natural pressure/complusion to switch to this library when maintainers bump their Java version. |
I am not completely familiar with all of the imglib2, imagej nuances. When should I start using this? It seems like it it will be targeting the java 21 version of fiji? |
It is not yet ready for usage as there is no available release, but yeah, our plan is to target the Java 21 version of Fiji. At that point, I'd advise using imglib2-ij for Java 8 projects, and this library for Java 11+. |
9ad2e1b
to
f0d8ef3
Compare
They are doing very similar things and people might miss VirtualStackAdapter's functionality if the name doesn't convey the purpose
There were many different classes containing methods that do similar things, and it can be hard to discover and compare if they aren't all in one place.
The only functionality remaining was for showing images - we can always add it back if/when there is demand
Only one of these should live here forever so this change will make that easier.
Can add back later if needed
Packages should imply something more about the classes contained within. To be fair, I think these package names are only marginally less confusing that their predecessors, but I couldn't think of anything better :)
Current thoughts are that this should not be exposed due to the dependency on
Have removed any exposure of this class (using |
This draft PR aims to reorganize this library, such that we can more easily accomplish the following goals:
I was motivated to submit this PR because:
Img<T>
to anImagePlus
, you have:ImageJFunctions.wrap(RandomAccessibleInterval<T> img)
and its many friendsImgToVirtualStack.wrap(ImgPlus<?> imgPlus)
and its many friendsArrayImgToVirtualStack.wrap(ImgPlus<?> imgPlus)
and similar functions forPlanarImg
andCellImg
.The goal of this PR is to reorganize all functionality by purpose, while also making it clearer in future PRs which functionality should be migrated out to other libraries (e.g. imagej-legacy) and to reorganize for natural packages when this library eventually becomes modularized. The work isn't quite done yet, but it is ready for initial opinions. Specifically, I still want to decide about:
ArrayImgToVirtualStack
,CellImgToVirtualStack
,PlanarImgToVirtualStack
- ideally, these could be encapsulated within a single function somewhere (ImgPlusToImagePlus
?), to avoid case logic like thisImagePlusImgs
feels like it could be top-level.Happy to hear opinions from @ctrueden and @tpietzsch