Unfolding the band structure of non cubic system

How to determine the right coefficients to use in the “RefoldingLatticeVectors” for a tetragonal lattice (a=b≠c) related to its primitive cell by the matrix :
(1/2 0 -1/2
1/2 1 1/2
1/2 0 1/2)
Simply entering this matrix is not giving the correct result.
The tetragonal case is here taken to illustrate more complex cases as for orthorombic or monoclinic systems

Thank you