A federal judge has ruled that allowing male guards to videotape strip searches of female inmates at a western Massachusetts jail is unconstitutional.

The judge in U.S. District Court in Springfield ruled Tuesday that allowing men to videotape nude female inmates at the Western Massachusetts Regional Women's Correctional Center is "antithetical to human dignity" and "deeply humiliating."

The class-action lawsuit was brought on behalf of 178 former and current inmates against the Hampden County Sheriff's Office, which runs the Chicopee jail.

The plaintiffs said the policy was a violation of their protection against unreasonable searches under the Fourth Amendment.

The Sheriff's Department said the male guards were trained to turn their heads and take video only from the neck up.

A sheriff's lawyer says the agency disagrees with the decision and is weighing an appeal.