[Castor-users] TR: SPECT reading Interfile
COMTAT Claude
claude.comtat at cea.fr
Tue Apr 25 14:29:00 CEST 2017
I had a similar problem the first time I used CASToR to reconstruct PET data with OSEM.
I’m not familiar with SPECT reconstruction, but I was referring to what is written in the manual, pages 6-7 :
If I follow your convention :
I have a float matrix Mat(I,J,K) where I,J is the projections bins for a specific SPECT camera position (projection ID ) K. The index I goes from left to right and J goes axially from the patient head and down.
As the order of the histogram “events” is important for OSEM, I would recommend the following:
ievent=0;
for (J=1; J<= MtsizJ; J++) {
for (I=1; I<= MtsizI; I++) {
for (K=1; K<= NbViews; K++) {
fwrite(Itime, Mat(I,J,K), K-1,(I-1)+(J-1)*MtxsizI);
ievent++;
}
}
}
instead of the usual:
ievent=0;
for (K=1; K<= NbViews; K++) {
for (J=1; J<= MtsizJ; J++) {
for (I=1; I<= MtsizI; I++) {
fwrite(Itime, Mat(I,J,K), K-1,(I-1)+(J-1)*MtxsizI);
ievent++;
}
}
}
where NbViews is a multiple of the number of subsets.
De : Michael Ljungberg [mailto:michael.ljungberg at med.lu.se]
Envoyé : mardi 25 avril 2017 13:52
À : COMTAT Claude
Objet : Re: [Castor-users] TR: SPECT reading Interfile
Hi
You write “..first subset will contain Mat(i=0,j=0,k=0), Mat(i=0,j=0,k=N), Mat(i=0,j=0,k=2*N), … and the resulting subsets will be better balanced.”
I need to write for each event Itime,DataValue,ProjectionID,BinID. This means that Fwrite should include FWrite(Itime, Mat(I,J,K),X,Y)
Could you tell me, based on your index about what X and Y should be? I have in my code X=(K-1),Y=MtxsizJ*(J-1)+(I-1) for the moment. I use Fortran so index starts at 1 :-)
Hälsningar / Best regards
Michael
From: Castor-users <castor-users-bounces at lists.castor-project.org> on behalf of COMTAT Claude <claude.comtat at cea.fr>
Date: Tuesday, 25 April 2017 at 10:11
To: "castor-users at lists.castor-project.org" <castor-users at lists.castor-project.org>
Subject: [Castor-users] TR: SPECT reading Interfile
Dear Michael,
radial : I
axial : J
azimuthal : K
You should not store your projection data as it is usually done :
for (k=0 ;k<K ;k++) for (j=0 ;j<J ;j++) for (i=0 ;i<I ;i++) fwrite(Mat(i,j,k));
and then perform an OSEM reconstruction. In CASToR, there is no assumption at all about the organization of the data. The code will read sequentially the data : if there are N subsets, first subset will contain Mat(i=0,j=0,k=0), Mat(i=N,j=0,k=0), Mat (i=2*N,j=0,k=0), … and the resulting subsets will not be well balanced.
You can rather write your matrix as :
for (j=0 ;j<J ;j++) for (i=0 ;i<I ;i++) for (k=0 ;k<K ;k++) fwrite(Mat(i,j,k)) ;
Then, first subset will contain Mat(i=0,j=0,k=0), Mat(i=0,j=0,k=N), Mat(i=0,j=0,k=2*N), … and the resulting subsets will be better balanced.
I did not get your figure 9.
Best,
Claude
De : Michael Ljungberg [mailto:michael.ljungberg at med.lu.se]
Envoyé : mardi 25 avril 2017 08:18
À : COMTAT Claude
Objet : Re: [Castor-users] SPECT reading Interfile
Hi Claude
Sorry but I am still puzzle about this. You mentioning I should write the histogram events with the inner loop over the radial or axial coordinate. Radial – what does this mean? Next sentences mention the azimuthal coordinate. What does this mean relative to the previous question?
I have a float matrix Mat(I,J,K) where I,J is the projections bins for a specific SPECT camera position (projection ID ) K. The index I goes from left to right and J goes axially from the patient head and down.
>From Figure 9 it looks like I need to flip the axial orientation because you start from the legs and goes to head (lower left corner to upper left corner for the axial rows.
Any clarification about how to write the dafa file based on the above would be very helpful because the osem if of course of interest to be able to use.
Hälsningar / Best regards
Michael
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.castor-project.org/pipermail/castor-users/attachments/20170425/f563b858/attachment-0001.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image001.png
Type: image/png
Size: 92268 bytes
Desc: not available
URL: <http://lists.castor-project.org/pipermail/castor-users/attachments/20170425/f563b858/attachment-0003.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image002.png
Type: image/png
Size: 81045 bytes
Desc: not available
URL: <http://lists.castor-project.org/pipermail/castor-users/attachments/20170425/f563b858/attachment-0004.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image003.png
Type: image/png
Size: 133346 bytes
Desc: not available
URL: <http://lists.castor-project.org/pipermail/castor-users/attachments/20170425/f563b858/attachment-0005.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 5587 bytes
Desc: not available
URL: <http://lists.castor-project.org/pipermail/castor-users/attachments/20170425/f563b858/attachment-0001.bin>
More information about the Castor-users
mailing list