Wa `alaykum As-Salamu waRahmatullahi wa Barakatuh.
In the Name of Allah, Most Gracious, Most Merciful.
All praise and thanks are due to Allah, and peace and blessings be upon His Messenger.
In his response, Sheikh Ahmad Kutty, a senior lecturer and an Islamic Scholar at the Islamic Institute of Toronto, Ontario, Canada, states:
If this is an integral part of their preparation for medical school, it is not objectionable. Otherwise, you can ask if they can skip attending the class on religious grounds.
See how you can approach this issue by consulting the religious leaders in your community. Perhaps you should have a free and frank discussion with the teacher if you are talking about regular school.
As for preparation for admission into medical school, such exposure may be deemed necessary, and therefore it is allowed under the rule of necessity.
It is important for a physician at the training level to have sound knowledge of such important body parts to know how to treat ailments affecting them.
Allah Almighty knows best.