From: "Rob Comer" <>
Newsgroups: comp.soft-sys.matlab
Subject: Re: Interpolation to arbitrary plane through 3D image / decimal truncation issue
Date: Mon, 21 Jun 2010 15:12:21 +0000 (UTC)
Organization: The MathWorks Inc
Lines: 10
Message-ID: <hvnvgl$3ns$>
References: <hvkqa1$n96$>
Reply-To: "Rob Comer" <>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
X-Trace: 1277133141 3836 (21 Jun 2010 15:12:21 GMT)
NNTP-Posting-Date: Mon, 21 Jun 2010 15:12:21 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 1184234
Xref: comp.soft-sys.matlab:646717

"Yngve Munck-Lindblom" <> wrote in message <hvkqa1$n96$>...
> I have a 3D magnetic resonance image (192x256x256 voxels) made up of voxels for which I know the coordinates of each voxel in some reference coordinate system (RCS). Further I have a smaller 3D image (10x10x30 voxels) for which I know the voxel coordinates in the same RCS. The two images may have an arbitrary orientation with respect to each other and are both rotated with respect to the RCS axes.
> What I want to do is to reslice the large image along the directions of the small image, i.e. find what the large image looks like within the smaller image and with respect to the coordinate system of the small image.

It sounds like you are doing a 3-D geometric transformation and that you need to resample the voxels of the large image to assign values to the small one. If you have Image Processing Toolbox you can do this with the TFORMARRAY function. TFORMARRAY is related to IMTRANSFORM, but it is much more general. It is not limited to 2-D transformations and is intended specifically for problems like this. The main requirement is that you construct a transformation that maps the voxel locations in the small, output image into the voxel space of the large, input image. (There's actually no need to be able to transform in the other direction, from the input to the output.) You can control the resampling, and can easily specify a nearest neighbor, linear, or cubic approach using the MAKERESAMPLER function.

Rob Comer
Mapping and Image Processing Team