Its my understanding after looking into this question years ago, that if an ODP is published for that runway, you climb until reaching that published altitude before making a turn issued by tower. The reason being is that tower does not have "radar contact" on you yet. Until you are given over to an approach/departure controller who says "radar contact," or after reaching the published ODP altitude, only then can you turn to the assigned heading given by ATC. This is a very good question and I could potentially be wrong, but hopefully someone on here has a definitive answer for us.