Hi, You will find that when you do substantial downsampling, FLIRT will apply a a 4x4x6 kernel of all ones (you can do this with fslmaths and the "-kernel boxv" option) Meaning, you can define an intermediate > resolution, co-register your . This document gives a brief description of flirt and the various command-line programs available in the FLIRT component of FSL. The interpolation is only used for the final transformation (and in applyxfm), not in the registration calculations. Hi, On 9 Feb , at , Li Jiang wrote: > Hi, > > For example, if I get AtoB and BtoC transform matrix wih trilinear > interpolation, and concatenate the AtoC .
To apply saved transformations, the GUI ApplyXFM can also be used which provides the option of specifying the number of voxels and voxel size directly.
There are two main types of cost function: If you are registering two images of different modality then you must use an inter-modal cost function, whereas for images of the same modality either can be used, although the intra-modal options may be more accurate.
Within each category there is not much to choose from - it is a practical, experience-based decision. The recommended options to try first are: If the scanner voxel size may have changed due to calibration shifts then it is appropriate to use 7 DOF instead of 6 or 4 instead of 3 to compensate for global scale changes. Note that for difficult registrations there is a translation only schedule file which is effectively 3 DOF, but only includes x,y,z translations. This is useful for obtaining initial position estimates when matching small FOV to large FOV, and can then be further refined.
FLIRT/UserGuide - FslWiki
Transforming masks with FSL requires a little extra care. To steps are needed: Masks can be transformed from one space to another by using either one of the command line tools flirt or applywarp, or the ApplyXFM GUI. The threshold used with fslmaths should be set depending on the intended use of the output mask. These guidelines should help in determining the correct value to use: For example, if the mask is being used to quantify values within an ROI and it is important to not include contamination from surrounding areas, then a high threshold should be used.
Alternatively, if the mask is being used to define an exclusion ROI then it may be better to have a liberal border, which can be achieved with a low threshold. Thresholding and binarising is done by fslmaths in the second call. Registrations with different numbers of DOF or different combinations of parameters can only be achieved using schedule files and the command line version of flirt.
If the input images are 2D it is still necessary to use the -2D option as well. For more details see the section on available schedule files. Note that when the FOV is limited, but still 3D multiple slices then 2D or limited DOF transformations are normally required in order for the registration to be robust.
Note that this is different from masking the original images, as masking introduces artificial boundaries whereas weighting does not. Note that it does not perform any search in 2D mode, and cannot deal with 2D to 3D registrations. Interpolation Methods This includes Nearest Neighbour, a family of Sinc-based methods three window types - rectangular, Hanning and Blackman with configurable window width, and spline a highly efficient method, with similar output characteristics to sinc.
The interpolation is only used for the final transformation and in applyxfmnot in the registration calculations. In addition, there is the BBR cost function which utilises a segmentation of the reference image to define a boundary, and it is the intensity differences in the input image, across the transformed boundary, that contribute to the cost.
The pre-requisites to use this method are: This script will either use an existing white-matter segmentation of the structural image, or create one itself, to define a white-matter boundary. We recommend that the structural image is bias-corrected separately beforehand if there is obvious bias field present. The script is also capable of using fieldmaps to perform simultaneous registration and EPI distortion-correction.
The inputs echospacing and pedir both refer to the EPI image not the fieldmap and are the same as required for FEATbut be careful to use the correct units. It can read and write ascii 4x4 matrices. In addition, it can be used to concatenate two transforms using -concat with the second transform or to find the inverse transformation using -inverse. If the option -mm is used then both input and output coordinates will be in mm coordinates, otherwise with -vox both coordinates will be in voxel coordinates.
For conversion between voxel and mm coordinates it is necessary to use either img2stdcoord or std2imgcoord see below. Note that the source coordinates can either be input via a file or via a pipe and for the latter the "-" symbol is used as the filename. The format in either case is three numbers per line, space separated.
To avoid this use the pipe input format or suppress the final line: The coordinates for the source image can be either in voxel coordinates default, or by explicitly using -vox or in mm coordinates using -mm. This utility, and std2imgcoord are therefore useful for converting between voxel and mm coordinates within the same image, as well as for mapping coordinates between spaces.
Converting from voxel to mm coordinates within the same image can be done with the command: It works the same way but transfers coordinates from "standard space" to the other image IMG space.
- flirt Command-line Program and Utilities
It can also convert between mm and voxel coordinates within the same image. See the entry on img2stdcoord above. Changing this to float will decrease the amount of RAM needed to store H and will hence allow one to go to slightly higher warp-resolution.
The default is double since that is what we have used for most of the testing and validation.
Back to list of parameters --imprefm, --imprefval, --impinm, --impinval When set to 1 the --imprefm and --impinm flags imply that a certain value implies that that voxel is outside the valid FOV and should be excluded when estimating the warps. This is useful for example if one has data that has already been resampled by an affine transform or if one uses skull stripped data.
In both those cases there will be zeros in the image volume that does not mean that the intensity is actually zero, but rather that it is unknown. Note though that the recommended use of fnirt is to not use skull-stripped data and to inform fnirt of any affine warps through the --aff parameter instead of resampling the data. Typically that value will be zero, in which case one does not need to bother with --imprefval. Occasionally a software wil use some other value to indicate NaN I have seen e.
FMRIB Software Library
Both --imprefm and --impinm are set to 1 as default. However, within a given sub-sampling step that regularisation is constant, and that could in turn cause the algorithm to take a "poor" initial step for that resolution level.
The default is to use Bending Energy, and our testing indicate that that is slightly advantageous compared to Membrane Energy. Back to list of parameters --refderiv When this parameter is set the spatial derivatives of the --in in image is approximated by those of the --ref image.
Since the --ref images remains stationary that means that one does not need to recalculate the gradient and Hessian for each iteration, thereby saving execution time. Back to list of parameters --intmod intmod is short for "intensity model" and is the parameter that allows fnirt to successfully use a sum-of-squared-differences cost-function even when the assumptions are not completely fulfilled for that.
A "theoretical" explanation can be found here. The purpose is to model intensity differences between --ref and --in to avoid these from affecting the estimation of the warps. Modelling the intensity involves estimation of another set of parameters in addition to those modelling the warps and will hence increase both execution time and memory requirements.
There are six different intensity models. These differ in the kind of differences they can model and also in the number of additional parameters that fnirt has to estimate. It simply assumes that the images are identical apart from differences in shape. This is the model one "usually" means when talking about a "sum-of-squared differences cost-function".
It is useful mainly for quantitative images such as e. It assumes a linear relationship between the intensities in the two image. It needs to estimate one additional parameter, the slope of the linear relationship.
It correponds roughly to a traditional correlation-coefficient cost-function. It is useful mainly for registering images acquired with the same scanner and sequence when the images has no or very little intensity inhomogeneity. Imagine creating a scatter-plot where for each point takes its x-value from a voxel in the --ref image and the y-value from the same voxel in the warped --in image.
Let us further assume that this scatter-plot displays a pattern where the majority of the points fall along a curved path. Using this model fnirt will fit a polynomial-function to that curve. The order of the polynomial will be determined by the value of the parameter --intorder and this is also the number of additional parameters that needs to be estimated. It assumes that the curved intensity relationship is the same for all parts of the image global.
It corresponds roughly to a correlation-ratio cost-function. It is useful when both images --ref and --in have little or no intensity inhomogeneity and they have been acquired with similar sequences but on different scanners or with slightly different sequences on the same scanner. This option models such a field as a linear combination of B-splines same as the warp fields. The properties of the field are determined by the parameters --biasres and --biaslambda.
The number of additional parameters are also determined by --biasres and is typically substantial several hundreds -- thousands. This option has no correspondence in traditional cost-functions.
The number of additional parameters are given by --intorder and --biasres and is the sum of the numbers for the two previous models. This means that execution time is roughly twice that of e.