Topological measurements are increasingly being accepted as an important tool for quantifying complex structures. In many applications, these structures can be expressed as nodal domains of real-valued functions and are obtained only through experimental observation or numerical simulations. In both cases, the data on which the topological measurements are based are derived via some form of finite sampling or discretization. In this paper, we present a probabilistic approach to quantifying the number of components of generalized nodal domains of nonhomogeneous random processes on the real line via finite discretizations, that is, we consider excursion sets of a random process relative to a nonconstant deterministic threshold function. Our results furnish explicit probabilistic a priori bounds for the suitability of certain discretization sizes and also provide information for the choice of location of the sampling points in order to minimize the error probability. We illustrate our results for a variety of random processes, demonstrate how they can be used to sample the classical nodal domains of deterministic functions perturbed by additive noise and discuss their relation to the density of zeros.