Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
8 changes: 4 additions & 4 deletions apps/heatmap/heatmap.html
Original file line number Diff line number Diff line change
Expand Up @@ -189,15 +189,15 @@
}

else if(!$D.params.execId){
redirect($D.pages.table,'execId is undefined. Redirecting to Table.');
redirect($D.pages.table,'ExecId Is Undefined. Redirecting To Table.');
}

else if ($D.params && ($D.params.slide || $D.params.specimen ||$D.params.study || $D.params.location)){
let STORE = new Store()
STORE.findSlide($D.params.slide, $D.params.study, $D.params.specimen, $D.params.location).then(x=>{
let offset = parseInt($D.params.offset,10) || 0;
if(x.length == 0 || offset >= x.length){
redirect($D.pages.table,'No Slide Found. Redirecting to Table.');
redirect($D.pages.table,'No Slide Found. Redirecting To Table.');
} else {
newParams = $D.params
delete newParams.data
Expand All @@ -210,13 +210,13 @@
}
}).catch(e=>{
console.warn(e)
redirect($D.pages.table,'Redirecting to Table.');
redirect($D.pages.table,'Redirecting To Table.');
})
// find the associated slideID
// open viewer with that slideID
}
else {
redirect($D.pages.table,'Slide is undefined. Redirecting to Table.');
redirect($D.pages.table,'Slide Is Undefined. Redirecting To Table.');
}

// get states parameters
Expand Down
4 changes: 2 additions & 2 deletions apps/heatmap/init.js
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ function initCore(){


if(!$D.heatMapData){
redirect($D.pages.table,`No Heatmap's data Found. Redirecting to Table.`);
redirect($D.pages.table,`No Heatmap's Data Found. Redirecting To Table.`);
}


Expand Down Expand Up @@ -185,7 +185,7 @@ function initCore(){
// editedDate:$D.
onFieldChange: editorPenChange,
onReset: function(){
if(confirm('Do you want to clear edited data?')){
if(confirm('Do You Want To Clear Edited Data?')){
$CAMIC.viewer.canvasDrawInstance.clear();
}
}, // clearEditData
Expand Down
8 changes: 4 additions & 4 deletions apps/heatmap/uicallbacks.js
Original file line number Diff line number Diff line change
Expand Up @@ -371,7 +371,7 @@ function heatmapEditorOff(){
2. Analytics
*/
async function onUpdateHeatmapFields(){
if(!confirm('Do you want to update Threshold values?')) return;
if(!confirm('Do You Want To Update Threshold?')) return;
Loading.open(document.body,'Saving Threshold ... ');
const fields = $D.heatMapData.provenance.analysis.fields;
const subject = $D.heatMapData.provenance.image.subject_id;
Expand All @@ -384,7 +384,7 @@ async function onUpdateHeatmapFields(){

async function onExportEditData(){
if($D.editedDataClusters.isEmpty()){
alert('There are no edit data to export...');
alert('No Edit Data ... ');
return;
}
const user = getUserId();
Expand Down Expand Up @@ -548,8 +548,8 @@ async function onDeleteEditData(data){
const cluster = data.cluster;
const idx = data.index;

if(!confirm(`Do you want to delete { ${cluster.name} - ${cluster.value==0?'Negative':'Positive'} index:${idx} }?`)) return;
Loading.open(document.body,`deleting Edit Data ...`);
if(!confirm(`Do You Want To Delete { ${cluster.name} - ${cluster.value==0?'Negative':'Positive'} Index:${idx} }?`)) return;
Loading.open(document.body,`Deleting Edit Data ...`);

// UPDATE EDIT DATA
$D.editedDataClusters.removeEditDataForCluster(cluster.index, cluster.name, cluster.value, cluster.color, idx);
Expand Down
8 changes: 4 additions & 4 deletions apps/labeling/labeling.html
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@
createWarningText('You are using an <strong>IE/Edge</strong> browser that may be lead to erratic behavior on caMicroscope. Please switch to <a href="https://www.google.com/chrome/">Chrome</a>, <a href="https://www.mozilla.org/en-US/firefox/new/">Firefox</a> or <a href="https://www.apple.com/safari/">Safari</a> browser to improve your experience.');
}

Loading.open(document.body, 'CaMicroscope is initializing...');
Loading.open(document.body, 'CaMicroscope Is Initializing...');
// get slide id from url
const url = new URL(window.location.href);
$D.params = getUrlVars();
Expand All @@ -105,7 +105,7 @@
STORE.findSlide($D.params.slide, $D.params.study, $D.params.specimen, $D.params.location).then(x=>{
let offset = parseInt($D.params.offset,10) || 0;
if(x.length == 0 || offset >= x.length){
redirect($D.pages.table,'No Slide Found. Redirecting to Table.');
redirect($D.pages.table,'No Slide Found. Redirecting To Table.');
} else {
newParams = $D.params
delete newParams.data
Expand All @@ -118,12 +118,12 @@
}
}).catch(e=>{
console.warn(e)
redirect($D.pages.table,'Redirecting to Table.');
redirect($D.pages.table,'Redirecting To Table.');
})
// find the associated slideID
// open viewer with that slideID
}else{
redirect($D.pages.table,'Slide Id is undefined. Redirecting to Flex Table.');
redirect($D.pages.table,'Slide Id Is Undefined. Redirecting To Flex Table.');
}

// get states parameters
Expand Down
2 changes: 1 addition & 1 deletion apps/labeling/labeling.js
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ function initCore(){
}
function downloadLabel(){
if(!$CAMIC.viewer.pmanager.hasPatches()){
alert('There is no patches');
alert('There Is No Patches');
return;
}

Expand Down
6 changes: 3 additions & 3 deletions apps/segment/segment.html
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@
STORE.findSlide($D.params.slide, $D.params.study, $D.params.specimen, $D.params.location).then(x=>{
let offset = parseInt($D.params.offset,10) || 0;
if(x.length == 0 || offset >= x.length){
redirect($D.pages.table,'No Slide Found. Redirecting to Table.');
redirect($D.pages.table,'No Slide Found. Redirecting To Table.');
} else {
newParams = $D.params
delete newParams.data
Expand All @@ -176,13 +176,13 @@
}
}).catch(e=>{
console.warn(e)
redirect($D.pages.table,'Redirecting to Table.');
redirect($D.pages.table,'Redirecting To Table.');
})
// find the associated slideID
// open viewer with that slideID
}
else {
redirect($D.pages.table,'Slide is undefined. Redirecting to Table.');
redirect($D.pages.table,'Slide Is Undefined. Redirecting To Table.');
}

// get states parameters
Expand Down
2 changes: 1 addition & 1 deletion apps/segment/segment.js
Original file line number Diff line number Diff line change
Expand Up @@ -290,7 +290,7 @@ function checkSize(imgColl, imagingHelper) {

// check that image size is ok
if (width * height > 8000000) {
alert("Selected ROI too large, current version is limited to 4 megapixels");
alert("Selected ROI Too Large, Current Version Is Limited To 4 Megapixels");
// Clear the rectangle canvas-draw-overlay.clear()
$CAMIC.viewer.canvasDrawInstance.clear();
return {}; //throw('image too large')
Expand Down
2 changes: 1 addition & 1 deletion apps/segment/segmentpanel/segmentpanel.js
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ SegmentPanel.prototype.close = function(){
};

SegmentPanel.prototype.save = function(){
alert('Saving Image and Mask!');
alert('Saving Image And Mask!');
};

SegmentPanel.prototype.showThreshBar = function(){
Expand Down
2 changes: 1 addition & 1 deletion apps/table.html
Original file line number Diff line number Diff line change
Expand Up @@ -306,7 +306,7 @@
if(i==0) default_btn.push("NO DATA")
else default_btn.push('')
});
const btn = `<button class="btn" onclick='alert("no data")'>Open</button>`
const btn = `<button class="btn" onclick='alert("No Data")'>Open</button>`
default_btn.push(btn);
return [default_btn];
}
Expand Down
26 changes: 16 additions & 10 deletions apps/viewer/uicallbacks.js
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ label.style.width = 0;

function draw(e){
if(!$CAMIC.viewer.canvasDrawInstance){
alert('draw doesn\'t initialize');
alert('Draw Doesn\'t Initialize');
return;
}
const state = +e.state;
Expand Down Expand Up @@ -252,7 +252,7 @@ function annotationOff(){
if(!$CAMIC.viewer.canvasDrawInstance) return;
const canvasDraw = $CAMIC.viewer.canvasDrawInstance;

if(canvasDraw._draws_data_.length && confirm(`Do you want to save annotation before you leave?`)){
if(canvasDraw._draws_data_.length && confirm(`Do You Want To Save Annotation Before You Leave?`)){
saveAnnotation();
}else{
canvasDraw.clear();
Expand Down Expand Up @@ -389,9 +389,9 @@ function anno_delete(data){
const annotationData = $D.overlayers.find(d=>d.data && d.data._id.$oid == data.oid);
let message;
if(annotationData.data.geometries){
message = `Are you sure you want to delete this Annotation {ID:${data.id}} with ${annotationData.data.geometries.features.length} mark(s)?`;
message = `Are You Sure You Want To Delete This Annotation {ID:${data.id}} With ${annotationData.data.geometries.features.length} Mark(s)?`;
}else{
message = `Are you sure you want to delete this markup {ID:${data.id}}?`;
message = `Are You Sure You Want To Delete This Markup {ID:${data.id}}?`;
}
$UI.annotPopup.close();
if(!confirm(message)) return;
Expand Down Expand Up @@ -499,7 +499,7 @@ function anno_callback(data){
// has Path?

if($CAMIC.viewer.canvasDrawInstance._path_index===0){
alert('No Markup on Annotation.');
alert('No Markup On Annotation.');
return;
}
// save
Expand Down Expand Up @@ -652,7 +652,7 @@ function loadAnnotationById(camic, layerData ,callback){
layerData.item.loading = true;
const item = layerData.item;

Loading.open(document.body,'loading layers...');
Loading.open(document.body,'Loading Layers...');

$CAMIC.store.getMarkByIds([item.id],$D.params.data.name)
.then(data =>{
Expand Down Expand Up @@ -692,9 +692,10 @@ function loadAnnotationById(camic, layerData ,callback){
return [Math.round(point[0]*imgWidth),Math.round(point[1]*imgHeight)];
});
d.properties.style = {
color: "#7CFC00",
color: "#000080",
lineCap: "round",
lineJoin: "round"
lineJoin: "round",
isFill:false
};
return {
_id:d._id,
Expand All @@ -705,6 +706,8 @@ function loadAnnotationById(camic, layerData ,callback){
});
// if(item) data[0].isShow = item.isShow;
item.render = old_anno_render;
item.clickable = false;
item.hoverable = false;
}else{
data[0].geometries = VieweportFeaturesToImageFeatures(camic.viewer, data[0].geometries);
item.data = data[0];
Expand Down Expand Up @@ -796,7 +799,7 @@ function hostedHeatmap(){
if (typeof list === "undefined") { list = [] }
// get heatmap data
if(!list.length){
alert(`${slide} has No heatmap data.`);
alert(`${slide} Has No Heatmap Data.`);
return;
}
createHeatMapList(list);
Expand Down Expand Up @@ -849,7 +852,7 @@ function imgboxHeatmap(){

data.provenance.image.slide = slide
const execId = data.provenance.analysis.execution_id;
Loading.open(document.body,'loading Heatmap...');
Loading.open(document.body,'Loading Heatmap...');
$CAMIC.store.addHeatmap(data).then(rs=>{
window.location.href = `../heatmap/heatmap.html${window.location.search}&execId=${execId}`;
}).catch(e=>{
Expand Down Expand Up @@ -892,6 +895,9 @@ function anno_render(ctx,data){
//DrawHelper.draw(this._canvas_ctx, this.data.canvasData);
}
function old_anno_render(ctx,data){
const imagingHelper = this.viewer.imagingHelper;
const lineWidth = (imagingHelper.physicalToDataX(1) - imagingHelper.physicalToDataX(0))>> 0;
ctx.lineWidth = lineWidth;
DrawHelper.draw(ctx, data);

}
Expand Down
2 changes: 1 addition & 1 deletion apps/viewer/viewer.html
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@
STORE.findSlide($D.params.slide, $D.params.study, $D.params.specimen, $D.params.location).then(x=>{
let offset = parseInt($D.params.offset,10) || 0;
if(x.length == 0 || offset >= x.length){
redirect($D.pages.table,'No Slide Found. Redirecting to Table.');
redirect($D.pages.table,'No Slide Found. Redirecting To Table.');
} else {
newParams = $D.params
delete newParams.data
Expand Down
2 changes: 1 addition & 1 deletion components/loading/loading.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ Loading.instance = null;
* @property {Element} the text element of Loading page.
*/
Loading.text = null;
Loading.open = function(parentNode ,text = 'loading...',zIndex=999){
Loading.open = function(parentNode ,text = 'Loading...',zIndex=999){
if(!Loading.instance) Loading.instance = Loading.createInstance();
if(parentNode !== Loading.instance.parentNode) Loading.close();
Loading.instance.style.zIndex = zIndex;
Expand Down
14 changes: 7 additions & 7 deletions core/CaMic.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ class CaMic{
*
*/
constructor(divId, slideQuery, options){
Loading.open(document.body, 'CaMicroscope is initializing...');
Loading.open(document.body, 'CaMicroscope Is Initializing...');
// initalize viewer
this.setting = {
id: divId,
Expand Down Expand Up @@ -141,7 +141,7 @@ class CaMic{
* Loads the staged image
*/
loadImg(func){
Loading.open(document.body, 'CaMicroscope is loading images ...');
Loading.open(document.body, 'CaMicroscope Is Loading Images ...');
// loads current image
// if id is set, use id
var slidePromise;
Expand All @@ -154,7 +154,7 @@ class CaMic{
slidePromise
.then((x)=>{
if(!x || !OpenSeadragon.isArray(x) || !x.length || !x[0].location){
redirect($D.pages.table,`Can't find the slide information`);
redirect($D.pages.table,`Can't Find The Slide Information`);
return;
}
let data = x[0];
Expand All @@ -166,8 +166,8 @@ class CaMic{
}.bind(this),
error: function ( xhr, exc ) {
console.log(xhr, exc);
Loading.text.textContent = 'Something wrong with this Slide... X_X';
if(func && typeof func === 'function') func.call(null,{hasError:true,isServiceError:true,message:'Something wrong with this Slide... X_X'});
Loading.text.textContent = 'Something Wrong With This Slide... X_X';
if(func && typeof func === 'function') func.call(null,{hasError:true,isServiceError:true,message:'Something Wrong With This Slide... X_X'});
}.bind(this),
});

Expand Down Expand Up @@ -211,7 +211,7 @@ class CaMic{
imagingHelper.setMaxZoom(1);
data.url = "../../img/IIP/raw/?DeepZoom="+ data["location"] + ".dzi";
if(func && typeof func === 'function') func.call(null,data);
Loading.text.textContent = `loading slide's tiles...`;
Loading.text.textContent = `Loading Slide's Tiles...`;
}

/**
Expand Down Expand Up @@ -252,7 +252,7 @@ class CaMic{

this.drawContextmenu.addHandler('clear',function(e){
if(this.viewer.canvasDrawInstance._draws_data_.length == 0) return;
if(confirm("Do you want to clear all markups?")) this.viewer.canvasDrawInstance.clear();
if(confirm("Do You Want To Clear All Markups?")) this.viewer.canvasDrawInstance.clear();
}.bind(this));

// this.drawContextmenu.addHandler('draw-mode-changed',function(e){
Expand Down
Loading