Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

8
  • $\begingroup$ Thanks, this helps a lot, at least in reassuring me that I'm not crazy :-). I suspect that the confusion in the spec is a consequence of confusion in the Matlab library most commonly used to read these files (the authors of the spec, and most neuroscientists, are strict Matlab users, and the library for decoding GIFTI files does not have much documentation for its compression methods). I believe I can use JLink to fix up the slow code I have in the original post for reading the data currently, but if you know of a more elegant way to decode it, I'd love to see it! $\endgroup$ Commented Feb 20, 2015 at 18:20
  • 1
    $\begingroup$ By the way, I am a Rocket Scientist. So I can easily see how Brain Surgeons would mess up the specification. :-) $\endgroup$ Commented Feb 20, 2015 at 21:42
  • 1
    $\begingroup$ @MarkAdler there are actually two undocumented built-in functions to work with zlib streams in Mathematica: Developer`RawCompress[] and Developer`RawUncompress[]. Their syntax is described in the answer below. $\endgroup$ Commented Mar 21, 2017 at 0:22
  • 1
    $\begingroup$ I have just realized that you are the author of zlib and your code can be found basically in every app! (On my PC there are 210 executables containing string Mark Adler :) It is a pleasure to meet you here! $\endgroup$ Commented Mar 21, 2017 at 23:38
  • 1
    $\begingroup$ Those functions were discovered by accident. First version of auto-complete feature in Mathematica suggested symbols not only from Global`* context, but also from other contexts including Developer`*. I was curious to find out what these compress functions do. After some experiments it became clear they are just wrappers around zlib. $\endgroup$ Commented Mar 21, 2017 at 23:38