Ballets have been inspired by fairy tales, myths, poems, novels and Shakespeare plays, among other things. But never by a documentary that exposed the harrowing conditions at a state prison for the criminally insane.

Until now.

Titicut Follies,” Frederick Wiseman’s landmark black-and-white documentary from 1967, took viewers behind the walls of a state prison hospital in Bridgewater, Mass., with unsparing scenes of strip searches, a psychiatrist interviewing a pedophile, a guard force-feeding an inmate. It might seem like an unlikely subject, but with the help of a new ballet think tank, it is being turned into “Titicut Follies: The Ballet.”

“Let’s do the waiting room, and then we’ll do the strip search,” its choreographer, James Sewell, told a troupe of dancers as he and Mr. Wiseman watched a rehearsal together on a winter’s day in New York.

The dancers ran through the two scenes, to an eerie score by Lenny Pickett, the saxophonist and composer best known these days as the bandleader for “Saturday Night Live.” Mr. Sewell stopped them to tweak the choreography of the strip search. “I think when we get to the butt-check circle,” he said, “it needed to be slightly larger.

The ballet — which is to have its premiere this weekend in Minneapolis, where Mr. Sewell’s company, James Sewell Ballet, is based — had an unusual genesis. Mr. Wiseman, 87, said he had grown fascinated by dance and movement while making documentaries about American Ballet Theater, the Paris Opera Ballet and a boxing gym. But he said he found the subjects of most ballets less than compelling.

“I got sick and tired of seeing ballets about relationships, or mythological forests 10 centuries ago,” said Mr. Wiseman, who recently won an honorary Oscar for his half-century of filmmaking. (Film Forum in New York presents a Wiseman retrospective April 14-27.) “Of the ballets I saw, very few of them were about the contemporary world. So I thought why not take an extreme subject — like psychotics in a prison for the criminally insane — and see if something resembling a classical ballet could be made out of their behavior, their movements, their tics, convulsions and obsessions.”

He shared his idea with Jennifer Homans, the dance critic and historian who in 2014 founded the Center for Ballet and the Arts at New York University; the center serves as a sort of think tank to dream up new directions for ballet, foster academic and artistic work, and connect dance to other fields. She invited Mr. Wiseman to be in the first class of visiting fellows, and put him in touch with Mr. Sewell — whose work has grappled with other dark subjects, including Abu Ghraib, the prison in Iraq where Americans tortured detainees.

“This is the whole point of the center: to encourage work like this,” said Ms. Homans, whose 2010 book, “Apollo’s Angels,” traced four centuries of ballet but ended with the warning that “ballet is dying.” The center, which has drawn fellows from many disciplines, got a new lease on life last fall when the Andrew W. Mellon Foundation, which helped establish it, gave it a second $2 million grant to keep it operating through at least 2019.

Translating “Titicut” into a ballet — one of the center’s highest-profile projects — has been a challenge. (It will be performed in New York at the Skirball Center for the Performing Arts at New York University, April 28 to April 30.)

From left, Jennifer Homans (whose ballet think tank at New York University midwifed “Titicut Follies: The Ballet”); the documentarian Frederick Wiseman; the composer Lenny Pickett; and the choreographer James Sewell of James Sewell Ballet. CreditAndrea Mohin/The New York Times

The film opens with a chorus of joyless, dazed, bow-tied inmates singing “Strike Up the Band” in a nightmarish variety show with the guards. Mr. Sewell took that as the jumping-off point for his ballet — but he decided to switch the idiom.

The guard acting as master of ceremonies in the film seemed to have “an Ed Sullivan complex,” Mr. Sewell said. “He was into theater, and he had his theater company. We’re a ballet company. So I kind of translated that he’s now Diaghilev, he has a Diaghilev complex.” He was referring to Sergei Diaghilev, the founder of the Ballets Russes.

The skewed chorus became a skewed ballet. Mr. Sewell said he had tried to “deconstruct ballet technique” in places so that, say, the port de bras, or carriage of the arms, would not line up. Mr. Sewell said he tried to stay “within the ballet vernacular” — there is dancing on point, though not much — but allowed that “there are a lot of steps that you’re not going to see in the ballet classroom.”

An off-kilter pas de deux pairs a swan that might have floated over from “Swan Lake” and the Faun from Vaslav Nijinsky’s “Afternoon of a Faun.” To stage the strip search, Mr. Sewell turned to one of the most famous scenes in classical ballet: the Kingdom of the Shades in Marius Petipa’s “La Bayadère,” with its entrance of a line of ballerinas in white.

The strip search, he said, “is like the entrance of the Shades: coming in one by one, taking off the shirt and taking off the pants.” Mr. Pickett’s music for the scene echoes Ludwig Minkus’s score for “Bayadère” — if played as a sad, slightly sour Tom Waits-meets-Kurt Weill waltz.

A scene from Mr. Wiseman’s 1967 documentary “Titicut Follies.” CreditZipporah Films

Surprisingly, it has been the documentarian urging the choreographer to feel free to stray from reality — Mr. Wiseman told Mr. Sewell not to be too wedded to what his cameras captured 50 years ago. “In my view — perhaps in no one else’s — there is a very abstract quality to all my movies,” Mr. Wiseman said. “There’s a literal track, and there’s an abstract track. And in the ballet, the abstract track is more important.”

“Titicut Follies” caused quite a stir — embarrassing officials by drawing attention to the horrifying prison conditions, but also raising questions about privacy for showing mentally ill prisoners stripped naked. It was banned for years by a Massachusetts court after a judge described it as “a nightmare of ghoulish obscenities” — a phrase that, Mr. Wiseman said puckishly, he was tempted to quote for a cinema marquee.

The new ballet risks offending other sensitivities, with dancers being asked to pretend to be mentally ill — more realistically than, say, a ballerina dancing the mad scene in “Giselle.”

Mr. Sewell said that he had asked people with experience in the mental health field whether his choreography looked right. “The last thing we want to do is be making fun of people,” he said.

Mr. Wiseman had a different take. “The last thing I want is either psychiatric approval or disapproval,” he said. “This is a fictional dance piece, and I really don’t care what any psychiatrist, social worker or clinical psychologist thinks. Obviously, I hope they like it. But it’s a fictional dance piece.”

Mr. Sewell said that he hoped that the ballet would retain the power of the film.

“The emotional range of the movie is huge: It goes from the funny to the absurd to the tragic to the I-can’t-hardly-even-look-at-that,” he said. “When you finish watching the movie, there’s this feeling that you’ve been through all these things — almost sort of a shell shock from all that you’ve seen and been through,” he said. “And can that feeling be given to an audience going out from the ballet? I don’t know. I hope so.”