  We consider the problem of calculating the weak and strong topological
indices in noncentrosymmetric time-reversal (T) invariant insulators. In 2D we
use a gauge corresponding to hybrid Wannier functions that are maximally
localized in one dimension. Although this gauge is not smoothly defined on the
two-torus, it respects the T symmetry of the system and allows for a definition
of the Z_2 invariant in terms of time-reversal polarization. In 3D we apply the
2D approach to T-invariant planes. We illustrate the method with
first-principles calculations on GeTe and on HgTe under [001] and [111] strain.
Our approach differs from ones used previously for noncentrosymmetric materials
and should be easier to implement in ab initio code packages.
