Requiring a sex offender to submit to a penile plethysmograph as a condition of his supervised release from prison is a violation of due process, the U.S. Court of Appeals for the Second Circuit held Thursday.

The court said that forcing a person to take a plethysmograph examination, whereby a gauge is attached to the penis to measure an individual’s response to sexually stimulating images, is an “extraordinarily invasive condition,” that “is not reasonably related to the statutory goals of sentencing.”