Save/Load VAMToolbox objects#
Saving data#
VAMToolbox objects, including TargetGeometry, Sinogram, and Reconstruction can be saved with the class method vamtoolbox.geometry.Volume.save(), and the ImageSeq object can be saved with the class method save().
# target_geo is a geometry.TargetGeometry object
# save the object as mytarget.target
# ".target" is the default file extension
target_geo.save("C:\User\myfiles\mytarget")
# sino is a geometry.Sinogram object
# save the sinogram as mysinogram.sino
# ".sino" is the default file extension
sino.save("C:\User\myfiles\mysinogram")
# recon is a geometry.Reconstruction object
# save the reconstruction as myreconstruction.recon
# ".recon" is the default file extension
recon.save("C:\User\myfiles\myreconstruction")
# imgseq is a imagesequence.ImageSeq object
# save the imagesequence as myimagesequence.imgseq
# ".imgseq" is the default file extension
imgseg.save("C:\User\myfiles\myimagesequence")
Loading data#
To load Volume objects, a convenience function is provided in the loadVolume().
# to load saved Volume objects, use the method in the geometry module
# loadVolume()
target_geo_load = vam.geometry.loadVolume("")
sino_load = vam.geometry.loadVolume("C:\User\myfiles\mysinogram.sino")
recon_load = vam.geometry.loadVolume("C:\User\myfiles\myreconstruction.recon")
Similarly, to load ImageSeq objects, a convenience function is provided in the loadImageSeq().
# to load saved ImageSeq objects, use the method in the imagesequence module
# loadImageSeq()
imgseq_load = vam.imagesequence.loadImageSeq("C:\User\myfiles\myimagesequence.imgseq")