is there a simple command to upsample a 4D nifti using FSL (world-space should stay in place)?
For instance, would like to upsample a dwi file with [2.0 2.0 2.0] mm voxelsize to [1.2 1.2 1.2]. Optimally using sinc interpolation and optimally without breaking the files apart to a series of 3D volumes to do so.
The flirt -applyisoxfm command (or flirt in general) only works on 3D volumes.
Thanks so much for a hint!
I am not sure of a way to do this in directly in fsl, though a combination of fslsplit, flirt -applyisoxfm and fslmerge would do the trick. Since your Lead-DBS) uses Matlab you could use a little SPM script to do this. This script is a wrapper for imresize3 and the
lanczos3 method is a windowed form of sins interpolation. Similar solutions are in Python.
You are an advanced user, and therefore I assume you have a specific application in mind. However, in general I would strongly encourage doing all dwi analyses in native space. These interpolations will compound partial volume problems, artifact removal and other assumptions of analyses will become problematic, processing time and memory usage will increase dramatically. For these same reasons, I would discourage anyone from acquiring DWI data with interpolation turned on at the MRI console.
Perhaps you can describe what problem you are trying to solve. If it is simply a matter of creating richer streamlines, it might be worth use a method like Bedpost to estimate the probability of different fibers within each voxel. You can then use probtrackx or a streamlining tool (like my tracktion) to leverage this richer data.
you may try 3dresample in afni
Hi all, thanks so much for your help!
@Chris_Rorden, thanks also for the headsup. Indeed, there is good evidence that upsampling the raw DWI data can lead to some gains (e.g. https://www.ncbi.nlm.nih.gov/pubmed/25219332) and I wanted to test this out a bit. I interpret any results from dMRI tractography with greatest caution anyways.
However, I mainly asked this question since I was a bit surprised that there’s no FSL tool for this. I have seen your SPM script in a different forum before and have checked it out. In Matlab, there are a ton of ways to do this. Still, a simple FSL command would have been nice for pipelining.
In any case, thanks a lot to both of you!
I wanted to point out there are a few ways to resample with AFNI. All these will apply the results to multiple volume 4D datasets.
3dresample will upsample/downsample with several interpolation methods (-rmode), but not wsinc.
3dAllineate (-1Dparams_apply or -1Dmatrix_apply) - applies affine parameters or matrix including IDENTITY transformations to effectively resample to another grid. Use -final to specify the interpolation scheme. That includes wsinc5 interpolation as well as options for linear, cubic, quintic, nearest neighbor interpolation.
3dNwarpApply - applies nonlinear warps from deformation fields that can be combined with affine transformations too. The -ainterp option specifies the interpolation method. The default for this program is wsinc5.
The input for 3dAllineate and 3dNwarpApply can include multiple lines to apply different affine transformations for corresponding time points/volumes in a 3D+time dataset. If only one affine transformation is found, then that is applied to every volume in the dataset.