-
-
Notifications
You must be signed in to change notification settings - Fork 381
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
The basic principles in template construction #520
Comments
There are no A <--> B, B <--> C registrations. Your initial conceptualization is correct except you left out the shape update step. So it goes Initialization: Average all images to create an initial template
|
@ntustison : Nick, based on my understanding from your explanation of the template building process, it seems that all the input images should be approximately aligned to create a plausible initial average image. If there is any translation/rotation offsets between the input images, should we rigidly co-register all the input images before we start the template building process? |
Look at the |
Thank you. |
@ntustison |
Neither |
Thanks for your reply! @ntustison
My data are FA images derived from DTI, like
Step1-2: Apply Transforms
Step1-3: Create initial template
Step2: Procedures 1 to 4 of your suggestion
Step2-1: Register all images to the initial template
Step2-2: Average all warped images to create a new template.
Step2-3: Average all the transforms from 1 to create a single transform.
Step2-4: Apply the transform from 3 to warp the template towards the true mean shape.
The errors occured in the Step2-4, and the script can't run.
, I modify the shape of |
The protocol for template construction is contained in the scripts. You don't need to attempt to reproduce the steps on your own. |
@ntustison The reason why I reproduced the steps is that I want to construct the DTI template with these separated steps, since The next question is that how to use ANTs scripts to act shape-correction of template.
i.e Take the old template as the reference image and the new template as the input image with Best! |
That's basically the procedure as you've outlined above (although you need to make sure you average the linear part as well). I would encourage you to look at the code in the antsMultivariateTemplateConstruction.sh scripts as that describes exactly what is done. |
Hi, may I please know with what commands did you fix the error in your Step2-4, also if I may know the correct call for the step for the sharpening filter. would be very grateful if someone can help. |
Sharpening is performed in the averaging call. |
Thank you Sir for the prompt response, for my project your assistance would be worthwhile. |
@ntustison Can you please help me here? |
@mairadee Please provide more information. Simply stating that a failure occurs with a particular program isn't very helpful. Before further discussion, however, is there a particular reason why you're trying to reproduce the steps of template building instead of simply using the script directly? |
@ntustison I've attached the input files of the subject with 4 timepoints and even if I run the script with following options simluc841F_T1W3D_mri.nii.gz The template output is as follows but the script ends witht e following message Exception caught: Using single precision for computations. shapeupdatetotemplate---voxel-wise averaging of the warped images to the current template
|
I ran another call for the same set of files as following: **antsMultivariateTemplateConstruction2.sh -d 4 -i 4 -k 1 -f 6x4x2x1 -s 3x2x1x0vox -q 100x100x70x20 -t SyN -m CC -c 0 -o MY2 T1W3D but still get the same message. |
Why are you using |
-d: ImageDimension: 2 or 3 (for 2 or 3 dimensional registration of single volume) |
These are not time-series data. You should use |
A call as simple as this Exception caught: Using single precision for computations. shapeupdatetotemplate---voxel-wise averaging of the warped images to the current template
|
https://github.com/ntustison/TemplateBuildingExample
Please verify you can run the above examples. If you can , then you may be
able to diagnose the problem yourself by comparing the examples to your own
failing case.
On Fri, Sep 13, 2019 at 11:34 AM MInderyas ***@***.***> wrote:
A call as simple as this
**antsMultivariateTemplateConstruction2.sh -d 3 -r 1 -b 1 -c 0 -k 1 -o
example_T1W *_T1W3D_mri* **
would also produce a message similar at the end of the script. though I do
get 4 Repaired, 4 metriclog.txt and 4 job_0.sh, and a Template, but its
supposed to end successfully, right?
Exception caught:
itk::ExceptionObject (0x3c05c50)
Location: "unknown"
File:
/home/ec2-user/ants-binaries/ITKv4-install/include/ITK-4.7/itkImageToImageFilter.hxx
Line: 248
Description: itk::ERROR: ImageToImageFilter(0x3bc06b0): Inputs do not
occupy the same physical space!
InputImage Origin: [-1.3003742e+02, 1.6185423e+02, -6.4711087e+01],
InputImage_1 Origin: [-1.3003741e+02, 1.6185423e+02, -6.4711090e+01]
Tolerance: 2.0000000e-06
Using single precision for computations.
Input scalar image:
./example_T1Wtemplate0simluc844F_T1W3D_mriRepaired.nii.gz
Reference image: example_T1Wtemplate0.nii.gz
Transform file does not exist:
./example_T1Wsimluc844F_T1W3D_mri30GenericAffine.mat
Can't read initial transform
./example_T1Wsimluc844F_T1W3D_mri30GenericAffine.mat
ls: cannot access example_T1W
*Warp.nii.gz: No such file or directory ls: cannot access example_T1W*GenericAffine.mat:
No such file or directory
shapeupdatetotemplate()
------------------------------
shapeupdatetotemplate---voxel-wise averaging of the warped images to the
current template
Wed Sep 13 13:57:57 CEST 2019
ls: cannot access example_T1Wtemplate0*WarpedToTemplate.nii.gz: No such
file or directory
ERROR shapeupdatedtotemplate - imagelist length is 0
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#520?email_source=notifications&email_token=AACPE7VSTEYDJ7B3XT2BMZTQJOXKDA5CNFSM4EDEOOUKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD6VMNDA#issuecomment-531285644>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AACPE7UOBMF3LTA77V32ILDQJOXKDANCNFSM4EDEOOUA>
.
--
brian
|
Hi again, thankyou very much for the prompt responses. I tried with the following call from one of the examples: ** buildtemplateparallel.sh -d 3 -o try_ -i 4 -g 0.2 -j 1 -c 0 -m 100x70x50x10 -n 1 -r 1 -s CC -t RI T1W3D ** User Linear interpolation itk::ImageFileReaderException (0x2dfc640) shapeupdatetotemplate 6/usr/local/ANTS/bin/buildtemplateparallel.sh: line 347: 21061 Segmentation fault (core dumped) ${ANTSPATH}/MeasureMinMaxMean ${dim} ${templatename}warp.nii.gz ${templatename}warplog.txt 1 Backing up results from iteration 4cp: cannot stat `try_templatewarp*log.txt': No such file or directory Done creating: try_template.nii.gz |
Did you actually try running one of the examples? If not, please do that first before trying with your data. |
Hello Nick, I also have a template-related question. Basically, my approach is to create a initial custom template with (ANTSMultivariate) using a subset (20%) of T1w control brains, then warp the rest of the T1w brains (control, patients) to the initial custom template, average this custom template and affine transform it to the MNI 1mm template. My aim is to have a study specific template in the MNI 1mm template space. Based on your expertise, could you please comment whether this approach is logical? Many thanks! |
Hi @karthikc777 , For many of our studies, we would do something similar where we create a template from a subset of the cohort of interest. Generally, we see convergence with a random sampling of 10-20 brains but typically go beyond this number if the cohort allows it just to play it on the safe side. We don't typically do the extra step of modifying the template with the remaining cohort because a) it's not going to improve the shape or intensity but, also, b) the template building process includes an intensity sharpening which will be negated somewhat if you do the follow up normalization + intensity averaging. Practically it probably won't make much difference but it's not something we do. Finally, we don't typically use the MNI template as everything gets reported in the cohort-specific template space so there's no need to add the additional complexity of normalization to MNI. However, because MNI use is so prevalent, many of our collaborators feel the need to include this step. Therefore, we'll do a final deformable normalization to MNI. We don't limit registration to affine due to the shape differences that are usually apparent between MNI and the cohort-specific template. Nick |
Thanks for the quick and detailed reply :) Best regards, |
Thank you @ntustison for the support, we have asked our systems operator to check for the update of ANTS library and for ITK tool. I will try with you data and will contact you again for any queries. Thanks again. |
Hi, what is the general logic of ANTs template construction process? I used to think that template construction is a process of "averaging-registration-iteration". For example, there are three brain images (A, B, C) and I could make a template out of the three images. So I average A/B/C to get a mean image, and then register A/B/C to mean image to get A1/B1/C1. A1/B1/C1 are again averaged to update the mean image. This process is iterated several times until the mean image converges.
But I think ANTs' process is different because I guess there are pairwise registration (i.e. A->B, B->C) from naming conventions. It is difficult for me to understand the underlying mathematics but I try my best to have a simplified and coarse understanding of this process.
Many thanks!
The text was updated successfully, but these errors were encountered: