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

Migrating web to vue #191

Open
wants to merge 336 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
336 commits
Select commit Hold shift + click to select a range
6bfdd25
Linting
NewtonSander May 10, 2023
f672885
Updating page title
NewtonSander May 10, 2023
7ce6d08
Adding custom css with identantion
NewtonSander May 10, 2023
da3e84d
Removing module docstring to have it rendered in the API docs
NewtonSander May 10, 2023
8a80a9a
All docstring args start with lower case, all return descriptions sta…
NewtonSander May 11, 2023
89ed759
Extracting results to its own module
NewtonSander May 17, 2023
c77fbf3
Merge pull request #25 from agencyenterprise/fix_and_improve_api_doc_…
NewtonSander May 17, 2023
73d8835
Adding process section to 'Contributing' (#31)
NewtonSander May 17, 2023
7a34c37
Adding job to display a link to the PR generated documentation
NewtonSander May 17, 2023
b5c0dbe
Fixing typo in PR template
NewtonSander May 17, 2023
9ff2cd6
Labeling circle ci job
NewtonSander May 17, 2023
d3e9356
Trigger CI
NewtonSander May 17, 2023
a970cc2
Merge pull request #49 from agencyenterprise/display_circle_ci_artifa…
NewtonSander May 17, 2023
a7625cc
Triggering CI
NewtonSander May 17, 2023
7747679
Updating contributing page with the new way of checking the generated…
NewtonSander May 17, 2023
c18d7d6
Using offline plugin of mkdocs
NewtonSander May 18, 2023
e9b8004
Merge pull request #50 from agencyenterprise/trigger_circle_ci_artifa…
NewtonSander May 18, 2023
4bacc7c
Adding phased array source example to gallery (#40)
NewtonSander May 19, 2023
263b622
Updating instructions for MacOS installation
NewtonSander May 19, 2023
4c35e0e
Adding python 3.10 as CI testing target (#59)
NewtonSander May 24, 2023
f314253
Add example notebooks to the gallery (#39)
NewtonSander May 24, 2023
2495879
Adding example of save and load results (#42)
NewtonSander May 25, 2023
0113931
Adding GPU support documentation (#43)
NewtonSander May 25, 2023
7b656c9
Poetry version updated
d-lucena May 25, 2023
c1398fd
Updating instructions for MacOS installation (#54)
NewtonSander May 25, 2023
f6f5661
Extending troubleshooting (#61)
NewtonSander May 25, 2023
037d978
Adding gallery example with multiple sources (#52)
NewtonSander May 25, 2023
ae3620e
Split installation methods in docs (#60)
NewtonSander May 25, 2023
93ee3e9
Merge branch 'main' into update_macosx_installation_instructions
NewtonSander May 25, 2023
4be913b
Save to disk with version (#55)
NewtonSander May 25, 2023
b86ae93
Poetry version updated
d-lucena May 25, 2023
cdebff5
Merge pull request #63 from agencyenterprise/update_macosx_installati…
NewtonSander May 25, 2023
02bf803
Caching in CI (#64)
NewtonSander May 25, 2023
0f5a9fb
Renaming plot file to prevent doc rendering
NewtonSander May 25, 2023
a453b89
Reverting example rename
NewtonSander May 25, 2023
c238c67
Reverting example renaming
NewtonSander May 25, 2023
49b4887
Adding restore-keys to cache strategy
NewtonSander May 25, 2023
7e8442d
Reverting example renaming
NewtonSander May 25, 2023
a4294fa
Changing cache key
NewtonSander May 25, 2023
57a178b
Reverting example renaming
NewtonSander May 25, 2023
0ba302d
Reverting example renaming
NewtonSander May 25, 2023
28c9d2d
Cleanup cache leftovers
NewtonSander May 25, 2023
358799c
Removing leftovers from cache
NewtonSander May 25, 2023
e281583
Updating CI cache folder (#65)
NewtonSander May 25, 2023
9b0d19c
Preventing release before tests are passing (#67)
NewtonSander May 26, 2023
41d95a3
Adding pulsed simulation to gallery (#41)
NewtonSander May 26, 2023
339f005
Document full scenario (#44)
NewtonSander May 27, 2023
a19010a
Poetry version updated
d-lucena May 27, 2023
1222014
Adding documentation on how to download the example notebooks (#58)
NewtonSander May 27, 2023
44741d3
Adding extra instructions to MacOS users installing neurotechdevkit (…
NewtonSander May 27, 2023
8646419
Using generated gallery as cache for making docs (#68)
NewtonSander May 27, 2023
800d499
Adding apt-get update step before installing ffmpeg
NewtonSander May 27, 2023
ffddf07
Adding cronjob triggering circleCI to build the gallery examples with…
NewtonSander May 30, 2023
dfdfbae
Adding linux installation instructions (#62)
NewtonSander May 30, 2023
944ddf0
Changing time of execution for a test
NewtonSander May 30, 2023
3d916b8
Changing time of execution for a test
NewtonSander May 30, 2023
f0cc37a
Updating time of execution
NewtonSander May 30, 2023
5c4b3c1
Updating trigger time
NewtonSander May 30, 2023
baa0ea5
Updating time
NewtonSander May 30, 2023
6478688
Increasing deadline of circleCI job
NewtonSander May 30, 2023
bcffb32
Adding ffmpeg dependency
NewtonSander May 30, 2023
65c6069
change hyperlink
d-lucena May 31, 2023
fa0c052
Adding status badges to project (#70)
NewtonSander Jun 1, 2023
bc834ea
Adding Windows installation instructions (#71)
NewtonSander Jun 1, 2023
7b9ccde
Adding 3d example to gallery (#53)
NewtonSander Jun 1, 2023
49374b7
Adding integration test with compilation to CI (#72)
NewtonSander Jun 1, 2023
ecbad99
Preventing execution of cached docs job when uncached job is running …
NewtonSander Jun 1, 2023
85b796b
Describing the gallery execution on CI (#74)
NewtonSander Jun 1, 2023
cdba974
Moving _metrics.py to results folder (#45)
NewtonSander Jun 1, 2023
9b3a53e
update readme text (#75)
d-lucena Jun 1, 2023
78fd51b
Various improvements to docs (#77)
NewtonSander Jun 2, 2023
d386d46
Adding python version to cache key (#78)
NewtonSander Jun 2, 2023
3297ab7
Renaming docs job to trigger CI
NewtonSander Jun 16, 2023
13bd229
Removing leftover index.html
NewtonSander Jun 16, 2023
a577034
Setting OFFLINE flag for docs
NewtonSander Jun 16, 2023
f7a012f
Test with offline flag set to true
NewtonSander Jun 16, 2023
5c2abba
Test without mkdocs gh-deploy
NewtonSander Jun 16, 2023
ac7b28f
Removing offline flag
NewtonSander Jun 16, 2023
b0f9a7d
Reverting all changes
NewtonSander Jun 16, 2023
b078bd7
Adding --force flag to gh-deploy command
NewtonSander Jun 16, 2023
730bcdb
update main page text (#84)
d-lucena Jun 21, 2023
f267485
Testing ndk with python 3.11 (#18)
NewtonSander Jun 22, 2023
29abb85
Trigger gallery
NewtonSander Jun 23, 2023
abedf2f
Replacing github action to publish docs with CircleCI (#85)
NewtonSander Jun 26, 2023
1a377d0
Adding spellchecker (#79)
NewtonSander Jun 26, 2023
f002456
Improving docs for ARM MacOS (#76)
NewtonSander Jun 29, 2023
aea64a0
Renaming circle_ci job (#103)
NewtonSander Jul 5, 2023
88ed639
Add ffmpeg to docker dependencies (#107)
charlesbmi Jul 7, 2023
49c2965
Poetry version updated
NewtonSander Jul 7, 2023
79f9eda
Allowing customization of the center frequency and of material layers…
NewtonSander Jul 17, 2023
5bd680e
Poetry version updated
NewtonSander Jul 17, 2023
6de043c
various documentation changes and corrections (#111)
conditg Jul 19, 2023
699d311
Update `napari` install instructions to Qt6 on Mac M1 (#121)
charlesbmi Jul 20, 2023
955c8d2
Poetry version updated
charlesincharge Jul 20, 2023
8a9fe05
Fixing gallery example
NewtonSander Jul 20, 2023
6303cd8
Add resource estimation for pulsed simulations (#81)
NewtonSander Jul 20, 2023
f3efe05
Poetry version updated
NewtonSander Jul 20, 2023
1c4e912
Add Dockerfile-gpu (#112) (#113)
vaiana Jul 20, 2023
191213d
Adding default labeler to PRs (#120)
NewtonSander Jul 20, 2023
081e0a9
fix typo: type-hint vs default-value (#125)
charlesbmi Jul 21, 2023
02bc8ce
Poetry version updated
NewtonSander Jul 21, 2023
4b5e4a1
Compiling problem on render_layout if it was not compiled previously …
NewtonSander Jul 21, 2023
e62c90b
Not adding default labels if PR is already labeled (#127)
NewtonSander Jul 25, 2023
6e53d78
Time-reverse simulation for phased-array delay design (#105)
charlesbmi Jul 28, 2023
7696119
Implementing new API for NDK (#122)
NewtonSander Aug 9, 2023
793aef9
Poetry version updated
d-lucena Aug 9, 2023
0a31dab
According to benchmark paper, transducer center is 190 (0-indexed) fo…
charlesbmi Aug 9, 2023
713f6d1
Poetry version updated
charlesincharge Aug 9, 2023
bf56bdc
[#128] Fix Scenario-2 and Scenario-0 to work with different center fr…
charlesbmi Aug 9, 2023
20e7034
Poetry version updated
charlesincharge Aug 9, 2023
89eb31f
Fixing issue with load from disk
NewtonSander Aug 22, 2023
8b6a236
Run poetry lock with pyrevolve temporarily pinned to 2.2.3 to fix ins…
charlesbmi Aug 30, 2023
0dcb663
Poetry version updated
d-lucena Aug 30, 2023
46f50b9
Allow saving and loading custom scenarios (#136)
NewtonSander Aug 30, 2023
3f22483
Poetry version updated
d-lucena Aug 30, 2023
6184f01
[#109] add ultrasound imaging examples (#145)
charlesbmi Sep 7, 2023
0402968
Poetry version updated
d-lucena Sep 7, 2023
ac62594
[134] Slice `SteadyStateResult3D` to `SteadyStateResult2D` (#147)
kylmcgr Sep 7, 2023
86e81c7
Poetry version updated
d-lucena Sep 7, 2023
aab06da
Add link check workflow action file (#153)
kylmcgr Sep 14, 2023
8782e85
Adding web interface to NDK
NewtonSander Sep 18, 2023
182666d
Cleaning up, enforcing message schema
NewtonSander Aug 15, 2023
435234a
Downgrading pydantic to avoid a conflict with napari
NewtonSander Sep 18, 2023
d190419
Merging Scenario/Simulation configuration that goes to the client wit…
NewtonSander Aug 15, 2023
346003c
Allowing user to edit and remove added transducers, applying FE setti…
NewtonSander Aug 16, 2023
2444def
Small bugfixes
NewtonSander Aug 16, 2023
0962783
Improving style
NewtonSander Aug 16, 2023
02cb1cd
Creating new scenario from built in scenario to avoid issues with cla…
NewtonSander Aug 16, 2023
14e0301
Recreating sources list
NewtonSander Aug 16, 2023
a953fbe
Rendering layout when parameters change
NewtonSander Aug 18, 2023
6c3b19d
Improving style
NewtonSander Aug 18, 2023
5f5cc2d
Fixing issue adding a transducer
NewtonSander Aug 18, 2023
c62e940
Only showing material properties that are defined in the built in sce…
NewtonSander Aug 18, 2023
8476334
Moving messages to their own module
NewtonSander Aug 18, 2023
0c4f70b
Small refactoring
NewtonSander Aug 18, 2023
8d74c1b
Making MaterialProperties validator dynamic
NewtonSander Aug 18, 2023
ce52ce1
Created an external form to easily clear all params
NewtonSander Aug 18, 2023
fe997a1
Making 2D and 3D buttons blue
NewtonSander Aug 18, 2023
5f908a1
Disabling Run Simulation button if there are no transducers
NewtonSander Aug 21, 2023
602b1a5
Adding support to render 3D layouts
NewtonSander Aug 21, 2023
6686079
Adding 3d transducers support
NewtonSander Aug 22, 2023
c798a25
Disabling axis and distance from origin until a scenario is selected
NewtonSander Aug 22, 2023
100165e
Adding waitress as web server
NewtonSander Sep 18, 2023
9506ef2
Removing async from views
NewtonSander Aug 22, 2023
2abc496
Revert "Removing async from views"
NewtonSander Aug 22, 2023
b30d86c
Adding flask async to project dependencies
NewtonSander Sep 18, 2023
f382248
replacing waitress with gunicorn
NewtonSander Sep 18, 2023
5faf854
Various minor improvements
NewtonSander Aug 22, 2023
a985738
Adding more tests
NewtonSander Aug 22, 2023
cc12722
Fixing spell
NewtonSander Aug 22, 2023
bf2aa53
Fixing issue with parameters for a 3d phased array transducer
NewtonSander Aug 23, 2023
96b6ae0
Adding support to 3D simulations
NewtonSander Aug 25, 2023
fbcc1fc
Fixing spellcheck
NewtonSander Aug 25, 2023
316ded9
Moving simulation executor into a thread that we can kill
NewtonSander Aug 25, 2023
87d9c14
Using npt ArrayLike
NewtonSander Sep 4, 2023
7279227
Closing matplotlib figure after using it
NewtonSander Sep 4, 2023
fb2ae74
Instantiating scenarios for each center frequency
NewtonSander Sep 4, 2023
1103784
Updating pyrevolve version
NewtonSander Sep 4, 2023
bdd459a
Adding step to number input fields
NewtonSander Sep 4, 2023
d51c62c
Addressing review suggestions
NewtonSander Sep 4, 2023
ea59085
Using step=0.01 only for specific fields
NewtonSander Sep 4, 2023
115be4d
Updating poetry lock file
NewtonSander Sep 4, 2023
e0caf9a
Adding placeholders to transducers and fixing X and Y coordinates
NewtonSander Sep 5, 2023
febfa4e
Adding tooltips to fields
NewtonSander Sep 5, 2023
94eddcd
Making labels consistently title case
NewtonSander Sep 5, 2023
08ca317
Moving slice axis and slice position to a new accordion panel called …
NewtonSander Sep 5, 2023
59b0e55
Added validation to all fields
NewtonSander Sep 5, 2023
09a189f
Removing duplicated IDs
NewtonSander Sep 5, 2023
4fd3f1e
Adding space between components
NewtonSander Sep 5, 2023
45480d0
Renaming 'set focal length' checkbox
NewtonSander Sep 5, 2023
e2b3bb5
Allowing user to see the parameters while the simulation is running
NewtonSander Sep 11, 2023
3794e39
Creating script to run the web interface
NewtonSander Sep 11, 2023
8bd8f1a
Adding a web UI service to docker compose
NewtonSander Sep 11, 2023
b365f4b
Adding section to documentation explaining how to run the web user in…
NewtonSander Sep 11, 2023
3efeff5
Adding Scenario 3 support to the web-ui
NewtonSander Sep 18, 2023
c642858
Adding new keys to the spellcheck whitelist
NewtonSander Sep 18, 2023
3872078
Removing default source from Scenario3
NewtonSander Sep 18, 2023
e956039
Include gallery images in CircleCI-generated docs (#154)
charlesbmi Sep 26, 2023
99e438f
Poetry version updated
charlesincharge Sep 26, 2023
5b34206
Add Benchmark 7 of Aubry et al. (2022) as a Scenario2 variant (#151)
charlesbmi Sep 26, 2023
a56c179
Poetry version updated
charlesincharge Sep 26, 2023
d0fa31a
Merge branch 'main' into implementing_web_ui
NewtonSander Sep 27, 2023
cf67f0a
Document spellcheck issue on Mac M1 (#160)
charlesbmi Sep 28, 2023
448be93
Poetry version updated
charlesincharge Sep 28, 2023
37fda7f
Pin stride version in all the places we specify pip install (#163)
charlesbmi Oct 12, 2023
7a2dab7
Poetry version updated
d-lucena Oct 12, 2023
c762209
Add focal pressure, focal volume, and FWHM to results metrics (#152)
charlesbmi Oct 12, 2023
80f9691
Poetry version updated
d-lucena Oct 12, 2023
44e7c3b
Document spellcheck issue on Mac M1 (#160)
charlesbmi Sep 28, 2023
0ab2241
Poetry version updated
charlesincharge Sep 28, 2023
0ff819d
Pin stride version in all the places we specify pip install (#163)
charlesbmi Oct 12, 2023
a26e95c
Poetry version updated
d-lucena Oct 12, 2023
b15c42f
Add focal pressure, focal volume, and FWHM to results metrics (#152)
charlesbmi Oct 12, 2023
de8ad2c
Poetry version updated
d-lucena Oct 12, 2023
b58d1c9
[91] - Adding CT loading functionality to web interface (#161)
NewtonSander Oct 16, 2023
e7cdf63
Updating default web server port, preventing enter from submitting ht…
NewtonSander Oct 16, 2023
973bd9f
Adding button to fill default placeholder values
NewtonSander Oct 16, 2023
3745138
Cleaning transducers when the CT Scan toggle button is selected
NewtonSander Oct 16, 2023
df6e248
Exposing simulation errors to the user
NewtonSander Oct 17, 2023
f1b2959
Add Fixing Homer Simpson to docs (#162)
conditg Oct 18, 2023
9bfd7a1
Preventing CT form check on builtin scenarios
NewtonSander Oct 31, 2023
2d7a397
Fixing issue with pull request labeler permissions
NewtonSander Nov 3, 2023
17d5428
changed link (#174)
conditg Nov 8, 2023
772e99b
Add interp dimension in nearest-neighbors interpolation to match line…
charlesbmi Nov 8, 2023
4fa8a41
Poetry version updated
charlesincharge Nov 8, 2023
dea997f
First Vue.js commit
NewtonSander Jan 5, 2024
6207599
Migrating web ui to Vue.js
NewtonSander Jan 10, 2024
acae19b
Adding vuex
NewtonSander Jan 10, 2024
c215d1c
Replacing logic to display/hide components based on 2d/3d checks
NewtonSander Jan 12, 2024
d803207
Migrating to vue.js
NewtonSander Jun 6, 2024
0cefccc
Integrating vue with vuex
NewtonSander Jun 21, 2024
22ae5f2
Improving style
NewtonSander Jul 23, 2024
a57b157
Improving styles
NewtonSander Jul 23, 2024
c271f51
Various style improvements
NewtonSander Jul 23, 2024
184143b
Cleaning up
NewtonSander Jul 23, 2024
3789e2f
Making style improvements
NewtonSander Jul 24, 2024
217d553
Resetting state
NewtonSander Jul 24, 2024
98a57c2
Adding tooltips
NewtonSander Jul 24, 2024
78e9a5c
Allowing the user to upload ct files
NewtonSander Jul 24, 2024
f27f8c5
Allowing the user to see the parameters while the simulation is running
NewtonSander Jul 24, 2024
38bd950
showing spinning wheel when processing
NewtonSander Jul 25, 2024
8106a19
Showing loading spinner when file is being uploaded
NewtonSander Jul 25, 2024
316401e
Cleaning panel when user cancels simulation
NewtonSander Jul 25, 2024
f8774d1
Fixing issue with simulationType radio button
NewtonSander Jul 25, 2024
b1d5873
Minor improvements
NewtonSander Jul 25, 2024
c466645
Reducing size of buttons
NewtonSander Jul 25, 2024
895dc38
Adding button to fill default values
NewtonSander Jul 25, 2024
637ea7a
Adding form validation to all components
NewtonSander Jul 25, 2024
c6cff22
Replacing old app with new vue app
NewtonSander Jul 26, 2024
3ee2b37
Adding web workflow
NewtonSander Jul 26, 2024
26fcb90
Merge branch 'main' into migrating-web-to-vue
NewtonSander Jul 26, 2024
92b1d8b
Updating web build [skip ci]
NewtonSander Jul 26, 2024
2efdcbc
Updating server listening address
NewtonSander Jul 26, 2024
ef59578
Updating web build [skip ci]
NewtonSander Jul 26, 2024
02c11b7
Linting
NewtonSander Jul 26, 2024
1f746be
Updating web build [skip ci]
NewtonSander Jul 26, 2024
62e54ca
Fixing spellchecker
NewtonSander Jul 26, 2024
1cebf76
Fixing tests
NewtonSander Jul 26, 2024
847a1a1
Updating web build [skip ci]
NewtonSander Jul 26, 2024
72980b2
Removing restriction
NewtonSander Jul 26, 2024
c015fdd
Updating web build [skip ci]
NewtonSander Jul 26, 2024
eeefed1
Merge branch 'main' into migrating-web-to-vue
NewtonSander Jul 26, 2024
bccc263
Updating web build [skip ci]
NewtonSander Jul 26, 2024
e83e7f7
Adding favicon and preventing user from inserting default values for …
NewtonSander Jul 30, 2024
4cbcd18
Updating web build [skip ci]
NewtonSander Jul 30, 2024
cac4d5d
Reducing quality of images to make the files smaller
NewtonSander Jul 30, 2024
85a39fe
Updating web build [skip ci]
NewtonSander Jul 30, 2024
2ed0ca1
Fixing dockerfile for ndk web
NewtonSander Jul 30, 2024
ab9fa47
Merge branch 'main' into migrating-web-to-vue
NewtonSander Aug 1, 2024
3a662fd
Updating web build [skip ci]
NewtonSander Aug 1, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ jobs:
uses: snok/[email protected]
with:
virtualenvs-create: true
virtualenvs-in-project: false
virtualenvs-in-project: true
installer-parallel: true

- name: Load cached poetry dependencies
Expand Down
48 changes: 48 additions & 0 deletions .github/workflows/web.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
name: build web

on:
pull_request:
paths:
- "src/web/app/**"

jobs:
web:
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Check out repository
uses: actions/checkout@v4
with:
ref: ${{ github.head_ref }}

- name: Use node
uses: actions/setup-node@v4
with:
cache: "npm"
cache-dependency-path: "src/web/app/package-lock.json"

- name: Installing project dependencies
run: npm install
working-directory: src/web/app

- name: "Create env file"
run: |
touch src/web/app/.env
echo VUE_APP_BACKEND_URL=localhost:8080 >> src/web/app/.env

- name: Building the project
run: npm run build
working-directory: src/web/app

- uses: vimtor/[email protected]
name: Create zip file
with:
files: src/web/app/dist/
dest: src/web/app/dist.zip

- name: Commit & Push changes
uses: stefanzweifel/git-auto-commit-action@v5
with:
commit_message: Updating web build [skip ci]
file_pattern: src/web/app/dist.zip
11 changes: 8 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
FROM python:3.10.0 as build
FROM python:3.11.0 as build

# Install system dependencies for HDF5
RUN apt-get update && apt-get install -y \
libhdf5-dev python3-h5py \
&& rm -rf /var/lib/apt/lists/*

WORKDIR /ndk

Expand All @@ -19,15 +24,15 @@ ENV POETRY_VIRTUALENVS_CREATE=false
RUN ./venv/bin/poetry install && \
./venv/bin/pip install git+https://github.com/trustimaging/stride@2520c59

FROM python:3.10.0-slim
FROM python:3.11.0-slim

COPY --from=build /ndk /ndk
WORKDIR /ndk

RUN ./venv/bin/pip install --upgrade pip

RUN apt-get update && \
apt-get install -y g++ jq make unzip wget ffmpeg && \
apt-get install -y g++ jq make unzip wget ffmpeg libhdf5-dev python3-h5py && \
apt-get clean && \
rm -rf /var/lib/apt/lists/*

Expand Down
25 changes: 14 additions & 11 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
.PHONY:help lint lint-check test test-coverage test-unit test-integration docs
.PHONY:help lint lint-check test test-coverage test-unit test-integration docs web

help:
@echo "Available commands are: \n*lint, lint-check, spellcheck, test, test-unit, test-integration docs"
@echo "Available commands are: \n*lint, lint-check, spellcheck, test, test-unit, test-integration docs web"

lint:
poetry run isort src tests docs/examples
poetry run black src tests docs/examples
poetry run flake8 src tests docs/examples
poetry run mypy src docs/examples
poetry run codespell src docs/examples
poetry run pydocstyle src
poetry run flake8 --exclude=src/web/app/ src tests docs/examples
poetry run mypy --exclude=src/web/app/ src docs/examples
poetry run codespell --skip="src/web/app" src docs/examples
poetry run pydocstyle --match-dir="^(src/web/app)" src
poetry run pyright

spellcheck:
Expand All @@ -25,10 +25,10 @@ spellcheck:
lint-check:
poetry run isort --check src tests docs/examples
poetry run black --check src tests docs/examples
poetry run flake8 src tests docs/examples
poetry run mypy src docs/examples
poetry run codespell src docs/examples
poetry run pydocstyle src
poetry run flake8 --exclude=src/web/app/ src tests docs/examples
poetry run mypy --exclude=src/web/app/ src docs/examples
poetry run codespell --skip="src/web/app" src docs/examples
poetry run pydocstyle --match-dir="^(src/web/app)" src
poetry run pyright --warnings

test:
Expand All @@ -44,4 +44,7 @@ test-integration:
poetry run pytest tests -m "integration"

docs:
poetry run mkdocs build
poetry run mkdocs build

web:
poetry run ndk-ui
7 changes: 7 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,10 @@ services:
- ./notebooks:/ndk/notebooks
ports:
- 8888:8888

ndk-ui:
image: ghcr.io/agencyenterprise/neurotechdevkit:latest
working_dir: /ndk
command: python src/web/app.py
ports:
- 8080:8080
12 changes: 11 additions & 1 deletion docs/contributing.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,11 +37,21 @@ If you don't want to install NDK's dependencies on your machine, you can run it

* Run the container, which will start a jupyter notebook server:
```
docker compose up
docker compose up ndk
```

* Connect to the jupyter notebook directly in your browser or with your IDE.


Alternatively, you can start the web user interface with:

```
docker compose up ndk-ui
```

* Open the address `http://127.0.0.1:8080/` in your browser to access it.


#### Running locally

This project requires Python `>=3.9` and `<3.11` to be installed. You can find the Python version you have installed by running `python --version` in a terminal. If you don't have Python installed or are running an unsupported version, you can download a supported version from [python.org](https://www.python.org/downloads/).
Expand Down
2 changes: 1 addition & 1 deletion docs/examples/plot_phased_array_source.py
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,7 @@
phased_3d = ndk.sources.PhasedArraySource3D(
position=[0.0, 0.0, 0.0],
direction=[1.0, 0.0, 0.0],
center_line=np.array([0.0, 0.0, 1.0]),
center_line=[0.0, 0.0, 1.0],
num_points=20_000,
num_elements=16,
pitch=1.5e-3,
Expand Down
11 changes: 6 additions & 5 deletions docs/examples/plot_ultrasound_imaging_multiplane.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
"""

# %%
from typing import List
from typing import List, cast

import matplotlib.pyplot as plt
import numpy as np
Expand Down Expand Up @@ -129,6 +129,7 @@ def create_scenario(tilt_angle: float = 0.0) -> Scenario3:
# - rho - density
# - alpha - attenuation
fig, axs = plt.subplots(1, 3, figsize=(15, 5))
axs = cast(np.ndarray, axs)

for idx, attribute in enumerate(["vp", "rho", "alpha"]):
im = axs[idx].imshow(getattr(scenario.problem.medium, attribute).data)
Expand Down Expand Up @@ -271,7 +272,7 @@ def calc_simulation_time(scenario: Scenario3):

# Plot with some offsets
CHANNEL_OFFSET = 1000
_ = plt.plot(
plt.plot(
time[valid_time_mask] * 1e3,
rf_signal_visualize[valid_time_mask]
+ np.linspace(-0.5, 0.5, num=NUM_VISUALIZE, endpoint=True)
Expand All @@ -282,9 +283,9 @@ def calc_simulation_time(scenario: Scenario3):
for (channel_idx, echo_idx) in zip(channel_idxs, pulse_idxs)
],
)
_ = plt.legend()
_ = plt.title("Example radiofrequency signals (RF)")
_ = plt.xlabel("time [ms]")
plt.legend()
plt.title("Example radiofrequency signals (RF)")
plt.xlabel("time [ms]")

# %% [markdown]
# Plotting across elements (for a single shot) shows the typical
Expand Down
13 changes: 7 additions & 6 deletions docs/examples/plot_ultrasound_imaging_scanline.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
"""

# %%
from typing import List
from typing import List, cast

import matplotlib.pyplot as plt
import numpy as np
Expand Down Expand Up @@ -129,6 +129,7 @@ def create_scenario(tilt_angle: float = 0.0) -> Scenario3:
# - rho - density
# - alpha - attenuation
fig, axs = plt.subplots(1, 3, figsize=(15, 5))
axs = cast(np.ndarray, axs)

for idx, attribute in enumerate(["vp", "rho", "alpha"]):
im = axs[idx].imshow(getattr(scenario.problem.medium, attribute).data)
Expand Down Expand Up @@ -220,16 +221,16 @@ def calc_simulation_time(scenario: Scenario3):
time_mask = (40e-6 < time_arr) & (time_arr < 140e-6)

# Plot with some offsets
_ = plt.plot(
plt.plot(
time_arr[time_mask] * 1000,
rf_signals[time_mask][:, channel_idxs]
+ np.linspace(-1000, 1000, num=NUM_VISUALIZE, endpoint=True),
label=[f"channel-{channel_idx}" for channel_idx in channel_idxs],
)
_ = plt.legend()
_ = plt.title("Example radiofrequency signals (RF)")
_ = plt.xlabel("time [ms]")
_ = plt.ylabel("amplitude and channel offset [a.u]")
plt.legend()
plt.title("Example radiofrequency signals (RF)")
plt.xlabel("time [ms]")
plt.ylabel("amplitude and channel offset [a.u]")

# %% [markdown]
# The transmitted signals consisted of a high-frequency pulse, so
Expand Down
Binary file added docs/images/web_ui.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/images/web_ui_first.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
36 changes: 36 additions & 0 deletions docs/installation.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,11 +45,19 @@ As a last step **before running NDK**, follow the instructions below depending o

??? "Before running on MacOS"

<<<<<<< HEAD
The two main compiler options for MacOS are **clang** and **gcc**.

### clang

If you prefer to use **clang** you will have to install `libomp` and `llvm`, you will also have to export a few environment variables needed by the compiler.
=======
The single compiler option for MacOS is **clang**.

### clang

To setup your environment you will have to install `libomp` and `llvm`, you will also have to export a few environment variables needed by the compiler.
>>>>>>> main

1. Install libomp

Expand Down Expand Up @@ -89,6 +97,34 @@ As a last step **before running NDK**, follow the instructions below depending o
source ~/.zshrc
```

<<<<<<< HEAD
### gcc

On MacOS the `gcc` executable is a symbolic link to `clang`, so by defining ~~DEVITO_ARCH=gcc~~ devito will try to add `gcc` flags to the `clang` compiler, and the compilation will most probably fail.

You can tell devito to use the correct `gcc` compiler doing the following:

1. Install gcc-11

```
brew install gcc@11
```

1. Run the command that exports the `DEVITO_ARCH` environment variable:

```
echo 'export DEVITO_ARCH="gcc-11"' >> ~/.zshrc
```

1. Load the modified zsh configuration file:

```
source ~/.zshrc
```


=======
>>>>>>> main
??? "Before running on Linux"

1. Export the `DEVITO_ARCH` environment variable, or add it to your shell profile:
Expand Down
61 changes: 61 additions & 0 deletions docs/user_interface.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
!!! note
This functionality is currently under development.

# User Interface

Neurotech Development Kit has a built-in web server that allows you to create and run simulations using your web browser.


<figure markdown>
![Web UI](./images/web_ui.jpg){ width="900" }
</figure>



## Running

There are multiple ways of running the web server, you can choose between:

### Pip

1. Follow the [installation tutorial](installation.md)

1. Open a terminal and execute

```
ndk-ui
```

### Virtual environment

1. Follow the *running locally* section of the [contributing tutorial](contributing.md#running-locally)

1. Open a terminal in the project location and run the following command

```
make web
```

### Docker

1. Install [Docker](https://docs.docker.com/engine/install/#desktop).

1. Open a terminal and run the following command:

```
docker run -p 8080:8080 -e WEB_SERVER_HOST=0.0.0.0 -w "/ndk" -it ghcr.io/agencyenterprise/neurotechdevkit:latest python src/web/app.py
```


## Using

After executing the last step of any of the options described above you will be able to open the address `http://127.0.0.1:8080/` in your browser.

You should be able to select one of the pre-defined scenarios and see its layout:


<figure markdown>
![Web UI First](./images/web_ui_first.png){ width="900" }
</figure>


1 change: 1 addition & 0 deletions mkdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ theme:
nav:
- Home: index.md
- Installation: installation.md
- User Interface: user_interface.md
- Usage:
- Scenarios: usage/loading_scenarios.md
- Sources: usage/defining_sources.md
Expand Down
Loading