Giter Club home page Giter Club logo

bioimagesuiteweb / bisweb Goto Github PK

View Code? Open in Web Editor NEW
76.0 16.0 32.0 438.16 MB

This is the repository for the BioImage Suite Web Project

Home Page: https://bioimagesuiteweb.github.io/webapp/

License: Apache License 2.0

CMake 0.74% JavaScript 71.26% Shell 0.59% Python 6.85% Inno Setup 0.02% HTML 2.21% Batchfile 0.20% C 0.85% C++ 11.96% CSS 2.13% MATLAB 2.88% MAXScript 0.01% Tcl 0.16% Dockerfile 0.05% Makefile 0.01% Jupyter Notebook 0.09%
webassembly neuroimaging-analysis medical image-processing nifti viewer fmri nih-brain-initiative

bisweb's People

Contributors

anqu1002 avatar bioimagesuiteweb avatar dadashkarimi avatar damian5710 avatar dependabot[bot] avatar dscheinost avatar jxnding avatar kolcrooks avatar leej3 avatar mehravehs avatar smenon1999 avatar sneuroble avatar xeniosp avatar yarikoptic avatar zsaltzman 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  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  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

bisweb's Issues

lib=biswrapper() gives error in MATLAB

Hi,

I am using a Windows machine and trying to parcellate the .nii data using bis_individualizedparcellation.m, but the library calling line

% Loads the bisweb C++ library as lib
lib=biswrapper();

Doesn't work (error: Unrecognized function or variable 'biswrapper'.). I am wondering if this means I need to use the standard cmake/make commands to install the c++ libraries first?

Thank you!

Update: I figure that I didn't do the nativebuild.sh for MATLAB and I am trying it now.

Error with Permissions-Policy header: Unrecognized feature: 'interest-cohort'. ?

what could be a reason?

continuation to dandi/dandi-infrastructure#88 to make
https://bioimagesuiteweb.github.io/webapp/viewer.html?image=https://api.dandiarchive.org/api/assets/d62f3ac5-2a0f-4170-a2d9-37d9bb2085c0/download/ (which redirects to a pre-signed S3 URL) work.

access from datasets.datalad.org works fine on another image: https://bioimagesuiteweb.github.io/webapp/viewer.html?image=https://datasets-dev.datalad.org/dbic/QA/sub-emmet/ses-20180508/anat/sub-emmet_ses-20180508_acq-MPRAGE_T1w.nii.gz but when trying to get the asset from api download url -- getting that error logged in the console.

The same error with a direct url to S3 (not presigned, to get content-disposition):
https://bioimagesuiteweb.github.io/webapp/viewer.html?image=https://dandiarchive.s3.amazonaws.com/blobs/a62/0e5/a620e50a-22e9-4694-8ac5-5b784df07ccd so I guess it is not dandi-api issue, thus inquiring here.

Search for it +S3 gives no immediate hits, thus inquiring here for ideas.

Integrating Lesion Segmentation Model for CT scans into Web Application

Hello,

I'm interested in contributing to the development of the multiplatform medical viewer framework, specifically focusing on the web application aspect. Before diving into the code, I have a couple of questions and requests for documentation.

Focus on Web Application: I intend to work exclusively on the web application part of the framework. Could you provide guidance or pointers to relevant resources to get started with web development within the framework?

Integration of Lesion Segmentation Model: I have a trained lesion segmentation model stored as a .pth file. I'm interested in integrating this model into the web application to enable lesion segmentation functionality. Is there any existing documentation or guidelines on how to load and utilize external models within the framework?

I believe clear documentation will greatly facilitate my contribution and ensure smooth integration of new features into the framework. Thank you for your assistance!

Battery life and CPU usage

When viewing a volume with BioimageSuite I see high CPU usage (and presumably poor battery life). I do not see this behavior when viewing the same volume with JavaScript tools that refresh the canvas only when needed, for example MRIcroWeb.

Since BioimageSuite is showing static scenes that only change when the user interacts with the window, I would suggest not having the tool automatically refresh. I believe this page describes the solution.

can't provide URL from S3 with versionId

e.g. both https://bioimagesuiteweb.github.io/webapp/viewer.html?image=https://s3.amazonaws.com/openneuro.org/ds000001/sub-01/anat/sub-01_T1w.nii.gz?versionId=SHOhSfza0LCFpgctRH3sMZ8iwAGSUwIy or urlquoted (since not sure how former legit is) https://bioimagesuiteweb.github.io/webapp/viewer.html?image=https%3A//s3.amazonaws.com/openneuro.org/ds000001/sub-01/anat/sub-01_T1w.nii.gz%3FversionId%3DSHOhSfza0LCFpgctRH3sMZ8iwAGSUwIy say "An error occured while ..." (note: a typo in "occur[r]ed") and console saying

viewer.html:1 Uncaught (in promise) Failed to load from https://s3.amazonaws.com/openneuro.org/ds000001/sub-01/anat/sub-01_T1w.nii.gz?versionId=SHOhSfza0LCFpgctRH3sMZ8iwAGSUwIy(RangeError: Invalid typed array length: 1.2017398940635953e+23)
DevTools failed to load SourceMap: Could not load content for https://bioimagesuiteweb.github.io/webapp/bisweb-sw.js.map: HTTP error: status code 404, net::ERR_HTTP_RESPONSE_CODE_FAILURE

stripping away ?versionId works, e.g. https://bioimagesuiteweb.github.io/webapp/viewer.html?image=https%3A//s3.amazonaws.com/openneuro.org/ds000001/sub-01/anat/sub-01_T1w.nii.gz

Math.floor v Math.round when setting slices

Hi,

Great piece of software - really enjoyed using it!

I think though that I have found an issue when setting overlay slices:

3DOrthogonalSlice:

var sl=Math.floor(slmm/internal.imagespa[internal.plane]);

OrthogonalViewerElement:

let sl = [util.range(Math.round(coords[0] / this.internal.imagespa[0]), 0, this.internal.imagedim[0] - 1),

I have some data where the affines differ in the 8th decimal place, this is enough to send the overlay to a different slice (floor vs round).

Volume rendering

The recent commits have started work on volume rendering, using the shader in bis_3dvolrenutils.js

While volume rendering can be done with WebGL1, the 3D textures of WebGL2 make this much more efficient. This is timely, as Chrome, Edge and Firefox all support WebGL2, and the Safari Technology Preview reveals that WebGL2 will no longer be disabled by default.

Can I suggest a couple of features that are illustrated here:

My suggestions are described in Engel et al.'s Real-Time Volume Graphics.

  • The step size and opacity correction should be based on the resolution of your image. With WebGL2 you can get this from textureSize. In my example code this is dynamically adjusted to maintain a frame rate.
  • If you are only interested in orthogonal renderings (which I prefer, as size is not impacted by depth), all the rays are parallel. Therefore, there is no need to compute view_ray for each fragment. It can be done in the vertex shader (as in my example, just eight times) or as a uniform (once). I admit this probably has virtually no impact on performance.
  • Adding a stochastic jitter to the ray start will reduce the wood grain aliasing effects. Each ray's start point is offset randomly in the range between 0..1 steps. In my example, this is done with wang_hash. You can remove that to see the impact.
  • Each call to sample_3d_texture() is nested in 6 if conditionals. GPU shaders are poor at conditionals, and these should be avoided in your inner loop. In my code, only samples within the texture are sampled, so there is no need for a conditional.
  • The add_lighting function in your shader requires 6 expensive texture lookups and will yield low precision gradients. Pre computed gradients will be better quality and require only a single texture lookup. My code shows how to create a 3D gradient texture which you do once and retain for all subsequent renderings.
  • Beyond simple ambient+diffuse+specular lighting models, my example shows how one can use MatCaps.
  • Early ray termination accelerates rendering. In my example a ray stops once it is 95% opaque if (color.a >= 0.95)
  • While not demonstrated in my code, these ray casting shaders can be easily extended with other features, as shown in MRIcroGL. For example, once you know the textureSize, one can leverage the fact that you are using linear interpolation to have the ray traverse quickly in open space and switch to finer sampling with the first hit (so rays that hit a target benefit from early termination, and those that do not benefit from rapid traversal). It is also easy to apply arbitrary clip planes and CT specific optimizations.

I am happy to generate pull requests to improve your volume rendering methods if you wish. The bioImageSuite is an outstanding project and enhancing the volume rendering will have a great impact.

respect content-disposition response header field if provided

An example for dandiarchive URL
$> wget -S https://api.dandiarchive.org/api/assets/db080212-f712-4f09-b3b6-b39554cdd74e/download/  
--2021-08-20 16:36:26--  https://api.dandiarchive.org/api/assets/db080212-f712-4f09-b3b6-b39554cdd74e/download/
Resolving api.dandiarchive.org (api.dandiarchive.org)... 54.162.128.250, 18.205.36.100, 54.157.58.70, ...
Connecting to api.dandiarchive.org (api.dandiarchive.org)|54.162.128.250|:443... connected.
HTTP request sent, awaiting response... 
  HTTP/1.1 302 Found
  Connection: keep-alive
  Server: gunicorn
  Date: Fri, 20 Aug 2021 20:36:26 GMT
  Content-Type: text/html; charset=utf-8
  Location: https://dandiarchive.s3.amazonaws.com/blobs/74f/474/74f47415-04df-4b9c-9343-5e9a949dd5ba?response-content-disposition=attachment%3B%20filename%3D%22sub-MITU01_ses-MR_T1map.nii.gz%22&X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=AKIAUBRWC5GAEKH3223E%2F20210820%2Fus-east-2%2Fs3%2Faws4_request&X-Amz-Date=20210820T203626Z&X-Amz-Expires=3600&X-Amz-SignedHeaders=host&X-Amz-Signature=8f8840df510bade887f4d22ea04fbcbd934e8b5262531c81f9754ed77eb4440c
  Vary: Accept, Cookie, Origin
  Allow: GET, HEAD, OPTIONS
  X-Frame-Options: DENY
  Content-Length: 0
  Strict-Transport-Security: max-age=31536000
  X-Content-Type-Options: nosniff
  Referrer-Policy: same-origin
  Via: 1.1 vegur
Location: https://dandiarchive.s3.amazonaws.com/blobs/74f/474/74f47415-04df-4b9c-9343-5e9a949dd5ba?response-content-disposition=attachment%3B%20filename%3D%22sub-MITU01_ses-MR_T1map.nii.gz%22&X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=AKIAUBRWC5GAEKH3223E%2F20210820%2Fus-east-2%2Fs3%2Faws4_request&X-Amz-Date=20210820T203626Z&X-Amz-Expires=3600&X-Amz-SignedHeaders=host&X-Amz-Signature=8f8840df510bade887f4d22ea04fbcbd934e8b5262531c81f9754ed77eb4440c [following]
--2021-08-20 16:36:26--  https://dandiarchive.s3.amazonaws.com/blobs/74f/474/74f47415-04df-4b9c-9343-5e9a949dd5ba?response-content-disposition=attachment%3B%20filename%3D%22sub-MITU01_ses-MR_T1map.nii.gz%22&X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=AKIAUBRWC5GAEKH3223E%2F20210820%2Fus-east-2%2Fs3%2Faws4_request&X-Amz-Date=20210820T203626Z&X-Amz-Expires=3600&X-Amz-SignedHeaders=host&X-Amz-Signature=8f8840df510bade887f4d22ea04fbcbd934e8b5262531c81f9754ed77eb4440c
Resolving dandiarchive.s3.amazonaws.com (dandiarchive.s3.amazonaws.com)... 52.219.98.68
Connecting to dandiarchive.s3.amazonaws.com (dandiarchive.s3.amazonaws.com)|52.219.98.68|:443... connected.
HTTP request sent, awaiting response... 
  HTTP/1.1 200 OK
  x-amz-id-2: GJzEXRY1dUyHx4Uvir9qcZJ93xnoi1/b2zbtR54CfEX08ZHMYidggWK2nF0r/z38YwxtagQwNZc=
  x-amz-request-id: HBD8RV2ZEB96D8XS
  Date: Fri, 20 Aug 2021 20:36:28 GMT
  Last-Modified: Thu, 20 May 2021 15:45:12 GMT
  ETag: "88fba545aeb0f44cfecd0c023a1e817e-28"
  x-amz-version-id: xh4VEcI5OY_nMWCO.4VuNLwEq.h.2F7C
  Content-Disposition: attachment; filename="sub-MITU01_ses-MR_T1map.nii.gz"
  Accept-Ranges: bytes
  Content-Type: binary/octet-stream
  Server: AmazonS3
  Content-Length: 1863940394
Length: 1863940394 (1.7G) [binary/octet-stream]
Saving to: ‘index.html.2’

index.html.2                                            0%[                                                                                                                          ] 781.51K  2.35MB/s             index.html.2                                            0%[     

you can see that in the response header there is

  Content-Disposition: attachment; filename="sub-MITU01_ses-MR_T1map.nii.gz"

relevant code path pointed to: https://github.com/bioimagesuiteweb/bisweb/blob/devel/js/core/bis_coregenericio.js#L590

Support "sparse remote access" to nii.gz files?

I feel like we chatted about it but I failed to find an issue, so here it comes (may be again).

ATM bisweb requires download of the file to the client machine to be visualized. May be that could be avoided if bisweb would have done desired HTTP Range requests (similarly to how https://github.com/fsspec/filesystem_spec and using it datalad-fuse and various other libraries do) for only needed data -- that would allow to visualize data without requiring entire volume download.

Why needed: In dandiarchive.org we have some "sizeable" .nii.gz files in the dandiarchive , e.g. https://dandiarchive.org/dandiset/000026/draft/files?location=derivatives%2Fmri_average%2Fsub-I41%2F contains 2.6GB .nii.gz available via https://api.dandiarchive.org/api/assets/4bb02786-9998-4c2b-b01b-7e2f2aa42d2c/download/ which is (pardon the filename)

$> nib-ls blah.nii.gz
blah.nii.gz float32 [1200, 1110, 576] 0.15x0.15x0.15   sform

May be for that purpose, for integration with
https://github.com/pauldmccarthy/indexed_gzip could be used to index gzip to allow for random access (could even be 4 separate indexes - one per each of possible dimensions to slice ijkt). E.g. it is used by https://github.com/mxmlnkn/ratarmount to provide random access within gzipped tars, and then bisweb provided fetching and local caching for only needed/requested slices of data?

How to save automatically registered pictures

When I load the local file into the web application without any operation, I noticed that it can display the unregistered original image and mask image very well, but when I use the nibabel in the local python, it can’t. Very good display. So how can I export the pictures after automatic registration.

how to use the BioImage Suite Web to identify electrode locations

Deal all,
Hi!
I want to use the BioImage Suite to identify electrode locations in human's brain, however, i found that there was not the BioImage Suite, but the BioImage Suite web. I want to know where the BioImage Suite web could identify electrode locations and how?
Thank you !
Rongqi lin.

Makes my firefox sweat too much (and it is winter here!)

Opening https://bioimagesuiteweb.github.io/webapp/viewer.html?image=https://datasets.datalad.org/labs/haxby/raiders/derivatives/openfmrilayout-qa-defacing/defacing/alldefaced_mean.nii.gz leads my firefox to become extremely busy after a while. Not yet sure what triggers it (screen lock or something else). Firefox from debian 68.2.0esr (64-bit). Closing and reopening the page didn't yet trigger high CPU load. I am filing the report to seek instructions on what to do/check whenever cpu becomes too busy next time.

BAD BAD BAD ... -- bisweb dislikes something about something in a nii.gz "file"

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.