Re-order images based on similarity


I have a large number of images from a single TMA core that are unfortunately not in order. I would like to put them back in their original sequence.

What I am thinking about is to somehow measure similarity, or features and rank them based on how similar they are in ImageJ. Is there any built in function or any other solutions that you would advice I try?

Thank you!

1 Like

Hi @b3nb0z,

There is a Fiji plugin that estimates the z-spacing of a stack that can also try to find an appropriate re-ordering “Transform > Z-Spacing Correction”.

See this paper, and this github page.

Good luck! and please report back if any issues come up (and also if this works )


Addendum to @bogovicj’s answer:
If you have access to cplex, you can also download this plugin for section order correction and follow the build instructions to add it to your Fiji. This method works for arbitrary permutations of your sections, the method from @bogovicj’s answer only works only if the sections are out of order within a local neighborhood (the extent of local depends on the image data and how fast pairwise similarity decays as a function of distance). It is, however, more robust against noisy similarity measures. You might want to try both and pick the better result, or a combination of both, as described in the paper referenced by @bogovicj : Run the section-sort plugin first to get the sections in (approximately) correct order, then run the z-spacing plugin to correct for ordering mistakes that could not be resolved due to noisy similarity measures.