Dimensional tuning of Majorana fermions and real space counting of the Chern number