How can I remove a subject's name from an image file?
Up to table of contentsQ78. How can I remove a subject's name from an image file?
If you plan to distribute scanner-derived image files, you probably should remove the subject's name from the file headers. To find out if the name is in the files, try something like this:
strings 347-2-99.ima | moreHere, strings is a standard Unix command that will print legible ASCII strings from the input file, and 347-2-99.ima is a sample image file name. Here is some of the output from this sample:
SIEMENS MGH-NMR Center ekit5mrc Cox MAGNETOM Allegra 808c3e52 VC Robert Cox 051Y K1.3.12.2.1107.5.2.7.20006.20010516081058000In this example, we see that the subject's name (which has been replaced with my name) appears in two different forms: as the whole string "Robert Cox" and as the surname "Cox".
To fix this, the AFNI package program strblast can be used. In this example, we need to run the program twice, in order to remove the two different identifier strings:
strblast 'Robert Cox' 347-2-99.ima strblast 'Cox' 347-2-99.imaHowever, you probably want to do this to many different files. This can be done by using a wildcard to specify the filename:
strblast 'Robert Cox' *.ima strblast 'Cox' *.imaOn some computers (e.g., SGIs), the number of files specified by a wildcard is limited. You may get a warning like "command line too long". Don't panic: strblast can do the wildcard expansion for you. You need to put the filename with the wildcard inside single forward quotes, as in
strblast 'Robert Cox' '*.ima'Do not use double quotes "*.ima" or backward single quotes `*.ima` for this purpose! Also, if there are any blanks or other "special" characters in the target string, it need to be enclosed in single quotes, as in the examples above. (It wasn't necessary to put 'Cox' into single quotes, but it doesn't hurt.)
AFNI .BRIK files contain only the image data from the image files, and so do not contain any of the header strings that might identify a subject. If you put a subject's name into the .HEAD file using the Notes facility, then you can remove it by editing the Note (using the "Dataset Notes" plugin or the 3dNotes program).
Warning: program strblast will overwrite the existing file(s). To make sure it doesn't harm your image files, you should make a copy of one first, play with strblast on it, then see if it is still readable (e.g., using a command like afni -im filename and opening a Sagittal image viewer).
[Answer added 29 Jun 2001]
This FAQ applies to: Any version.