The technical term is penile plethysmography testing.

In layman's terms, it's an erection-measuring device. Thursday, a federal court ruled that probation officers had no business hooking up released sex offenders to one just to see how they react to pornographic.

In scathing language, the ruling of the U.S. Court of Appeals for the Second Circuit concluded that penile plethysmography testing of sex offenders "is unduly intrusive and bears insufficient relation to correctional or medical treatment, the protection of the public, or deterrence of crime, and that the district court’s decision to impose this condition was an abuse of discretion."

According to court filings, David Mclaurin was convicted of producing child pornography after taking a picture of his 13-year-old daughter with her chest exposed. He was required to register his address as a federally-convicted sex offender. He missed a registration and was sentenced to 15 months in prison and five years of probation. As a condition of his release, McLaurin was required to participate in sex offender evaluation and treatment. Erection-testing was done at the direction of the probation officer.

Penile plethysmography is a procedure that lasts two to three hours and involves placing 13 a pressure-sensitive device around a man’s penis, presenting him with an array of sexually stimulating images, and determining his level of sexual attraction by measuring minute changes in his erectile responses, Judges Guido Calabresi, José A. Cabranes and Barrington D. Parker noted in the ruling.

"The Government is unable to say, except with vague generalities, how the use of the device amounts to 'treatment,'" the judges wrote. "In other words, the Government has made no showing that this exceedingly intrusive procedure has any therapeutic benefit, and none is apparent to us." The judges concluded that probation officials and the state could not explain how testing led to lower rates of recidivism or helped identify would-be offenders. And the testing could not be used to mete out additional punishment, were a subject somehow to fail the exam, because sentences had already been served.

"In any event, we also find it odd that, to deter a person from committing 20 sexual crimes, the Government would use a procedure designed to arouse and excite a person with depictions of sexual conduct closely related to the sexual crime of conviction," the judges noted in considering deterrence as a justification for the use of the testing.

Describing the procedure as having no compelling state interest, the ruling said that "A person, even if convicted of a crime, retains his humanity."