A medical device for examination or treatment based on a reference point A1, includes: a virtual endoscopic image generation section 12 configured to generate a virtual endoscopic image of a bronchus 9 from a plurality of different line-of-sight positions using three-dimensional image data of the bronchus 9 of a subject that is obtained in advance an image retrieval section 11 configured to retrieve a virtual endoscopic image highly similar to an endoscopic image of the bronchus 9 picked up by an image pickup section 2D arranged at a distal end portion 2C of an insertion section 2E a reference-point setting section 15 configured to set a reference point A1 based on a line-of-sight position of the highly similar virtual endoscopic image and a relative-position calculation section 16 configured to calculate a relative position of a treatment instrument 4 to the reference point.