[Gate-users] How convert atn.BIN from 32 bit to 16 bit?

Didier Benoit benoit at imnc.in2p3.fr
Wed Nov 16 17:09:42 CET 2011


Hi Chang-Lae

All values in your atn.bin are inferior to 0, so if you convert to 
unsigned short (uint16) all your values will be 0. You have to use the 
file act.bin in GATE to simulate a voxellized phatom. After you create 
your own activity map in a file activity.dat for instance. You have an 
example in the following folder:

$GATEHOME/examples/example_PHANTOM_SOURCE/Voxelized_Phantom_Source

Kind regards,
Didier

On 11/16/2011 06:26 AM, changlae lee wrote:
>
> Dear gate-users,
>
> I am doing study on x-ray CT MOBY modelling for dose calculation with 
> GATE.
> GATE can't read float data (32 bit). So I have converted unsigned 
> integer (16bit) format using MATLAB.
> I converted "act.BIN" from 32 bit to 16 bit, and I could see the 
> imaging well (amide, XMedCon, Image-J).
>
> And I am trying to do x-ray CT dosimetry using attenuation 
> map(atn.BIN). However, when I converted 'atn.BIN' from 32 bit to 16 
> bit, I couldn't see the 16 bit image. What I could see was only black box.
> Is there a particular way to convert atn.BIN from 32 bit to 16 bit?
>
> The codes I used is below (MATLAB)...
>
> >> uiopen('C:\MOBY\atn_32bit.bin',1);
> >> a=fopen('atn_32bit.bin','rb','ieee-le');
> c=zeros(128,128,4);
> for i=1:4;
> [b,co]=fread(a,[128 128],'float32=>uint16');
> c(:,:,i)=b;
> end
> >> a2=fopen('atn_32bit.bin','wb');
> fwrite(a2,c,'uint16');
> fclose(a);
> fclose(a2);
>
> The attached files are "atn.BIN" of 32bit and detail explain file.
> Thank you,
>
> Kind regards.
> Chang-Lae
>
> Doctoral student,
> Dept. of Radiological Science
> Yonsei University College of Health Science, korea
>


-- 
----------------------------------------------------------------
Didier BENOIT, GATE Engineer
Imagerie et Modélisation en Neurobiologie et Cancérologie (IMNC)
IMNC – UMR 8165 CNRS – Université Paris 7 – Université Paris 11
Campus d’Orsay
Bâtiment 440
91406 ORSAY Cedex

Tél : (33) 1 69 15 68 76
E-mail : benoit at imnc.in2p3.fr
http://www.imnc.in2p3.fr
----------------------------------------------------------------



More information about the Gate-users mailing list