"Shades of Gray" is the twenty-second and final episode of the second season of the American science fiction television series Star Trek: The Next Generation, the 48th episode overall. It was originally broadcast on July 17, 1989, in broadcast syndication. It was the only clip show filmed during the series and was created due to a lack of funds left over from other episodes during the season. Set in the 24th century, the series follows the adventures of the Starfleet crew of the Federation starship Enterprise NCC 1701-D. In this episode, Commander William Riker (Jonathan Frakes) undergoes medical treatment by Dr. Katherine Pulaski (Diana Muldaur) for an alien infection and must relive numerous past events. It was the final episode written by Maurice Hurley, who originated the idea and wrote the first draft of the script, with Hans Beimler and Richard Manning conducting re-writes. It was directed by Rob Bowman and the framework sequences were filmed over the course of three days. It was watched by 9.8 million viewers on the first broadcast, the highest ratings for the series since "Samaritan Snare" two months earlier. "Shades of Gray" is widely regarded as the worst episode of the series, with critics calling it "god-awful" and a "travesty"; even Hurley referred to it negatively. It was the last appearance of Dr. Katherine Pulaski (Diana Muldaur). It is also the final episode to regularly feature the original Type A TNG Starfleet uniforms, which were introduced in Season 1. Plot During a geological survey on Surata IV, Commander William Riker is struck by a thorn growing on a motile vine plant. The away team immediately beams back to the Enterprise, where Dr. Katherine Pulaski finds out that the thorn has released a deadly virus into Riker's body. Within a matter of hours, the virus will reach Riker's brain, killing him. To try to save Riker's life, Pulaski puts him into a machine that will artificially stimulate his brain neurons, keeping them active and resisting the virus. This causes Riker to dream of his past adventures aboard the Enterprise. Riker's first dreams are of reasonably neutral occasions, such as his first meeting with Lieutenant Commander Data. He soon moves on to more passionate and even erotic dreams, such as meeting the cheerful young Edo women on Rubicon III, the matriarch Beata on Angel One, and the computer-generated holodeck woman Minuet (Carolyn McCormick from "11001001"). However,