In the summer of 2007, French actress and singer Charlotte Gainsbourg had a water-skiing accident in Miami. Weeks later, back home in Paris, she started having terrible headaches.

At her sister's urging, Gainsbourg, now 38, went to get an MRI, or in French, an IRM, for imagerie par resonance magnetique.

"I was terrified of seeing that it was cancer or something," said Gainsbourg, talking from New York about her terrific new album "IRM," recorded in Los Angeles with Beck, who, with Gainsbourg as his muse, wrote and produced all the songs she sings. "And when I saw their faces, I knew. They said, 'You have to go straight to hospital.' " Gainsbourg had been bleeding internally from a cerebral hemorrhage and needed emergency surgery. "There was so much blood," she said.

"'You should be dead,' they said. 'Either paralyzed or dead.'" The surgery was successful. And over subsequent months, Gainsbourg - who played Heath Ledger-as-Bob Dylan's wife in Todd Haynes' "I'm Not There" and won the best actress prize at last year's Cannes Film Festival for her role in Lars von Trier's controversial horror film "Antichrist" - kept getting more MRIs to make sure the crisis had passed.

"It was the only way of reassuring myself that I wasn't going to die," Gainsbourg said. "There's something very chaotic about those sounds and being in that box. The whole thing is very strange and violent. But I could find an escape inside that thing that I quite enjoyed in the end."

Gainsbourg, who worked with Beck producer Nigel Godrich as well as Jarvis Cocker and the French duo Air on her previous album, 2007's "5:55," suggested to Beck that he use her experiences inside a long metal tube as songwriting inspiration.

"I think Beck understood that it was something important in my life," says Gainsbourg, daughter of iconic French singer Serge Gainsbourg and English actress and singer Jane Birkin. "And I loved the lyrics he wrote so much. He has a way of putting the medical aspects of it close to the poetic aspects in your mind." The song "IRM" blends becalmed Gainsbourg vocals with a bass drumbeat and MRI-inspired clangor to create a sound that's more musical than you might imagine. Most of the string-sweetened, often gorgeous, stylistically varied "IRM" is softer in texture than the title cut - though it occasionally rocks hard, as on the stomping "Trick Pony." But a sense of unsettled and imaginatively arranged urgency runs throughout the album, which comes off like a feminine electro-folk mirror image of Beck's Godrich-produced albums "Mutations" and "Sea Change." "A lot of the songs relate to death and memory and loss, so in a lot of ways it does have a very strong link" to the title song, said Gainsbourg, who's married to director Yvan Attal and has two children.

She worked on "IRM" both before and after filming the sexually violent "Antichrist." "The shoot was so wild," she said, "but I hadn't seen any footage. I didn't know what I had done. I was lost, I think. So to go from that straight into the studio and be isolated again with those memories was very intense."

Gainsbourg came up with titles for "IRM's" songs, "and I was trying to write lyrics, but I couldn't," she says. "Then Beck would start from scratch and be done in, like, 10 minutes.

"And either we're very similar or he guessed things that were very personal about me, which is quite strange. Because I'm not a very talkative person, and he's also quite shy. And we didn't have profound conversations. Things just happened in a mysterious way."

SUBSCRIBE

Unlimited Digital AccessOnly 25¢for 6 months

ACT NOWSALE ENDS SOON | CANCEL ANYTIME