Nocturnal penile tumescence (NPT) is a spontaneous boner during sleep (usually REM) or when waking. Basically the technical term for 'morning wood'.
All penises experience NPT multiple times during the night, except those suffering with ED (erectile dysfunction). For this reason morning wood is a great 'tool' for working out if a case of ED has a physiological or psychosomatic cause. If NPT occurs then the ED is presumed to be due to a psychological process such as sexual anxiety.