0

I have two medical images. One is the "scan image" and the other is the "region of interest" (ROI) of that scan image. Now I need to overlay on top of the other. Here is the original scan image. enter image description here

Scan image

enter image description here

ROI image

How can I overlay, such that I should be able to see the ROI region in the original scan image?. I would like to do this in python.

Mass17
  • 1,555
  • 2
  • 14
  • 29

1 Answers1

0

I solved the problem like below. If anyone is interested in it, you can do as follow;

from PIL import Image

import numpy as np

img = Image.open("path/to/the/roi")

background = Image.open("path/to/the/scan/image")

background.paste(img, (0, 0), img)
background.save('path/to/save',"PNG")

The result looks like below as I wanted. enter image description here

ref: click for reference

Mass17
  • 1,555
  • 2
  • 14
  • 29