External Email - Use Caution Hi Antonin and Bruce,
thanks for your great suggestions and the headsup on the command line history in the file. I tried both methods and they both work. We will definitely remove the IDs, so this is very helpful. All the best, Tim -- Dr. Tim Schäfer Postdoc Computational Neuroimaging Department of Child and Adolescent Psychiatry, Psychosomatics and Psychotherapy University Hospital Frankfurt, Goethe University Frankfurt am Main, Germany > On January 21, 2020 at 11:02 PM Bruce Fischl <fis...@nmr.mgh.harvard.edu> > wrote: > > > Hi Antonin and Tim > > you should be able to do: > setenv FS_SKIP_TAGS 1 > mri_convert vol_with_tags.mgz vol_without_tags.mgz > > and verify it worked with mri_info > > cheers > Bruce > > On Tue, 21 Jan 2020, Antonin Skoch wrote: > > > > > External Email - Use Caution > > > > Hi, Tim, > > the subject ID can be also contained in the commandline history which is sto > > red in .mgz files. This can be viewed using > > mri_info file.mgz --cmds > > I am not aware of any direct command which can strip out this info, but you > > surely could convert .mgz file to .nii and then (using path which does not c > > ontain subject ID) convert back to .mgz, if needed. > > Antonin > > Hi Doug, > > > > thanks for the mri_add_xform_to_header idea, I didn't know about that option > > ! > > > > Best, > > > > Tim > > > > > On January 21, 2020 at 4:24 PM "Greve, Douglas N.,Ph.D." > > > <dgr...@mgh.harvard.edu> wrote: > > > > > > > > > > > > For the mgz volumes, you should be able to do something like > > > mri_add_xform_to_header -c /new/path/to/xfm brain.mgz > > > > > > For the labels you could just use something like > > > sed s/oldsubjectname/newsubjectname > > > > > > > > > > > > > > > On 1/17/2020 3:48 AM, Tim Schäfer wrote: > > > > External Email - Use Caution > > > > > > > > Hi Douglas, > > > > > > > > sure, you can get two example files here: > > > > > > > > wget http://rcmd.org/tmp/brain.mgz > > > > wget http://rcmd.org/tmp/lh.BA1_exvivo.label > > > > > > > > The brain volume contains the ID because it stores the full path to the > > > > tairach xfm (which includes the folder name, so the ID). You can check b > > y: > > > > > > > > mri_info brain.mgz | grep talair > > > > > > > > (In this case the ID is 'tim'). > > > > > > > > Without mri_info, you can get it as well: > > > > > > > > mv brain.mgz brain.gz > > > > gunzip -c brain.gz | strings | grep talair > > > > > > > > The second file is an ASCII label from the same subject. You can get the > > ID > > > > by running: > > > > > > > > head -n 1 lh.BA1_exvivo.label > > > > > > > > There are some other files which contain the ID, these are just 2 exampl > > es. > > > > > > > > > > > > I am currently in contact with the people running the consortium server > > and > > > > I am not really sure whether the rule that the ID must not be in the fil > > es > > > > makes any sense at all. Maybe I can get around this. > > > > > > > > > > > > Best, > > > > > > > > Tim > > > > > > > > > > > > > > > > > > > >> On January 17, 2020 at 12:23 AM "Greve, Douglas N.,Ph.D." > > > >> <dgr...@mgh.harvard.edu> wrote: > > > >> > > > >> > > > >> Hi Tim, can you send a list of files that have the identifier. For > > > >> volumes and surfaces, it might be as easy as running > > > >> mri_convert/mris_convert using the same file as input and output. > > > >> > > > >> On 1/13/2020 5:54 AM, Tim Schäfer wrote: > > > >>> External Email - Use Caution > > > >>> > > > >>> Dear FreeSurfer experts, > > > >>> > > > >>> > > > >>> I have two questions on subject IDs in FreeSurfer output. > > > >>> > > > >>> 1) is it possible to change to subject identifier in the FreeSurfer > > > >>> output after recon-all has been run? > > > >>> > > > >>> Background: I would like to upload data pre-processed with FreeSurfer > > to > > > >>> a consortium server. The subject ID is a random identifier, but the > > > >>> upload guidelines say this identifier must only occur in certain file > > > >>> types (Excel files, .log files, and some more, but not in any other > > > >>> files). > > > >>> > > > >>> I noticed that a lot of the output files produced by FreeSurfer contai > > n > > > >>> the subject identifier somewhere, including various binary files, so I > > > > > >>> guess there is no easy way to change it. But maybe there is? Like > > > >>> rerunning a part of recon-all? > > > >>> > > > >>> > > > >>> > > > >>> 2) If not, I could rename the source NIFTI files (e.g., from the > > > >>> identifiers to something like 'subject001', 'subject002', ...) and > > > >>> re-process everything. This would take some computational time for the > > > > > > >>> 500 subjects, but it would be okay I guess. > > > >>> > > > >>> But a large number of the subjects have manual edits applied already. > > Is > > > >>> there a way to keep the manual edits? E.g., I thought maybe I could > > > >>> rename the individual directories of the edited subjects, leave the > > > >>> edited files in there, and run recon-all again. But what would happen? > > > > > >>> Will the new output files have the renamed ID from the directory name > > > >>> (and thus the recon-all command line), or will they still use the old > > ID > > > >>> (from the header of the existing files)? Or will the existing, edited > > > >>> files which contain a different ID be ignored during the new run becau > > se > > > >>> the IDs do not match, and thus the existing edits would have no effect > > ? > > > >>> > > > >>> > > > >>> All the best, > > > >>> > > > >>> Tim > > > >>> > > > >>> -- > > > >>> Dr. Tim Schäfer > > > >>> Postdoc Computational Neuroimaging > > > >>> Department of Child and Adolescent Psychiatry, Psychosomatics and > > > >>> Psychotherapy > > > >>> University Hospital Frankfurt, Goethe University Frankfurt am Main, > > > >>> Germany > > > >>> > > > >>> _______________________________________________ > > > >>> Freesurfer mailing list > > > >>> Freesurfer@nmr.mgh.harvard.edu > > > >>> https://mail.nmr.mgh.harvard.edu/mailman/listinfo/freesurfer > > > >> > > > >> _______________________________________________ > > > >> Freesurfer mailing list > > > >> Freesurfer@nmr.mgh.harvard.edu > > > >> https://mail.nmr.mgh.harvard.edu/mailman/listinfo/freesurfer > > > > > > > > > _______________________________________________ > > > Freesurfer mailing list > > > Freesurfer@nmr.mgh.harvard.edu > > > https://mail.nmr.mgh.harvard.edu/mailman/listinfo/freesurfer > > > > -- > > Dr. Tim Schäfer > > Postdoc Computational Neuroimaging > > Department of Child and Adolescent Psychiatry, Psychosomatics and Psychother > > apy > > University Hospital Frankfurt, Goethe University Frankfurt am Main, Germany > > > >_______________________________________________ > Freesurfer mailing list > Freesurfer@nmr.mgh.harvard.edu > https://mail.nmr.mgh.harvard.edu/mailman/listinfo/freesurfer _______________________________________________ Freesurfer mailing list Freesurfer@nmr.mgh.harvard.edu https://mail.nmr.mgh.harvard.edu/mailman/listinfo/freesurfer