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

Implementing web UI #144

Closed
wants to merge 280 commits into from
Closed

Implementing web UI #144

wants to merge 280 commits into from

Conversation

NewtonSander
Copy link
Collaborator

@NewtonSander NewtonSander commented Aug 15, 2023

Introduction

Added a web UI to interact with NDK with the following functionalities:

  • Use built-in scenarios
  • Add transducers
  • Run 2d and 3d simulations
  • Load CT scans

Running it

After installing the dependencies with poetry install and poetry run pip install git+https://github.com/trustimaging/stride@2520c59, run make web

Loading CT Scans

  1. Download and extract ct-scans.zip anywhere in your computer

  2. Start the web server by running make web

  3. Click the CT Scan toggle

  4. Select the pair of files with the same name from the extracted folder to make the upload.

    One of the files is the .nii or .zip archive with the dicom files, the other file has to be a .json containing the mapping between the material layer names and the layer number, like this:

    {  
        "water": 0,
        "brain": 1,
        "trabecular_bone": 2
    }
    

After performing the upload, the CT scan is available on the CT Scan section of the web interface

CT Loading example

load_ct

Running on Docker

The documentation on this PR was updated to run the NDK UI on docker, but the docker image will only be generated when this PR is merged.
So if you want to test/run the UI on docker you will have to manually execute these two steps on the project folder:

docker build . -t ndk_with_web
docker run -w /ndk -p8080:8080 ndk_with_web python src/web/app.py

florin-pop and others added 30 commits May 4, 2023 16:24
Replacing auto-generate GITHUB_TOKEN with Personal Access Token, since the main branch is protected
NewtonSander and others added 8 commits September 18, 2023 11:36
* Move webpage.html files into their own folder, as they are done in local MacOS build

* Revert "Move webpage.html files into their own folder, as they are done in local MacOS build"

This reverts commit a9b2e4a.

* Remove mkdocs offline plugin, which conflicts with how the gallery examples link to images

* no need to pass in OFFLINE environment variable since it is no longer used

* Revert "no need to pass in OFFLINE environment variable since it is no longer used"

This reverts commit 208318e.

* Revert "Remove mkdocs offline plugin, which conflicts with how the gallery examples link to images"

This reverts commit ca4a389.

* Add mkdocs-offline-links-plugin as a dependency and include as a mkdocs.yml plugin

* Update mkdocs-offline plugin to new home at agencyenterprise

* Update poetry.lock
* Add Scenario2 variant that mirrors Benchmark 7 of Aubry et al. (2022)

* Fix spellcheck
charlesbmi and others added 11 commits October 16, 2023 15:14
* Pin stride version in all the places we specify pip install
* Fix dead link
* Adding CT loading functionality to web

* Fixing issues with ct loading

* Adding support to load zipped dicom CTs

* Spellcheck

* Adding absorption to shaped grid

* Exposing CT scan info to the FE, so that we can make FE validations

* Constraining the distance from origin based on the CT size

* Removing unused pynrrd lib

* Small refactoring

* Refactoring

* Using voxels spacing when creating the grid

* Adding dependency

* Reverting the X/Y swap

* Removing gunicorn and replacing the make tarket web with web-development

* Pin stride version in all the places we specify pip install (#163)

* Pin stride version in all the places we specify pip install
* Fix dead link

* Poetry version updated

* Add focal pressure, focal volume, and FWHM to results metrics (#152)

* Poetry version updated

---------

Co-authored-by: newton sander <[email protected]>
Co-authored-by: charles <[email protected]>
Co-authored-by: d-lucena <[email protected]>
Copy link
Contributor

@charlesbmi charlesbmi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice work! Thanks for addressing my feedback.

@@ -33,6 +36,9 @@ hdf5storage = "^0.1.18"
psutil = "^5.9.0"
nest-asyncio = "^1.5.6"
mkdocs-gallery = "0.7.6"
flask = {extras = ["async"], version = "^2.3.3"}
Copy link
Contributor

@charlesbmi charlesbmi Oct 18, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I turned this into an issue to address in a future PR: #164

The web app does seem to work fine with flask = 2.2.5 though, so maybe you could just reduce to flask = "^2.2.5" here and that would address the error message.

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

Successfully merging this pull request may close these issues.

Create user interface for scenarios exploration
9 participants