Ants Hand Out
Ants Hand Out
Brian B. Avants
2016-08-08
Introduction
Data types
Images
Images are the core data type in ANTs. Valid extensions are deter-
mined by ITK 6 image input/output libraries 7 . ITK images can be of 6
www.itk.org
arbitrary dimensionality and pixel type, but in ANTs we instantiate 7
NiftiImageIO, NrrdImageIO, GiplIm-
ageIO, HDF5ImageIO, JPEGImageIO,
float pixel type in 2, 3 or 4 dimensions.
GDCMImageIO, BMPImageIO, LSMIm-
ageIO, PNGImageIO, TIFFImageIO,
VTKImageIO, StimulateImageIO, BIO-
RadImageIO, MetaImageIO, MRCIm-
ageIO, GE4ImageIO, GE5ImageIO,
MGHImageIO
advanced normalization tools quick reference 2
Point sets may also be stored in the binary format provided by the
Meta I/O library 9 . This format allows much faster I/O for large 9
http://www.itk.org/Wiki/ITK/
MetaIO/Documentation
datasets.
Registration
Quick start
ANTsR gives some quick registration options. One can achieve simi-
lar performance with antsRegistrationSyNQuick.sh.
fi <- antsImageRead(getANTsRData("r16"))
mi <- antsImageRead(getANTsRData("r64"))
mytxr <- antsRegistration(fixed = fi, moving = mi,
typeofTransform = c("Rigid"))
mywarpedimager <- antsApplyTransforms(fixed = fi,
moving = mi, transformlist = mytxr$fwdtransforms)
mytx <- antsRegistration(fixed = fi, moving = mi,
typeofTransform = c("SyN"))
mywarpedimage <- antsApplyTransforms(fixed = fi,
moving = mi, transformlist = mytx$fwdtransforms)
Low-dimensional
translation, rigid, affine - optional multi-start exploration of the trans-
formation space (antsAI)
High-dimensional
transformations with many parameters - primarily SyN and B-spline
SyN as well as time-varying diffeomorphic models.
N4
Nick’s N3 15 improves the original N3 inhomogeneity correction 15
http://www.ncbi.nlm.nih.gov/pmc/
articles/PMC3071855/
method.
invisible(plot(ficorrupt))
invisible(plot(fifixed))
advanced normalization tools quick reference 8
Figure 5: n4 repair
advanced normalization tools quick reference 9
Atropos
Expecation maximization segmentation with a variety of likelihood
models and initialization strategies. Incorporates multiple modalities
and allows control of prior strength. The finite mixture modeling
(FMM) segmentation approach is the most popular. Prior constraints
include the specification of a prior label image, prior probability
images (one for each class), and/or an MRF prior to enforce spatial
smoothing of the labels.
invisible(plot(fi, segs1$segmentation))
invisible(plot(fi, segs2$segmentation))
fi <- antsImageRead(getANTsRData("mni"))
fiseg = kmeansSegmentation(fi, 3)
fik <- weingartenImageCurvature(fi)
fisulc = antsImageClone(fik) * 0
selector = (fiseg$segmentation == 2 & fik < 0)
fisulc[selector] = fik[selector]
invisible(plot(fi, fisulc, axis = 3))
advanced normalization tools quick reference 10
Statistical pipelines
program description
4 ANTSIntegrateVectorField ode integration of vector field
5 ANTSIntegrateVelocityField ode integration of velocity field
8 ANTSUseLandmarkImagesToGetAffineTransform fit affine tx to landmarks
12 AverageAffineTransform average affine transformations
13 AverageAffineTransformNoRigid average affine transformations without rigid part
19 CompositeTransformUtil dis/assembles composite transform files
25 ConvertTransformFile convert mat to txt, for example
30 CreateJacobianDeterminantImage compute deformation gradient from displacement
38 FitBSplineToPoints fit bspline to point set
64 ReorientTensorImage reorient tensors by transformation
85 antsAI multi-start low-dimensional registration
88 antsAffineInitializer see antsAI
89 antsAlignOrigin basic origin alignment
90 antsApplyTransforms apply (multiple) transformations to image types
91 antsApplyTransformsToPoints apply (multiple) transformations to points
96 antsIntermodalityIntrasubject.sh example of how to map within subject
advanced normalization tools quick reference 15
program description
103 antsMotionCorr time series motion correction
104 antsMotionCorrDiffusionDirection DWI specific motion correction
106 antsMotionCorrStats summarize antsMotionCorr output
107 antsMultivariateTemplateConstruction.sh multiple modality templates
108 antsMultivariateTemplateConstruction2.sh multiple modality templates
111 antsRegistration standard registration algorithms
112 antsRegistrationSpaceTime.sh spatiotemporal registration methods
113 antsRegistrationSyN.sh default decent quality registration
114 antsRegistrationSyNQuick.sh default fast registration
115 antsSliceRegularizedRegistration see spinal cord toolbox
132 geodesicinterpolation.sh shape-based interpolate two images
133 guidedregistration.sh example of landmark based registration
137 landmarkmatch.sh example of landmark based registration
program description
11 Atropos EM segmentation framework and tools
49 LabelClustersUniquely label each isolated region
77 ThresholdImage simple image thresholding
92 antsAtroposN4.sh joint segmentation and bias correction
94 antsBrainExtraction.sh brain extraction via registration and segmentation
98 antsJointFusion better JLF implementation
99 antsJointLabelFusion.sh better JLF script
150 skel.sh topological skeleton of segmentation
163 mrvnrf machine learning segmentation - see ANTsR
program description
14 AverageImages average list of images
15 AverageTensorImages average list of tensor images
21 ConvertImagePixelType change pixel type
34 DenoiseImage non-local denoising
39 GetConnectedComponentsFeatureImages ?
45 ImageMath basic processing operations on images
47 KellyKapowski image-based thickness estimator
50 LabelGeometryMeasures measure geometry of labeled regions
58 N3BiasFieldCorrection ancient bias corrector
59 N4BiasFieldCorrection better bias corrector
advanced normalization tools quick reference 16
program description
63 RebaseTensorImage map tensor into new basis
71 SmoothImage smooth in given units
73 SurfaceBasedSmoothing smoothing restricted to segmentation
74 SurfaceCurvature shape operator curvature
75 TextureCooccurrenceFeatures texture based statistics
76 TextureRunLengthFeatures texture based statistics
86 antsASLProcessing.R BMKandel ASL processing
87 antsASLProcessing.sh BMKandel ASL processing
95 antsCorticalThickness.sh brain thickness pipeline
101 antsLongitudinalCorticalThickness.sh longitudinal brain thickness pipeline
110 antsNeuroimagingBattery align MR modalities to common space
program description
27 CreateDTICohort simulate DTI population
44 ImageIntensityStatistics simple summary stats for image +/- ROIs
46 ImageSetStatistics compute mean, median, etc of images
51 LabelOverlapMeasures compute overlaps
54 MeasureImageSimilarity similarity between image pairs
55 MeasureMinMaxMean basic stats on an image
79 TimeSCCAN cca for temporal images
146 sccan utility for sparse decomposition - see ANTsR
program description
23 ConvertScalarImageToRGB use lookup table to make RBG from gray
31 CreateTiledMosaic tile images for viewing
32 CreateWarpedGridImage make a warped grid from displacement
72 StackSlices stack up a population of image slices
78 TileImages collect images in tile form for viewing
116 antsSurf surface rendering and other operations
program description
10 ANTSpexec.sh helper for parallel execution
advanced normalization tools quick reference 17
program description
26 CopyImageHeaderInformation copy header from one image to another
28 CreateDisplacementField make vector field from component images
29 CreateImage make an image
35 ExtractRegionFromImage get subset of image using indices
36 ExtractRegionFromImageByMask get subset of image using mask
37 ExtractSliceFromImage get slice from image
41 ITK_bld_internal_H5detect ?
42 ITK_bld_internal_H5make_libsettings ?
43 ImageCompare see if images are nearly the same
56 MemoryTest memory profiler
57 MultiplyImages multiply image1 by x
60 PasteImageIntoImage put one image in another
61 PermuteFlipImageOrientationAxes flip or permute image
62 PrintHeader image header information
65 ResampleImage change image resolution
66 ResampleImageBySpacing change image resolution
67 ResetDirection change image direction to identity
68 SetDirectionByMatrix change image direction
69 SetOrigin set origin in image
70 SetSpacing set spacing in image
117 antsTransformInfo investigate a transformation
118 antsUtilitiesTesting see how metric changes with tx
130 compareTwoTransforms as described
157 waitForPBSQJobs.pl utility
158 waitForSGEQJobs.pl utility
159 waitForXGridJobs.pl utility