прийти мне в голову = « me venir à l'esprit »
с кривой душой = « à l'esprit torturé »
в своем уме = « sain d'esprit »
I'm a bit fuzzy on the difference in usage between these three synonyms, especially as you can express each of them with the noun « esprit {mind} » in French.
To my mind, "голова" seems to be about what you are thinking, while "душа" centres round your feelings, even your personalities, whereas "ум" refers to your intellect.
As to when to use which of the three, I wonder if they are ultimately linked to their corresponding idiomatic expressions?