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.

writing.m
for  n = 1:25
    if n <10
        number = sprintf(['0' num2str(n)]);
    else
        number = num2str(n);
    end
    path = sprintf(['C:\shapes\Cube\cube' number '.dcm']);
    dicomwrite(square(:,:,n),path);
end

Contact us at files@mathworks.com