Consider a Gaussian random field with a finite
Karhunen--Loève expansion of the form
$Z(u) = \sum_{i=1}^n u_i z_i$, where
$z_i$, $i=1,\ldots,n,$ are independent standard normal variables and
$u=(u_1,\ldots,u_n)'$ ranges over an index set $M$, which is a subset
of the unit sphere $S^{n-1}$ in $R^n$. Under a very general assumption
that $M$ is a manifold with a piecewise smooth boundary,
we prove the validity and the equivalence of
two currently available methods for obtaining
the asymptotic expansion of the tail probability of
the maximum of $Z(u)$. One is the tube method, where
the volume of the tube around the index set $M$ is evaluated.
The other is the Euler characteristic method, where the expectation
for the Euler characteristic of the excursion set is evaluated.
General discussion on this equivalence was given in a recent
paper by R. J. Adler.
In order to show the equivalence we prove a version of
the Morse theorem for a manifold with a piecewise smooth boundary.