[Rtk-users] .dat to .mha image

Simon Rit simon.rit at creatis.insa-lyon.fr
Sun May 5 05:20:22 EDT 2013


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



More information about the Rtk-users mailing list