1. A medical image processing apparatus comprising: a virtual endoscopic image generation unit configured to generate a virtual endoscopic image of a tubular structure represented in a three-dimensional medical image, and which is viewed from the inside of the tubular structure; an observation path setting unit configured to set an observation path along the tubular structure in the three-dimensional medical image; an observation direction setting unit configured to set an observation direction of the tubular structure along the observation path; a viewpoint setting unit configured to set a viewpoint on the observation path; and a visual range determination unit configured to identify, based on the three-dimensional medical image, the position of a wall region of the tubular structure present in a local observation direction at the viewpoint and in the vicinity of the local observation direction, and to estimate, based on a positional relationship between the viewpoint and the wall region, a global observation direction at the viewpoint, and to determine a visual range of the virtual endoscopic image in such a manner that image information about a region located in the global observation direction with respect to the viewpoint is represented at a central part of the virtual endoscopic image, wherein the virtual endoscopic image generation unit is configured to generate, from the three-dimensional medical image, the virtual endoscopic image representing a view within the visual range at the viewpoint, wherein the vicinity of the local observation direction at the viewpoint is a direction from the viewpoint toward each of a plurality of search points on the observation path located on the forward side of the viewpoint along the observation direction that has been set by the observation direction setting unit, and wherein the visual range determination unit is configured to determine, based on pixel values on a plurality of second search lines connecting the viewpoint and the plurality of search points, the direction of one of the second search lines on which the wall region is not present between the viewpoint and the search points, and the length of which is sufficiently long to satisfy a predetermined standard, as the global observation direction.