I'll be brief and (happily) add more details on demand
(**Edit:** Some more details were added).

**Some Philosophy**

Slogan: *You can do math fibered over a measured space*.

Most of us are already used to the idea of doing algebraic geometry over schemes and topology over topological spaces, but are less familiar with doing math over measured spaces. Yet, this concept has a long history.
Maybe its first appearance is in the notion of a *bundle of Hilbert spaces over a measured space* aka as *direct integral* of Hilbert spaces. Also in the theory of von-Neumann algebras one decomposes a general algebra into a direct integral of *factors* (similarly to the way in which an *Azumaya algebra* is decomposed over its center). I find Furstenberg's pov on Ergodic Theory parallel to Grothendieck's pov on Algebraic Geometry in the way spaces are treated relative to a base space, only that Ergodic Theory is somehow more generous in allowing further constructions, due to the flexibility of measurable functions.

In recent decades Zimmer developed the theory of convex compact spaces, Gaboriau developed the theory of simplicial complexes, Sauer developed the theory of manifolds, all over a base measured space. This pov is quite common nowadays in Ergodic Theory and there are many more examples.

I should probably mention that in all of the above examples, theories were developed for an external sake. Maybe it is about time for approaching these theories as a whole and develop a master theory. I don't know.

**Vector spaces over $X$**

Given a measured spaces $X$ (that is, a standard Borel space endowed with a measure class), a (complex) vector space over $X$ is a Borel space $V$ endowed with a Borel map $\pi:V\to X$ such that the fibers $V_x$ over (a.e) point is endowed with a vector space structure which varies measurably.
A precise axiomatic definition could be given by means of the standard vector space axioms reinterpreted by means of fiber-products constructions.
For example you have the addition map $V\times_X V \to V$ and the scalar multiplication $\mathbb{C}\times V \to V$ which commute with the obvious maps to
$X$ and satisfy the obvious compatibility relations.

Whatever is ones definition of "a measurably varying $X$-indexed family of vector spaces" it should be equivalent to a vector space over $X$.
Unfortunately, I haven't seen this definition published anywhere, so let's say it is a folklore definition.

Note that associated with $X$ we have the algebra of bounded (measurable, defined up to a.e equivalence) $\mathbb{C}$-valued functions $L^\infty(X)$,
which is a commutative *von-Neumann algebra* (aka a W*-algebra), that is a C*-algebra which has a predual ($L^1(X)$).

To a vector space over $X$, $\pi:V\to X$, one associates the vector space of all (classes of) measurable sections of $\pi$, to be denoted $L(V)$ (or $L(\pi)$ if there is a danger of misunderstanding).
This is a module over the algebra $L^\infty(X)$.

**Dimension**

Assume now that $X$ is actually endowed with a finite measure (not merely a measure class). Then integration is a *finite trace* on the algebra $L^\infty(X)$, and this algebra becomes a *finite von-Neumann algebra*. For modules over such guys there is a well developed notion of dimension, the *von-Neumann dimension*.
For finitely generated projective modules, this dimension is given by taking the trace of a certain projection in a certain matrix algebra over $L^\infty(X)$ (you can guess which projection: a one associated with a presentation of a the module as a direct summand of a free module, which trace is choice independent).
The dimension of a general module is defined as the supremum over the dimensions of its f.g projective submodules. This theory is carried in Lueck's book. For an online survey, see his paper.

Finally, it is an exercise to show that for a vector space over $X$, $\pi:V\to X$, as defined above, we have that the von-Neumann dimension of the $L^\infty(X)$-module $L(V)$ equals exactly $\int_X \dim V_x$.

7more comments