Skip to content

Commit

Permalink
Merge pull request #13 from LinkunGao/pwa
Browse files Browse the repository at this point in the history
Update Density
  • Loading branch information
LinkunGao authored Sep 27, 2024
2 parents 7445e52 + 2abc9eb commit bbaf615
Show file tree
Hide file tree
Showing 53 changed files with 81,795 additions and 206 deletions.
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@

## Setup Project

### Install with PWA

### Setup App

- Setup frontend
Expand Down
66 changes: 0 additions & 66 deletions frontend/assets/data/topics copy.json

This file was deleted.

40 changes: 38 additions & 2 deletions frontend/assets/data/topics.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
"dataFile": "breast-main",
"category": "success",
"subTitle": "subSuccess",
"model": { "name": "NoInfarct" }
"model": { "name": "normal" }
}
}
},
Expand All @@ -20,10 +20,46 @@
"heading": "Breast Density",
"icon": "mdi-heart-broken",
"subTopics": {
"1": {
"title": "<25% FG",
"heading": "Almost entirely fat",
"icon": "mdi-home-heart",
"dataFile": "breast-main",
"category": "success",
"subTitle": "subSuccess",
"model": { "name": "normal" }
},
"2": {
"title": "25%-50% FG",
"heading": "Scattered fibroglandular densities",
"icon": "mdi-home-heart",
"dataFile": "breast-main",
"category": "success",
"subTitle": "subSuccess",
"model": { "name": "density_2" }
},
"3": {
"title": "51%-75% FG",
"heading": "Heterogeneously dense",
"icon": "mdi-home-heart",
"dataFile": "breast-main",
"category": "success",
"subTitle": "subSuccess",
"model": { "name": "density_3" }
},
"4": {
"title": ">75% FG",
"heading": "Extremely dense",
"icon": "mdi-home-heart",
"dataFile": "breast-main",
"category": "success",
"subTitle": "subSuccess",
"model": { "name": "density_4" }
}
}
},
"benign": {
"title": "B.C.",
"title": "Benign",
"heading": "Breast Benign Conditions",
"icon": "mdi-lightning-bolt",
"subTopics": {
Expand Down
Binary file added frontend/assets/images/gestures-icons.png
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 frontend/assets/images/loading/loading.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
10 changes: 10 additions & 0 deletions frontend/assets/images/loading/loading.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
19 changes: 4 additions & 15 deletions frontend/components/about/Logo.vue
Original file line number Diff line number Diff line change
@@ -1,19 +1,8 @@
<template>
<div class="logo">
<img src="~assets/images/logo1.png" />
<img src="~assets/images/logo2.png" />
<img src="~assets/images/logo3.png" />
<div class="flex flex-col justify-end items-end">
<img class="w-32 h-auto my-1 mx-5" src="~assets/images/logo1.png" />
<img class="w-32 h-auto my-1 mx-5" src="~assets/images/logo2.png" />
<img class="w-48 h-auto my-1 mx-5" src="~assets/images/logo3.png" />
</div>
</template>

<style scoped lang="scss">
.logo {
display: flex;
flex-direction: column;
img {
width: 250px;
height: auto;
margin: 5px 0;
}
}
</style>
44 changes: 39 additions & 5 deletions frontend/components/model/LeftModel.vue
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,25 @@ export default {
panelStyle: null,
model_panel: null,
model_title: null,
navPanelName: null,
modelUrlsArray:{
normal: [
"modelView/density-1/left/density25.glb",
"modelView/density-1/left/left_breast_view.json",
],
density_2:[
"modelView/density-2/left/density50.glb",
"modelView/density-2/left/left_breast_view.json",
],
density_3:[
"modelView/density-3/left/density75.glb",
"modelView/density-3/left/left_breast_view.json",
],
density_4:[
"modelView/density-4/left/density100.glb",
"modelView/density-4/left/left_breast_view.json",
]
},
};
},
Expand All @@ -40,6 +59,9 @@ export default {
this.$nuxt.$on("panel-height", this.setupPanelHeight);
this.model_panel = "model_name";
this.model_title = "model_title";
this.$nuxt.$on("onNavChange", this.onNavChange);
this.start();
Expand All @@ -64,20 +86,30 @@ export default {
}, 500);
}
},
onNavChange(modelName) {
this.navPanelName = modelName;
this.loadModel(this.modelUrlsArray[this.navPanelName][0], this.navPanelName+"left");
},
start() {
this.loadModel("modelView/breast-l.glb", "breastmodel");
if (this.navPanelName === null) {
this.loadModel(this.modelUrlsArray.normal[0], this.navPanelName+"left");
}else{
this.loadModel(this.modelUrlsArray[this.navPanelName][0], this.navPanelName+"left");
}
},
loadModel(model_url, model_name) {
const viewURL = "modelView/left_breast_view.json";
let viewURL = "";
if (this.navPanelName === null) {
viewURL = this.modelUrlsArray.normal[1];
} else {
viewURL = this.modelUrlsArray[this.navPanelName][1];
}
this.scene = this.baseRenderer.getSceneByName(model_name);
if (this.scene === undefined) {
this.scene = this.baseRenderer.createScene(model_name);
this.scene.addLights();
// this.scene.controls.staticMoving = true;
// this.scene.controls.rotateSpeed = 3.0;
// this.scene.controls.panSpeed = 3.0;
this.scene.controls.panSpeed = 0.2;
this.baseRenderer.setCurrentScene(this.scene);
Expand All @@ -98,6 +130,8 @@ export default {
this.scene.updateBackground("#fab9c5", "#fab9c5");
this.Copper.setHDRFilePath("environment/venice_sunset_1k.hdr");
this.baseRenderer.updateEnvironment();
}else{
this.baseRenderer.setCurrentScene(this.scene);
}
this.scene.onWindowResize();
},
Expand Down
Loading

0 comments on commit bbaf615

Please sign in to comment.