<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
<style type="text/css" style="display:none;"> P {margin-top:0;margin-bottom:0;} </style>
</head>
<body dir="ltr">
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255);">
<span style="font-size: 12pt; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255);">Hi Abdellah,</span>
<div style="font-size: 12pt; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255);">
<br>
</div>
<div style="font-size: 12pt; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255);">
As a possible automated solution, you could try using the functions Voxelized_phantom_handle.m and saveInterfile.m or saveMetaImage.m from OMEGA (<a href="https://github.com/villekf/OMEGA/tree/master/source" data-auth="NotApplicable">https://github.com/villekf/OMEGA/tree/master/source</a>).<br>
</div>
<div class="_Entity _EType_OWALinkPreview _EId_OWALinkPreview _EReadonly_1"></div>
<div style="font-size: 12pt; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255);">
<br>
</div>
<span style="font-size: 12pt; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255);">Manually you can do it by using the functions
<i>fopen </i>and <i>fread </i>to load the data, manually scaling the data so that it can be converted to integers and then simply use uint16(data) to convert the data. After that, save it as a binary data and manually write a hdr-file (or use the above saveInterfile
or saveMetaImage functions).</span></div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255);">
<br>
</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255);">
Regards,</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255);">
Ville-Veikko Wettenhovi<br>
</div>
<div id="appendonsend"></div>
<hr style="display:inline-block;width:98%" tabindex="-1">
<div id="divRplyFwdMsg" dir="ltr"><font face="Calibri, sans-serif" style="font-size:11pt" color="#000000"><b>From:</b> Gate-users <gate-users-bounces@lists.opengatecollaboration.org> on behalf of ABDELLAH KITANI <abdellah.kitani@etu.uae.ac.ma><br>
<b>Sent:</b> Wednesday, April 20, 2022 15:54<br>
<b>To:</b> Gate-users@lists.opengatecollaboration.org <Gate-users@lists.opengatecollaboration.org><br>
<b>Subject:</b> [Gate-users] How convert XXX.HDR from 32 bit to 16 bit using MATLAB</font>
<div> </div>
</div>
<div>
<div dir="ltr">Hello dear users. I need to convert a voxel phantom using Matlab, and I'm not familiar with matlab. Can anyone here send an example of the codes he/she used (MATLAB) to convert a xxx.hdr file from float32=>uint16 ???</div>
</div>
</body>
</html>