timholy/Images.jl — pull request #26 by daniel-perry (2013-10-23 18:20:26+00:00)
Title: support for nrrd gzip encoding

I'm somewhat new to julia, so please feel free to modify or comment on these changes. I'm happy to change them to suit.

"gzip encoding" for nrrd format just means that the data section of the file is compressed using gzip.
So I changed the reader so that if the header indicates gzip encoding, it reads in the separate data file using GZip, or if it's a combined file it writes out the data section as a tmp file and then opens that using GZip.

However I wasn't sure what to do with the tmp file if it is memory mapped (since I assume the tmp file needs to persist while the returned image is being used..), so I left a comment saying that the tmp file is only removed if the image is not memory mapped. But I can also just disabled the ability to do a memory mapped gzip encoded nrrd. Since a simple workaround is to use a separate compressed "data file" that requires no tmp file, I thought I'd leave it like this.

I also included a test file with two very small nrrds, but I couldn't find any documentation on how the testing should work so I tried to just mimic what was already there (the test file has some relative paths in there "../test/small.nrrd", but again I wasn't completely sure of the proper way to handle paths in the tests). I also don't know if you want actual nrrd files in the repo.
(If you don't want the test files I can issue a new pull request without the test files.)