The process by which the neural tube - the precursor to the brain and spinal cord - forms from the ectoderm.