Code covered by the BSD License  

Highlights from
3D Free Form Image Registration Toolbox (GUI)

image thumbnail
from 3D Free Form Image Registration Toolbox (GUI) by Daniel Markel
A toolbox for performing image registrations on 4D RTOG files or any other volumetric image.

numbername(number,digits)
function numstring = numbername(number,digits)

if number == 0 
    numdigits = 1;
else
numdigits = ceil(log10(number+1));
end

numzeros = digits - numdigits;

numstring = '';
for n = 1:numzeros
    numstring = [numstring '0'];
end

numstring  = [numstring num2str(number)];

Contact us at files@mathworks.com