Hi Jesper,
thank you for answering. Maybe
I left too many details in the explanation.
I previously recorded
the ASL data to the T1 space with spmregister, then I inverted the matrix and I applied the transformation
from T1 to ASL space with flirt.
Than I used these for
registration in MNI.
These are the previous registrations:
spmregister --mov "$pcasl"_mc_mean_2mm.nii.gz --reg ASL_lin_T1.dat
--fsvol "$dirBC"/"$subj"/"$subj"_orig-2mm_BC.nii.gz
convert_xfm -omat T1_lin_ASL.mat -inverse ASL_lin_T1.mat
flirt -noresample -in "$FreeSurferDir"/"$subj"/mri/brainmask_masked-2mm.nii.gz -ref "$pcasl"_mc_mean_BET_2mm.nii.gz -applyxfm -init T1_lin_ASL.mat -out brain_lin_ASL.nii.gz # porto immagine maschera cervello in ASL
flirt -noresample -in "$dirBC"/"$subj"/PET/SUVR_2mm-processing/"$subj"_orig-2mm_BC.nii.gz -ref "$pcasl"_mc_mean_BET_2mm.nii.gz -applyxfm -init T1_lin_ASL.mat -out T1_lin_ASL.nii.gz
I hope I have been clearer now,
thank you
Dear Stefano,
>
> I'm applying the same code to different patients and for some the registration with fnirt fails.
> I'm running these lines:
>
> flirt -noresample -searchrx -120 120 -searchry -120 120 -searchrz -120 120 -in brain_lin_ASL.nii.gz -ref "$mniref"/MNI152_T1_2mm_brain.nii.gz -out brain_lin_ASL_lin_MNI.nii.gz -omat brain_lin_ASL_lin_MNI.mat -dof 12
>
> fnirt --ref="$mniref"/MNI152_T1_2mm_brain.nii.gz --in=T1_lin_ASL.nii.gz --aff=brain_lin_ASL_lin_MNI.mat --config=T1_2_MNI152_2mm.cnf --fout=T1_lin_ASL_nl_MNI.mat --iout=T1_lin_ASL_nl_MNI.nii.gz
>
> during the fnirt running there are warning/warnings like this:
>
> Warning, Jacobian not within prescribed range. Prescription is 0.01 -- 100 and obtained range is -12.5089 -- 85.4155
>
> in the end the image obtained from the registration is totally unrecognizable, while there gistration with flirt seems to be successful.
hmm, am I right in thinking you are attempting non-linearly register ASL-EPI data directly to the MNI152_T1_2mm_brain.nii.gz template? If so, I would not expect it to ever work. FNIRT can only be used to register like-with-like. i.e. T1->T1, ASL-ASL etc.
If I am wrong in thinking that, please let me know.
Jesper
>
> I hope you can solve my problem,
>
> Thank you in advance.
>
> Stefano