<div dir="ltr"><div><div><div><div><div>Dear all <br></div>I have a very very simple C code (attached) that merge to raw file if they have the same size (then I just keep the header of one of them for the merged file)<br><br></div><div>To compile :<br></div><div>gcc -c merge.c<br></div><div>gcc merge.o -o merge<br></div><div><br></div><div>Then<br>// Use : ./merge img1.raw img2.raw out.raw<br>// Add img1.raw and img2.raw in out.raw<br><br></div><div><br></div>Hereafter you ll find a part of a small bash script that loop in a directory to merge many files...<br><br> # - - - - - - - - - - - - - - - - - -<br> # MERGING <br><br> # get name of the first file<br> file1=`ls -1 output/water/*doseW.raw | head -1`<br> mv $file1 output/water/first.raw<br> cp output/water/first.raw output/water/backUp.raw<br> <br> varW=0<br> for file in output/water/*doseW.raw<br> do<br> varW=$((varW+1))<br> # merge first and next into out<br> output/water/merge $file output/water/first.raw output/water/out.raw<br> # out become first<br> mv output/water/out.raw output/water/first.raw<br> done<br> varW=$((varW+1))<br> <br> mv output/water/backUp.raw $file1<br> mv output/water/first.raw output/water/out.raw<br><br> # - - - - - - - - - - - - - - - - - -<br><br><br></div>Not perfect but it works for me<br></div>hope it helps<br><br></div>Luc SIMON<br><br><div><div><div><br><br></div></div></div></div><div class="gmail_extra"><br><div class="gmail_quote">2017-04-20 20:42 GMT+02:00 G Tom <span dir="ltr"><<a href="mailto:gregthom992@gmail.com" target="_blank">gregthom992@gmail.com</a>></span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Does anyone have a script to merge (mhd in particular or other files txt from dose actor) files from several split simulations ? VV seems to only merge several nD into (n+1)D not several nD into nD. <div><br></div><div><div><br></div><div>Thanks</div><span class="HOEnZb"><font color="#888888"><div><br></div><div>GT</div></font></span></div></div>
<br>______________________________<wbr>_________________<br>
Gate-users mailing list<br>
<a href="mailto:Gate-users@lists.opengatecollaboration.org">Gate-users@lists.<wbr>opengatecollaboration.org</a><br>
<a href="http://lists.opengatecollaboration.org/mailman/listinfo/gate-users" rel="noreferrer" target="_blank">http://lists.<wbr>opengatecollaboration.org/<wbr>mailman/listinfo/gate-users</a><br></blockquote></div><br><br clear="all"><br>-- <br><div class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr"><div><div dir="ltr"><div>___________________<br><br>SIMON Luc, Physicien Médical, PhD<br>Département d'Ingénierie et de Physique Médicale - IUCT-Oncopole - Toulouse, FRANCE</div><div>INSERM UMR 1037 (CRCT) - Equipe 15 - Toulouse, FRANCE</div></div></div></div></div>
</div>