[Rtk-users] .dat to .mha image

Marc Vila Oliva marc.vila-oliva at creatis.insa-lyon.fr
Mon Jun 3 06:01:18 EDT 2013


Hello Laura, 

Cyril is right. What you get from Gate is just the accumulated energy on
the detector (raw data) and you should convert it to attenuation in
order to reconstruct your projections with FDK. Generally this means
that you need to take the -log (check Beer-Lambert law) of the results
on your detector, in the case that you don't need to correct for
background noise or other parameters. 

With the link that Cyril provided you, I think it will be enough for you
to keep going. If not, let us know if you need more help. 

Cheers, 
Marc

On Mon, 2013-06-03 at 07:07 +0000, MORY, CYRIL wrote:
> Hi Laura,
> 
>  
> 
> Judging from the projection image you sent, you seem to be missing a
> crucial step.
> 
> The area around your water cylinder is white and the balls are black.
> This is probably what GATE generates, and it’s the raw data you would
> obtain from a scanner. It is (more or less) the power received by each
> pixel of the detector. Before you backproject this, you have to
> convert it to attenuations.
> 
> Check out the Wikipedia
> pagehttp://en.wikipedia.org/wiki/Tomographic_reconstruction.Currently
> your images represent I, and you have to extract p. Only then can you
> hope to get something coherent from an FDK reconstruction.
> 
>  
> 
> I’m not a specialist of this step of the reconstruction, but some
> people on this list probably know the details and can help you
> further.
> 
>  
> 
> Regards,
> 
> Cyril
> 
>  
> 
> De : rtk-users-bounces at openrtk.org
> [mailto:rtk-users-bounces at openrtk.org] De la part de Laura Trubuil
> Envoyé : lundi 27 mai 2013 15:45
> À : rtk-users at openrtk.org
> Objet : Re: [Rtk-users] .dat to .mha image
> 
> 
>  
> 
> Dear RTK-users,
> 
> I am working on reconstruction with RTK backprojection algorithm.
> RTK Wiki examples worked fine but now, I am trying with my own images,
> and I obtain a result I cannot explain.
> 
> I have 15 projections, simulated with GATE. My phantom is a water
> cylinder, containing 4 balls of different materials.
> I attached one of them with the mail, to give an example (the other
> are quite similar, only the place of the balls changes).
> 
> I generate a geometry.xml file with the command : rtksimulatedgeometry
> -o geometry.xml -n 15 --sdd 300 --sid 150
> and then apply rtkbackprojection with : rtkbackprojections -o
> output.mha -g geometry.xml -r header.mhd -p. 
> I display output.mha with VTK and obtain a white cube...
> 
> Does anybody have an idea of what I am missing? Is the number of
> projections too small? Is it a display problem?
> 
> Regards,
> 
> Laura Trubuil
> 
> 
> 
> Le 13/05/2013 16:14, Simon Rit a écrit :
> 
> 
>         Dear Laura,
>         If you use rtk::FDKConeBeamReconstructionFilter, there is a weighting
>         by the angular gap (angular distance between the previous and the next
>         projection) so that will be a problem. If you only use the
>         backprojection, that should not be a problem.
>         With FDK, there are a few solutions, the simplest being to trick the
>         algorithm by adding 2 projections with zeros at the beginning and the
>         end of your tomosynthesis acquisition.
>         If you have some problems with the geometry, don't hesitate to provide
>         your Gate macros and we can try to help.
>         Simon
>          
>         On Tue, May 7, 2013 at 10:05 AM, Laura Trubuil
>         <laura.trubuil at mail.medecom.fr> wrote:
>                 Dear Simon,
>                 Thank you for your help.
>                  
>                 It is a circular cone beam CT, yes.
>                 In fact, what I precisely do is working on tomosynthesis. I use the CT
>                 scanner simulator of GATE as a basis for a tomosynthesis simulation. The
>                 only differences are that the X-Ray dose is lower, and the angle is not 360°
>                 but 40° maximum. I do not think it is a problem for RTK, is it?
>                 First, I intend to use RTK backprojection, and then, I will try to enhance
>                 the quality of the reconstruction by filtering techniques.
>                  
>                 I have already done some simulations on GATE, for small animal in a first
>                 time (because the computation time is too long for real human chest
>                 detectors, which are much bigger). It allows me to work on algorithms and
>                 test reconstruction with something, for the moment! I will be glad to help
>                 you if I can.
>                  
>                 I will continue studying RTK examples, I will let you know if I make some
>                 progress. Thanks again.
>                  
>                 Regards,
>                  
>                 Laura
>                  
>                  
>                 Le 07/05/2013 01:50, Simon Rit a écrit :
>                  
>                         Hi,
>                         I don't know the CT simulation module of Gate so I can't help you. I
>                         will discuss this matter with my colleagues. We are currently working
>                         on a new CT simulation module but we definitely need to investigate
>                         how one can reconstruct from the existing module. What is the geometry
>                         of the scanner, is it circular cone-beam CT? It is the only geometry
>                         that RTK can handle.
>                         To understand how to use mhd files, you can look at other examples on
>                         RTK wiki. We will work on your problem and I'll let you know as soon
>                         as we have progressed but keep us informed if you make some progresses
>                         on your side.
>                         Regards,
>                         Simon
>                          
>                         On Mon, May 6, 2013 at 9:21 AM, Laura Trubuil
>                         <laura.trubuil at mail.medecom.fr> wrote:
>                                 Dear Simon,
>                                  
>                                 Thank you for your answer.
>                                 I  am using the CT Scanner simulation in GATE, so the output available
>                                 are
>                                 the ".root" and the ".dat" only.
>                                  
>                                 First, I simply tried to change the extension ".dat" to ".mhd" or to
>                                 ".raw"
>                                 but, as expected, it does not work because I need to specifiy which kind
>                                 of
>                                 data the file contains (the role of the header in fact...).
>                                 Then, I tried to do something with the GateToImage Class, which contains
>                                 a
>                                 function called WriteMHD, but it was not a success... I did not find a
>                                 way
>                                 to directly obtain ".mhd" from a CT Scanner simulation from GATE. That is
>                                 when I decided to ask the RTK users!
>                                  
>                                 With M. Mory's method, I am now able to open  my ".dat" files with
>                                 ImageFileReader function from ITK, and visualize it with VTK.
>                                  
>                                  
>                                 For the moment, I am trying to reconstruct slices from 15 projections
>                                 acquired with the CT Scanner example in GATE.
>                                 Have you got any example of reconstruction of slices from projections
>                                 with
>                                 RTK?
>                                  
>                                 I already studied the Sphere reconstruction tuto, but it does not help me
>                                 to
>                                 understand how I can make use of my ".mhd" files in the RTK algorithms. I
>                                 will do further research work.
>                                  
>                                 Regards,
>                                  
>                                 Laura Trubuil
>                                  
>                                  
>                                  
>                                 Le 05/05/2013 11:20, Simon Rit a écrit :
>                                  
>                                         Dear Laura,
>                                         I think that in the latest version of Gate, you should be able to
>                                         write mhd files. hdr file format should also work in both platforms.
>                                         What happens if you change the extension of your output files to .mhd?
>                                         Regards,
>                                         Simon
>                                          
>                                         On Thu, May 2, 2013 at 10:51 AM, MORY, CYRIL <Cyril.Mory at philips.com>
>                                         wrote:
>                                                 Hi Laura,
>                                                  
>                                                 In the .mhd and .raw format, the .raw file is a binary file of floats
>                                                 (or
>                                                 whatever) representing the pixel intensities, and the .mhd a simple
>                                                 header
>                                                 that indicates the number of dimensions, the size in pixels along each
>                                                 dimension, ... Your .dat seems to be exactly the same as the .raw
>                                                 You can create the .mhd header yourself, using a text editor. Here is
>                                                 an
>                                                 example :
>                                                  
>                                                 ObjectType = Image
>                                                 NDims = 2
>                                                 BinaryData = True
>                                                 BinaryDataByteOrderMSB = False
>                                                 CompressedData = False
>                                                 TransformMatrix = 1 0 0 1
>                                                 Offset = -190.5 -190.5
>                                                 CenterOfRotation = 0 0
>                                                 ElementSpacing = 3 3
>                                                 DimSize = 128 128
>                                                 ElementType = MET_FLOAT
>                                                 ElementDataFile = SheppLogan.raw (try to replace this field with your
>                                                 .dat filename)
>                                                  
>                                                 If I were you, I'd start by trying to adjust these parameters until you
>                                                 manage to visualize a single projection (there are plenty of viewers
>                                                 that
>                                                 open mhd/raw files), and then create a header for the whole sequence
>                                                 (NDims
>                                                 = 3, etc ...) and concatenate the .dat binary files into a single one.
>                                                 You
>                                                 could use a script like the following :
>                                                  
>                                                 #!/bin/bash
>                                                 # Concatenate all projections into a single raw file
>                                                 NbProj=300
>                                                 i=0
>                                                 list="projection${i}.raw"
>                                                 for i in $(seq 1 1 $(($NbProj-1)))
>                                                 do
>                                                           list="$list projection${i}.raw"
>                                                 done
>                                                 cat $list > SheppLogan.raw
>                                                  
>                                                 which would concatenate all files named "projection0.raw",
>                                                 "projection1.raw", ... into "SheppLogan.raw"
>                                                  
>                                                  
>                                                 -----Message d'origine-----
>                                                 De : rtk-users-bounces at openrtk.org
>                                                 [mailto:rtk-users-bounces at openrtk.org]
>                                                 De la part de Laura Trubuil
>                                                 Envoyé : jeudi 2 mai 2013 09:29
>                                                 À : rtk-users at openrtk.org
>                                                 Objet : [Rtk-users] .dat to .mha image
>                                                  
>                                                 Dear RTK users,
>                                                  
>                                                 I am working on GATE (from Geant4), to create projections images of
>                                                 tomosynthesis.
>                                                 I have projections but they are in ".dat" format (binary matrix of
>                                                 float
>                                                 numbers that stores the simulated tomosynthesis image and is produced
>                                                 for
>                                                 each time slice).
>                                                  
>                                                 I want to reconstruct a 3D volume, from projections, with RTK.
>                                                 To do that, I know I must change the format of my images (for example
>                                                 to
>                                                 .mhd/.raw or to .mha format) but my problem is that I do not know how.
>                                                  
>                                                 I anyone could help...
>                                                  
>                                                 Regards,
>                                                  
>                                                 Laura
>                                                  
>                                                 _______________________________________________
>                                                 Rtk-users mailing list
>                                                 Rtk-users at openrtk.org
>                                                 http://public.kitware.com/cgi-bin/mailman/listinfo/rtk-users
>                                                  
>                                                 ________________________________
>                                                 The information contained in this message may be confidential and
>                                                 legally
>                                                 protected under applicable law. The message is intended solely for the
>                                                 addressee(s). If you are not the intended recipient, you are hereby
>                                                 notified
>                                                 that any use, forwarding, dissemination, or reproduction of this
>                                                 message is
>                                                 strictly prohibited and may be unlawful. If you are not the intended
>                                                 recipient, please contact the sender by return e-mail and destroy all
>                                                 copies
>                                                 of the original message.
>                                                  
>                                                 _______________________________________________
>                                                 Rtk-users mailing list
>                                                 Rtk-users at openrtk.org
>                                                 http://public.kitware.com/cgi-bin/mailman/listinfo/rtk-users
>                                         _______________________________________________
>                                         Rtk-users mailing list
>                                         Rtk-users at openrtk.org
>                                         http://public.kitware.com/cgi-bin/mailman/listinfo/rtk-users
>                                          
> 
>  
> 
> 
> 
> 
> ______________________________________________________________________
> The information contained in this message may be confidential and
> legally protected under applicable law. The message is intended solely
> for the addressee(s). If you are not the intended recipient, you are
> hereby notified that any use, forwarding, dissemination, or
> reproduction of this message is strictly prohibited and may be
> unlawful. If you are not the intended recipient, please contact the
> sender by return e-mail and destroy all copies of the original
> message.
> _______________________________________________
> Rtk-users mailing list
> Rtk-users at openrtk.org
> http://public.kitware.com/cgi-bin/mailman/listinfo/rtk-users





More information about the Rtk-users mailing list