You could try the following:
3dSkullStrip to remove the skull from the volume (if not already done), producing dataset askull+orig (say)
Make a connected binary mask with
3dAutomask -prefix A0 askull+orig
Pick out voxels which are in the binary mask and at least one of whose neighbors is NOT in the mask:
3dcalc -a A0+orig -b a+i -c a-i -d a+j -e a-j -f a+k -g a-k -expr 'ispositive(a)*amongst(0,b,c,d,e,f,g)' -prefix AB
The AB+orig dataset may be of use to you as a mask of the edge voxels.
Also, it annoys me a little that you are posting anonymously. Is there a reason?