[Castor-users] SPECT reconstruction with scatter

tmerlin Thibaut.Merlin at univ-brest.fr
Tue Aug 8 17:57:26 CEST 2017


Hello James,

Apparently something went wrong when generating the binary datafile, 
though I can't tell exactly why from your matlab code.

This error occurs when the binary datafile doesn't have the expected 
size. The size is computed from the number of event, and what 
mandatory/optional fields are in your data. From your header, the 
datafile should contain 1966080 events with normalization and scatter 
correction factors. Each event will be composed of (time(uint32) + event 
value (FLNTBDATA) + scat factor (FLTNBDATA) + norm factor (FLTNBDATA) + 
2*ID (2*uint32). As you said, default FLNTBDATA is 32-bits floats, so 
this means the code will expect a datafile with a size equal to 
1966080*(6*4bytes) = 47185920 bytes. (The error message erroneously 
states the expected size is 39321600 bytes because there is a small typo 
in your data header for the normalization field. It should be 
"Normali*z*ation correction flag" instead of "Normali*s*ation correction 
flag", unless it won't enable normalization factors).

Now looking at your binary datafile with an hexa editor, it seems your 
conversion stopped after 58354 events (see attached file) for some 
reasons. Besides, each event has the correct number of fields, but it 
seems that all pixel data and scat factor are equals to 0.

Hope it helps !

Best regards,

Thibaut



-- 
Thibaut MERLIN -- PhD

Docteur en Imagerie Médicale au Laboratoire de Traitement de l'Information Medicale (LaTIM - INSERM UMR 1101)
Bâtiment 1
CHRU Morvan - 2, Av. Foch
29609 Brest CEDEX - FRANCE
Tel: 06.75.12.24.90


On 02/08/2017 20:18, SCUFFHAM, James (ROYAL SURREY COUNTY HOSPITAL NHS 
FOUNDATION TRUST) wrote:
>
> Dear CASToR community,
>
> I am appealing for some help getting CASToR to reconstruct some SPECT 
> projection data with scatter correction.
>
> I have attached the Matlab code we’re using to convert SPECT 
> projection data from Interfile into CASToR .cdh/.cdf files. I also 
> attach the result of this code when we feed it three interfiles 
> (photopeak and upper/lower scatter windows).  The code estimates the 
> scatter component (in counts/sec) using the Triple Energy Window method.
>
> When we run the resulting datafiles through castor-recon.exe, we get 
> the attached error message.  As there is a mismatch between the 
> expected and actual sizes, I suspect the problem relates to the bit 
> depth of the variables as I write them to the .cdf file, or a problem 
> with the header and CASToR not recognising the fact that I’ve included 
> normalisation factors.  As we are using the pre-compiled binaries, we 
> haven’t changed the default FLTNMDATA variable, so I am writing 
> variables of this type as 32-bit floats.
>
> I can’t spot any other issues with the conversion code, but I’m 
> obviously missing something.  I would appreciate any help anyone can 
> offer.  I have already had some very helpful email exchanges with 
> Michael Ljungberg in Lund, who has already got this working.  But 
> rather than continue to hassle Michael, I thought I would give him a 
> break and appeal to the wider community!
>
> Kind regards,
>
> James.
>
> *James Scuffham, MSc, PhD, MIPEM *
>
> Deputy Head of Section
>
> Nuclear Medicine Physics
>
> Royal Surrey County Hospital
>
> Egerton Road, Guildford, GU2 7XX
>
> T: 01483 406708
>
> 	
>
> Associate Tutor
>
> Department of Physics
>
> University of Surrey
>
> Guildford, GU2 7XH
>
> 	
>
>
> 	
> 	
>
> *From:*Castor-users 
> [mailto:castor-users-bounces at lists.castor-project.org] *On Behalf Of 
> *Kajal Aggarwal
> *Sent:* 02 August 2017 10:10
> *To:* tmerlin
> *Cc:* castor-users at lists.castor-project.org
> *Subject:* Re: [Castor-users] Query related to castor-GateMacToGeom
>
> Hello,
>
> Thank you for the detailed explanation. I am having troubles to 
> reconstruct an image for a cylindrical PET system simulated using 
> Gate. I am generating .geom file and .cdh and .cdf files (attached in 
> this email) for my .mac file and for the output root file. But the 
> image generated has some problem (see the screen-shot below). Please 
> guide me where I am going wrong.
>
> Thank you very much for all your support.
>
> Regards,
>
> Kajal
>
>
>
> Inline image 1
>
>
> Inline image 2
>
> On Tue, Aug 1, 2017 at 9:00 PM, tmerlin <Thibaut.Merlin at univ-brest.fr 
> <mailto:Thibaut.Merlin at univ-brest.fr>> wrote:
>
> Hello Kajal,
>
> F.O.V variables are arbitrary computed as /scanner_radius(mm)/4/ for 
> the transaxial component, and the axial dimension (mm) of the 
> rsector/block for the axial component. The transaxial/axial number of 
> voxels are calculated from these values in order to get (large) 
> isotropic 4mm voxels.
>
> The sole purpose of these variables is to be used as default for 
> reconstruction dimensions/voxel sizes when using this scanner, in the 
> case no dimensions have been initialized in command-line options. In 
> practice, they are overwritten by the parameters entered in command 
> line options (/-dim/ for number of voxels, /-fov /-vox/ for field of 
> view and voxel dimensions initializations ).
>
> Best regards,
>
> Thibaut
>
> On 01/08/2017 16:54, Kajal Aggarwal wrote:
>
>     Hello everyone,
>
>     I am trying to create .geom file from a .mac file for PET scanner
>     system. In the .geom file created, I would like to know how the
>     voxels number transaxial, voxels number axial, field of view
>     transaxial, field of view axial are being calculated.
>
>
>
>
>     -- 
>
>     Thanking you.
>
>     Yours sincerely,
>
>     Kajal Aggarwal
>
>     _______________________________________________
>
>     Castor-users mailing list
>
>     Castor-users at lists.castor-project.org
>     <mailto:Castor-users at lists.castor-project.org>
>
>     http://lists.castor-project.org/listinfo/castor-users
>
> -- 
> Thibaut MERLIN -- PhD
> Docteur en Imagerie Médicale au Laboratoire de Traitement de 
> l'Information Medicale (LaTIM - INSERM UMR 1101)
> Bâtiment 1
> CHRU Morvan - 2, Av. Foch
> 29609 Brest CEDEX - FRANCE
> Tel: 06.75.12.24.90
>
>
>
>
> -- 
>
> Thanking you.
>
> Yours sincerely,
>
> Kajal Aggarwal
>
>
>
> ********************************************************************************************************************
>
> This message may contain confidential information. If you are not the 
> intended recipient please inform the
> sender that you have received the message in error before deleting it.
> Please do not disclose, copy or distribute information in this e-mail 
> or take any action in relation to its contents. To do so is strictly 
> prohibited and may be unlawful. Thank you for your co-operation.
>
> NHSmail is the secure email and directory service available for all 
> NHS staff in England and Scotland. NHSmail is approved for exchanging 
> patient data and other sensitive information with NHSmail and other 
> accredited email services.
>
> For more information and to find out how you can switch, 
> https://portal.nhs.net/help/joiningnhsmail
>
>
>
> _______________________________________________
> Castor-users mailing list
> Castor-users at lists.castor-project.org
> http://lists.castor-project.org/listinfo/castor-users

-- 
Thibaut MERLIN -- PhD

Docteur en Imagerie Médicale au Laboratoire de Traitement de l'Information Medicale (LaTIM - INSERM UMR 1101)
Bâtiment 1
CHRU Morvan - 2, Av. Foch
29609 Brest CEDEX - FRANCE
Tel: 06.75.12.24.90

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.castor-project.org/pipermail/castor-users/attachments/20170808/3630f904/attachment-0001.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: image/png
Size: 36446 bytes
Desc: not available
URL: <http://lists.castor-project.org/pipermail/castor-users/attachments/20170808/3630f904/attachment-0003.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: image/png
Size: 18324 bytes
Desc: not available
URL: <http://lists.castor-project.org/pipermail/castor-users/attachments/20170808/3630f904/attachment-0004.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: datafile.png
Type: image/png
Size: 157946 bytes
Desc: not available
URL: <http://lists.castor-project.org/pipermail/castor-users/attachments/20170808/3630f904/attachment-0005.png>


More information about the Castor-users mailing list