forked from r03ert0/microdraw
-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
13 changed files
with
221 additions
and
70 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
<!DOCTYPE html> | ||
<html> | ||
|
||
<head> | ||
{{> partials/header }} | ||
<link href='https://fonts.googleapis.com/css?family=Roboto:100' rel='stylesheet' type='text/css'> | ||
</head> | ||
|
||
<body> | ||
|
||
<!-- Header (fixed height) --> | ||
<div id="header"> | ||
<!-- Small left-top logo --> | ||
<div style="display:inline-block;margin:10px"> | ||
<a href='/' style="text-decoration:none"> | ||
<img style='height:28px;vertical-align:middle' src='/img/microdraw-white.svg'/> | ||
</a><span id="fontLogo"> | ||
<a href='/' style="font-family: Roboto, sans-serif; font-size: 28px; font-weight:100; text-decoration:none;vertical-align:middle">MicroDraw</a> | ||
</span> | ||
</div> | ||
</div> | ||
|
||
This user has removed his account. <a href="/">Back to the homepage</a> | ||
|
||
|
||
</body> | ||
|
||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,96 @@ | ||
<template> | ||
<Header v-if="!fullscreen"> | ||
<span class="title">MicroDraw</span> | ||
</Header> | ||
<main :class="{ fullscreen }"> | ||
<OntologySelector | ||
:ontology="ontology" | ||
:open="displayOntology" | ||
@on-close="displayOntology = false" | ||
@label-click="handleOntologyLabelClick" | ||
/> | ||
<Editor :title="title" :class="{reduced: !displayChat && !displayScript}" toolsMinHeight="300px"> | ||
<template v-slot:tools> | ||
<Tools /> | ||
</template> | ||
<template v-slot:content> | ||
<div id="microdraw" style="width: 100%; height: 100%"></div> | ||
</template> | ||
</Editor> | ||
</main> | ||
</template> | ||
|
||
<script setup> | ||
import useVisualization from "../store/visualization"; | ||
import Tools from "./Tools.vue"; | ||
import { | ||
Header, | ||
Editor, | ||
OntologySelector, | ||
} from "nwl-components"; | ||
import * as Vue from "vue"; | ||
const { baseURL } = Vue.inject('config'); | ||
const { | ||
title, | ||
displayChat, | ||
displayScript, | ||
displayOntology, | ||
currentLabel, | ||
ontology, | ||
currentSlice, | ||
currentFile, | ||
totalSlices, | ||
fullscreen, | ||
init: initVisualization, | ||
} = useVisualization(); | ||
const handleResize = () => { | ||
Microdraw.resizeAnnotationOverlay(); | ||
}; | ||
const toggleFullScreen = () => { | ||
if (!document.fullscreenElement) { | ||
document.documentElement.requestFullscreen(); | ||
} else if (document.exitFullscreen) { | ||
document.exitFullscreen(); | ||
} | ||
} | ||
Vue.watch(fullscreen, toggleFullScreen); | ||
const _findSelectedRegion = () => { | ||
const {currentImage, region} = Microdraw; | ||
const {Regions: regions} = Microdraw.ImageInfo[currentImage]; | ||
return regions.findIndex(reg => reg.uid === region.uid); | ||
}; | ||
const handleOntologyLabelClick = (index) => { | ||
Microdraw.currentLabelIndex = index; | ||
displayOntology.value = false; | ||
currentLabel.value = index; | ||
const regionIndex = _findSelectedRegion(); | ||
if(regionIndex != null) { | ||
const { region } = Microdraw; | ||
if (region != null) { | ||
Microdraw.changeRegionName(region, Microdraw.ontology.labels[index].name); | ||
} | ||
} | ||
} | ||
Vue.onMounted(async () => { | ||
await initVisualization(); | ||
window.addEventListener('resize', handleResize); | ||
}); | ||
</script> | ||
<style scoped> | ||
.area { | ||
height: calc(100vh - 82px); | ||
width: 100vw; | ||
} | ||
.fullscreen .area { | ||
height: 100vh; | ||
} | ||
</style> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
/* global loggedUser */ | ||
|
||
import 'nwl-components/dist/style.css'; | ||
import Data from '../components/Data.vue'; | ||
import config from './nwl-components-config'; | ||
import { createApp } from 'vue'; | ||
|
||
|
||
const app = createApp(Data); | ||
app.provide('config', config); | ||
app.provide('user', loggedUser); | ||
|
||
app.mount('#app'); |
Oops, something went wrong.