Forum

Welcome Guest 

Show/Hide Header

Welcome Guest, posting in this forum requires registration.





Pages: [1]
Author Topic: Python Example/Tutorial
wlamont
Newbie
Posts: 1
Permalink
Post Python Example/Tutorial
on: December 13, 2013, 14:53
Quote

I am trying to make a quick tutorial/example for using this package in Python 2.7.5. I am starting from the basic Python script that demonstrates the Radon transform, inverse Radon transform and SART (see: http://scikit-image.org/docs/dev/auto_examples/plot_radon_transform.html).

I have appended to that python file:

from NiftyRec import NiftyRec

nfr = NiftyRec.Reconstructor(image.shape)
nfr.set_sinogram(sinogram)
nfr.set_cameras_equispaced(0, 180, 30)

where my image.shape is 200, 200 (using the Shepp-Logan phantom) and the sinogram.shape is 200, 8. I get the following message: Sinogram size not consistent with activity eatimate, need reinterpolation. This comes from line 286 of NiftyRec.py:

    def set_sinogram(self,sinogram):
        if (sinogram.shape[1] != self.volume_size[0]) or (sinogram.shape[2] != self.volume_size[1]):
#        if (sinogram.shape[0] != self.volume_size[0]) or (sinogram.shape[1] != self.volume_size[1]):
            print("Sinogram size not consistent with activity estimate, need reinterpolation")
            print("Sinogram size: "+str(sinogram.shape))
            print("Activity size: "+str(self.volume_size))
            return

Is this correct? It seems like the two if statements should be switched e.g. comment out the top one and uncomment the bottom one.

Also, from here what are the steps or commands to get to a reconstruction?

Thank you.

Pages: [1]
Mingle Forum by cartpauj
Version: 1.0.34 ; Page loaded in: 0.049 seconds.
{lang: 'en-GB'}