The nrrd format seems to be similar (text header and binary data). You can 
have a look at the implementation in Images.jl. 
See https://github.com/timholy/Images.jl/blob/master/src/ioformats/nrrd.jl#L356 
for the part where the data is written. Note that the "data" function is 
only required here, because the module does not operate on regular arrays 
but on "Image" objects.

Am Samstag, 14. März 2015 13:41:04 UTC+1 schrieb Christian Dengler:
>
> Hello,
>
> I'm trying to save my data as .vtk files, and ran into a problem with the 
> "print" and "write" function.
>
> Resumee of what would solve my problems:
> - Using print(filestream, data), but omitting the square brackets, and
> - using print(filestream, vector), and actually writes the vector, one 
> element per line
>
> Does anyone know how this is done?
>
> Another way of creating .vtk files using binary data, using the write 
> function, didn't lead to any success, but i cant really say whats wrong, 
> because the files are unreadable. Could it be, that write also somehow 
> includes brackets?
>
>
> For those who want to see my problem in code, i attached a script, 
> creating and saving a simple veocity field as .vtk (ASCII) file.
> After manually deleting the brackets, atleast the velocity can be imported 
> into paraview.
> In order to create the binary .vtk file (thats not working at all), i used 
> to replace "ASCII" by "BINARY", and "print" in line 22 and  41 by "write".
>
> Greetings, 
> Christian
>

Reply via email to