Time, time, time.
Imagine your dog isn't a dog; pretend she's a kid who has had to be on his own since he was a child. He didn't have a leader (dogs are pack animals, remember - they need leadership) or anyone to be on his side, so he didn't develop trust in people. This is the sort of kid who gets lost in the system because it's necessary for everyone else to have so much patience with him, and everybody else is too busy. He's not acting the way a child is expected to act, but he can't do any better.
Your new family member wanted to be friends with you, so she let you pet her. She picked you out! Now that she's out of the shelter, she still wants you. She just is terribly unsure what to expect. It will take time for her to learn how to trust. I bet she would love to be friendly. She may seem unfriendly, but actually she may be very frightened. Think about the kid (in the paragraph above), and compare that to one of your own children who has learned to be trusting from babyhood.
If she is staying around and going in and out the dog door, then, to her mind, she isn't a stray. She has adopted you.
She hasn't been threatening, right? She's just keeping away. Is she healthy? You may need to ask a vet what to do if she's sick.
I suggest that you accept her as she is right now. Smile at her. Talk to her in a friendly, loving way, as you would talk to your friends. Have your kids be friendly to her, but tell them that she's very shy and scared, and to let her alone.
Make it a point to sit outside with her. When she's inside, too, act friendly, trying not to startle her (!) and acting as if her behavior is just fine. Start with the dog snacks again (baby carrots are low calorie, if it helps you to know). Praise the dog whenever she comes in your direction, even when she looks at you or wags her tail. You can try some command words, but don't expect her to obey. She can't get that far. You're just making her familiar with the words, but mostly you're reinforcing the behavior you want her to develop.
If you need to, ask around your area for a reputable dog trainer and pick his or her brains.
This will take time!
It's not, perhaps, what you thought you'd be doing when you adopted a dog, but you may find a greater reward from this patience than if you'd come home with a "perfect pet." You may well end up with a dog whom you're so thankful to have in your family. And your children may learn some valuable life lessons.