[Insight-users] Little Endian or Big Endian and How to find out

Bradley Lowekamp blowekamp at mail.nih.gov
Thu Apr 18 13:59:46 EDT 2013


Here is the documentation for the file format:

http://www.vtk.org/VTK/img/file-formats.pdf

On Apr 18, 2013, at 1:55 PM, Emma Saunders <emmasaunders123 at gmail.com> wrote:

> Hi all,
> 
> Im running a little endian system,  I am attempting to visualize a displacement field saved as a .vtk file (float) in matlab, and would like to compare this to Paraviews display.
> 
> When I read the data in matlab using fid=fopen('deformfield2d.vtk','r','l'); and after iterating to the correct line:
> 
> V = fread(fid,siz,'*single');  V = reshape(V,siz);  
> 
> The output is nonsense and it appears to be written as big endian, however the min max values I obtain when reading as big endian don't agree with paraviews for one of the two components?
> 
> Can anyone offer insight into my problem?
> 
> Kind regards
> 
> Emma        
> 
> _____________________________________
> Powered by www.kitware.com
> 
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
> 
> Kitware offers ITK Training Courses, for more information visit:
> http://www.kitware.com/products/protraining.php
> 
> Please keep messages on-topic and check the ITK FAQ at:
> http://www.itk.org/Wiki/ITK_FAQ
> 
> Follow this link to subscribe/unsubscribe:
> http://www.itk.org/mailman/listinfo/insight-users



More information about the Insight-users mailing list