Dear Clemens,

I now see where is the problem:

The current implementation of recon-all -talairach step is quite complicated, as far as I understand:

The -talairach registration step produces talairach.auto.xfm. If the talairach.xfm exists, it is not overwritten by talairach.auto.xfm (unless -clean-tal is specified on the command line). For further recon-all processing steps the talairach.xfm is used. It assures that when talairach.xfm is edited (for example by tkregister2), the edits are not overwritten, but only IN THIS VERY STEP.

Further step is talairach failure detection, which uses talariach.xfm. When the failure detection passes, everything is ok and recon-all proceeds further (using talairach.xfm). However, when the failure detection indicates failure, the current implementation is to use alternative talairach registration procedures - first it is trying to align to 3T-based atlas and if it also fails, it is trying to use MINC mritotal tool. And here comes the problem: In both these steps the talairach.xfm is by default OVERWRITTEN by talairach.auto.xfm. This has consequence, that when user is modyfying talairach.xfm (i.e. by tkregister2) and this modified talairach.xfm also do not pass failure detection, it is OVERWRITTEN as indicates following lines in your recon-all.log code:
cp transforms/talairach.auto.xfm transforms/talairach.xfm 
I personally think that this is not very optimal behaviour and it deserves modification of the recon-all code by developers.

So the remedy for your case would be:

either
try to align better your data in tkregister2, and rerun trecon-all -s subj_id -all until you pass talairach failure detection of your customized talairach.xfm. If the talairach check failed and your talairach.xfm is overwritten, you will find it in the subdirectory transforms-bak.

or
after tkregister2, rerun your data by adding -notal-check to your recon-all:
recon-all -s subj_id -all -notal-check

Antonin





Dear Antonin

Yes, that is the directory where - after failed recon-all - I opened, manually registered, then saved the talairach.xfm file. Before I re-ran recon-all, I reopened the modified talairach.xfm file with  tkregister2 to verify that it was my manual registration, which was true.

I attached the recon-all log and error files and the talairach and talairach-avi log file.

Version: freesurfer-Darwin-OSX-stable-pub-v6.0.0-2beb96c

Clemens


-----freesurfer-bounces@nmr.mgh.harvard.edu schrieb: -----
An: freesurfer@nmr.mgh.harvard.edu
Von: Antonin Skoch
Gesendet von: freesurfer-bounces@nmr.mgh.harvard.edu
Datum: 16.08.2017 12:23
Betreff: Re: [Freesurfer] Antwort: Re: use manually defined talairach.xfm

Dear Clemens,

I am almost out of ideas, since the behaviour is contrary to my expectations.

I would expect that if you run your recon by

recon-all -s subject_id -all

the files you named

before_recon-all_talairach.xfm and after_recon-all_alairach.xfm

should be identical.

Could you assure that after tkregister2, you saved the transform file under name talairach.xfm and put into directory

/Volumes/PromisePegasus/HippocampusPreparedT1Data/subjects/x140214_b02_0917040_3_1_wipmp2rage0p8mmsenseV42_reOrient/mri/transforms ?
What freeSurfer version are you using? Could you post full recon-all output?


Antonin



Hi Antonin

Thank you for your reply.
Here is what I did:
1.      tkregister2 --mgz --s 
x140214_b02_0917040_3_1_wipmp2rage0p8mmsenseV42_reOrient --fstal
2.      manual registration (see attached file “before_recon-all_talairach.xfm”)
3.      re-run recon-all, which is:     recon-all -s 
x140214_b02_0917040_3_1_wipmp2rage0p8mmsenseV42_reOrient -all 
-hippocampal-subfields-T1

This resulted in the following error message:
#@# Talairach Failure Detection Wed Aug 16 08:53:15 CEST 2017
/Volumes/PromisePegasus/HippocampusPreparedT1Data/subjects/x140214_b02_0917040_3_1_wipmp2rage0p8mmsenseV42_reOrient/mri
\n talairach_afd -T 0.005 -xfm transforms/talairach.xfm \n
ERROR: talairach_afd: Talairach Transform: transforms/talairach.xfm 
***FAILED*** (p=0.0622, pval=0.0034 < threshold=0.0050)
\nManual Talairach alignment may be necessary, or
include the -notal-check flag to skip this test,
making sure the -notal-check flag follows -all
or -autorecon1 in the command string.
See:\n
http://surfer.nmr.mgh.harvard.edu/fswiki/FsTutorial/Talairach

\nERROR: Talairach failed!\n


The file that I now find in the “transforms” folder is attached 
(“after_recon-all_talairach.xfm”).

I also attached the two talairach.auto.xfm but I didn’t modify these at any 
point.
(Should I? If so, how do I?)

Clemens


-----freesurfer-boun...@nmr.mgh.harvard.edu schrieb: -----
An: freesurfer@nmr.mgh.harvard.edu
Von: Antonin Skoch 
Gesendet von: freesurfer-boun...@nmr.mgh.harvard.edu
Datum: 15.08.2017 16:46
Betreff: Re: [Freesurfer] use manually defined talairach.xfm

Dear Clemens,

this is very strange, since the talairach.xfm is not by default overwritten in 
recon-all (unless you specified -clean-tal to recon-all).

When you rerun your recon-all after modifying talairach.xfm, your automatic 
talairach registration will be saved into talairach.auto.xfm, therefore 
talairach.auto.xfm and talairach.xfm will be different (without editing they 
will be identical).

See the excerpt of the recon-all -help:

Talairach (-<no>talairach)

This computes the affine transform from the orig volume to the MNI305
atlas using Avi Snyders 4dfp suite of image registration tools,
through a FreeSurfer script called talairach_avi. Several of the downstream
programs use talairach coordinates as seed points. You can/should check
how good the talairach registration is using
"tkregister2 --s subjid --fstal-avi". You must have an "fsaverage" subject in
your SUBJECTS_DIR. tkregister2 allows you to compare the orig volume
against the talairach volume resampled into the orig space. If you modify
the registration, it will change the talairach.xfm file. Your edits will
be *not* be overwritten unless you run recon-all specifying -clean-tal.
Run "tkregister2 --help" for more information.
Creates the files mri/transform/talairach.auto.xfm and talairach.xfm.
The flag -tal-check will check the registration against known-good transforms.
Adding the flag -use-mritotal after -talairach will use the MINC program
mritotal (see Collins, et al., 1994) to perform the transform.

Can you check that your edited talairach.xfm is indeed modified to default 
after recon-all rerun? Do the talairach.xfm and talairach.auto.xfm differ?

Antonin




Hi I got a Talairach Failure Detection Error and therefore did manual registration using tkregister2 following the advice at: https://surfer.nmr.mgh.harvard.edu/fswiki/FsTutorial/Talairach_freeviewAgain following the advice on the site, I re-ran recon-all just to run into the identical error. When I checked talairach.xfm it was the same as BEFORE I did manual registration in tkregister2. The above site states: Because the talairach transformation affects everything in the stream it is necessary to rerun the whole process using your new talairach, which is a default. However, it seems this is not the default since recon-all comes up with its own talairach.xfm and overwrites my manual version, after which recon-all fails. How can I make recon-all use my manual registration?