-
Notifications
You must be signed in to change notification settings - Fork 25
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
Consider adding delegate converter String => ImagePlus => Dataset #246
Comments
This issue has been mentioned on Image.sc Forum. There might be relevant details there: |
Hi @imagejan,
As mentioned in the thread I think this behaviour is particularly confusing for ij1 macro. Personally I never use My 2 cents : I would be in favor of removing this delegate converter and making a direct String to Dataset converter - keeping in mind the ij1 macro use cases. I think converting from String to File can be explicitely done easily - so there's no big need for it. |
@NicoKiaru wrote:
It was exactly an IJ1 Macro use case where this behavior was desired/requested by @tischi (see imagej/imagej-common#71 (comment) for example). I don't have a strong opinion about this specific converter. I do think however that from the plugin/script implementer's view, you shouldn't have to worry about how people use your command, and just take a It should be up to the framework to cover all use cases, and make it possible to work with images both read from disk or already opened, depending on the user needs (see the discussion on the |
I didn't know about about this, that was why I was asking so thanks for linking, I'll read it |
I agree, but then I believe it should explicitly mentioned whether you want to allow this behaviour or not. The property Otherwise how can you know what is the nature of the object you are refering to ? Is Sometimes people rename their image with the full path of the image - not saying it's good practice, but it happens. I see a lot of ways this can create some confusing behaviour. Imagine you want to open two times the same image - maybe the second time because an image is already open it will not open it twice but only link the first opened image. I believe a String - without specifying any sort of convention - is not enough to define what it really refers to. You also mentioning in imagej/imagej-common#71 :
I completely agree, and I'm pretty sure that a lot of problems can happen. Maybe we need to adopt a convention, reinvent or reuse URL, like having a protocol name |
This issue has been mentioned on Image.sc Forum. There might be relevant details there: |
Just refreshing this thread, as it is pretty important. The main issue is:
This converter is needed in at least two cases:
For the first use case, I made this temp fix in ilastik4ij repo, which is a String to Dataset converter For the second use case, @imagejan made a PR in scifio which will soon makes its way into FIJI Right now these two fix live in separate worlds - and perform their duty. But they will soon be in the same world (FIJI updated to the new pom version + ilastik4ij update site), and then, when put together, issues will occur because the first fix assumes the String is a reference to an opened Image, while the second fix assumes the String is a Path. Personnally I do not agree with the assumption String = Path, because this can create too much confusion in the behaviours. But my opinion is not important, the important point is that both use cases should work, and also, I believe, that the behaviours are easy to understand (thus easy to debug). I saw this discussion on gitter regarding |
The use of The point is that there are legitimate use cases for both applications: a I think we can agree that The general question whether for To solve the (possible) conflict between a
If we apply all three of these, then there will be little chance of conflict: only when a string matches both an existing file and an opened image, we would follow the highest priority (so there's no possibility to open the file in that case). |
@NicoKiaru I agree that this is an important issue! And I thank you and @imagejan very much for discussing it, to help identify the best path forward. 💯 Unfortunately, I am currently still consumed by the server migration at the moment. I'll try to keep this issue on my radar and contribute my thoughts later... in the meantime, to help avoid the dire future you warn about coming to pass when we upload new components to the core update site, I filed fiji/fiji#252, as a place to track the concerns we should be dealing with when preparing the new Fiji release. |
Ok, so if I understand correctly, here's the list of things to do - and the location where to do the modifications (guess) :
Would you agree @imagejan ? |
Yes, exactly, @NicoKiaru.
imagej-legacy/src/main/java/net/imagej/legacy/convert/StringToImagePlusConverter.java Lines 71 to 73 in 5c46549
We just have to make sure the same is true when we migrate the converter code from As for the |
This issue has been mentioned on Image.sc Forum. There might be relevant details there: |
This issue has been mentioned on Image.sc Forum. There might be relevant details there: https://forum.image.sc/t/ilastik-error-on-ilastik4ij-1-7-3/46902/4 |
Let's fix this issue. Labkit has a |
Thanks for notifying, @maarzt! Actually, this issue (adding a
What's the exact issue with the macro parameters? If I remember correctly, the image inputs are recorded with the image title, right? If so, we'd have to make sure that we convert title strings to |
See this forum topic.
Currently, we support:
String => ImagePlus
vianet.imagej.legacy.convert.StringToImagePlusConverter
ImagePlus => Dataset
vianet.imagej.legacy.convert.ImagePlusToDatasetConverter
In other components, we also support:
String => File
viaorg.scijava.convert.FileListConverters$StringToFileConverter
inscijava-common
File => Dataset
viaio.scif.convert.FileToDatasetConverter
(inscifio
)and with SCIFIO 0.39.0 and later, also directly via delegate converter:
String (=> File) => Dataset
viaio.scif.convert.StringToDatasetConverter
The important difference between the two scenarios above is that
String
can be an image name referring to an already opened image (in case ofString => ImagePlus
), orString
can be a file path of an image file to be opened (in case ofString => File
).I think it would make sense to also support the conversion from image title to
Dataset
for already opened images, but we need to carefully consider the different use cases here.The text was updated successfully, but these errors were encountered: