||Transport measurements in YBa2Cu3O7 single crystals using a modification of the d.c. flux transformer configuration are reported. We show that, for applied magnetic fields in the crystallographic c direction, the vortex correlation length in this direction is reduced to values smaller than the thickness of the sample. The reduction can be induced either by thermal disorder (linear response) or by flux cutting after the vortices reach a critical velocity (nonlinear response). The results show that, in the transition from a vortex-glass state to a vortex-liquid state, the vortices are effectively three dimensional in character. A two-dimensional regime is induced at higher temperatures well inside the reversibility region.