[MINC-users] losing bytes when converting to/from minc

Sylvain MILOT sylvain@bic.mni.mcgill.ca
Mon Sep 6 20:51:04 2004


Hello,

I would suggest that your assumption about the size of your volume's
dimensions is wrong since 256*256*256 = 16777216, hence rawtominc did
exactly what you asked it to do, it stored 16777216 raw bytes + a
header (and dropped the last 16 bytes).

Sylvain


On Mon, 6 Sep 2004, Jon Frederick wrote:

> Hello,
> when we convert our raw file to minc and back to raw with the following
> commands, our image browser complains that it has reached the end of the
> file and, in fact, the output of minctoraw is 16 bytes shorter. Any idea
> where these bytes are going?
>
> # dd conv=swab if=eih0060t1.al0 | rawtominc -coronal -byte -unsigned
> -ystep 1 -zstep 1 -xstep 1 -mri -origin 0 0 0 -range 0 255 -real_range 0
> 255 -clobber temp.mnc 256 256 256
>
> 32768+1 records in
> 32768+1 records out
> 16777232 bytes transferred in 0.771042 secs (21759164 bytes/sec)
>
> total 98376
> # minctoraw -range 0 255 -normalize temp.mnc | dd conv=swab of=temp.al0
>
> 32768+0 records in
> 32768+0 records out
> 16777216 bytes transferred in 0.714025 secs (23496678 bytes/sec)
>
> nal7:/private/var/root/nucorrect.dir root# ls -l
> -rw-r--r--  1 root  wheel  16777232  1 Sep 17:33 eih0060t1.al0
> -rw-r--r--  1 root  wheel  16777216  6 Sep 17:17 temp.al0
> -rw-r--r--  1 root  wheel  16783884  6 Sep 17:17 temp.mnc
>
> _______________________________________________
> MINC-users@bic.mni.mcgill.ca
> http://www.bic.mni.mcgill.ca/mailman/listinfo/minc-users
>

---
Sylvain Milot (sylvain@bic.mni.mcgill.ca)
              (trinity@bic.mni.mcgill.ca)
Brain Imaging Centre
Montreal Neurological Institute
Webster 2B, Room 208
Montreal, Qc., Canada, H3A 2B4
Phone  : (514) 398-4965, 1996   Fax: 8948
Mobile : (514) 712-1768
Office : 527 Pine, room 204