diff --git a/Gruntfile.js b/Gruntfile.js deleted file mode 100644 index da2a1992..00000000 --- a/Gruntfile.js +++ /dev/null @@ -1,70 +0,0 @@ -/** - * Copyright 2016 Kitware Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -const path = require('path'); - -module.exports = function (grunt) { - var staticLibPath = path.resolve( - grunt.config.get('staticDir'), 'built', 'plugins', 'isic_archive', 'libs'); - - // Install and copy legacy resources for Angular app - grunt.registerTask('isic_archive-legacy-bower-install', 'Install Bower packages', function () { - var bower = require('bower'); - var done = this.async(); - bower.commands - .install([ - 'jquery#2.1.0', - 'flatstrap#3.1.1', - 'font-awesome#4.0.3', - 'angular#1.4.5', - 'angular-resource#1.4.5', - 'angular-ui-bootstrap-bower#0.14.3' - ]) - .on('end', function (results) { - done(); - }) - .on('error', function (results) { - done(false); - }); - }); - grunt.config.set('copy.isic_archive-legacy-libs-bower', { - expand: true, - nonull: true, - cwd: 'bower_components', - src: [ - 'jquery/dist/jquery.min.js', - 'bootstrap/dist/js/bootstrap.min.js', - 'bootstrap/dist/css/bootstrap.min.css', - 'bootstrap/dist/fonts/glyphicons-halflings-regular.woff', - 'bootstrap/dist/fonts/glyphicons-halflings-regular.ttf', - 'font-awesome/css/font-awesome.min.css', - 'font-awesome/fonts/fontawesome-webfont.ttf', - 'font-awesome/fonts/fontawesome-webfont.woff', - 'angular/angular.min.js', - 'angular-resource/angular-resource.min.js', - 'angular-bootstrap/ui-bootstrap-tpls.min.js' - ], - dest: staticLibPath - }); - grunt.registerTask('isic_archive-legacy', [ - // 'npm-install:isic_archive:false:bower@^1.8.0', - 'isic_archive-legacy-bower-install', - 'copy:isic_archive-legacy-libs-bower' - ]); - - grunt.registerTask('isic_archive-web', [ - 'isic_archive-legacy' - ]); -}; diff --git a/ansible/roles/isic/tasks/main.yml b/ansible/roles/isic/tasks/main.yml index 5007bb66..66aaed9c 100644 --- a/ansible/roles/isic/tasks/main.yml +++ b/ansible/roles/isic/tasks/main.yml @@ -174,6 +174,5 @@ value: core_girder: "/girder" core_static_root: "/static" - markup: "/markup" state: present notify: Restart Girder diff --git a/ansible/roles/nginx/templates/girder.conf.j2 b/ansible/roles/nginx/templates/girder.conf.j2 index b1a5545e..29acc74c 100644 --- a/ansible/roles/nginx/templates/girder.conf.j2 +++ b/ansible/roles/nginx/templates/girder.conf.j2 @@ -28,7 +28,7 @@ server { alias {{ isic_gui_dir }}; } {% endif -%} - location ~ /(girder|api/v1|static|markup|uda) { + location ~ /(girder|api/v1|static) { proxy_pass http://localhost:{{ girder_port }}; proxy_http_version 1.1; diff --git a/custom/phase1.html b/custom/phase1.html deleted file mode 100644 index a2c66974..00000000 --- a/custom/phase1.html +++ /dev/null @@ -1,167 +0,0 @@ - - - - - - - - - - - ISIC Archive: Image Segmentation - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-
-
- -
-
-
-
- ISIC Segmentation Tool - Return home. -
-
-
- Image: {{ image.name }} -
-
- User: {{ user.firstName}} {{ user.lastName }} ({{ user.login }}) -
-
-
- - -
-
-
-
- -
- - - - Previous: {{ prev_segmentation.created }} {{ prev_segmentation.skill }} - - - - - - Semi-automated: Seeded floodfill - -
-
- - Click a seed point in the image to generate a new segmentation. -
-
-
- -
-
- -
-
- Tolerance: {{ magicwand_tolerance }} -
-
-
-
- - - - Manual: Drawing - -
- -
- - Place 3 or more points to create a perimeter. -
- -
- - Only the first completed polygon will be used. Close and re-open this tab to reset drawing. -
-
-
-
-
- -
-
-
- Submit -
-
-
-
-
- Submitting... - - -
-
-
-
-
-
-
-
-
-
- - diff --git a/custom/static/css/derm.css b/custom/static/css/derm.css deleted file mode 100644 index df2dfeae..00000000 --- a/custom/static/css/derm.css +++ /dev/null @@ -1,505 +0,0 @@ -* { - border-radius: 0 !important; -} - -body { - /*background: #272822 !important;*/ - background: #000; - font-family: "Avenir", "Helvetica Neue Light", "Helvetica Neue", Helvetica, Arial, "Lucida Grande", sans-serif; - font-weight: 300; - color: #ccc; -} - -h2, h3, h4 { - font-family: "Avenir", "HelveticaNeue-CondensedBold", Helvetica, Arial, sans-serif; - color: #fff; -} - -#map { - height: 700px; - /*width: 100%;*/ - /*background-image:url('static/images/gridme.png');*/ - /*background-repeat:repeat;*/ - /*background: #1d1e18;*/ - /*padding: 0px !important;*/ - /*border: 1px solid #333;*/ - background: #000; -} - -#annotatorcontainer { -} - -.panel .panel-body { - background-color: #333; -} - -#toolContainer { - /*height: 100%;*/ - height: 600px; - overflow-y: scroll; - - color: #fff; - - /*width: 500px;*/ - /*left: 10px;*/ - /*top: 10px;*/ - - /*position: absolute;*/ - - padding: 0px; - background: black; - background-repeat: repeat; - /*box-shadow: 0px 0px 10px rgba(0,0,0,0.9);*/ -} - -.nopad { - padding: 0px; -} - -#hoverBar { - - width: 100px; - height: 100px; - position: absolute; - bottom: 0px; - left: 10px; -} - -#verticalToolbar { - width: 100%; - overflow: auto; - overflow-y: scroll; - overflow-x: hidden; -} - -.progress { - height: 5px !important; - padding: 0px !important; - margin: 0px !important; -} - -.pagination { - margin: 0px !important; - margin-top: 10px !important; -} - -.imagePreview { - padding: 1px; - /*padding-top: 10px;*/ - margin-left: 5px; - /*min-height: 200px;*/ - /*max-height: 300px;*/ - overflow-x: hidden; - overflow-y: scroll; -} - -.imagePreviewInner { - width: 480px; -} - -div.wrapper { - float:left; /* important */ - position:relative; /* important(so we can absolutely position the description div */ -} - -div.description { - position:absolute; /* absolute position (so we can position it where we want)*/ - bottombottom:0px; /* position will be on bottom */ - left:0px; - width:100%; - /* styling below */ - background-color:transparent; - font-family: 'Avenir Next'; - font-weight: 700; - /*font-size:13px;*/ - color:white; - /*opacity:0.6; *//* transparency */ - /*filter:alpha(opacity=60); *//* IE transparency */ -} - -/*div.description{*/ - /*position:absolute; *//* absolute position (so we can position it where we want)*/ - /*bottombottom:0px; *//* position will be on bottom */ - /*left:0px;*/ - /*width:100%;*/ - /* styling below */ - /*background-color:black;*/ - /*font-family: 'Avenir Next';*/ - /*font-weight: 700;*/ - /*font-size:13px;*/ - /*color:white;*/ - /*opacity:0.6; *//* transparency */ - /*filter:alpha(opacity=60); *//* IE transparency */ -/*}*/ - -p.description_content{ - padding:3px; - padding-left: 10px; - margin:0px; -} - -.givedropshadow { - box-shadow: 0px 0px 10px rgba(0,0,0,0.9); -} - -.imagethumb { - z-index: 1; - height: 90px; - width: 90px; - margin: 2px; - /*border: 1px solid #999;*/ - float: left; -} - -.imagedone { - z-index: 2; - height: 90px; - width: 90px; - margin: 2px; - border: 1px solid #999; - float: left; - position: relative; -} - -.imagethumb:hover { - border: 1px solid #fff; -} - -/* Annotation List CSS */ - -#annotationListView { - min-height: 100px; - max-height: 190px; - overflow: auto; - overflow-y: scroll; - overflow-x: hidden; -} - -#annotationListView ul,ol { - margin:0px !important; -} - -#annotationListView li { - padding: 2px; - list-style-image: none; - list-style-position: outside; - list-style-type: none; - border-bottom: 1px solid #b2b2b2; -} - -.advancedoptions { - /*margin-top:5px;*/ - padding-top:5px; - width: 100%; - float:left; -} - -.select_group { - /*border: 1px solid #999;*/ - background-color: #222; - min-width: 60px; - height: 26px; - padding: 2px; - padding-left: 5px; - padding-right: 5px; -} - -.optionitem { - /*max-width: 60px;*/ - /*height: 65px;*/ - float: left; - - /*margin-left: 5px;*/ - /*margin-top: 3px;*/ - margin-bottom: 5px; - - height: 90px; - width: 90px; - margin: 2px; - margin-left:3px; - border: 1px solid #999; - - /*margin: 1px;*/ - /*border: 1px solid #999;*/ -} - -.optionimage { - height: 77px; - width: 117px; -} - -.lowertoolbar { - /*background-color:black;*/ - - /*background-color: rgb(62, 64, 54);*/ - /*background: #282727;*/ - /*background-color: rgb(62, 64, 54);*/ - width: 100%; - padding-top: 4px; - padding-bottom: 4px; - float:left; -} - - -.lowertoolbar > div { - margin-left: 6px; - /*margin-right: 10px;*/ - padding-right: 6px; -} - -.choiceoption { - margin-top: 10px; - margin-left: 5px; -} - -.btncontainer { - max-height: 28px; - width: 120px; - float: left; - margin-left: 4px; - /*background-color: #fff;*/ -} - -.btnimage { - max-height: 28px; -} - -.btn:hover { - color: #eee; -} - -.modal-content { - /*background-color: rgb(39, 40, 34);*/ - background-color: #000; - border: 1px solid #666; -} - -.modal-body { - text-align: center; -} - -.thumbnailImg { - width: 60px; -} - -.thumbnailSelector { - height: 120px; - width: 200px; - overflow: auto; - box-shadow: inset 0px 0px 10px rgba(0,0,0,0.9); -} - -.thumbspacer { - float: left; - margin: 1px; - border: 1px dashed #333333; -} - -.thumbborder { - float: left; - border: 1px solid #00ccff; - margin: 1px; -} - -.isichead { - background: #171616; - /*background-color: rgb(62, 64, 54);*/ - /*background: #000;*/ - color: #fff; - - /*height: 50px;*/ - font-weight: 300; - padding: 6px; - /*margin-top: 10px;*/ - /*margin-bottom: 10px;*/ - padding-top:10px; - padding-left: 10px; - border-bottom: 1px solid #333; -} - -.isictitle { - font-size: 15pt; - /*font-family: "HelveticaNeue-CondensedBold", Helvetica, Arial, sans-serif;*/ -} - -.isicuser { - margin-top: 0px; -} - -nav { - width: 100%; - z-index: 200; -} - -.content-group { - padding-top: 9px; - padding-bottom: 5px; - padding-left: 24px; -} - -.btn.active { - color:#fff; - background: #0099ff; -} - -/** - * The zoomslider in the third map shall be horizontal, placed in the top-right - * corner, smaller and orange. - */ -#map .ol-zoomslider { - top: 10px; - left: auto; - right: 10px; - background-color: rgba(122,122,122,0.2); - width: 200px; - height: 20px; - padding: 0; - box-shadow: 0 0 5px rgb(33,33,33); - border-radius: 10px; -} - -#map .ol-zoomslider:hover { - background-color: rgba(200,200,200,0.3); -} - -#map .ol-zoomslider-thumb { - height: 20px; - width: 20px; - margin: 0; - filter: none; - background-color: rgba(255,255,255,0.6); - border-radius: 10px; -} - -#map a.ol-zoomslider-handle:hover { - background-color: rgba(255,255,255,0.7); -} - -.ol-zoom { - display: none; -} - -.ol-logo { - display: none; -} - -.labelgreen { - color: #aeaeae; -} - -.modal.fade { - opacity: 1; -} - -.modal.fade .modal-dialog, .modal.in .modal-dialog { - -webkit-transform: translate(0, 0); - -ms-transform: translate(0, 0); - transform: translate(0, 0); -} - -.modal-backdrop { - opacity: 0.8 !important; -} - -.hideli { - list-style: none; -} - -.markupsmalllabel { - font-size: 80%; -} - -.markupwell { - padding-left: 7px; - /*background: #111;*/ - /*background-repeat:repeat;*/ - /*box-shadow: inset 0px 0px 5px rgba(0,0,0,0.3) ;*/ -} - -nav { - margin-left: 10px; -} - -nav ul ul { - display: none; -} - -nav ul li:hover > ul { - display: block; -} - -nav ul { - background: #efefef; - /*background: linear-gradient(top, #efefef 0%, #bbbbbb 100%);*/ - /*background: -moz-linear-gradient(top, #efefef 0%, #bbbbbb 100%);*/ - /*background: -webkit-linear-gradient(top, #efefef 0%,#bbbbbb 100%);*/ - /*box-shadow: 0px 0px 9px rgba(0,0,0,0.15);*/ - /*padding: 0 20px;*/ - /*border-radius: 10px;*/ - list-style: none; - position: relative; - display: inline-table; - padding: 0px !important; -} - -nav ul:after { - content: ""; - clear: both; - display: block; -} - -nav ul li { - float: left; -} - -nav ul li:hover { - background: #4b545f; - /*background: linear-gradient(top, #4f5964 0%, #5f6975 40%);*/ - /*background: -moz-linear-gradient(top, #4f5964 0%, #5f6975 40%);*/ - /*background: -webkit-linear-gradient(top, #4f5964 0%,#5f6975 40%);*/ -} - -nav ul li:hover a { - border: 1px solid #1a1c1e; -} - -nav ul li a { - display: block; - border: 1px solid #000; - /*padding: 25px 40px;*/ - /*color: #757575; text-decoration: none;*/ -} - -nav ul ul { - /*background: #5f6975; */ - /*border-radius: 0px; padding: 0;*/ - position: absolute; - top: 100%; -} - -nav ul ul li { - float: none; - /*border-top: 1px solid #6b727c;*/ - /*border-bottom: 1px solid #575f6a; */ - position: relative; -} - -nav ul ul li a { - border: 1px solid #555; - /*padding: 15px 40px;*/ - /*color: #fff;*/ -} - -nav ul ul li a:hover { - /*background: #4b545f;*/ -} - -nav ul ul ul { - position: absolute; - left: 100%; - top: 0; -} - -.fawhite { - color: #fff; -} diff --git a/custom/static/css/ol.css b/custom/static/css/ol.css deleted file mode 100644 index b9cf1936..00000000 --- a/custom/static/css/ol.css +++ /dev/null @@ -1 +0,0 @@ -.ol-mouse-position{top:8px;right:8px;position:absolute}.ol-scale-line{background:#95b9e6;background:rgba(0,60,136,.3);border-radius:4px;bottom:8px;left:8px;padding:2px;position:absolute}.ol-scale-line-inner{border:1px solid #eee;border-top:none;color:#eee;font-size:10px;text-align:center;margin:1px;padding:0 2px}.ol-unsupported{display:none}.ol-viewport .ol-unselectable{-webkit-touch-callout:none;-webkit-user-select:none;-khtml-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;-webkit-tap-highlight-color:transparent}.ol-control{position:absolute;background-color:#eee;background-color:rgba(255,255,255,.4);border-radius:4px;padding:2px}.ol-control:hover{background-color:rgba(255,255,255,.6)}.ol-zoom{top:.5em;left:.5em}.ol-rotate{top:.5em;right:.5em;transition:opacity .25s}.ol-zoom-extent{top:4.643em;left:.5em}.ol-full-screen{right:.5em;top:.5em}@media print{.ol-control{display:none}}.ol-control button{display:block;margin:1px;padding:0;color:#fff;font-size:1.14em;font-weight:700;text-decoration:none;text-align:center;height:1.375em;width:1.375em;line-height:.4em;background-color:#7b98bc;background-color:rgba(0,60,136,.5);border:none;border-radius:2px}.ol-control button::-moz-focus-inner{border:none;padding:0}.ol-zoom-extent button{line-height:1.4em}.ol-compass{display:block;font-family:Arial;font-weight:400;font-size:1.2em}.ol-touch .ol-control button{font-size:1.5em}.ol-touch .ol-zoom-extent{top:5.5em}.ol-control button:focus,.ol-control button:hover{text-decoration:none;background-color:#4c6079;background-color:rgba(0,60,136,.7)}.ol-zoom-extent button:after{content:"E"}.ol-zoom .ol-zoom-in{border-radius:2px 2px 0 0}.ol-zoom .ol-zoom-out{border-radius:0 0 2px 2px}button.ol-full-screen-false:after{content:"\2194"}button.ol-full-screen-true:after{content:"\00d7"}.ol-has-tooltip [role=tooltip]{position:absolute;clip:rect(1px 1px 1px 1px);clip:rect(1px,1px,1px,1px);padding:0;border:0;height:1px;width:1px;overflow:hidden;font-weight:400;font-size:14px;text-shadow:0 0 2px #fff}.ol-has-tooltip:focus [role=tooltip],.ol-has-tooltip:hover [role=tooltip]{-moz-box-sizing:content-box;-webkit-box-sizing:content-box;box-sizing:content-box;clip:auto;padding:0 .4em;font-size:.8em;height:1.2em;width:auto;line-height:1.2em;z-index:1100;max-height:100px;white-space:nowrap;display:inline-block;background:#FFF;background:rgba(255,255,255,.6);color:#000;border:3px solid rgba(255,255,255,0);border-left-width:0;border-radius:0 4px 4px 0;bottom:.3em;left:2.2em}.ol-touch .ol-has-tooltip:focus [role=tooltip],.ol-touch .ol-has-tooltip:hover [role=tooltip]{display:none}.ol-zoom .ol-has-tooltip:focus [role=tooltip],.ol-zoom .ol-has-tooltip:hover [role=tooltip]{top:1.1em}.ol-attribution .ol-has-tooltip:focus [role=tooltip],.ol-attribution .ol-has-tooltip:hover [role=tooltip],.ol-full-screen .ol-has-tooltip:focus [role=tooltip],.ol-full-screen .ol-has-tooltip:hover [role=tooltip],.ol-rotate .ol-has-tooltip:focus [role=tooltip],.ol-rotate .ol-has-tooltip:hover [role=tooltip]{right:2.2em;left:auto;border-radius:4px 0 0 4px;border-left-width:3px;border-right-width:0}.ol-attribution{text-align:right;bottom:.5em;right:.5em;max-width:calc(100% - 1.3em)}.ol-attribution ul{margin:0;padding:0 .5em;font-size:.7rem;line-height:1.375em;color:#000;text-shadow:0 0 2px #fff;max-width:calc(100% - 3.6em)}.ol-attribution li{display:inline;list-style:none;line-height:inherit}.ol-attribution li:not(:last-child):after{content:" "}.ol-attribution img{max-height:2em}.ol-attribution button,.ol-attribution ul{display:inline-block}.ol-attribution.ol-collapsed ul,.ol-attribution:not(.ol-collapsed) button:hover [role=tooltip]{display:none}.ol-attribution.ol-logo-only ul{display:block}.ol-attribution:not(.ol-collapsed){background:rgba(255,255,255,.8)}.ol-attribution.ol-uncollapsible{bottom:0;right:0;border-radius:4px 0 0;height:1.1em;line-height:1em}.ol-attribution.ol-logo-only{background:0 0;bottom:.4em;height:1.1em;line-height:1em}.ol-attribution.ol-uncollapsible img{margin-top:-.2em;max-height:1.6em}.ol-attribution.ol-logo-only button,.ol-attribution.ol-uncollapsible button{display:none}.ol-zoomslider{position:absolute;top:4.5em;left:.5em;background:#eee;background:rgba(255,255,255,.4);border-radius:4px;outline:0;overflow:hidden;width:1.5675em;height:200px;padding:3px;margin:0}.ol-zoomslider-thumb{position:absolute;display:block;background:#7b98bc;background:rgba(0,60,136,.5);border-radius:2px;outline:0;overflow:hidden;cursor:pointer;font-size:1.14em;height:1em;width:1.375em;margin:3px;padding:0}.ol-touch .ol-zoomslider{top:5.5em;width:2.052em}.ol-touch .ol-zoomslider-thumb{width:1.8em}.ol-attribution,.ol-control button,.ol-has-tooltip [role=tooltip],.ol-scale-line-inner{font-family:'Lucida Grande',Verdana,Geneva,Lucida,Arial,Helvetica,sans-serif}.ol-overviewmap{background:#474545;border:1px solid rgba(255,255,255,.5);border-radius:0 4px 0 0;padding:4px;position:absolute;right:0;bottom:0;width:150px;height:150px}.ol-overviewmap-minimized{display:none}.ol-overviewmap-box{border:2px dotted rgba(0,60,136,.7)}a.ol-overviewmap-button{position:absolute;right:0;bottom:0;display:block;margin:1px;padding:0;color:#fff;font-size:14px;font-family:'Lucida Grande',Verdana,Geneva,Lucida,Arial,Helvetica,sans-serif;font-weight:700;text-decoration:none;text-align:center;height:22px;width:22px;line-height:19px;background:rgba(0,60,136,.5);border-radius:4px;border:3px solid rgba(255,255,255,.4)}a.ol-overviewmap-button:hover{background:rgba(0,60,136,.7)}a.ol-overviewmap-button-minimized:before{content:"+"}a.ol-overviewmap-button-maximized:before{content:"\2212"}.ol-depthcontrol{position:absolute;top:4.5em;left:.5em;background:#eee;background:rgba(255,255,255,.4);border-radius:4px;outline:0;overflow:hidden;width:1.5675em;height:200px;padding:3px;margin:0}.ol-depthcontrol-thumb{position:absolute;display:block;background:#7b98bc;background:rgba(0,60,136,.5);border-radius:2px;outline:0;overflow:hidden;cursor:pointer;font-size:1.14em;height:1em;width:1.375em;margin:3px;padding:0}.ol-touch .ol-depthcontrol{top:5.5em;width:2.052em}.ol-touch .ol-depthcontrol-thumb{width:1.8em} \ No newline at end of file diff --git a/custom/static/js/dermapp-phase1.js b/custom/static/js/dermapp-phase1.js deleted file mode 100644 index 5a3d58da..00000000 --- a/custom/static/js/dermapp-phase1.js +++ /dev/null @@ -1,201 +0,0 @@ -'use strict'; -/*global $, angular*/ -/*jslint browser: true*/ - -var derm_app = angular.module('DermApp'); - -// Register 'ol' service -derm_app.value('ol', ol); - -// Initialization of angular app controller with necessary scope variables. Inline declaration of external variables -// needed within the controller's scope. State variables (available between controllers using $rootScope). Necessary to -// put these in rootScope to handle pushed data via websocket service. -derm_app.controller('ApplicationController', [ - '$scope', '$rootScope', 'olViewer', - function ($scope, $rootScope, olViewer) { - - // global ready state variable - $rootScope.applicationReady = false; // a hack to know when the rest has loaded (since ol3 won't init until dom does) - $rootScope.imageviewer = undefined; // the ol3 viewer - - // initial layout - $("#angular_id").height(window.innerHeight); - $("#map").height(window.innerHeight); - - $rootScope.imageviewer = new olViewer($('#map')[0]); - - // TODO: remove and clean up HTML elements - $scope.showingSegmentation = false; - } -]); - -derm_app.controller('SegmentationController', [ - '$scope', '$rootScope', '$location', '$http', '$log', 'Image', 'Segmentation', - function ($scope, $rootScope, $location, $http, $log, Image, Segmentation) { - $scope.isSubmitting = false; - - $scope.load = function () { - var image_id = $location.path().substring(1); - - $scope.image = Image.get({'id': image_id}); - $scope.prev_segmentations = Segmentation.query({'imageId': image_id}); - }; - $scope.load(); - - var start_time; - $scope.$watch('image && image._id', function () { - if (!$scope.image || !$scope.image.$resolved) { - return; - } - - $rootScope.imageviewer.clearCurrentImage(); - $rootScope.imageviewer.loadImageWithURL($scope.image._id); - - start_time = Date.now(); - }); - - $scope.canSubmit = function() { - return Boolean($rootScope.imageviewer.getFeatures().length); - }; - - $scope.doSubmit = function () { - var formatter = new ol.format.GeoJSON(); - var feature = formatter.writeFeatureObject( - $rootScope.imageviewer.getFeatures()[0] - ); - - // flip the sign of the y-coordinates - var coordinates = feature.geometry.coordinates[0]; - for (var j=0; j= 5) { - $scope.magicwand_tolerance -= 5; - updateParameter(); - } - }; - } -]); - - -derm_app.controller('ManualSegmentationController', [ - '$scope', '$rootScope', - function ($scope, $rootScope) { - $scope.$parent.$parent.$watch('isOpen', function (isOpen) { - if (isOpen) { - start(); - } else { - stop(); - } - }); - - function start() { - $rootScope.imageviewer.setDrawMode('pointlist', 'lesion'); - } - - function stop() { - $rootScope.imageviewer.clearLayerAnnotations(); - $rootScope.imageviewer.removeDrawInteraction(); - if ($rootScope.imageviewer.draw_mode === 'pointlist') { - // Directly switching to another accordion opens that one before - // this is closed - $rootScope.imageviewer.setDrawMode('navigate', 'lesion'); - } - } - } -]); diff --git a/custom/static/js/dermapp-viewer.js b/custom/static/js/dermapp-viewer.js deleted file mode 100644 index f5c87330..00000000 --- a/custom/static/js/dermapp-viewer.js +++ /dev/null @@ -1,407 +0,0 @@ -'use strict'; -/*global derm_app, $, console*/ -/*jslint browser: true*/ - -var derm_app = angular.module('DermApp'); - -function externalApply() { - var scope = angular.element($("#angular_id")).scope(); - if (!scope.$root.$$phase) { - scope.$apply(); - } -} - -var olViewer = derm_app.factory('olViewer', - function (ol, $http, $log) { - - var olViewer = function (mapContainer) { - - $log.debug('Creating olViewer:', this); - - var self = this; - - // Instance variables - this.image_layer = undefined; - self.image_metadata = undefined; - - this.map = undefined; - this.draw_mode = undefined; - this.draw_label = undefined; - - this.last_click_location = undefined; - this.last_job_id = undefined; - this.fill_tolerance = 50; - - this.paint_size = 70; - -// this.select_interaction = new ol.interaction.Select(); -// this.selected_features = this.select_interaction.getFeatures(); -// var collection = select.getFeatures(); -// this.selected_features.on('add', function(e){ -// $log.debug('add', e); -// }); -// this.selected_features.on('remove', function(e){ -// $log.debug('remove', e); -// }); - - // annotations added that need to be saved -// this.clearTemporaryAnnotations(); - - // current list of features - // annotations previously saved - - var styleFunction = (function () { - return function (feature, resolution) { - if (feature.get('hexcolor')) { - return [ - new ol.style.Style({ - stroke: new ol.style.Stroke({ - color: feature.get('hexcolor'), - width: 2 - }), - fill: new ol.style.Fill({ - color: feature.get('rgbcolor') - }) - }) - ]; - } else { - return [ - new ol.style.Style({ - fill: new ol.style.Fill({ - color: 'rgba(255, 255, 255, 0.2)' - }), - stroke: new ol.style.Stroke({ - color: '#000000', - width: 0 - }), - image: new ol.style.Circle({ - radius: 0, - fill: new ol.style.Fill({ - color: '#000000' - }) - }) - }) - ]; - } - }; - })(); - - this.vector_source = new ol.source.Vector({ - wrapX: false - }); - this.vector_layer = new ol.layer.Vector({ - source: this.vector_source, - style: styleFunction - }); - - this.draw_interaction = new ol.interaction.Draw({ - source: this.vector_source, - type: 'Polygon' - }); - - this.draw_interaction.on('drawend', function (e) { - var properties; - - if (self.draw_label === 'lesion') { - properties = { - icon: 'static/derm/images/lesion.jpg', - hexcolor: '#ff0000', - source: 'manual pointlist', - title: self.draw_label, - rgbcolor: 'rgba(255, 255, 255, 0.1)' - }; - } else if (self.draw_label === 'normal') { - properties = { - icon: 'static/derm/images/normal.jpg', - hexcolor: '#0099ff', - source: 'manual pointlist', - title: self.draw_label, - rgbcolor: 'rgba(255, 255, 255, 0.1)' - }; - } else { - properties = {}; - } - - //e.feature.setValues(properties); - e.feature.setProperties(properties); - - //$log.debug(e.feature.getProperties()); - // need to manually update the angular state, since they're not directly linked - externalApply(); - }); - - // initialize map (imageviewer) - this.map = new ol.Map({ - renderer: 'canvas', - target: mapContainer, - logo: false - }); - - // set map event handlers - this.map.on('singleclick', function(evt) { - var click_coords = self.flipYCoord(evt.coordinate); - - if (self.draw_mode === 'navigate') { - self.last_click_location = click_coords; - - } else if (self.draw_mode === 'pointlist') { - self.last_click_location = evt.coordinate; - - } else if (self.draw_mode === 'autofill') { - self.last_click_location = click_coords; - self.autofill(click_coords); - - } else if (self.draw_mode === 'lines') { - self.last_click_location = evt.coordinate; - self.addPoint(evt.coordinate); - } - }); - - $(this.map.getViewport()).on('mousemove', function (evt) { - var pixel = self.map.getEventPixel(evt.originalEvent); - self.featuresAtPoint(pixel); - }); - }; - - - // Define the "instance" methods using the prototype - // and standard prototypal inheritance. - olViewer.prototype = { - - clearCurrentImage: function () { - if (this.image_layer) { - this.map.removeLayer(this.image_layer); - } - }, - - hasLayerAnnotations: function () { - return this.vector_source.getFeatures().length > 0; - }, - - moveToFeature: function (feature) { - this.map.getView().fitGeometry( - feature.getGeometry(), - this.map.getSize(), - { - padding: [120, 20, 20, 20], - constrainResolution: false - } - ); - }, - - featuresAtPoint: function (pixel) { - var feature = this.map.forEachFeatureAtPixel(pixel, function (feature, layer) { - return feature; - }); - var info = document.getElementById('objectinfo'); - - if (feature) { - var icon = feature.get('icon'); - - if (icon) { - info.src = icon; - info.style.display = 'inline'; - } else { - info.src = '/uda/static/na.jpg'; - info.style.display = 'none'; - } - } else { - info.style.display = 'none'; - info.src = '/uda/static/na.jpg' - } - }, - - featureListFromAnnotation: function (annotation) { - // $log.debug(annotation); - var features_list = []; - - if (annotation.polygons.length > 0) { - var af_feature = new ol.Feature({ - classification: annotation.classification - }); - - af_feature.setGeometry(new ol.geom.Polygon([annotation.polygons])); - features_list.push(af_feature); - } - - if (annotation.lines.length > 0) { - var l_feature = new ol.Feature({ - classification: annotation.classification - }); - - l_feature.setGeometry(new ol.geom.Polygon([annotation.lines])); - features_list.push(l_feature); - } - - return features_list; - }, - - getFeatures: function () { - return this.vector_source.getFeatures(); - }, - - setAnnotations: function (features) { - if (features) { - this.vector_source.addFeatures(features); - } - }, - - clearLayerAnnotations : function (step) { - this.vector_source.clear(); - }, - - removeDrawInteraction: function () { - if (this.draw_interaction) { - this.map.removeInteraction(this.draw_interaction); - } - }, - - setFillParameter: function (new_fill_tolerance) { - this.fill_tolerance = new_fill_tolerance; - }, - - setPaintParameter: function (new_paint_size) { - this.paint_size = new_paint_size; - }, - - regenerateFill: function () { - this.autofill(this.last_click_location); - }, - - autofill: function (click_coords) { - var self = this; - -// var extent = this.map.getView().calculateExtent(this.map.getSize()); -// var tr = ol.extent.getTopRight(extent); -// var tl = ol.extent.getTopLeft(extent); -// var bl = ol.extent.getBottomLeft(extent); - // think: if x is positive on left, subtract from total width - // if x on right is greater than width, x = width - - var segmentURL = '/api/v1/image/' + this.current_image_id + '/segment'; - var msg = { - tolerance: this.fill_tolerance, - seed: click_coords.map(Math.round) - }; - $http.post(segmentURL, msg).success(function (response) { - - self.vector_source.clear(); - var f = new ol.format.GeoJSON(); - - // translate and flip the y-coordinates - var coordinates = response.geometry.coordinates[0]; - for (var j=0; jCLOSURE_NO_DEPS is set to true. This allows projects to - * include their own deps file(s) from different locations. - * - * - * @provideGoog - */ - - -/** - * @define {boolean} Overridden to true by the compiler when --closure_pass - * or --mark_as_compiled is specified. - */ -var COMPILED = false; - - -/** - * Base namespace for the Closure library. Checks to see goog is already - * defined in the current scope before assigning to prevent clobbering if - * base.js is loaded more than once. - * - * @const - */ -var goog = goog || {}; - - -/** - * Reference to the global context. In most cases this will be 'window'. - */ -goog.global = this; - - -/** - * A hook for overriding the define values in uncompiled mode. - * - * In uncompiled mode, {@code CLOSURE_UNCOMPILED_DEFINES} may be defined before - * loading base.js. If a key is defined in {@code CLOSURE_UNCOMPILED_DEFINES}, - * {@code goog.define} will use the value instead of the default value. This - * allows flags to be overwritten without compilation (this is normally - * accomplished with the compiler's "define" flag). - * - * Example: - *
- *   var CLOSURE_UNCOMPILED_DEFINES = {'goog.DEBUG': false};
- * 
- * - * @type {Object.|undefined} - */ -goog.global.CLOSURE_UNCOMPILED_DEFINES; - - -/** - * A hook for overriding the define values in uncompiled or compiled mode, - * like CLOSURE_UNCOMPILED_DEFINES but effective in compiled code. In - * uncompiled code CLOSURE_UNCOMPILED_DEFINES takes precedence. - * - * Also unlike CLOSURE_UNCOMPILED_DEFINES the values must be number, boolean or - * string literals or the compiler will emit an error. - * - * While any @define value may be set, only those set with goog.define will be - * effective for uncompiled code. - * - * Example: - *
- *   var CLOSURE_DEFINES = {'goog.DEBUG': false};
- * 
- * - * @type {Object.|undefined} - */ -goog.global.CLOSURE_DEFINES; - - -/** - * Returns true if the specified value is not undefined. - * WARNING: Do not use this to test if an object has a property. Use the in - * operator instead. - * - * @param {?} val Variable to test. - * @return {boolean} Whether variable is defined. - */ -goog.isDef = function(val) { - // void 0 always evaluates to undefined and hence we do not need to depend on - // the definition of the global variable named 'undefined'. - return val !== void 0; -}; - - -/** - * Builds an object structure for the provided namespace path, ensuring that - * names that already exist are not overwritten. For example: - * "a.b.c" -> a = {};a.b={};a.b.c={}; - * Used by goog.provide and goog.exportSymbol. - * @param {string} name name of the object that this file defines. - * @param {*=} opt_object the object to expose at the end of the path. - * @param {Object=} opt_objectToExportTo The object to add the path to; default - * is |goog.global|. - * @private - */ -goog.exportPath_ = function(name, opt_object, opt_objectToExportTo) { - var parts = name.split('.'); - var cur = opt_objectToExportTo || goog.global; - - // Internet Explorer exhibits strange behavior when throwing errors from - // methods externed in this manner. See the testExportSymbolExceptions in - // base_test.html for an example. - if (!(parts[0] in cur) && cur.execScript) { - cur.execScript('var ' + parts[0]); - } - - // Certain browsers cannot parse code in the form for((a in b); c;); - // This pattern is produced by the JSCompiler when it collapses the - // statement above into the conditional loop below. To prevent this from - // happening, use a for-loop and reserve the init logic as below. - - // Parentheses added to eliminate strict JS warning in Firefox. - for (var part; parts.length && (part = parts.shift());) { - if (!parts.length && goog.isDef(opt_object)) { - // last part and we have an object; use it - cur[part] = opt_object; - } else if (cur[part]) { - cur = cur[part]; - } else { - cur = cur[part] = {}; - } - } -}; - - -/** - * Defines a named value. In uncompiled mode, the value is retreived from - * CLOSURE_DEFINES or CLOSURE_UNCOMPILED_DEFINES if the object is defined and - * has the property specified, and otherwise used the defined defaultValue. - * When compiled, the default can be overridden using compiler command-line - * options. - * - * @param {string} name The distinguished name to provide. - * @param {string|number|boolean} defaultValue - */ -goog.define = function(name, defaultValue) { - var value = defaultValue; - if (!COMPILED) { - if (goog.global.CLOSURE_UNCOMPILED_DEFINES && - Object.prototype.hasOwnProperty.call( - goog.global.CLOSURE_UNCOMPILED_DEFINES, name)) { - value = goog.global.CLOSURE_UNCOMPILED_DEFINES[name]; - } else if (goog.global.CLOSURE_DEFINES && - Object.prototype.hasOwnProperty.call( - goog.global.CLOSURE_DEFINES, name)) { - value = goog.global.CLOSURE_DEFINES[name]; - } - } - goog.exportPath_(name, value); -}; - - -/** - * @define {boolean} DEBUG is provided as a convenience so that debugging code - * that should not be included in a production js_binary can be easily stripped - * by specifying --define goog.DEBUG=false to the JSCompiler. For example, most - * toString() methods should be declared inside an "if (goog.DEBUG)" conditional - * because they are generally used for debugging purposes and it is difficult - * for the JSCompiler to statically determine whether they are used. - */ -goog.DEBUG = true; - - -/** - * @define {string} LOCALE defines the locale being used for compilation. It is - * used to select locale specific data to be compiled in js binary. BUILD rule - * can specify this value by "--define goog.LOCALE=" as JSCompiler - * option. - * - * Take into account that the locale code format is important. You should use - * the canonical Unicode format with hyphen as a delimiter. Language must be - * lowercase, Language Script - Capitalized, Region - UPPERCASE. - * There are few examples: pt-BR, en, en-US, sr-Latin-BO, zh-Hans-CN. - * - * See more info about locale codes here: - * http://www.unicode.org/reports/tr35/#Unicode_Language_and_Locale_Identifiers - * - * For language codes you should use values defined by ISO 693-1. See it here - * http://www.w3.org/WAI/ER/IG/ert/iso639.htm. There is only one exception from - * this rule: the Hebrew language. For legacy reasons the old code (iw) should - * be used instead of the new code (he), see http://wiki/Main/IIISynonyms. - */ -goog.define('goog.LOCALE', 'en'); // default to en - - -/** - * @define {boolean} Whether this code is running on trusted sites. - * - * On untrusted sites, several native functions can be defined or overridden by - * external libraries like Prototype, Datejs, and JQuery and setting this flag - * to false forces closure to use its own implementations when possible. - * - * If your JavaScript can be loaded by a third party site and you are wary about - * relying on non-standard implementations, specify - * "--define goog.TRUSTED_SITE=false" to the JSCompiler. - */ -goog.define('goog.TRUSTED_SITE', true); - - -/** - * @define {boolean} Whether a project is expected to be running in strict mode. - * - * This define can be used to trigger alternate implementations compatible with - * running in EcmaScript Strict mode or warn about unavailable functionality. - * See https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Functions_and_function_scope/Strict_mode - */ -goog.define('goog.STRICT_MODE_COMPATIBLE', false); - - -/** - * Creates object stubs for a namespace. The presence of one or more - * goog.provide() calls indicate that the file defines the given - * objects/namespaces. Provided objects must not be null or undefined. - * Build tools also scan for provide/require statements - * to discern dependencies, build dependency files (see deps.js), etc. - * @see goog.require - * @param {string} name Namespace provided by this file in the form - * "goog.package.part". - */ -goog.provide = function(name) { - if (!COMPILED) { - // Ensure that the same namespace isn't provided twice. This is intended - // to teach new developers that 'goog.provide' is effectively a variable - // declaration. And when JSCompiler transforms goog.provide into a real - // variable declaration, the compiled JS should work the same as the raw - // JS--even when the raw JS uses goog.provide incorrectly. - if (goog.isProvided_(name)) { - throw Error('Namespace "' + name + '" already declared.'); - } - delete goog.implicitNamespaces_[name]; - - var namespace = name; - while ((namespace = namespace.substring(0, namespace.lastIndexOf('.')))) { - if (goog.getObjectByName(namespace)) { - break; - } - goog.implicitNamespaces_[namespace] = true; - } - } - - goog.exportPath_(name); -}; - - -/** - * Marks that the current file should only be used for testing, and never for - * live code in production. - * - * In the case of unit tests, the message may optionally be an exact namespace - * for the test (e.g. 'goog.stringTest'). The linter will then ignore the extra - * provide (if not explicitly defined in the code). - * - * @param {string=} opt_message Optional message to add to the error that's - * raised when used in production code. - */ -goog.setTestOnly = function(opt_message) { - if (COMPILED && !goog.DEBUG) { - opt_message = opt_message || ''; - throw Error('Importing test-only code into non-debug environment' + - (opt_message ? ': ' + opt_message : '.')); - } -}; - - -/** - * Forward declares a symbol. This is an indication to the compiler that the - * symbol may be used in the source yet is not required and may not be provided - * in compilation. - * - * The most common usage of forward declaration is code that takes a type as a - * function parameter but does not need to require it. By forward declaring - * instead of requiring, no hard dependency is made, and (if not required - * elsewhere) the namespace may never be required and thus, not be pulled - * into the JavaScript binary. If it is required elsewhere, it will be type - * checked as normal. - * - * - * @param {string} name The namespace to forward declare in the form of - * "goog.package.part". - */ -goog.forwardDeclare = function(name) {}; - - -if (!COMPILED) { - - /** - * Check if the given name has been goog.provided. This will return false for - * names that are available only as implicit namespaces. - * @param {string} name name of the object to look for. - * @return {boolean} Whether the name has been provided. - * @private - */ - goog.isProvided_ = function(name) { - return !goog.implicitNamespaces_[name] && - goog.isDefAndNotNull(goog.getObjectByName(name)); - }; - - /** - * Namespaces implicitly defined by goog.provide. For example, - * goog.provide('goog.events.Event') implicitly declares that 'goog' and - * 'goog.events' must be namespaces. - * - * @type {Object} - * @private - */ - goog.implicitNamespaces_ = {}; -} - - -/** - * Returns an object based on its fully qualified external name. The object - * is not found if null or undefined. If you are using a compilation pass that - * renames property names beware that using this function will not find renamed - * properties. - * - * @param {string} name The fully qualified name. - * @param {Object=} opt_obj The object within which to look; default is - * |goog.global|. - * @return {?} The value (object or primitive) or, if not found, null. - */ -goog.getObjectByName = function(name, opt_obj) { - var parts = name.split('.'); - var cur = opt_obj || goog.global; - for (var part; part = parts.shift(); ) { - if (goog.isDefAndNotNull(cur[part])) { - cur = cur[part]; - } else { - return null; - } - } - return cur; -}; - - -/** - * Globalizes a whole namespace, such as goog or goog.lang. - * - * @param {Object} obj The namespace to globalize. - * @param {Object=} opt_global The object to add the properties to. - * @deprecated Properties may be explicitly exported to the global scope, but - * this should no longer be done in bulk. - */ -goog.globalize = function(obj, opt_global) { - var global = opt_global || goog.global; - for (var x in obj) { - global[x] = obj[x]; - } -}; - - -/** - * Adds a dependency from a file to the files it requires. - * @param {string} relPath The path to the js file. - * @param {Array} provides An array of strings with the names of the objects - * this file provides. - * @param {Array} requires An array of strings with the names of the objects - * this file requires. - */ -goog.addDependency = function(relPath, provides, requires) { - if (goog.DEPENDENCIES_ENABLED) { - var provide, require; - var path = relPath.replace(/\\/g, '/'); - var deps = goog.dependencies_; - for (var i = 0; provide = provides[i]; i++) { - deps.nameToPath[provide] = path; - if (!(path in deps.pathToNames)) { - deps.pathToNames[path] = {}; - } - deps.pathToNames[path][provide] = true; - } - for (var j = 0; require = requires[j]; j++) { - if (!(path in deps.requires)) { - deps.requires[path] = {}; - } - deps.requires[path][require] = true; - } - } -}; - - - - -// NOTE(nnaze): The debug DOM loader was included in base.js as an original way -// to do "debug-mode" development. The dependency system can sometimes be -// confusing, as can the debug DOM loader's asynchronous nature. -// -// With the DOM loader, a call to goog.require() is not blocking -- the script -// will not load until some point after the current script. If a namespace is -// needed at runtime, it needs to be defined in a previous script, or loaded via -// require() with its registered dependencies. -// User-defined namespaces may need their own deps file. See http://go/js_deps, -// http://go/genjsdeps, or, externally, DepsWriter. -// https://developers.google.com/closure/library/docs/depswriter -// -// Because of legacy clients, the DOM loader can't be easily removed from -// base.js. Work is being done to make it disableable or replaceable for -// different environments (DOM-less JavaScript interpreters like Rhino or V8, -// for example). See bootstrap/ for more information. - - -/** - * @define {boolean} Whether to enable the debug loader. - * - * If enabled, a call to goog.require() will attempt to load the namespace by - * appending a script tag to the DOM (if the namespace has been registered). - * - * If disabled, goog.require() will simply assert that the namespace has been - * provided (and depend on the fact that some outside tool correctly ordered - * the script). - */ -goog.define('goog.ENABLE_DEBUG_LOADER', true); - - -/** - * Implements a system for the dynamic resolution of dependencies that works in - * parallel with the BUILD system. Note that all calls to goog.require will be - * stripped by the JSCompiler when the --closure_pass option is used. - * @see goog.provide - * @param {string} name Namespace to include (as was given in goog.provide()) in - * the form "goog.package.part". - */ -goog.require = function(name) { - - // If the object already exists we do not need do do anything. - // TODO(arv): If we start to support require based on file name this has to - // change. - // TODO(arv): If we allow goog.foo.* this has to change. - // TODO(arv): If we implement dynamic load after page load we should probably - // not remove this code for the compiled output. - if (!COMPILED) { - if (goog.isProvided_(name)) { - return; - } - - if (goog.ENABLE_DEBUG_LOADER) { - var path = goog.getPathFromDeps_(name); - if (path) { - goog.included_[path] = true; - goog.writeScripts_(); - return; - } - } - - var errorMessage = 'goog.require could not find: ' + name; - if (goog.global.console) { - goog.global.console['error'](errorMessage); - } - - - throw Error(errorMessage); - - } -}; - - -/** - * Path for included scripts. - * @type {string} - */ -goog.basePath = ''; - - -/** - * A hook for overriding the base path. - * @type {string|undefined} - */ -goog.global.CLOSURE_BASE_PATH; - - -/** - * Whether to write out Closure's deps file. By default, the deps are written. - * @type {boolean|undefined} - */ -goog.global.CLOSURE_NO_DEPS; - - -/** - * A function to import a single script. This is meant to be overridden when - * Closure is being run in non-HTML contexts, such as web workers. It's defined - * in the global scope so that it can be set before base.js is loaded, which - * allows deps.js to be imported properly. - * - * The function is passed the script source, which is a relative URI. It should - * return true if the script was imported, false otherwise. - * @type {(function(string): boolean)|undefined} - */ -goog.global.CLOSURE_IMPORT_SCRIPT; - - -/** - * Null function used for default values of callbacks, etc. - * @return {void} Nothing. - */ -goog.nullFunction = function() {}; - - -/** - * The identity function. Returns its first argument. - * - * @param {*=} opt_returnValue The single value that will be returned. - * @param {...*} var_args Optional trailing arguments. These are ignored. - * @return {?} The first argument. We can't know the type -- just pass it along - * without type. - * @deprecated Use goog.functions.identity instead. - */ -goog.identityFunction = function(opt_returnValue, var_args) { - return opt_returnValue; -}; - - -/** - * When defining a class Foo with an abstract method bar(), you can do: - * Foo.prototype.bar = goog.abstractMethod - * - * Now if a subclass of Foo fails to override bar(), an error will be thrown - * when bar() is invoked. - * - * Note: This does not take the name of the function to override as an argument - * because that would make it more difficult to obfuscate our JavaScript code. - * - * @type {!Function} - * @throws {Error} when invoked to indicate the method should be overridden. - */ -goog.abstractMethod = function() { - throw Error('unimplemented abstract method'); -}; - - -/** - * Adds a {@code getInstance} static method that always returns the same - * instance object. - * @param {!Function} ctor The constructor for the class to add the static - * method to. - */ -goog.addSingletonGetter = function(ctor) { - ctor.getInstance = function() { - if (ctor.instance_) { - return ctor.instance_; - } - if (goog.DEBUG) { - // NOTE: JSCompiler can't optimize away Array#push. - goog.instantiatedSingletons_[goog.instantiatedSingletons_.length] = ctor; - } - return ctor.instance_ = new ctor; - }; -}; - - -/** - * All singleton classes that have been instantiated, for testing. Don't read - * it directly, use the {@code goog.testing.singleton} module. The compiler - * removes this variable if unused. - * @type {!Array.} - * @private - */ -goog.instantiatedSingletons_ = []; - - -/** - * True if goog.dependencies_ is available. - * @const {boolean} - */ -goog.DEPENDENCIES_ENABLED = !COMPILED && goog.ENABLE_DEBUG_LOADER; - - -if (goog.DEPENDENCIES_ENABLED) { - /** - * Object used to keep track of urls that have already been added. This record - * allows the prevention of circular dependencies. - * @type {Object} - * @private - */ - goog.included_ = {}; - - - /** - * This object is used to keep track of dependencies and other data that is - * used for loading scripts. - * @private - * @type {Object} - */ - goog.dependencies_ = { - pathToNames: {}, // 1 to many - nameToPath: {}, // 1 to 1 - requires: {}, // 1 to many - // Used when resolving dependencies to prevent us from visiting file twice. - visited: {}, - written: {} // Used to keep track of script files we have written. - }; - - - /** - * Tries to detect whether is in the context of an HTML document. - * @return {boolean} True if it looks like HTML document. - * @private - */ - goog.inHtmlDocument_ = function() { - var doc = goog.global.document; - return typeof doc != 'undefined' && - 'write' in doc; // XULDocument misses write. - }; - - - /** - * Tries to detect the base path of base.js script that bootstraps Closure. - * @private - */ - goog.findBasePath_ = function() { - if (goog.global.CLOSURE_BASE_PATH) { - goog.basePath = goog.global.CLOSURE_BASE_PATH; - return; - } else if (!goog.inHtmlDocument_()) { - return; - } - var doc = goog.global.document; - var scripts = doc.getElementsByTagName('script'); - // Search backwards since the current script is in almost all cases the one - // that has base.js. - for (var i = scripts.length - 1; i >= 0; --i) { - var src = scripts[i].src; - var qmark = src.lastIndexOf('?'); - var l = qmark == -1 ? src.length : qmark; - if (src.substr(l - 7, 7) == 'base.js') { - goog.basePath = src.substr(0, l - 7); - return; - } - } - }; - - - /** - * Imports a script if, and only if, that script hasn't already been imported. - * (Must be called at execution time) - * @param {string} src Script source. - * @private - */ - goog.importScript_ = function(src) { - var importScript = goog.global.CLOSURE_IMPORT_SCRIPT || - goog.writeScriptTag_; - if (!goog.dependencies_.written[src] && importScript(src)) { - goog.dependencies_.written[src] = true; - } - }; - - - /** - * The default implementation of the import function. Writes a script tag to - * import the script. - * - * @param {string} src The script source. - * @return {boolean} True if the script was imported, false otherwise. - * @private - */ - goog.writeScriptTag_ = function(src) { - if (goog.inHtmlDocument_()) { - var doc = goog.global.document; - - // If the user tries to require a new symbol after document load, - // something has gone terribly wrong. Doing a document.write would - // wipe out the page. - if (doc.readyState == 'complete') { - // Certain test frameworks load base.js multiple times, which tries - // to write deps.js each time. If that happens, just fail silently. - // These frameworks wipe the page between each load of base.js, so this - // is OK. - var isDeps = /\bdeps.js$/.test(src); - if (isDeps) { - return false; - } else { - throw Error('Cannot write "' + src + '" after document load'); - } - } - - doc.write( - ' diff --git a/isic-archive-gui/src/vue/components/SegmentationTool/SegmentationToolViewer.vue b/isic-archive-gui/src/vue/components/SegmentationTool/SegmentationToolViewer.vue new file mode 100644 index 00000000..f6b7bf45 --- /dev/null +++ b/isic-archive-gui/src/vue/components/SegmentationTool/SegmentationToolViewer.vue @@ -0,0 +1,76 @@ + + + diff --git a/isic_archive/api/task.py b/isic_archive/api/task.py index fdf11f0d..48866227 100644 --- a/isic_archive/api/task.py +++ b/isic_archive/api/task.py @@ -326,8 +326,8 @@ def redirectSegmentationTask(self, params): nextResp = self.nextSegmentationTask(params) imageId = nextResp['_id'] - segmentUrl = '/markup/segment#/%s' % imageId - self._doRedirect(segmentUrl) + url = '/#tasks/segment/%s' % imageId + self._doRedirect(url) @describeRoute( Description('Get the current user\'s annotation tasks.')