It could very much be structural dissociation, especially if you have other symptoms of dissociation. I have personality fragments, and I also struggle with symptoms like this.
Impulsively, or compulsively, imagining doing something that we don't want to do that is violent or self destructive, is also symptom that can happen quite commonly for OCD sufferers. In a high state of stress (which is what PTSD is) people can develop one or two symptoms of other anxiety based disorders without having the full condition.
For me, I will be walking along the road and suddenly picture jumping in front of a car. I will also randomly want to do drug myself to oblivion. I don't want to do any of this, but it's there all the same. It's strong enough it scares me. It's a very impulsive and intrusive thought/image/urge.
For me, it's different than being suicidal or being tempted to try to get high. It's not what I actually want to do. It's egodystonic. It's compulsive. I feel compelled to act for a few moments. The fact that it doesn't fit with what is wanted, it's actually distressing to experience, is what makes it similar to other OCD symptoms and why this symptom shows up with that disorder more often than PTSD alone.
It's really a symptom of high underlying anxiety, and such anxiety is common with PTSD.
If getting high is something you actually really want to do, or etc, then that's something different. But if it is a urge to do those behaviors and you don't want to do them, it could be that your PTSD symptoms /anxiety are spilling over and coming out symptom that is common for OCD suffers. It doesn't mean you have OCD, I am just trying to say that you are very much not alone in experiencing this distressing symptom.
For me, it helps if I reduce my underlying anxiety by working on the PTSD and any trauma symptoms. I also use CBT style "thought stopping" or "though diffusion" and distraction techniques. This is usually enough to make the impulses and images of doing random horrible things to myself go away. They stop popping into my head at all. It didn't work very well at first, but with practice, it now does the trick for me. It pops up again every few months, but I can stop the pattern and make it go away fairly quickly. My therapist says that once I work through the trauma, this hopefully will go away completely. I hope she is right.
I hope you find something that helps shift it for you.