How to obtain the bounding box?

How do I make a Region of Interest image with a bounding box like the one in the third image? both images are in Nifti format

forgive me for being “mr. obvious” here, but shouldnt you be reading about
“Graph Cut Segmentation and morphological operations” now ?

also, your illustration sems to be from some paper – you have a link for us ?