From: Srinivasarao Sakamuri on
Hi Stanley ,
Here is the code to reconstruct 3D image from sinogram.

SPECT = data.sinogram;
filter = 'Ram-Lak';interpol = 'linear';
figure,
imagesc(SPECT);color(hot)
theta = 0 : 1 :179 ;
del_sinogram = SPECT(:, theta+1);
rec_img = iradon(del_sinogram,theta,filter, interpol);
figure,
imagesc(rec_img), colormap(pink);

Here data representing the structure variable.
I think it will help full to you.

"Stanley " <smsearcy(a)ufl.edu> wrote in message <hp83r1$dbg$1(a)fred.mathworks.com>...
> Good morning,
>
> I learning how to reconstruct SPECt images and need some help.
>
> Here&#8217;s what I have:
>
> A 128x64 array, 120 angles (slices), 2 byte integer
>
> To open the projection file into a 2-D array I used the following commands:
>
> fid=fopen(&#8216;imageA.prj&#8217;);
> B=fread(fid,[128,64], &#8216;uint16&#8217;);
>
> theta = linspace(270, -90, 120) This gives me 120 different projection angles
>
> theta will be used with iradon
>
> #1 I want to reshape imageA so that I have a 3-D matrix (x, y, projection angle)
>
> &#8226; I&#8217;ve tried the reshape command without success and really don&#8217;t know how to proceed
>
> #2 I also want to create a sinogram from the projection data
>
> &#8226; To reduce noise I was provided with the following code that sum to sum the 6 through 21 transaxial slices of the projection data:
>
> sino_sum(1:ndim, 1:nang)=0.;
> for k=1:nang
> for i=1:ndim
> for j=6:21
> sino_sum(I,k)=sino_sum(I,k) +B(i, j, k)
> end
> end
> end
>
> Can you help me convert the projection data from a 2D array into a 3D array?
> Can you show me how to make a sinogram? &#8211; do I use iradon?
> I believe nang is the number of projection angles (i.e., 120)
> I&#8217;m not sure about the value for ndim
>
> Thank you in advance.
>
> Stanley
From: Srinivasarao Sakamuri on
Here is the code.
To make Sinogram you need radon function as follows...

theta = 0:180;
[R,xp] = radon(rec_img,theta);
% rec_img is the input image.
imshow(R,[],'Xdata',theta,'Ydata',xp,...
'InitialMagnification','fit')
xlabel('\theta (degrees)')
ylabel('x''')
colormap(hot);

You will get sinogram.

To construct 3D image from sinogram you need iradon function as follows.
SPECT = data.sinogram;
filter = 'Ram-Lak';interpol = 'linear';
figure,
imagesc(SPECT);color(hot)
theta = 0 : 1 :179 ;
del_sinogram = SPECT(:, theta+1);
rec_img = iradon(del_sinogram,theta,filter, interpol);
figure,
imagesc(rec_img), colormap(pink);
> Here data representing the structure variable.
> I think it will help full to you.
>
> "Stanley " <smsearcy(a)ufl.edu> wrote in message <hp83r1$dbg$1(a)fred.mathworks.com>...
> > Good morning,
> >
> > I learning how to reconstruct SPECt images and need some help.
> >
> > Here&#8217;s what I have:
> >
> > A 128x64 array, 120 angles (slices), 2 byte integer
> >
> > To open the projection file into a 2-D array I used the following commands:
> >
> > fid=fopen(&#8216;imageA.prj&#8217;);
> > B=fread(fid,[128,64], &#8216;uint16&#8217;);
> >
> > theta = linspace(270, -90, 120) This gives me 120 different projection angles
> >
> > theta will be used with iradon
> >
> > #1 I want to reshape imageA so that I have a 3-D matrix (x, y, projection angle)
> >
> > &#8226; I&#8217;ve tried the reshape command without success and really don&#8217;t know how to proceed
> >
> > #2 I also want to create a sinogram from the projection data
> >
> > &#8226; To reduce noise I was provided with the following code that sum to sum the 6 through 21 transaxial slices of the projection data:
> >
> > sino_sum(1:ndim, 1:nang)=0.;
> > for k=1:nang
> > for i=1:ndim
> > for j=6:21
> > sino_sum(I,k)=sino_sum(I,k) +B(i, j, k)
> > end
> > end
> > end
> >
> > Can you help me convert the projection data from a 2D array into a 3D array?
> > Can you show me how to make a sinogram? &#8211; do I use iradon?
> > I believe nang is the number of projection angles (i.e., 120)
> > I&#8217;m not sure about the value for ndim
> >
> > Thank you in advance.
> >
> > Stanley
 | 
Pages: 1
Prev: HDL code generation
Next: Excel read in