Spin filtering through ballistic nanojunctions, the role of geometry and of spin orbit interaction