It's hard to say from the photos, but I think that you might be able to succeed, even though it will be very tight, IF:
- you get your pipes and trap to stay within the joists' height.
- you get the required slopes for smooth drainage.
- rerout copper pipes too.

Get a plumber, not just any plumber but a qualified one to assess the situation and do the job right.