BUG: Update the baseline image.
Merge branch 'IncSize' of https://github.com/ntustison/ITK into IncSize
ENH: Update caorrect baseline image.
ENH: Update correct baseline image.
BUG: Incorrect size for closed parametric dimension.
PERF: Remove unnecessary computations and parallelize function.
Please post this as an issue over at the ANTs github site.
Please post this as an issue over at the ANTs github repo. We can continue the conversation over there.
V02_to_V01_Using_trans.nii.gz is different than V02_to_V01_Warped.nii.gz How much different?
Please post your questions as an issue over at the ANTs GitHub repo.
The flag needs to precede each transform: --initial-moving-transform $transform1 --initial-moving-transform $transform2 ...
That would be great. On May 21, 2020, at 8:40 AM, Philip Cook cookpa@users.sourceforge.net wrote: I have trouble getting Sourceforge emails consistently. We could set preferred support to Github rather than this forum? Problem when creating FA map after Warping and reorienting a DT image Sent from sourceforge.net because you indicated interest in https://sourceforge.net/p/advants/discussion/840261/ To unsubscribe from further messages, please visit https://sourceforge.net/auth/subscriptions/
Please post this over at the ANTs GitHub site as an issue. SourceForge tends to be not as visible to the developers. Also, if you can, please post the actual data.
Please post this over at the appropriate GitHub forum depending on the package you're using (e.g., ANTsPy or ANTs).
Please post this as an issue over at the ANTsPy github website.
Sorry, I can't make sense of the error log. It looks to be a system-specific issue for which is really difficult to debug using the help forum.
Have you looked at the images?
It sounds like a system-specific issuse which is obviously difficult to debug through a help forum. Know that all the main developers primarily use macs so you should be fine with respect to that issue.
Your second link is incomplete and I don't have permission to read the first link.
Please include the entire error log file. Also, if you're compiling, I would recommend compiling from the latest source.
Do the registration results look correct?
One other difference is I didn't use the mask. I suspect that would be more of a cause than the metric.
Here's what I ran and the results look fine: $ antsRegistrationSyNQuick.sh -d 3 -f DSURQE_40micron_average.nii -m sub-apoe0084_acq-2avg_space-T2w_desc-brain_unbiased.nii -o templatexsub -n 4 $ antsApplyTransforms -d 3 -i DSURQE_40micron_labels.nii -r sub-apoe0084_acq-2avg_space-T2w_desc-brain_unbiased.nii -o sub-apoe0084_acq-2avg_space-T2w_desc-brain_unbiased_labels.nii.gz -n GenericLabel -t [ templatexsub0GenericAffine.mat , 1] -t templatexsub1InverseWarp.nii.gz -v 1
Here's what I ran and the results look fine: $ antsRegistrationSyNQuick.sh -d 3 -f DSURQE_40micron_average.nii -m sub-apoe0084_acq-2avg_space-T2w_desc-brain_unbiased.nii -o templatexsub -n 4 $ antsApplyTransforms -d 3 -i DSURQE_40micron_labels.nii -r sub-apoe0084_acq-2avg_space-T2w_desc-brain_unbiased.nii -o sub-apoe0084_acq-2avg_space-T2w_desc-brain_unbiased_labels.nii.gz -n GenericLabel -t [ templatexsub0GenericAffine.mat , 1] -t templatexsub1InverseWarp.nii.gz -v 1
Are these the inputs to antsRegistrationSyN.sh? If so, that's the first problem. ANTs registration won't correct orientation issues like this. You can try to use antsAI but it might be easier for you to place corresponding landmarks in the two images and use antsLandmarkBasedTransformInitializer to determine an initial transform.
Yeah, the partial FOV would seem to be incorrect and not consistent with the input images or typical ants registration performance. Can you post the data for us to look at?
The command calls appear to be correct. My guess is that the headers are different between $template and /templates/DSURQE_40micron_labels.nii. You can try copying the header information from the former to the latter using CopyImageHeaderInformation.
Instead of trying to run template construction, try to run a single ANTs program, like bias correction. Also, this appears to be a compilation/system issue so you might want to do some google searching in addition to further consultation with your IT support.
ExtractRegionFromImage
What is exactly "PaddingSize"? Is it the amount of added voxels on each size of the image, or the final size after the padding? The former. Also, is there a function to get the size of the image? PrintHeader
There isn't ANTs-specific functionality to handle that data. Although you tried ITK Dicom, you might want to ask over at the ITK discussion forums to see if anybody has a solution.
Cluster system requirements and protocols vary from institution to institution so I really can't provide any direction in that respect. You should ask your cluster administrators who will likely point you to a tutorial or other resources.
% ImageMath | grep PadImage PadImage : If Pad-Number is negative, de-Padding occurs Usage : PadImage ImageIn PaddingSize [PaddingVoxelValue=0]
Okay, well you need to calculate those transforms. Regarding mixing packages---I already provided the requisite caveat but obviously you're welcome to do whatever you want. As far as I know, there's no universal/general solution that works for every case so just proceed with caution and always look at your results.
Okay, do you have the transform from each average image to its corresponding T1?
Okay, hvae you made your average motion corrected image? The code is in one of my previous responses.
Sure. Now you can register each subject's motion corrected data to the template by concatenating the transforms that go from the the average EPI sequence through the corresponding T1-w image to the template.
Try ResampleImage.
You might first want to see if your data is affected. Try looking at the registered images in both ITK-SNAP and fsleyes.
You have to be careful about mixing toolkits. There's a well-known difference in how FSL treats the header information vs. ITK/ANTs which dictates the image orientation in physical space. You can read more about it here.
Okay, so now you want to compute the transformations from your 4-D EPI sequences to your structural data. Typically, we'll do a motion correction of that sequence using antsMotionCorr. $ antsMotionCorr -d 3 -a ${input4dEpi} -o ${averageEpi} $ antsMotionCorr -d 3 -m MI[${averageEpi},${input4dEpi},1,32,0.1] -t Rigid[0.2] -i 500x100x50x0 -s 3x2x1x0 -f 5x4x2x1 -o [${outputPrefix},${outputPrefix}Warped.nii.gz] -v 1 Note that these is simply one set of parameters which might not be optimal for your sequence...
Okay, those landmarks look better but you also need to check your bspline landmarks. Run this antsLandmarkBasedTransformInitializer 3 \ $landmarks_human \ $landmarks_macaque \ bspline \ $bspline_init and take a look at the resulting displacement field. An easy way to do this is in ITK-SNAP: Layer inspector --> General --> Display mode: Deformation Grid Display. You definitely have some mismatched landmarks. Also, instead of antsRegistrationSyN.sh use antsRegistrationSyNQuick.sh. You'll get much quicker...
Okay, when I debug normalization issues, I think it's best to look at the results after each step. If we take a look at the results after the first landmark initialization, it's clear that something is off with one or more of your landmark pairs. Take a look at the attached screenshot which shows the registered $macaque_template in the space of the $human_template. Specifically, you can do antsApplyTransforms -d 3 -v 1 \ -i $macaque_template \ -r $human_template \ -o test.nii.gz \ -n linear \ -t...
It can handle 3-D images. It's just that your images are atypical, probably incorrect, and that is probably why the program segfaults.
Great. Did you do that for all your subjects?
Okay, the first thing to do is delete all those files except for template0.nii.gz. The subject-specific files are not optimal (outdated) and the other template* files are not useful. Once you do that you can continue with your processing: Let's start with registering each subject to the template. First try: $ antsRegistrationSyNQuick.sh -d 3 -f $template -m $subjectT1 -o $outputPrefix -n ${numberOfThreads} Once you get that done, let me know and we'll move on to the second step.
These aren't typical input to the LaplacianThickness program for which we don't really provide support. The program was designed for gray and white matter probability images. Although you could probably adapt the program, it would be on you to actually made the changes for accommodation in the code.
Can you post your images?
Please reproduce the script to include the variable names. That makes it easier on me and allows me to reproduce exactly what you've done.
Yeah, my guess is that your landmarks are off somehow. Can you post the data with the script you used to get your most recent results?
HI Alice, So just to be clear, I didn't advise that second registration. That is only going to drive your landmarks away from the landmark-based solution. How was the alignment after the landmarking? Nick
Hi Edite, Please open this up as an issue over at the GitHub ANTsPy site.
Hi Alice, I'd do something along those lines. I would try to get as close to possible to your desired solution using intensity-based registration and then use landmarking for the last step. So, $ antsRegistrationSyN.sh -d 3 -f $human -m $macaque -o $outputPrefix # Here you landmark ${outputPrefix}Warped.nii.gz and $human After you do this, come back and we can discuss the landmark initializer. From what I can tell from the results above, you might not be using it correctly.
You should specify a reference image (the -r option) so whatever issues you might have with the results have a cause in something else. Because of historical development issues, transforms are inverted on the command line from what might be expected. The order of transform application goes from last transform specified to first. So try reversing your transforms.
One obvious omission seems to be the -r option from your antsApplyTransforms call. Is there a reason why you're not including it?
what is the main differences between antsMultivariateTemplateConstruction.sh and antsMultivariateTemplateConstruction2.sh? The central difference is that the other former uses the ANTS program at it's central workhorse whereas the latter uses antsRegistration. The parameter differences follow from the differences between those two programs. Cluster issues most often need to be worked out with your cluster administrators. And looking at the errors here, I have no idea what's going on. We try to create...
You have multiple issues so let's rewind a bit to make tackling those issues simpler and less time-consuming for all of us. Given that we can't reproduce your error and since this looks to be system-specific, I would suggest working this out on a simple 2-D example. For example, here's a [self-contained repo] (https://github.com/ntustison/antsCorticalThicknessExample) that would allow you to run a cortical thickness example quickly. If memory isn't an issue, then you should be able to run it without...
No, I'm pretty certain it does not. I can't remember why but I'm guessing there was a reason why it wasn't added with the shrink factor option.
(i) why 0 iterations at the second step? The script is named Quick for a reason. A 0at the final iteration is used to ensure that the final displacement field is interpolated to the highest resolution level without the overhead of runnning the registration at that stage. Also, that's way too many SyN iterations. You're probably around the local minimum a good percentage of the time and even those final iterations are probably not changing the solution noticeably. (iii) don't want to shrink at all...
You could start with the basic script antsRegistrationSyNQuick.sh. That has default parameters which are a good place to start.
Please don't cross post the same issue in both ANTs forums and in multiple threads. We will get to your question as soon as we can. An obvious problem with what you currently have is that you need a double dash, --, before your long options. For example, you should have --float.
Can you post the screen dump?
Before we look more closely at your issues, please reinspect your results with something that is ITK compatible, like ITK-SNAP. Nifti headers are read differently between the two packages and, unfortunately, this has been the source of many reported problems.
Before looking more closely at your issues, please reinspect your results with something that is ITK compatible, like ITK-SNAP. Nifti headers are read differently between the two packages and, unfortunately, this has been the source of many reported problems.
Thanks. Your TSE and segmentation images are actually not defined in the same physical space. They have different origins. Try correcting that and see if that resolves your issue.
Did you run this script on your end to make sure it worked? I'm having difficulties getting it to run even after correcting a couple issues. Also, "GenericLabel[NearestNeighbor]" isn't really an option. For label images, one either uses "NearestNeighbor", "MultiLabel", or "GenericLabel[Linear]" with the latter generally exhibiting the best performance.
Thanks for the upload gj. However, this is more of a data dump than a small, easy-to-use example I can quickly reproduce on my end to diagnose the problem. I see multiple scripts and several images but I don't know which ones I should use. And I don't really have the time to dig through them to figure it out. As a reference for the type of thing we're looking for, see this example we made for people to demonstrate ANTs registration usage---minimal commands with only the requisite data.
Okay, easy question first---you should try -n GenericLabel[Linear]. W.r.t. your original question---everything looks okay. Can you post the data so I can take a look? If so, please include the script that you're using to produce these exact results.
See above. It's the same command that you used. You said you were able to run it on your other machine which (is "less powerful" and presumably doesn't have memory issues) which is why I think it's an issue specific to your machine. The next best option at this point is to recompile from a fresh GitHub checkout to see if that fixes the issue.
Please post this as an issue over at that repository.
Unfortunately, I'm unable to reproduce your error. The processing completed without issue. You might want to try installing ANTs directly from the current GitHub repo.
Based on your earlier description and the fact that the registration seg faults mid iteration, my first guess is that this is an isolated issue particular to that machine. If that's the case, there's really nothing we can do. If you post the data, I can try running it. Alternatively, you can try updating to the current GitHub repository or you can try a different template.
Please post the entire log file. I might be able to figure something out from that.
We don't have a buildtemplateparallel_VBM.sh in ANTs. If you're referring to buildtemplateparallel.sh, please update to using antsMultivariateTemplateConstruction.sh or antsMultivariateTemplateConstruction2.sh. Sure. You can do a couple things. The most obvious is to consider the number of images that you're using to construct your template. You can also run each iteration (the -i option) as a separate run using the template from the previous iteration as your starting template (the -z option). If...
Please ask this question over at the ANTsPy GitHub forum as an issue.
SurfaceCurvature is the ANTs program you'll want to look at. Here's some more information about the same functionality but accessed from within ANTsR: https://github.com/ANTsX/ANTsR/wiki/Gyrification-index,-mean-and-gaussian-curvature
Please post this as an issue over at the ANTsPy GitHub website.
That's a well-known effect of interpolation associated with using any registration algorithm.
You can. But you'd have to supply your own probability masks for mouse data.
Please post this as an issue over at the ANTsPy github website
Please post this as an issue over at the ANTsPy github website. Also, before you do, make sure you have tried to run this example.
No, definitely not a stupid question. If I understand correctly, you can calculate the distance map for each mask (A and B) using ImageMath ... MaurerDistance... which gives you Adist and Bdist. Then given a voxel x in A, A(x), Bdist(x) will give you the shortest distance. If you need to extract the contours from each mask, I have a pull request to add this functionality to ANTs.
Yes, please do. But you shouldn't have to install ITK separately. I don't know why this happens for just 4 subjects. There's no reason for it and like I mentioned, I only noticed it recently which leads me to believe that something changed in ITK.
Look at ImageMath | grep Rescale
No, rescaling won't help. Coincidentally I ran into this awhile back and I had to recompile from source. I suspect that something happened upstream in ITK proper causing this issue in the N4 class.
What is the command call?
Please post the actual screen dump.
Please use ITK-SNAP.
Okay, so what are you using to view the results? If you're not using ITK-SNAP, please use that program to verify that the problem is not with the viewer.
Please cut-and-paste the output of the help menu.
What's your command call?
You could try using one of our user scripts e.g., antsRegistrationSyNQuick.sh. Try $ antsRegistrationSyNQuick.sh -h 1 to see the help menu.
Here are some examples you should try.
As part of the ITK library, it's already parallelized. See this thread for more information.
You'll have to post all the input/output to further diagnose the problem.
What program are you using to view the results?
A couple things: Make sure you've gone through each step of this tutorial. I didn't look too closely but my guess is that the nibabel conversion might be a source of potential compatibility problems. From here, it looks like both the sform and qform are used which is not compatible with ITK's use of that header information. More information here.
No, that functionality doesn't exist. You'd have to wrap it in a loop.
Hi Ida, In the future, please post ANTsPy questions as issues over at the ANTsX/ANTsPy github repository. If you want to apply the transforms to pixels, just use apply_transforms. Nick
Hi Sarah, I would advise you to do a literature search to find papers where these types of questions have been explored. You could start with some of the ANTs-based papers that are listed on our website. Nick