Add semitransparent image to another, move it around, measure, move it again

I’m having a devil of a time understanding the differences between selections, ROIs, and overlays, and understanding how to move between them and select things in them. Specifically I want to:

Add image A to image B in a partially transparent manner so I can see both images, then move image A around until a portion of it aligns with image B, then measure something on image B, then move the overlaid image A some more, then measure something else, etc.

I tried this: Image->Overlay->Add Image, followed by Image->Overlay->To ROI Manager, and set opacity to something like 50%. This shows the two images merged, but sometimes I can pan the added image and sometimes I can’t, and I don’t know what is different. I have tried selecting the HAND and the LINE tool, and in both cases sometimes I can pan and sometimes I can’t.

Once I had panned properly, I couldn’t figure out how to stop panning and instead draw a line on image B to set scale. The line tool kept panning image A instead of drawing a line.

At one point I got it to work but then was unable to re-enter the mode where I could pan image A.

Can you explain any fundamentals here that might help clear confusion? Thanks.

Hi tedtoal,

You can try the laborious method of using ‘Translate’ in the ROI manager to move the overlay around. I’m not sure about manually panning the image around using the hand tool. Also not sure what exactly you need to measure in the two images, is it pixel intensity information, or just geometric?

A different thing you could try, which I think I would use in your situation (if I understand it correctly), is to use G. Landini’s Align_4 and Align_Slice. These can do transparent alignment of images, or manual movement of images in separate parts of a stack. I generally use Align_Slice to manually align images that can’t be registered using StackReg.

If you have image A and image B in a stack and use Align_Slice, you could switch between the two images while moving them to align a portion. Then measure something on image B (the pixel information should be completely unchanged unless you’ve rotated or translated it out of the image window). Depends what you’re looking to measure though? If you need to make an ROI in image A and copy to image B, that should be easy enough as you’ll be in a stack, so the ROI will be in all slices (if the appropriate options are set).

Cheers,

Rob

Hi, thanks Rob for the info. I’ll have to check out Align_Slice. Yes, it is geometric info I need to measure.

It looks like I found a way to do it.

To 1) overlay two images; 2) drag image2 to align a feature with something on image1; 3) draw on image1; 4) drag image2 to a different alignment; 5) draw some more on image1:

  1. Load the two images
  2. On first image, Image|Overlay|Add image… to add second image with X=Y=0, Opacity 33%
  3. Image|Overlay|To ROI manager…, select second image name in ROI manager window
  4. Select most any tool, e.g. segmented line tool, can then drag image2 over image1 to align
  5. Select None then causes the tool to do its drawing operation rather than dragging image2
  6. Deselect image in ROI Manager window, then click on its name in ROI mgr, causes tool to again drag image2

If I understand what is happening, I think the overlay holds image2 and it never becomes part of image1. An ROI can be a region in the main image or a region in the overlay, and in this case it is a region in the overlay. You can’t drag things in the overlay, unless they are ROIs. ROIs can be dragged. A selected tool does its drawing work as long as an ROI is not selected. If an ROI is selected, the tool instead drags the ROI, in this case the image ROI located in the overlay.

Cheers,
Ted

1 Like

Ted,

it’s been two years since you typed your message - and I want to say thank you for these steps. They have solved a problem I have been working on for days (thinking about peripherally for weeks) and couldn’t solve with my usual tools and google queries.

For anyone who wants to manually fit (translate, scale) one image (anatomical mask, grid, pattern, outline) onto another image, where all automated and semi-manual techniques are not practical, this solution (Steps 1-4 from above) could work - especially with multimodal images with complicated landmarks.

Simple manual drag and scale.

grafik
grafik

Rotation is a bit tricky - I have so far only been able to rotate the image, not the overlay.
My workaround is to first align by line ROI, then add the aligned image as an overlay for final rescaling.

Best,
Teresa