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

nsviewer fails to display an image properly #15

Open
chrisgorgo opened this issue Oct 26, 2013 · 4 comments
Open

nsviewer fails to display an image properly #15

chrisgorgo opened this issue Oct 26, 2013 · 4 comments

Comments

@chrisgorgo
Copy link

This image https://dl.dropboxusercontent.com/u/412959/spmT_0001.nii is displayed as a scrambled matrix.
screenshot 2013-10-26 13 44 40

@tyarkoni
Copy link
Contributor

But it looks so pretty! You sure you want to fix it?

Is the image 91 x 109 x 91? If not, that's probably the issue. Currently, transformations between image/world/canvas spaces are hardcoded to only work for those dimensions. This needs to be fixed by generalizing the matrix transformations in the Transform class in models.coffee to handle arbitrary dimensions based on the header.

@tyarkoni
Copy link
Contributor

Is this happening when loading from json, from nifti, or both?

@chrisgorgo
Copy link
Author

JSON. Does the viewer support loading niftis directly? We can get rid of
this JSON silliness (it's quite slow)?

On Mon, Oct 28, 2013 at 6:05 PM, Tal Yarkoni [email protected]:

Is this happening when loading from json, from nifti, or both?


Reply to this email directly or view it on GitHubhttps://github.com//issues/15#issuecomment-27232008
.

@tyarkoni
Copy link
Contributor

Yes, the viewer supports loading nifti directly--this was one of the things we did at the hackathon in Boulder, remember? ;)

The tradeoff between the json and nifti approaches amounts to server vs. client-side loading time right now. For reasons I'm not entirely clear on, the xtk I/O code (which is what I'm using to read Nifti images in) is quite slow compared to constructing a volume from json. This is presumably an implementation issue, since reading from binary with typed arrays should be faster than filling a volume from plain text. But right now most json images load in under a second, whereas larger nifti volumes can take a few seconds to load from binary. But given that reading directly from nifti pushes the load to the client, and eliminates the need for server-side conversion, I would also support moving to binary-only. That's actually how neurosynth.org has been operating for the past few months.

The nsviewer documentation/example is already loading the MNI template from nifti, so you can look at that to see how it's done. Actually, I'm pretty sure that if you just change the filename from .json to .nii.gz or .nii everything should work seamlessly without having to do anything else.

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

No branches or pull requests

2 participants