Fabrication of porous titanium scaffold with controlled porous structure and net-shape using magnesium as spacer.