That document is several years old, but it can be more easily done using the later suggestions at the end of the document, namely using 3dAutomask to generate a mask for the brain or the newer program, 3dSkullstrip. Using the automask in a 3dcalc command, you can mask the dataset. There's an example of the 3dcalc command to use on that page.