Sync Windows Plugin for ImageJ

I want to open multiple images, draw a line in one image and then apply the same line (same position and angle) to all the other open images. So I downloaded the Sync Windows Plugin for ImageJ here.

I can create a line on all images at the same time, but as soon as I try to “draw” the line (‘Ctrl + D’ or ‘Edit’ -> ‘Draw’) it vanishes on all the other images. I need more than one line so it’s important that it’s actually drawn.

Is there a way to fix this? (I use ImageJ 1.52d)

Hi, welcome to the forum !
Do you really need to draw/burn the line in the image (ie overwriting the initial pixel image).
If not you could draw a line as a region of interest from the menu bar. Press t to add it to the Roi Manager and tick Show all so that the ROI is displayed on all images (if it does not work clic on the image of interest and untick/retick Show all)

Hi LThomas,

thanks for the quick reply! It works like a charm!
However, I really would like to burn the lines into the images. Is there an elegant way to do so? Otherwise I’ll just do screenshots of the images.

Kind regards

You could have a macro to automatically burn the ROI for each open image but I don’t really know how you would select each image without knowing its title, unless you have them in a stack.

If it’s just for a presentation I guess the screenshot option is fine :sweat_smile: but please dont use it for any quantitative analysis.

ok so I guess there is no easy way to work around this. I’ll go with screenshots then, thank you very much!! :slight_smile:

Just to let you know, you can get the names of the open images with something like this:

titles = newArray(nImages); 

for (i = 1; i <=nImages; i++) { 
	titles[i-1] = getTitle;

So for the OP you could run the below macro code and get and save all your open images with the ROIs flattened on.

dir = getDirectory("Choose where to save your images"); 
titles = newArray(nImages); 

for (i = 1; i <=nImages; i++) { 
	titles[i-1] = getTitle;

for (j = 0; j < titles.length; j++) { 
    	roiManager("Show all without labels");
        saveAs("tiff", dir + titles[j]); 

run("Close All");
1 Like

No need to download and install a plugin. The Analyze › Tools › Synchronize Windows is included in ImageJ since 2012 (version 1.46f):

Some alternative suggestions:

  • Without using the Synchronize Windows command, you could just do:

    • Create a line in one image
    • Draw D
    • Select next image
    • Edit › Selection › Restore Selection ShiftE
    • Draw D
    • etc.
  • another option:

    • Merge all your images into a single stack,
    • create the line selection and
    • draw on each slice
  • Using Synchronize Windows, you can draw the line and use the Image > Overlay > Flatten command (I didn’t test it, maybe you have to pay attention to not also flatten the red mouse indicator added by the synchronize plugin).

1 Like

I’ll try it later but wow thank you very much!!

woops I really didn’t notice that this plugin was already included!

And thanks for those alternatives! =)