DOC: Remove outdated comment about sparse sampling
How to get help with ANTs ANTs wiki: https://github.com/ANTsX/ANTs/wiki Search issues or open a new one: https://github.com/ANTsX/ANTs/issues Please use the issue templates to ensure that you provide us with the information we need to help.
How to get help with ANTs ANTs wiki: https://github.com/ANTsX/ANTs/wiki Search issues or open a new one: https://github.com/ANTsX/ANTs/issues Please use the issue templates to ensure that you provide us with the information we need to help.
How to get help with ANTs ANTs wiki: https://github.com/ANTsX/ANTs/wiki Search issues or open a new one https://github.com/ANTsX/ANTs/issues Please use the issue templates to ensure that you provide us with the information we need to help.
I have trouble getting Sourceforge emails consistently. We could set preferred support to Github rather than this forum?
Thanks guys. So that's one thing to consider with big slices and the CC metric.
Question for @ntustison - how does the metric radius handle anisotropic voxels? I know the shrink factors use the smallest of the three dimensions. Does CC[fixed, moving, 1, 4] work the same way? I kind of think it would have to, but I've not checked the code.
Here's a script I have used with some success. Nothing's as good as a field map, but this is what I use when that's not an option https://github.com/ftdc-picsl/dtProcessing/blob/master/preproc/distCorrDiffToStructural.pl It's pretty customized to work with in-house data, but could be a starting point. It uses a Rigid stage then BSplineSyN. I avoid affine as I find there is little true affine distortion between the DWI and T1, and it just makes the solution worse. For anisotropic voxels, you might...
Here's a script I have used with some success. Nothing's as good as a field map, but this is what I use when that's not an option https://github.com/ftdc-picsl/dtProcessing/blob/master/preproc/distCorrDiffToStructural.pl It's pretty customized to work with in-house data, but could be a starting point. It uses a Rigid stage then BSplineSyN. I avoid affine as I find there is little true affine distortion between the DWI and T1, and it just makes the solution worse. For anisotropic voxels, you might...
It sounds like the template is not being updated, which suggests a problem with the pairwise registration to the initial template. The output files from those jobs might hold some clues.
I think you need to request more memory to run the job. Most HPC environments limit the memory available by default, and this can cause programs to exit with status 137. Your local system administrators should be able to tell you how to get more RAM when you submit the job.
It might be memory. You can control threads by setting the variable ITK_GLOBAL_DEFAULT_NUMBER_OF_THREADS=1 If this variable is not defined, ANTs will try to use as many threads as there are available cores. So setting this to 1 or 2 will use fewer threads on most machines. You can also run antsCorticalThickness.sh with -j 1 to use single precision floats, which will reduce memory footprint.
It might be memory, you can control by setting the variable ITK_GLOBAL_DEFAULT_NUMBER_OF_THREADS=1 If this variable is not defined, ANTs will try to use as many threads as there are available cores. So setting this to 1 or 2 will use fewer threads on most machines. You can also run antsCorticalThickness.sh with -j 1 to use single precision floats, which will reduce memory footprint.
In addition to the above, this page may also be helpful
In addition to the above, this page may also be helpful https://github.com/ANTsX/ANTs/wiki/Forward-and-inverse-warps-for-warping-images,-pointsets-and-Jacobians
If the file /Users/lawlesrd/antsbin/bin/antsRegistration does not exist, then nothing is going to work. Please try installing again, there is a guide with links to a runnable script here https://github.com/ANTsX/ANTs/wiki/Compiling-ANTs-on-Linux-and-Mac-OS
ANTSPATH needs a trailing slash. You should be able to run ${ANTSPATH}antsRegistration
ENH: Check quaternion validity and correct for precision errors
Test output including new conmat functionality
ENH: Allow SD as a tract stat
ENH: Allow conmat to count longest paths.
Tests for longest path endpoints
BUG: bitpix set incorrectly for RGB images, doesn't bother ITK but fixing anyway
Somehow lost the code that allowed headers in conmat label definitions. Re-adding it
Adding an option to conmat to output the graph nodes
Allow -unweightedb in estimatesnr
Make -bscale 1 the default, which is what most DTI users will want
ENH: eig2nii converts dteig output to nii
ENH: Allow non-zero unweighted measurements for dtspd
It is probably caused by a failure to allocate memory. Segmentation faults happen when a pointer references memory that it's not allowed to use by the OS. Bus errors happen when a pointer references memory that can't be a valid pointer. Just because a system has a large amount of RAM doesn't mean it will allow any process to use all or even most of it. You have to be sure that your system will allow antsRegistration to allocate enough memory for the process.
There is randomness to the sampling even in the "regular" strategy. There is a small perturbation of the points, designed to reduce aliasing. This goes back a long time: https://github.com/InsightSoftwareConsortium/ITK/blob/f25526e6a430590ed2b0e78110d470da5d441e46/Modules/Registration/RegistrationMethodsv4/include/itkImageRegistrationMethodv4.hxx#L954-L983 Multi-threading is also known to produce differences in results, so changing the number of threads will also change output. Can you produce identical...
Set "USE_SYSTEM_ITK" in CMake. Be aware that ANTs updates its minimum required ITK rather frequently, so to maximize the chances of this working, I recommend basing your changes off the ITK commit that ANTs uses in the Superbuild.
ANTSPATH needs to be defined such that ${ANTSPATH}antsRegistration exists. Then you can export PATH=${ANTSPATH}:${PATH} and run the executables and scripts.
Sorry, that old thread has wrong information. ANTSPATH must end with a slash. The Github wiki has current installation instructions.
Writing interval volumes definitely works - but it writes them to a fixed file name from where the program is called. Something like "stage0_iter0.nii.gz".
You can call ANTsR code from a script via Rscript. This is the best way to keep the processing consistent. Alternatively, you can use a general image calculator like c3d, which uses ITK I/O. This is important to maintain compatibility within an ANTs pipeline.
Try TimeSeriesAssemble in ImageMath to stack a 3D into a 4D volume.
Try running ulimit -a to see the resource limits on your system. There will be an entry for cpu time. If this limit is exceeded by any process, it gets killed and that notification is generated.
Can you share the full command please?
I think those are log values.
In humans, I've used Rigid alignment followed by BSplineSyN, using the T1 and the B0 from the DTI. I'd do rigid first just to see if you can get a good initialization, and how much nonlinear distortion you are dealing with.
Hmm. There might be a problem with the multiple periods in your file names. It seems to be looking for a different affine file than is being produced. In a clean directory, try replacing the periods in the file names (not in the .nii.gz extension) with underscores, and see if it runs.
Can you check with ls that all these files exist? /l/Downloads/LPBA40subjects.native_space_radio/LPBA40/test/rigid0_0_S01Affine.txt /l/Downloads/LPBA40subjects.native_space_radio/LPBA40/test/S01.native_radio.mri.nii.gz /l/Downloads/LPBA40subjects.native_space_radio/LPBA40/test/MyFastertemplate0.nii.gz /l/Downloads/LPBA40subjects.native_space_radio/LPBA40/test/rigid0_0_S01Affine.txt
buildtemplateparallel.sh is no longer maintained, so antsMultivariateTemplateConstruction.sh is the thing to use. I suspect you have the same error in both, which is that there's not enough RAM available to complete the registration and warping of the input images. That's the usual cause of missing output. You can also look for clues in ./job*_metriclog.txt and try running the individual steps in ./job_00_r.sh etc. Since you are running 5 jobs in parallel, one job might work. In which case running...
buildtemplateparallel.sh is no longer maintained, so antsMultivariateTemplateConstruction.sh is the thing to use. I suspect you have the same error in both, which is that there's not enough RAM available to complete the registration and warping of the input images. That's the usual cause of missing output.
ANTs does not have a tensor metric, but you can use any scalar image. The script requires that the different modalities be aligned simultaneously for each subject. In other words, your T1 and T2 from the same subject should be aligned before building the template. Depending on the sequences, there may be nonlinear distortions between each modality that are quite difficult to resolve. With diffusion images, the distortions can be locally quite large. These would need ot be corrected before building...
This thread might be helpful. https://github.com/stnava/ANTs/issues/385 Also this paper https://www.ncbi.nlm.nih.gov/pmc/articles/PMC3870320/ To get help with your specific problem, post the full commands you tried, and better yet also a link to the data.
Thanks. I ran the command successfully antsRegistration --dimensionality 3 --float 0 --interpolation BSpline[3] --use-histogram-matching 1 --initial-moving-transform [PrePET_50.nrrd,PostPET_50.nrrd,1] --transform Rigid[0.1] --metric MI[PrePET_50.nrrd,PostPET_50.nrrd,1,32,Regular,0.25] --convergence [1000x500x250x0,1e-6,10] --shrink-factors 8x4x2x1 --smoothing-sigmas 3x2x1x0vox --transform SyN[0.1,3,0] --metric MeanSquares[PrePET_50.nrrd,PostPET_50.nrrd,1,16,Regular,0.25] --convergence [50x0,1e-6,10]...
Updating doc
Your command is missing the -o / --output option. In the current ANTs, this will refuse to run before it could encounter any error with the initial moving transform. I can investigate further if you can share data and provide the exact command that was run. I'm puzzled by the use of ./antsRegistration, which suggests your data and your ANTs executables are in the same directory. Better to add ANTs (the directory containing executables and ANTs scripts) to the PATH variable, and store the data elsewhere...
Document cone of uncertainty output for orientbiasmap
If /filepath/mpr_brain/ exists, and the file cannot be written, check your disk quota. Padding the images will require more storage space on disk and also more RAM for the registration jobs.
Problems like this need a good initialization. You can open both images in separate ITK-SNAP windows and click in different places in the moving image, the crosshairs will show the corresponding place in the fixed image. There should be a reasonably good correspondence if the image headers are set correctly. If not, you're going to need an inital transform to supply to -r in antsRegistration. Once you have solved initialization, I'd recommend not doing large shrink factors as it will reduce your...
Standardize residuals
Increase I/O buffering
Some notes on matching parameters from ANTS and antsRegistration here https://github.com/stnava/ANTs/wiki/ANTS-and-antsRegistration
Merge branch 'master' of ssh://git.code.sf.net/p/camino/code into dtiQC
WIP on dtspd command. Also did some I/O speed tinkering
dtspd command implemented
Output additional stuff from orientbiasmap
Almost complete first pass
Merge remote-tracking branch 'origin/master' into dtiQC
The rigid component of the average transform is not applied to the template. The deformable part is, so there could still be some drift, but it should be much less. To avoid bias, I try not to use -y unless it's causing serious problems. The final template can be resampled after the fact.
When you use -z, that image is used as the initial template. It's not incorporated into subsequent iterations, unless it is also specified as one of the input images. After each iteration, the template is updated to move it closer to the population mean. This can involve translation and rotations as well, unless you disable that with -y. Say you pick an initial template from a subject with the head rotated to the left, but most subjects are centered or rotated slightly to the right. Over time the...
Working on fixing negative eigenvalues and other QC output. Might also try iRESTORE
Update test to deal with new default bscale = 1 for fsl2scheme
Thanks, that is newer than what comes with the Superbuild, by my reading of this https://github.com/stnava/ANTs/blob/4d580c86fb3d7935165660c707fca1bdd7bbc968/SuperBuild/External_ITKv4.cmake So maybe something changed that fixes the problem.
Thanks for the update. Do you happen to know the exact version of ITK you compiled against? Might be helpful if this problem comes up in the future.
Superbuild should work. You can try changing the build mode from Release to Debug, see if that offers any clues. I don't know if it will print anything else to the terminal. The only other thing I can think of is the compiler. There's been reports of different run time behavior between GNU compilers and XCode / clang.
I'm out of ideas at this point. The same command line works for me on today's ANTs (running OS X 10.11) Using double precision for computations. Input scalar image: input_t1.nii.gz Reference image: template.nii.gz ============================================================================= The composite transform comprises the following transforms (in order): 1. temp_2_subj_0GenericAffine.mat (type = AffineTransform) ============================================================================= Default...
Syntax looks correct, suggesting the file is unreadable due to OS issues (file permissions, wrong directory) or because it's corrupted (perhaps by a text editor), or otherwise incompatible with the data. I might be able to say more if you post the actual error message. You can also try antsRegistrationSyNQuick.sh with the -t a option, which outputs the deformed images directly from antsRegistration - you should be able to replicate that output very closely by subsequently calling antsRegistration...
It's a binary file, you can see its contents with antsTransformInfo. It can be read directly into antsApplyTransforms with the -t option.
That's odd. Can you see this in the deformed individual images, or only in the template? You might want to run MeasureMinMaxMean on the input images to verify the intensities as understood by ANTs.
The order shouldn't matter if the images are correctly aligned in physical space. Can you create a minimal example, say using 1 image from each of the sites, and share data?
Maybe the mean intensity drifts because N4 is called with -r 0? https://github.com/stnava/ANTs/blob/master/Scripts/antsMultivariateTemplateConstruction.sh#L1177
The call to SGE qsub includes -cwd, which sets the working directory for the job to be the current directory. Perhaps you can find an equivalent flag for your system.
You are changing the input to antsRegistration at every iteration, and it is then finding a new solution that minimizes MI for the new input. Every time you apply the transforms, you are resampling the previous output and this produces a different input to the next round of registration, so it should keep changing. If you saved the miwarp_ii images, you could compare them to miwarp_1. I would expect that the miwarps would get smoother but not change too much after the first few iterations. It would...
I also know little to nothing about Windows but there might be some helpful info...
I also know little to nothing about Windows but there might be some helpful info...
I usually use ITK-SNAP
The sigma values (standard deviations) of the Gaussian smoothing kernel are passed...
I believe that's correct. You can use the T1 only to get a whole-brain alignment,...
Make -bscale 1 the default for fsl2scheme, as m...
This code looks like it will fail because $file is T1_ro_brainRepaired. and not T1_ro_brainRepaired.nii.gz....
It's a bit of a chicken and egg problem as the linear registration is also going...
OK going back to the cropped volumes Fixed.nrrd and Moving.nrrd. Are they cropped...
Whoa, that's a lot of coverage. I was looking at the JPG image, which had the whole...
I saw the link, but aren't those cropped versions?
You won't be able to close such holes because that violates one assumption underpinning...
For example, -t SyN[gradientStep,updateFieldVarianceInVoxelSpace,totalFieldVarianceInVoxelSpace]...
If you want the solution to stay close to the initial solution, I think you would...
I think you would want to do -t sr. This will do rigid, followed by SyN. The rigid...
I think you would want to do -s sr. This will do rigid, followed by SyN. The rigid...
Hi, It sounds like you figured this out already, but the number of threads affects...
The WM image has a NIFTI datatype of 32. This is for complex data. The imaginary...
OK I looked at this more carefully. The exact details of the downsampling / smoothing...
The images are downsampled by some integer factor at each level to make the registration...
OK I looked at this more carefully. The exact details of the downsampling / smoothing...