Closed szan0808 closed 2 weeks ago
Can you provide a complete collection of commands you have used, and examples of the inputs, outputs and clearly indicate what you thing is insufficient about the results.
antsMultivariateTemplateConstruction2.sh
will write scripts called job_X_X.sh
that contain the exact call to antsRegistration
.
Can you provide a complete collection of commands you have used, and examples of the inputs, outputs and clearly indicate what you thing is insufficient about the results.
Sure. I'll just show T1w images, but the template was construced using T1w, T2w, FA and MD.
1) This is the T1w template:
2) This is the sharpened T1w I produced using this filter hoping to improve the performance (I did the same for T2w, FA and MD):
3) This is the subject's T1w warped to template as retured by antsMultivariateTemplateConstruction2.sh
:
4) This is the subject's T1w warped to template using the unmodified template images and this command:
antsRegistrationSyN.sh -d 3 -o $pjdir/$line/T1w/${line}_T1w_brain_reg \ -f ${template_directory}/T1w.nii.gz -m $sbjdir/T1w_brain.nii.gz \ -f ${template_directory}/T2w.nii.gz -m $sjdir/T2w_brain.nii.gz \ -f ${template_directory}/FA.nii.gz -m $sjdir/fa.nii.gz \ -f ${template_directory}/MD.nii.gz -m $sjdir/adc.nii.gz \
5) This is the subject's T1w warped to template using the unmodified template images and the command saved in the job_X_X.sh
script, as suggested by @cookpa in his comment:
Here I would have expected to get the same as 3), and that is pretty much the point I am trying to discuss here. Is there something else going on in
antsMultivariateTemplateConstruction2.sh
before the command stored in job_X_X.sh
is executed (here is why I later attempted the sharpening)?
6) This is the subject's T1w warped to template using the sharpened template images and using a command like the one used in 4):
The other attempts using normalised subject's images didn't help with matching 3) either.
To answer you, @gdevenyi , there is a noticeable difference in the cortical areas and that's where my attention will go for the next steps of my processing. The warped images retured by antsMultivariateTemplateConstruction2.sh
seem the most accurate and I would like to replicate that before extending the processing to subjects outside the population used to construct the template.
Thanks again, Simone
The only pre-processing that should happen in the template script is N4BiasFieldCorrection, which is done if the -n
argument is 0 or unspecified. If N4 is run, it should appear in your job*.sh
files.
It's hard to gauge from screen caps how different the results are. There will be some run-to-run variability because of random sampling in the affine stage. Also, your output from the template script is registered to the previous template - after each set of pairwise registrations, the template is updated. After the last run, the final template is generated, so the registrations are out of date. However, you can find template (n - 1) under the intermediateTemplates/
directory. Registering the template input images (using the command precisely as written in job.sh) will be the closest you can get to doing the same thing.
Sharpening is done on the template, not the individual images, so that's not it. Dividing the images by their mean is done during averaging after registration.
Also, your output from the template script is registered to the previous template - after each set of pairwise registrations, the template is updated. After the last run, the final template is generated, so the registrations are out of date. However, you can find template (n - 1) under the intermediateTemplates/ directory.
I think this is where the unexpected difference arises.
The only pre-processing that should happen in the template script is N4BiasFieldCorrection, which is done if the
-n
argument is 0 or unspecified. If N4 is run, it should appear in yourjob*.sh
files.
I noticed that, as the images were labelled as "Repaired", but the dataset I'm using is already preprocessed, so I left it out for now. I might include it, just in case.
Also, your output from the template script is registered to the previous template - after each set of pairwise registrations, the template is updated. After the last run, the final template is generated, so the registrations are out of date. However, you can find template (n - 1) under the
intermediateTemplates/
directory. Registering the template input images (using the command precisely as written in job.sh) will be the closest you can get to doing the same thing.
As @gdevenyi pointed out, sounds like this could be the clarification I was after. I'll just run a quick test using the (n-1) template. That would not be relevant when working with subjects outside the template population, but it will be hopefully a good way to confirm that this is what causes these differences.
Sharpening is done on the template, not the individual images, so that's not it. Dividing the images by their mean is done during averaging after registration.
I confirm I only sharpened the template's images (T1w, T2w, FA, MD). That step makes sense to me, although it didn't have much effect on the final result, as the template images would generally be smoother that the subjects'.
Thanks you both for clarifying. I'll run some more tests and I'll report here the results.
Dear experts and developers,
I am dealing with a template that was generated with HCP subjects with the
antsMultivariateTemplateConstruction2.sh
script. So, I started using those template images (T1w, T2w, FA, MD) as fixed images and correspondent subject's images as moving images for theantsRegistrationSyN.sh
script. I felt like the results were sub-optimal and, surprisingly enough, I found out that the subject I was trying to register to the template belongs to the population that was used to construct the template. So, I compared the subject warped to template returned byantsMultivariateTemplateConstruction2.sh
to the subject I registered to the template withantsRegistrationSyN.sh
and they look significantly different.After making sure that the preprocessing of the images used for the template construction and my subject were exactly the same, I made some attempts to hopefully improve the registration result:
antsMultivariateTemplateConstruction2.sh
are normalised by their mean, so I did the same for my subjectantsRegistrationSyN.sh
using a Laplace approachUnfortunately I haven't had success, so far.
Is there anything I am missing? Next step for me would be to match the parameters set of the
antsRegistration
call made withinantsMultivariateTemplateConstruction2.sh
, but I feel like I am maybe missing some other fundamental steps.The aim of all this is to replicate the registration made within
antsMultivariateTemplateConstruction2.sh
and use the same approach to register any subject to a template. Could I get some information on how the template/subject registration is performed withinantsMultivariateTemplateConstruction2.sh
?Thanks, Simone