If there is no bike lane. Take the whole lane.
in a collision between a cyclist and a pedestrian there is an almost equal potential for harm for both the cyclist and the pedestrian. the rates of rapid deceleration are just as forceful as the rate of acceleration.
the pedestrian could potentially be struck with a metal part of the bike. an almost equal potential exists for the cyclist to be injured by a metal part of the bicycle hitting the ground or a parked car before the cyclist does.
So while i'm sure that your close encounter with a scofflaw cyclist was scary, it was just as dangerous for you as it was for them.
edit: I misunderstood. Yes, if the bike lane is contraflow of course use it that way. Everyone expects bikes from the "wrong way" in that situation. It's all about minimizing surprises to anyone in or near the street.