Please help😩

Can you masturbate before a Hysterosalpingography? I’m having it done the 2nd. No penetration, just like vibrators