[Gate-users] Voxelised source problem with ASCII input
David Oxley
d.c.oxley at rug.nl
Thu Apr 14 13:57:17 CEST 2011
Hi Simon,
thanks for your quick reply, I hope you dont mind me following up with further questions.
I will try to divide it into two categories (1) the InterFile and (2) the bug.
InterFile:
The header you sent me: am I right that this is written in FORTRAN and that the ! 's denote comments? So you are essentially defining a byte order and then an x , y, z size with two scaling factors and a slice thickness.
I am still not clear on this '3D image'. What is its format and how can I create it? Is it just a list of unsigned short integers, or is there more to it? What do you mean by labels? Perhaps a simple example will help, if I have a 2 x 2 x 2 source distribution with (obviously) 8 voxels with an activity of 1,2,3,4,5,6,7,8 in each voxel where do I add the labels to this? Sorry, I just dont really know what you mean by 3D image.
The bug:
While awaiting a response, I had kept trying to load my source distrubution in with ascii and hoped to understand where the compression that I saw was coming from. Eventually I reduced my distribution just to a straight line. Following the manual, the file must begin with nx, ny,nz and then be a list of numbers. If I do this I get, like the original post you helped with, always the same distribution. But I had also tried adding a voxel size in the second row
nx, ny, nz,
dx , dy, dz ,
list of numbers
(I am sure I read this somewhere, but I now cant find where anymore)
But for my straight line, this seems to work. I dont see any compression and the simulation runs. Plotting the source positions, it looks like my source - a straight line again. Basically, I am now wondering if the whole ascii input is unuseable or if this was part of the problem. Can you tell me more about what the bug was?
Dave
----- Original Message -----
From: Simon Stute
To: David Oxley
Cc: gate-users at lists.opengatecollaboration.org
Sent: Thursday, April 14, 2011 1:00 PM
Subject: Re: [Gate-users] Voxelised source problem with ASCII input
Hi David,
From my knowledge, the bug for ascii description of voxelized sources has not been yet fixed.
From my point of view, managing interfile images is much more convenient (or any binary one), at least for visualization purpose, as many viewers cannot open ascii images.
When you use interfile input, you do not have to describe it as a slice sequence like you said. You just have to make a 3D image in unsigned short int format, that contains labels. Then with your translator, you tranform labels in activity amount in each voxel.
I give you there, the most simplified interfile header that contains enough informations to be used with GATE.
!INTERFILE :=
!GENERAL DATA :=
!data offset in bytes := 0
!name of data file := your_image_in_unsigned_short_int_format.i33
;
!GENERAL IMAGE DATA :=
!total number of images := your_number_of_slices
imagedata byte order := LITTLEENDIAN
;
!number of images/energy window := your_number_of_slices
!matrix size [1] := your_number_of_pixels_along_x_axis
!matrix size [2] := your_number_of_pixels_along_y_axis
!number format := unsigned integer
!number of bytes per pixel := 2
scaling factor (mm/pixel) [1] := the_pixel_size_along_x_axis_in_mm
scaling factor (mm/pixel) [2] := the_pixel_size_along_y_axis_in_mm
!number of slices := your_number_of_slices
slice thickness (pixels) := the_slice_thickness_in_mm
!END OF INTERFILE :=
It should do the job.
When the bug for ascii description will be fixed, I will let you now.
Good luck,
Simon
On Wed, Apr 13, 2011 at 5:29 PM, David Oxley <d.c.oxley at rug.nl> wrote:
Dear all,
I am trying to implement a voxelised source of positrons into a cylindrical PET scanner using the ASCII method of defining the source and a linear translator.
my question follows on from a discussion in the archives between Simon Stute and Ismet Isnaini (http://article.gmane.org/gmane.comp.science.opengate.user/1356/match=voxelized+source+ascii, last post 22-Feb-2011) where they concluded reading in a voxelised source using the ascii method had a bug in it.
I am not sure if I am seeing the same bug, but I am not sure how GATE knows my voxel size and I see large amounts of my data are compressed into the early entries of my source.
First, I am wondering if there have been any developments on this bug as using an ASCII file really sounds much easier.
If not, then I was hoping for more information about this InterFile alternative. In the voxelised source section of the manual it appears there is only one interfile, in this case hof.h33. But earlier in the manual there is a link to http://www.colin-studholme.net/software/rview/rvmanual/fileform.html#interfile , where there is talk of a header and a different image for each slice. I want my source to be a matrix, 100 x 100 x 100 voxels with a voxel size of 1mm x 1 mm x 1mm and I know what the activity should be for each of the voxels.
Does this mean if I have an ascii file with 100^3 entries, I need to make 100 images ending in .IMG for the InterFie format? Are these saved as binary or ascii? Is the header binary?
Perhaps someone has come across this problem before or knows more about this InterFile format than I do.
Just finally, I would rather not use the InterFile format, if someone has fixed the bug or has been able to use the ascii voxelised source without problems, I would greatly appreciate their help.
Thanks in advance to you all for taking the time to assist.
Kind regards,
Dave
=================================
Dr. David Oxley
Postdoctoral Researcher
Kernfysisch Versneller Instituut
Zernikelaan 25
NL-9747 AA Groningen
The Netherlands
d.c.oxley at kvi.nl
d.c.oxley at rug.nl
_______________________________________________
Gate-users mailing list
Gate-users at lists.opengatecollaboration.org
http://lists.opengatecollaboration.org/mailman/listinfo/gate-users
More information about the Gate-users
mailing list