In this paper we present a novel deformable registration algorithm for diffusion tensor (DT) MR images that enables explicit analytic optimization of tensor reorientation. The optimization seeks a piecewise affine transformation that divides the image domain into uniform regions and transforms each of them affinely. The objective function captures both the image similarity and the smoothness of the transformation across region boundaries. The image similarity enables explicit orientation optimization by incorporating tensor reorientation, which is necessary for warping DT images. The objective function is formulated in a way that allows explicit implementation of analytic derivatives to drive fast and accurate optimization using the conjugate gradient method. The optimal transformation is hierarchically refined in a subdivision framework. A comparison with affine registration for inter-subject normalization of 8 subjects shows that our algorithm improves the alignment of manually segmented white matter structures (corpus callosum and cortio-spinal tracts).