Giter Club home page Giter Club logo

vscode-neuro-viewer's Introduction

NeuroViewer

GitHub license Visual Studio Marketplace Coverage Status Build

If you got here, you might be familiar with Nifti files. In any case, Nifti is a file format for neuroimaging. This extension allows the user to visualize the volumetric data in Nifti files, and more features are coming!

Features

A quick way to view your Nifti files. It shows some metadata and renders a volume!

  • Color palletes
  • Histogram
  • Range highlighting
  • Web compatible (github.dev)

My brain in the viewer

(yes, that's my head, so not worried on defacing it :)

Known Issues

  • It just renders the first volume of a fMRI.

vscode-neuro-viewer's People

Contributors

anibalsolon avatar dependabot[bot] avatar nx10 avatar suamirochadev avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

vscode-neuro-viewer's Issues

Output appears empty

I tried using vscode-neuro-viewer with visual-studio-code-bin 1.64.2-1 on Arch Linux.

This is the output after opening a file:

image

The same thing has happened for all NIfTI files that I've tested.

I can provide an example NIfTI file that failed for me (it is derived from publicly available data from the QSM Challenge 2.0):

https://ufile.io/9t6rlyri

NRRD Support

NRRD files are very simple and similar to NIFTI files. It would be amazing if you could add support for them.

Support Workspace Trust

Hello ๐Ÿ‘‹ I'm from the VS Code team.

Recently, we have been exploring a security feature we refer to as Workspace Trust. This feature is intended to centralize and unify a security conscious decision required by a variety of VS Code features. With workspace trust, the user will be able to declare whether or not they trust the folder that is opened in VS Code before these features are executed.

Why you should care

We want to make sure that those users have a delightful experience with workspace trust and that includes extension authors deciding how much of their extension is supported in an untrusted workspace. Custom editors are special in that if they cannot at least render in an untrusted state then they will be replaced by a lightweight message telling the user to enable trust. This means that users of your extension will not be able to see their editors and there may even be cases of data loss.

Custom Editors Untrusted

Workspace Trust experience

You can enable the feature with the following setting security.workspace.trust.enabled. Once enabled, you will see the following dialog when opening folders in VS Code.

Workspace Trust Startup Dialog

This dialog is important for allowing the user to make a decision early and understand the impact of their decision. Once you understand the feature, you may want to customize when to display the dialog using the setting security.workspace.trust.startupPrompt.

You can follow the development of Workspace Trust and provide feedback in issue #106488.

Workspace trust API

First off, all of what I am about to say can be found in issue #120251. That issue will include discussion of the feature and any updates to the feature.

The Workspace Trust extension API is now in stable. This allowed us to release the first cut of our guide for onboarding your extension to Workspace Trust. The API is small, so here is a quick look.

You can declare your extension to provide complete, partial or no support in untrusted workspaces using the untrustedWorkspaces capability in package.json.

The following example declares that the extension is supported completely in untrusted workspaces. In this case, the extension is enabled in untrusted workspaces.

"capabilities": {
  "untrustedWorkspaces": {
    "supported": true
  }
}

The next example declares that the extension is not supported in untrusted workspaces. In this case, the extension is disabled in untrusted workspaces.

"capabilities": {
  "untrustedWorkspaces": {
    "supported": false
  }
}

The third option is to declared limited support. There are three tools provided to you when you select the limited option.

First, if you have a setting that can be configured in the workspace but requires the workspace to be trusted in order to apply the workspace value, then you can include the setting using restrictedConfigurations array property in untrustedWorkspaces object. Doing so, VS Code will ignore the workspace value of these restricted settings when your extension reads these settings values using the VS Code Workspace Configuration API.

The following example declares the settings that are restricted in untrusted workspaces.

"capabilities": {
  "untrustedWorkspaces": {
    "supported": "limited",
    "restrictedConfigurations": [
      "markdown.styles"
    ]
  }
}

Next, you can also check and listen if the current workspace is trusted or not programmatically using the following API:

export namespace workspace {
  /**
   * When true, the user has explicitly trusted the contents of the workspace.
   */
  export const isTrusted: boolean;
  /**
   * Event that fires when the current workspace has been trusted.
   */
  export const onDidGrantWorkspaceTrust: Event<void>;
}

Lastly, you can hide commands or views declaratively with the isWorkspaceTrusted context key in your when clauses.

A far more detailed guide on how to onboard which will be updated as we receive feedback can be found in issue #120251.

Rollout plan

We are planning on enabling this by default in the near future (most likely next release). To prepare for that day, we want to work with you to allow your editor to work seamlessly alongside the trusted workspace experience

Our Asks

The main features that should work for custom editors in an untrusted folder is rendering, viewing, and saving (if applicable). After reviewing your codebase, I believe that your extension doesn't execute user files as code and therefore is safe to use in an untrusted workspace. My suggestion would be to adopt supported: true

Please let me know if you have any question or would like to meet up via voice chat as I would be happy to assist you in getting your extension ready for workspace trust!

Possibility of publishing it to open-vsx.org?

Hey Anibal!

Great extension! I was happily surprised to see you were the author. I was feeling lazy and needed to look at a bunch of nifti files on a server so I used the sshfs extension with your extension and it worked like a charm. So this issue is more a request than a bug report.

For open and libre reasons, I use VSCodium instead of VSCode, so I was wondering if you'd be willing to go for the extra mile and publish it to Open VSX in addition to the VS Code Marketplace? Open VSX is an open-source registry for VS Code extensions. It can be used by any development environment that supports such extensions.

I could install the extension by downloading the VSIX file, but it would be neat if NeuroViewer was directly on Open VSX! :) I have never published an extension myself, but I think it doesn't require much more from your side. Here's a link to the wiki explaining the publishing process.

Happy to help you in that regard if you need anything.

Thanks again for your great extension ๐Ÿš€

Improve CI/CD flow

  • #7
  • Compute coverage for unit tests
  • Upload to Coveralls or other platform
  • Bump version
  • Automatic publish to vsce and ovsx
  • Find different Niftis to add to test, with different headers and data

All the items above are related to finishing up Github Actions setup.

References:
https://github.com/microsoft/vscode-jupyter

Include visualization settings

  • Global settings regarding default palettes and axis.
  • Settings per workspace, if a workspace is being used
  • Settings per session/window
  • Settings per file? Maybe save it in the Nifti, or check if there's another API for VSCode

Better handle loading errors

  • Detect errors in image parsing and store tracebacks
  • Point user to open issue when an error is detected (Github extension integration?)
  • File upload option (if smaller than 25MB- Github limit), WeTransfer?

Use-case: Code Server in Docker/Singularity

Hi @anibalsolon, great plugin. I've used it and it works seamlessly in VSCode. I have a separate use-case to propose and see if it's in the scope of your work.

Our group uses code-server on an HPC cluster which runs a VSCode backend in a singularity image, and forwards the port to a local machine. You can see how that's done here in docker and here in singularity. Our use case is here.

Our current only limitation is that we cannot open images that are on the cluster with NeuroViewer. When we select an image, it hangs on the Loading screen.

Let me know if this is something you'd consider adding as a feature, or if there is anywhere you can point me to start digging around as to how you load images -- maybe I can PR.

Thanks!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.