FreeART API
import freeart
import scipy.misc
import numpy
# forward projection
image = scipy.misc.ascent()
image.reshape(image.shape[0], image.shape[1], 1)
freeart.TxBckProjection(image.astype(numpy.float64), numpy.linspace(0, numpy.pi))
algoProj = freeart.TxFwdProjection(l.astype(numpy.float64), minAngle=0, maxAngle=numpy.pi, anglesNb=360)
sino, angles = algoProj.makeSinogram()
# backward projection
algoRecons = freeart.TxBckProjection(sino, angles)
recons = algoRecons.iterate(1)
Bases: freeart.python_interface.FreeART.FreeARTFwdProjection
Class to do a FreeART sinogram generation in transmision mode. The angles at which the sinogram must be computed is defined either by the angleList parameter either by the three parameters minAngle, maxAngle and AnglesNb
Parameters: |
|
---|
Ask algorithm to generate a sinogram. The mask has to be a numpy 2 dimensions array (data type bool) with one element per phantom matrix pixel. In transmission mode, the specification of a ROI using the mask parameter is not supported.
Parameters: | mask – mask to specify a Region Of Interest (ROI) - Optional |
---|---|
Returns: |
|
Bases: freeart.python_interface.FreeART.FreeARTBckProjection
Class to do a FreeART reconstruction in Transmission mode
Parameters: |
|
---|
Ask algorithm to do the required number of iteration This method releases the python GIL in order to let other Python thread(s) run.
Parameters: | numIter – Iteration number |
---|---|
Returns: | The phantom absorption matrix as a 3D numpy array |
import freeart
from freeart.utils import genph
import numpy
# forward projection
phGenerator = genph.PhantomGenerator()
sheppLogan_phantom = phGenerator.get2DPhantomSheppLogan(128)
sheppLogan_phantom.shape = (sheppLogan_phantom.shape[0], sheppLogan_phantom.shape[1], 1)
absMat = sheppLogan_phantom * 20.0
selfAbsMat = sheppLogan_phantom / 10.0
detPos = (0., 1000., 0.)
detSetup = [(detPos, 10.)]
alProj = freeart.FluoFwdProjection(phMatr=sheppLogan_phantom,
expSetUp=detSetup,
absorpMatr=absMat,
selfAbsorpMatrix=selfAbsMat,
minAngle=0.,
maxAngle=numpy.pi*2.0,
anglesNb=360)
sinogram, angles = alProj.makeSinogram()
# backward projection
alRecons = freeart.FluoBckProjection(sinoDat=sinogram, sinoAngles=angles, expSetUp=detSetup,
absorp=absMat, selfAbsorp=selfAbsMat)
recons = alRecons.iterate(1)
Bases: freeart.python_interface.FreeART.FreeARTFwdProjection
Class to do a FreeART sinogram generation in fluorescence mode. The angles at which the sinogram must be computed is defined either by the angleList parameter either by the three parameters minAngle, maxAngle and AnglesNb
Parameters: |
|
---|
Ask algorithm to generate a sinogram. The mask has to be a numpy 2 dimensions array (data type bool) with one element per phantom matrix pixel. In transmission mode, the specification of a ROI using the mask parameter is not supported.
Parameters: | mask – mask to specify a Region Of Interest (ROI) - Optional |
---|---|
Returns: |
|
Bases: freeart.python_interface.FreeART.FreeARTBckProjection
Class to do a FreeART reconstruction in Fluorescence mode
Parameters: |
|
---|
Ask algorithm to do the required number of iteration This method releases the python GIL in order to let other Python thread(s) run.
Parameters: | numIter – Iteration number |
---|---|
Returns: | The phantom absorption matrix as a 3D numpy array |