[Rtk-users] .dat to .mha image
Laura Trubuil
laura.trubuil at mail.medecom.fr
Wed May 29 03:49:06 EDT 2013
Dear Simon,
Thank you for your answer.
I have tried this morning both of your techniques but, unfortunately, I
obtain the same result as I had previously. There is still something I
am missing I guess... If anybody has suggestions!
Regards,
Laura
Le 28/05/2013 20:30, Simon Rit a écrit :
> Hi Laura,
> I think you are missing a point in the geometry definition. By
> default, it assumes that the ray going through the source and the
> isocenter (point of coordinate 0 0 0 in the volume) is intersecting
> the projection at coordinate (0 0). In the projection that you have
> sent, (0 0) is the corner of your image.
> Two solutions :
> - run the geometry specifying the translation
> rtksimulatedgeometry -o geometry.xml -n 1 --sdd 300 --sid 150
> --proj_iso_x -50 --proj_iso_y -50
> rtkbackprojections -p . -r headerOneImage.mhd -o test.mha -g geometry.xml
> - Change the origin of your image in your mhd file by adding the following line
> Offset = -50 -50
> Simon
>
> On Mon, May 27, 2013 at 3:44 PM, Laura Trubuil
> <laura.trubuil at mail.medecom.fr> wrote:
>> 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
>>
>>
>>
>> _______________________________________________
>> 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