Deformation Field Manipulation
(c) Moo K. Chung, 2008
Waisman Laboratory for Brain Imaging and Behavior
University of Wisconsin-Madison

Description
April 14, 2008

The code will manipulate the 3D deformation field on top of a template. The code is based on MATLAB 7.5 and  Analyze 7.5 format using the Mac Core-Duo laptop.


Loading a template image and applying deformation 
April 14, 2008


Load the template images (template.hdr, template.img).

>>fname_template='/Users/chung/Desktop/jacobian/template/template.hdr';
>>file_name=strcat(fname_template)
>>image_info = analyze75info(file_name)
>>template = analyze75read(image_info);
>>figure;imagesc(template(:,:,80));colormap('gray');

Load a deformation field into three variables volx,voly,volz. Each voxel position (i,j,k) will be deformed to

>>x= i+round(volx(i,j,k));
>>y=j+round(voly(i,j,k));
>>z=k+round(volz(i,j,k));

This routine is made into a function

>>deformation.x=volx;
>>deformation.y=voly;
>>deformation.z=volz;
>>deformed=apply_deformation(template,deformation);

Unfortunately, the discretization process will cause some voxels to be not filled with intensity value. The discritization error of not filling up every voxel will not be a problem for cortical mesh.

Figure 1. Left: Original template image. Right: deformation field applied to the template. The deformed image shows the discretization error.


References
April 14, 2008