Creating customisable image windows using imagej 2

Hi, I’m new here, so I’m sorry if my problem has been solved elsewhere - I haven’t found it yet if so! Also, I’m fairly new to Java, having only worked significantly with Python before, so I may be a bit slow.

Tl;dr: I want to be able to set default window size/location, and then copy the two displayed images across to a new window for alignment.

I’m currently trying to develop a plugin for Fiji/ImageJ to allow manual alignment of two quite different images of the same object. Initially, I was trying to create a large GUI with 3 images displayed in it, however moving between different image types for display and import confused things, so I’ve decided to open the two images for manual processing (one is usually very dark), and then overlay these modified images to a new window on a click of a button. I’d like the images to display in fixed-sized windows, preferably next to each other. After that, I need to create a window that displays both, with the upper image movable by mouse.

Are there any ways of displaying images in the way that I want? Most examples use ij.ui().show(), which doesn’t allow me any control over the window. Thank you in advance for any help.

Hello @fish and welcome to the forum,

Actually, I am not sure what you really want to achieve. Maybe you can explain the goal of your image analysis and forget about the technical details first ?

Do you have two example images which you want to align ?

For this specific goal, have a look at BigWarp, it’s fantastic.

That’s a very different goal… and actually this is already achieved in BigWarp.



1 Like

Hi Nicolas,

Thanks for the reply! My goal is to have a manual and automatic alignment plugin for two images of a grid. I have two sets of data, both mosaic images created using different cameras of the same grid, however the grid has been put into a different sample holder, so it has been rotated, flipped, a bit bent (though this can be ignored for now), and isn’t showing the exact same area, though there is an overlap . Initially I want a manual alignment option with some basic controls for rotation, scaling, and moving in the x-y plane.

My biggest issue so far has been with creating a UI that allows for pre-processing of the images separately. I ideally need control over image placement/size in order to avoid cluttering up the screen. Currently I can easily display the images, but accessing the modified data and getting control over window size/placement has been very hard while sticking to the ImageJ2 framework.

The next step would be combining the pre-processed images into a single frame while allowing control over the top image.

As I’m a beginner in Java, I am considering using a Python webservice framework instead. While having access to the ImageJ environment would be preferable, I am much more familiar with Python and BigWarp is a bit beyond what I would be able to write. Another option could be to build the automated matching section, then open the best guess into BigWarp for manual correction at each stage of the process. I suspect I would come across some issues forcing BigWarp to show the progress though.

You’ve given me a lot to think about, thank you.