@staticmethod
def _reshape_sparse_matrix(frmdat, dim):
    """
        Return 3D full matrix representation from 2D representation

        If the 2D matrix has the shape (width*height,channels) then the
        returned matrix has shape (channel, y, x)
        """
    cs, ys, xs = dim
    return frmdat.T.toarray().reshape(cs, ys, xs)
