Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Possibly switch to custom nifti reader #25

Open
njvack opened this issue Sep 3, 2015 · 2 comments
Open

Possibly switch to custom nifti reader #25

njvack opened this issue Sep 3, 2015 · 2 comments

Comments

@njvack
Copy link
Contributor

njvack commented Sep 3, 2015

Hi there,

So, for a variety of reasons, I fooled around with creating a custom nifti1 reader in javascript, and made something that actually works, and a toy viewer to go along with it. Here's a demo:

http://njvack.github.io/jsnifti

... and the source:

https://github.com/njvack/jsnifti

It's small (minified and gzipped, the reader is about 19k) and fast -- parsing the structural image from the NIH test dataset takes about 20ms on Chrome/my 5-year-old Air if the file's endianness matches, and 500ms if it doesn't.

All the header fields are included (yay jBinary), and getting slices is easy (#ras_slice). Slicing and rendering in the (broken, unoptimized!) toy viewer is insanely fast (about 3ms/frame).

It's still missing some features (most notably, converting ijk <-> ras coordinates) but that shouldn't be too hard to add.

Anyhow! We may wind up using this internally, but it also might be useful for you.

@tyarkoni
Copy link
Contributor

tyarkoni commented Sep 3, 2015

Ooh, this looks great! In principle I would love to use it instead of the xtk reader. It's just a matter of finding the time to work through the code and figure out how to integrate it. Probably won't happen in the next month or two (grant deadlines), but maybe in November. If you have a chance to write a README on usage and data structure, that will probably speed things along. I'm excited about this!

I've also been contemplating a complete re-write of the UI in React or something similar, so that might be a good time to switch to jsnifti...

@njvack
Copy link
Contributor Author

njvack commented Sep 3, 2015

Yeah, a "non-empty README" is pretty close to the top of my list. Sweet!

I have a couple other projects to get to here, but I'll do more with this after.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants