1. A medical image processing apparatus comprising: a core line identifying unit configured to identify a core line of a predetermined region of a tubular structure from medical three-dimensional image data; a center position identifying unit configured to identify a center position of the tubular structure from a plurality of points forming the core line identified by the core line identifying unit; an obtaining unit configured to obtain positions where straight lines connecting the center position and the plurality of points forming the core line and the tubular structure in the medical three-dimensional image data are in contact with each other; a determination unit configured to determine whether the tubular structure includes a branching based on the positions obtained by the obtaining unit; and a calculating unit configured to correct a position on a structure branching from the tubular structure among the positions obtained by the obtaining unit and calculate a length of the tubular structure based on the positions obtained by the obtaining unit and the corrected positions in a case where the determination unit determines that the tubular structure includes a branching, and to calculate the length of the tubular structure based on the positions obtained by the obtaining unit in a case where the determination unit determines that the tubular structure includes no branching, wherein the calculating unit calculates a position or a length of an artificial material to be inserted into the tubular structure.