  We consider random fields defined by finite-region conditional probabilities
depending on a neighborhood of the region which changes with the boundary
conditions. To predict the symbols within any finite region it is necessary to
inspect a random number of neighborhood symbols which might change according to
the value of them. In analogy to the one dimensional setting we call these
neighborhood symbols the context of the region. This framework is a natural
extension, to d-dimensional fields, of the notion of variable-length Markov
chains introduced by Rissanen (1983) in his classical paper. We define an
algorithm to estimate the radius of the smallest ball containing the context
based on a realization of the field. We prove the consistency of this
estimator. Our proofs are constructive and yield explicit upper bounds for the
probability of wrong estimation of the radius of the context.
