galaxyproject / galaxy

Data intensive science for everyone.
https://galaxyproject.org
Other
1.4k stars 1.01k forks source link

smarter Galaxy tool test for image comparision #8514

Open bgruening opened 5 years ago

bgruening commented 5 years ago

It would be nice if tests in Galaxy tools could be a little bit smarter in comparing images. Currently what most people do is using sim_size which is ok'ish.

We could add a comparison based on code from https://github.com/jterrace/pyssim maybe. Bonus points if we can just use pillow and dependencies that are already in Galaxy and can avoid the usage of skimage and co.

Pointed out by @erasche: https://github.com/JohannesBuchner/imagehash

mtekman commented 5 years ago

https://github.com/holman/spaceman-diff

I've seen mentioned somewhere

and imagemagick's compare function, which has an actual metric for number of changed pixels + fuzz option

compare image1 image2 diff -fuzz N% -metric AE

leobiscassi commented 5 years ago

Hey @bgruening, I'm looking for ways to start contributing with galaxy code. I think this is a nice opportunity to get more comfortable with galaxy code base, can I go ahead with this issue?

martenson commented 5 years ago

@leobiscassi please feel free to! If you keep us in the loop using this issue that'd be great.

leobiscassi commented 5 years ago

@martenson great, I'll do that! thanks in advance

bgruening commented 5 years ago

Awesome @leobiscassi! Let us know if you have questions here or on gitter.

leobiscassi commented 5 years ago

Hey guys, after some exploration to galaxy code, I think this task it's add a new comparison method like suggested by @bgruening after sim_size [1] condition in the verify module [2], right!?

I'd like to know whether this addition shouldn't have major implications on xml.py [3] and test_parsing.py [4] like I see or I'm missing something.

[1] https://github.com/galaxyproject/galaxy/blob/dev/lib/galaxy/tool_util/verify/__init__.py#L126 [2] https://github.com/galaxyproject/galaxy/blob/dev/lib/galaxy/tool_util/verify [3] https://github.com/galaxyproject/galaxy/blob/dev/lib/galaxy/tool_util/parser/xml.py [4] https://github.com/galaxyproject/galaxy/blob/dev/test/unit/tool_util/test_parsing.py

bgruening commented 5 years ago

I think that is correct. In addition for the documentation, you should add the nex syntax to https://github.com/galaxyproject/galaxy/blob/dev/lib/galaxy/tool_util/xsd/galaxy.xsd and maybe add a test tool to https://github.com/galaxyproject/galaxy/tree/dev/test/functional/tools

leobiscassi commented 5 years ago

@bgruening thanks, I'll check this.

lldelisle commented 1 month ago

Please, if someone can do it would be great!!! Tests passes with any of these two files... image