-
Notifications
You must be signed in to change notification settings - Fork 8
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
Replace current NIfTI viewer with NiiVue? #274
Comments
Thanks @kabilar I've done a basic integration, although haven't tested it on more than a couple examples. It's working for this anatomical example: For the fmri (BOLD) in that dataset it's takes a long time to load (around 1GB of data), and then only shows the first volume/timepoint. Since this is gzipped, there's no way to do a partial load, unfortunately. So maybe I'll disable viewing if file is larger than some threshold. |
nice! i would suggest making this work not by default but with a click of a button, as this view does pull data from the remote resource. also @neurolabusc could suggest a default view perhaps that makes most sense. for bold, it could be significantly more data, and i would stay away from a default view. |
|
@magland - for bold i would use the view @neurolabsc suggested. |
Thanks @neurolabusc , I look forward to the new version. What's the best way to determine whether to use the 3D or 4D views? Here's what I am using right now: |
@magland I think the choice of views depends on your use case - I tend to like volume rendering to ensure defacing removes recognizable features (e.g. many clinical scans have craniotomy scars, some people have dermoid cysts, etc.). I think the layout live demo provides an interactive way to evaluate options. The core niivue live demos are all pure HTML, so you can view their code to have a nice recipe regardless of your framework (Vue, React, Angular). |
But I think the user will want a different layout depending on the type of image (anat, func, etc). I'm wondering if there's a way to get the array dimensions of the volume prior to specifying the layout. Looking at the examples I don't see an obvious way to get that information. |
Thanks @magland. This looks great.
Perhaps using |
@magland - the BIDS mnemonics + nifti header would give you the info you need. certain entities are only single volumes (T1, T2, ...) and certain entities (bold, dwi, ...) are multi volumes. most datasets don't have derivatives so a lot of the downstream more useful visualizations are not going to be applicable to the majority of openneuro datasets that have collected (not processed) data. there can also be an agentic mapping between the semantics of the path + information in the corresponding json + nifti header to pass to an agent to tell you what visualization code to use :) |
@magland my personal preference is to leverage the fact that 4D images (fMRI, DWI) tend to be low resolution, and you want to show a timeline, while 3D volumes tend to be higher resolution and are ideal for volume rendering. To see this selection on the layout live demo make sure the nv1.opts.multiplanarShowRender = 1 //ENUM: SHOW_RENDER ALWAYS
nv1.graph.autoSizeMultiplanar = true Alternatively, as @satra notes, you could do this via the filename. If you want to implement a custom mechanism to define layout based on an image properties not only if a user loads an image from your interface, but also when they drag and drop a new image, you could use an onImageLoaded callback. The hero live demo illustrates this. |
Hi @magland, NiiVue is a WebGL2 viewer for NIfTI files that is quite performant. Feel free to checkout their demos. Perhaps NiiVue would be a good replacement for the current viewer which only allows viewing NIfTI files along a single axis and doesn't provide for much interactivity? Thanks for considering.
cc @satra
The text was updated successfully, but these errors were encountered: