Skip to content
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

Conversion between image classes not working #15

Open
PetrBainar opened this issue Dec 13, 2017 · 5 comments
Open

Conversion between image classes not working #15

PetrBainar opened this issue Dec 13, 2017 · 5 comments
Assignees
Milestone

Comments

@PetrBainar
Copy link
Contributor

Converting between various image classes like Dataset, ImageDisplay or DatasetView during module execution is not working properly. For example, when a Dataset object is provided, it is expected to be converted into an ImageDisplay or a DatasetView instance when needed.

However, this is not happening at the moment as ConvertService.convert(...) returns null.

@PetrBainar PetrBainar added the bug label Dec 13, 2017
@PetrBainar PetrBainar self-assigned this Dec 13, 2017
@ctrueden
Copy link
Member

@PetrBainar Did you have time to track this down? If not, I am happy to investigate it. Can you post a quick set of steps here to reproduce the issue?

@PetrBainar
Copy link
Contributor Author

@ctrueden
For example, the net.imagej.plugins.commands.rotate.FlipHorizontally Command requires an ImageDisplay object as an input, however the images are stored on the server as Dataset objects.

We did some investigation on this issue and it can easily be resolved by adding appropriate converters (e.g. from Dataset to ImageDisplay) to the project. However, the outputs resulting from the Command execution are not converted back so you might end up with multiple independent objects (e.g. Dataset and numerous DatasetView objects) corresponding to a single image.

We tried to store images as DatasetView objects immediately after upload and had better experience with this approach. Nevertheless, there might be some constrains we are not aware. What was the rationale for choosing Dataset as the type for storing images?

@ctrueden ctrueden added this to the m1 milestone May 2, 2018
@ctrueden ctrueden added the to do label Oct 15, 2018
@Wuyou98
Copy link

Wuyou98 commented Mar 18, 2019

I had the same probelm, but I don't know where to add the converters, do you have any suggestions?

@PetrBainar
Copy link
Contributor Author

I had the same probelm, but I don't know where to add the converters, do you have any suggestions?

A Converter should be discoverable by SciJava's ConvertService as long as it is decorated as the org.scijava.convert.Converter plugin. See a custom Converter added within this project here.

@Wuyou98
Copy link

Wuyou98 commented Mar 19, 2019

Thanks for your advice, it works!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants