[Rtk-users] .dat to .mha image

Laura Trubuil laura.trubuil at mail.medecom.fr
Mon May 27 09:44:41 EDT 2013


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
>>>>>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/rtk-users/attachments/20130527/94d6f1f7/attachment-0009.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: benchmarkCT_000.dat
Type: application/octet-stream
Size: 40000 bytes
Desc: not available
URL: <http://public.kitware.com/pipermail/rtk-users/attachments/20130527/94d6f1f7/attachment-0009.obj>
-------------- next part --------------
ObjectType=Image
NDims = 2
DimSize = 100 100
BinaryData = True
BinaryDataByteOrderMSB = False
CompressedData = False
ElementType = MET_FLOAT
ElementDataFile = LIST
benchmarkCT_000.dat 
benchmarkCT_001.dat 
benchmarkCT_002.dat 
benchmarkCT_003.dat 
benchmarkCT_004.dat 
benchmarkCT_005.dat 
benchmarkCT_006.dat 
benchmarkCT_007.dat 
benchmarkCT_008.dat 
benchmarkCT_009.dat 
benchmarkCT_010.dat 
benchmarkCT_011.dat 
benchmarkCT_012.dat 
benchmarkCT_013.dat 
benchmarkCT_014.dat 

-------------- next part --------------
ObjectType=Image
NDims = 2
DimSize = 100 100
BinaryData = True
BinaryDataByteOrderMSB = False
CompressedData = False
ElementType = MET_FLOAT
ElementDataFile = benchmarkCT_000.dat


More information about the Rtk-users mailing list