resample
From VoxBoWiki
resample is a command-line tool that performs a few different types of resampling operations on 3D files. It uses the sinc resampling algorithm ported from SPM96 (nearest neighbor is also an option), and is especially useful for adjusting voxel sizes or bounding boxes. The arguments are a bit of a mess, we will fix that at some point.
Here's the help text:
VoxBo resample (v1.8.5pre8/May 6 2010) usage: resample <in> <out> [flags] flags: -rr <ref> ref=image in desired space -rc <ref> ref=image with desired field of view -rz <ref> [z] same but specify size in z -rd <ref> ref=image of desired dimensions -ra <ref> aligns to ref on all dims, using corner position -rw <ref> aligns to ref on all dims, using corner position, same voxel sizes -d <x y z> desired dimensions -nn use nearest neighbor interpolation (default is sinc) -xx <a b c> a=start voxel (from 0); b=interval in voxels; c=# of voxels -yy <a b c> same for y dimension -zz <a b c> same for z dimension -r generic ref cube -aa, -ax, -ay, -az [origin/corner] -sa, -sx, -sy, -sz [n] Some examples for an axial image of dimensions 64x64x21: invert the order of the slices: resample in.cub out.cub -zz 20 -1 21 swap left-right: resample in.cub out.cub -xx 63 -1 64 interpolate in-plane: resample in.cub out.cub -xx 0 .25 256 -yy 0 .25 256 crop to 40x64x21: resample in.cub out.cub -xx 12 1 40
