Chloe Moretz is set to replace Dakota Fanning as the star of the indie movie “Brain on Fire,” which is being produced by Charlize Theron, an individual familiar with the project has told TheWrap.

Thomas Mann (“Me and Earl and the Dying Girl”) and Will Poulter (“We’re the Millers”) are attached to play the male leads. Fanning was forced to exit the project due to scheduling issues, according to an insider.

Gerard Barrett is set to direct the adaptation of Susannah Cahalan’s bestselling memoir, which chronicles a young woman’s sudden descent into madness following a mystery illness.

Also Read: Charlize Theron Thriller 'Dark Places' Debuts on DirecTV 7 Weeks Ahead of Theaters (Video)

Foundation Features is financing and producing “Brain on Fire,” which is also being produced by Theron’s company Denver and Delilah Productions.

Moretz and Theron recently worked together on the thriller “Dark Places,” which is now available on DirecTV in advance of its Aug. 7 release via A24.

Moretz recently co-starred opposite Denzel Washington in “The Equalizer” and she’ll soon be seen in Sony’s YA movie “The 5th Wave.” She’s represented by WME, 3 Arts Entertainment and Jackoway Tyerman.