Name: NRRD.jl
Owner: JuliaIO
Description: Julia support for the Nearly Raw Raster Data (NRRD) image file format
Created: 2015-03-15 16:20:27.0
Updated: 2017-01-28 10:40:01.0
Pushed: 2017-07-08 00:16:11.0
Size: 84
Language: Julia
GitHub Committers
User | Most Recent Commit | # Commits |
---|
Other Committers
User | Most Recent Commit | # Commits |
---|
Package for reading NRRD files. Implements the FileIO interface.
Originally located in Images.jl
Normal usage is as easy as
= load("myfile.nrrd")
= load("myfile.nhdr")
("myotherfile.nrrd", img)
However, if you already have a raw binary representing the “data file”, the FileIO interface isn't sufficently flexible for writing just the header. Assuming you want to save “rich” axis information, a low-level approach using AxisArrays is the following:
g NRRD, FileIO, FixedPointNumbers, AxisArrays, Unitful
g Unitful: ?m, s
r a 480x640x200 image with time as the third axis,
suming a pixel spacing of 0.25?m and a framerate of 8fps
= Axis{:y}((1:480)*0.25?m)
= Axis{:x}((1:640)*0.25?m)
= Axis{:time}((1:200)*0.125s)
er = NRRD.headerinfo(N0f16, (axy, axx, axt)) # assuming N0f16 data
er["datafile"] = "mydata.raw"
("mydata.nhdr", "w") do io
write(io, magic(format"NRRD"))
NRRD.write_header(io, "0004", header)