Frame of Mind was a play written and directed by USS Enterprise-D chief medical officer Beverly Crusher. Her theater troupe performed the play in 2369, with Enterprise-D first officer Will Riker in the lead role. Set in a single hospital room, the play dealt with a man accused (possibly falsely) of murder struggling to maintain his sanity after being placed in an abusive mental hospital. Data played the psychiatrist who attempted to break Riker's character's spirits.
When Riker was abducted and subjected to psychological abuse by Ferrone while on planet Tilonus IV, events in his unconscious mind revolved around Frame of Mind, and he found himself shifting between his life on the Enterprise-D and acting in the play to being the actual character in the play. Counselor Troi later believed that his mind used the play and recent elements from his real life in order to keep him sane.