Skip to content

Commit

Permalink
Merge branch 'develop' into ft-update-footer
Browse files Browse the repository at this point in the history
  • Loading branch information
birm authored Mar 26, 2024
2 parents ddc01d1 + 8a9c4db commit eb9b3e8
Show file tree
Hide file tree
Showing 26 changed files with 5,371 additions and 111 deletions.
3 changes: 2 additions & 1 deletion apps/Info.html
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@

<div class="header text-center text-white bg-info p-4">
<h1 class="h1">caMicroscope</h1>
<p>Digital pathology image viewer with support for human/machine generated annotations and markups.</p>
<p style="font-weight: bold; font-size: 14pt;">Digital pathology image viewer with support for human/machine generated annotations and markups.</p>
<div style="align-content: center;">
<div class="btn-group" role="group">
<a href="./table.html"> <button style="border-color: white; border-radius: 5px 0 0 5px;" type="button" class="btn btn-secondary bg-info text-light" title="Slides Table"><i class="fas fa-list-alt"></i> Slides</button> </a>
Expand Down Expand Up @@ -168,6 +168,7 @@ <h3 class="text-center h3 mb-2" style="margin-top:8px;margin-bottom:10px;">Infor
</div>
</div>


<!-- footer -->
<footer id="footer-layout"></footer>
</div>
Expand Down
135 changes: 67 additions & 68 deletions apps/dev-workbench/workbench.html
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,7 @@
href="#"
data-toggle="modal"
data-target="#helpModal"
onClick="displayUserGuide()"
>
<i class="fas fa-question-circle"></i>
&nbsp;&nbsp;Help/User Guide</a
Expand Down Expand Up @@ -239,74 +240,72 @@
"
>
<!-- Cards -->
<div class="card" style="max-width: 20em; margin-left:2cm; auto;">
<!-- Card content -->
<div class="card-body">
<!-- Title -->
<h4 class="card-title">Select your dataset</h4>
<!-- Text -->
<p style="text-align: justify;" class="card-text">
Select the dataset (.zip) having three files; spritesheet
(data.jpg), a binary labels (labels.bin) and the classes
(labelnames.csv) from your local storage.
</p>
<div class="input-group">
<div class="custom-file">
<input
type="file"
id="spriteInput"
accept=".zip"
style="max-width: 98%;"
/>
<label
style="overflow: hidden;"
class="custom-file-label spriteInputLabel"
for="spriteInput"
>Choose file
</label>
</div>
</div>
</div>
</div>
<div style="height: 1em; margin-left:5cm; padding: 2em 0; font-size: large;">
<b> OR</b>
</div>
<div class="card" style="max-width: 20em; margin-left:2cm; auto;">
<!-- Card content -->
<div class="card-body">
<!-- Title -->
<h4 class="card-title">Create your own</h4>
<!-- Text -->
<p class="card-text" style="text-align: justify;">
Build your own spritesheet using labeling from the caMicroscope
instance or browsing your own dataset.
</p>
<!-- Buttons -->
<div style="text-align: center;">
<button
data-toggle="modal"
data-target="#labelsUploadModal"
style="border-radius: 5px; font-size: 0.9em;"
class="btn btn-primary px-2"
onclick="resetLabelsModal()"
>
caM Labels
</button>
<button
style="border-radius: 5px; font-size: 0.9em;"
class="btn btn-primary px-2"
data-toggle="modal"
data-target="#labelsUploadModal"
onclick="resetLabelsModal(true)"
>
Custom Data
</button>
</div>
</div>
</div>
<!-- Cards -->
</div>
</div>
<div class="container">
<div class="row ">
<div class="col-12 col-lg-5 ">
<div class="card" style="max-width: 20em; margin:auto;">
<div class="card-body">
<h4 class="card-title">Select your dataset</h4>
<p style="text-align: justify" class="card-text">
Select the dataset (.zip) having three files; spritesheet (data.jpg),
a binary labels (labels.bin) and the classes (labelnames.csv)
from your local storage.
</p>
<div class="input-group">
<div class="custom-file">
<input
type="file"
id="spriteInput"
accept=".zip"
style="max-width: 98%;"
/>
<label
style="overflow: hidden;"
class="custom-file-label spriteInputLabel"
for="spriteInput"
> Choose file
</label>
</div>
</div>
</div>
</div>
</div>
<div class="col-12 col-lg-2 d-flex align-items-center justify-content-center">
<b>OR</b>
</div>
<div class="col-12 col-lg-5 ">
<div class="card" style="max-width: 20em; margin:auto;">
<div class="card-body">
<h4 class="card-title">Create your own</h4>
<p class="card-text" style="text-align: justify;">
Build your own spritesheet using labeling from the caMicroscope
instance or browsing your own dataset.
</p>
<div style="text-align: center;">
<button
data-toggle="modal"
data-target="#labelsUploadModal"
style="border-radius: 5px; font-size: 0.9em;"
class="btn btn-primary px-2"
onclick="resetLabelsModal()"
>
caM Labels
</button>
<button
style="border-radius: 5px; font-size: 0.9em;"
class="btn btn-primary px-2"
data-toggle="modal"
data-target="#labelsUploadModal"
onclick="resetLabelsModal(true)"
>
Custom Data
</button>
</div>
</div>
</div>
</div>
</div>
</div>

<!-- Labels/customData Upload Modal -->
<div
Expand Down
6 changes: 3 additions & 3 deletions apps/dev-workbench/workbench.js
Original file line number Diff line number Diff line change
Expand Up @@ -494,14 +494,14 @@ function importWork() {
}

// getting markdown from readme.md and parsing/displaying it as user-guide
$('.helpButton').click(function() {
function displayUserGuide() {
fetch('./readme.md').then((res) => res.blob()).then((blob) => {
let f = new FileReader();
f.onload = function(e) {
$('#helpModal .modal-body').html(marked(e.target.result));
$('#helpModal .modal-body').html(marked.marked(e.target.result));
$('#helpModal .modal-body td, #helpModal .modal-body th')
.css('border', '2px solid #dddddd').css('padding', '5px');
};
f.readAsText(blob);
});
});
}
6 changes: 5 additions & 1 deletion apps/heatmap/init.js
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,10 @@ function initCore() {

$CAMIC.loadImg(async function(e) {
Loading.open(document.body, `Loading Data ...`);
$CAMIC.viewer.addHandler('open-failed', function(e) {
console.error(e.message, e);
redirect($D.pages.table, e.message, 5);
});
// image loaded
if (e.hasError) {
$UI.message.addError(e.message);
Expand Down Expand Up @@ -355,7 +359,7 @@ function initUIcomponents() {
value: 'bugs',
type: 'btn',
callback: ()=>{
window.open('https://goo.gl/forms/mgyhx4ADH0UuEQJ53', '_blank').focus();
window.open('https://github.com/camicroscope/caMicroscope/issues', '_blank').focus();
},
},

Expand Down
6 changes: 5 additions & 1 deletion apps/labeling/labeling.js
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,10 @@ function initCore() {
defaultText: `Slide: ${$D.params.data.name}`,
});
}
$CAMIC.viewer.addHandler('open-failed', function(e) {
console.error(e.message, e);
redirect($D.pages.table, e.message, 5);
});
});

$CAMIC.viewer.addHandler('open', function() {
Expand Down Expand Up @@ -146,7 +150,7 @@ function initCore() {
value: 'bugs',
type: 'btn',
callback: ()=>{
window.open('https://goo.gl/forms/mgyhx4ADH0UuEQJ53', '_blank').focus();
window.open('https://github.com/camicroscope/caMicroscope/issues', '_blank').focus();
},
},
],
Expand Down
2 changes: 1 addition & 1 deletion apps/landing/landing.html
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
<a class="nav-link" href="../signup/signup.html"> <i class="fas fa-user-plus"></i> Signup</a>
</li>
<li class="nav-item link" style="font-family: sans-serif;">
<a class="nav-link" target="_blank" href="https://docs.google.com/forms/d/e/1FAIpQLScL91LxrpAZjU88GBZP9gmcdgdf8__uNUwhws2lzU6Lr4qNwA/viewform"> <i class="fas fa-comment"></i> Feedback</a>
<a class="nav-link" target="_blank" href="https://github.com/camicroscope/caMicroscope/issues"> <i class="fas fa-comment"></i> Feedback</a>
</li>
</ul>
</div>
Expand Down
6 changes: 6 additions & 0 deletions apps/landing/main.css
Original file line number Diff line number Diff line change
Expand Up @@ -2429,6 +2429,12 @@
display: -webkit-flex;
display: -ms-flex;
display: flex;
transition: background-color 0.3s ease, transform 0.3s ease;
}

.posts .post:hover {
background-color: #f0f0f0;
transform: translateY(-10px);
}

.posts .post .image {
Expand Down
111 changes: 111 additions & 0 deletions apps/mini/dataloaders.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,111 @@


function FormTempaltesLoader() {
function loadingFormTemplates() {
$CAMIC.store.findTemplate()
//
.then(function(temps) {
// get templates data
$D.templates = temps;
})
//
.catch(function(error) {
// templates schema

console.error(error);
})
//
.finally(function() {
if ($D.templates) {
// load UI
} else {
// set message
$UI.message.addError('Loading Templates is Error');
}
});
}

var checkCoreIsReady = setInterval(function() {
if ($CAMIC) {
clearInterval(checkCoreIsReady);
// load data
loadingFormTemplates();
}
}, 500);
}

function layersLoader() {
// human
function loadingHumanOverlayers() {
$CAMIC.store.findMarkTypes($D.params.slideId, 'human').then(function(layers) {
// convert part not nesscary
$D.humanlayers = [...layers.map(covertToHumanLayer)];

// add data and create ui item
addHumanLayerItems();
}).catch(function(error) {
// overlayers schema
$UI.message.addError('Loading Human Layers is Error');
console.error(error);
});
}
// ruler
function loadingRulerOverlayers() {
$CAMIC.store.findMarkTypes($D.params.slideId, 'ruler').then(function(layers) {
// convert part not nesscary
$D.rulerlayers = [...layers.map(covertToRulerLayer)];

// add data and create ui item
addRulerLayerItems();
}).catch(function(error) {
// overlayers schema
$UI.message.addError('Loading Ruler Layers is Error');
console.error(error);
});
}
// heatmap
function loadingHeatmapOverlayers() {
$CAMIC.store.findHeatmapType($D.params.slideId).then(function(layers) {
$D.heatmaplayers = [];
// convert and load heatmap layer
for (let i = 0; i < layers.length; i++) {
const item = layers[i].provenance.analysis;
$D.heatmaplayers.push({id: item.execution_id,
name: item.execution_id,
typeId: 'heatmap',
typeName: 'heatmap',
});
}
// add data and create ui item
addHeatmapLayerItems();
}).catch(function(error) {
// overlayers schema
$UI.message.addError('Loading heatmap Overlayers is Error');
console.error(error);
});
}

// segmentation
function loadingComputerOverlayers() {
$CAMIC.store.findMarkTypes($D.params.slideId, 'computer').then(function(layers) {
// convert part not nesscary
$D.computerlayers=[...layers.map(covertToCumputerLayer)];
// add data and create ui item
addComputerLayerItems();
}).catch(function(error) {
$UI.message.addError('Loading Computer Layers is Error');
console.error(error);
});
}
var checkCoreIsReady = setInterval(function() {
if ($UI.layersViewer && $UI.layersViewerMinor) {
clearInterval(checkCoreIsReady);
loadingHumanOverlayers();
loadingRulerOverlayers();
loadingHeatmapOverlayers();
loadingComputerOverlayers();
}
}, 500);
}


Loading

0 comments on commit eb9b3e8

Please sign in to comment.