THINK of Glasgow on the small screen and images of dour police detectives, murky ganglands and grisly murders probably spring to mind. A new psychological thriller, The Replacement, is about to turn those cliches on their head.

The three-part drama, which continues on BBC One tomorrow, stars Scottish actor Morven Christie as Ellen, a successful and ambitious architect who discovers she is pregnant at the same time as landing the biggest project of her career.

When she goes on maternity leave, her job is taken over by Paula, a mysterious newcomer played by Vicky McClure. As the weeks progress, Ellen becomes convinced Paula is out to get her, the crux of the cuckoo-in-the-nest plot resting on whether her spiralling fears are real – or imagined.

When The Replacement was first penned it was set in an anonymous urban landscape, but once the project was green lit the idea of shooting the three-part drama in Scotland was mooted.

Rather than Glasgow standing in for any generic town or city, writer and director Joe Ahearne made it very specific. That included committing to a largely Scottish cast led by Glaswegian native Morven alongside Dougray Scott, Richard Rankin, Neve McIntosh and Siobhan Redmond.

Equally, it meant ensuring the physical backdrop of the city – from the offices of the fictional architectural firm at its heart to the characters' homes, work projects and even the streets they walked – was deftly woven into fabric of the storyline.

Helping shape that vision was Joe's long-time friend and collaborator Nicole Cauverien. As a former director of drama at STV, she has worked on well-known TV shows such as Rebus, Taggart and McCallum.

Returning to Glasgow last summer as producer on The Replacement, Nicole was delighted to be able to showcase an entirely contrasting side to the city.

"Glasgow is often portrayed in crime drama or procedurals as being very gritty," she says. "The gritty, edgy, dark underbelly are the adjectives that are used. This is very different because the world of architecture features people for whom their environment really matters."

The TV show features a number of well-known public places including the former Glasgow 2014 headquarters at Commonwealth House on Albion Street in the Merchant City which was used as the principal location of the fictitious offices of Gillies Warnock Architects.

Viewers will recognise popular haunts such as Hutcheson's Bar and Brasserie on Ingram Street or The Trading House at St Vincent Place, as well as landmarks including George Square, the People's Palace and Glasgow Green.

The Linn Crematorium to the south of the city, with its striking Modernist design – described by Nicole as "a key Scottish 20th-century monument" – also features.

"We wanted to show off Glasgow as the beautiful city it is, celebrating its great architectural heritage as well as featuring its interesting and ambitious contemporary architecture," she says.

"It's about seeing the world through the eyes of our characters: people who, as architects, have a stronger connection with buildings than most of the rest of us.

"But it's a fine line you're treading; you don't ever want to distract attention away from the story."

To that end, the buildings and their interiors needed to do more than just look good. The city isn't merely a pleasant backdrop: it is vital to add flesh to the bones of the characters.

Ellen and her husband Ian, played by Morven and Richard, stay in a pretty mews cottage on a cobbled lane within the west end's historic Park District.

A short hop east across Glasgow is the rambling Victorian mansion in Dennistoun that is home to Vicky's on-screen alter ego Paula.

The firm's bosses David and Kay – played by Dougray and Neve – have a swish, modern property in Hyndland featuring sleek wood panelling, glass fronting and a nifty turning plate for their car.

The production used domestic houses across Glasgow for the shoot. "One of the real privileges of filmmaking is that you get to go into people's homes and look around," says Nicole. "The brief was to find interesting interiors and in doing that we got to see a lot of them.

"We easily looked at 20 properties per location across the city. I didn't get to see all of them because the designer and location manager would do the initial scouting and then as it was whittled down to a short list the designer, director and producer would go along to look."

Although not everything was quite as straightforward. With a pivotal part of the storyline centred on a £12.2 million library project, finding a building that fitted the bill had its challenges.

"We went round lots and lots of libraries," says Nicole. "The problem with shooting in an authentic location is that we would need to go backwards in time to create it as a building site.

"The other issue we found with most of the libraries we visited was that they didn't look brand new. They needed to have a blank canvas feel. We really have to sell this idea to people that we go from nothing to something in building this library."

They stumbled upon the perfect location: a striking private home in Pollokshields. "I think it is one of the most expensive new builds in Glasgow in recent years," says Nicole. "It is a domestic house but it is so big and the interior spaces are so vast that it could double as a library."

The Scottish actors felt particularly at home on The Replacement. Morven was thrilled not only at being able to use her own accent, but also getting to show off the city where she lives.

"To have a Scottish crew working on it and Glaswegian people all around, the energy had a light feel and it was uplifting on set which was amazing. I joke about it, but you go through days on set in London where nobody wants to be there. That can't help but trickle into the work.

"Glasgow is a beautiful city and I love it. To be able to cruise around with a crew filming and Vicky who fell in madly in love with it too, I was like: 'Check out my town, man!'"

The Replacement, BBC One, Tuesday, 9pm