Skip to content

Commit

Permalink
try using count for annots
Browse files Browse the repository at this point in the history
  • Loading branch information
birm committed Apr 23, 2024
1 parent 30dfd2a commit 703dfbf
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 7 deletions.
16 changes: 9 additions & 7 deletions apps/dicom-connect/table.js
Original file line number Diff line number Diff line change
Expand Up @@ -234,7 +234,7 @@ function initialize() {
'provenance.image.dicom-study': params.studyId // study

}
const annotations = await store.findMarks(annotationQuery)
const annotationCount = await store.countMarks(annotationQuery)
// update series data
datatable.data().each(function (d) {
const modality = d['00080060']['Value'][0]
Expand All @@ -252,11 +252,13 @@ function initialize() {
}
}
if (modality == 'ANN'){
// match annotations
const idx_annot = annotations.findIndex(annot=>annot.provenance.image['dicom-series']&&series==annot.provenance.image['dicom-series'])
if (idx_annot!=-1) {
// if we see a count, note this

if (annotationCount[0].count > 0) {
d.status = 'done';
d.slideId = annotations[idx_annot].provenance.image.slide;
const idx = slides.findIndex(slide=>series==slide.series)
d.slideId = slides[idx]._id.$oid
//d.slideId = annotations[idx_annot].provenance.image.slide;
} else {
d.status = 'unsync';
}
Expand All @@ -276,8 +278,8 @@ function initialize() {

// initialize
checkInterval()
// update every 30 seconds
var updateSeriesStatus = setInterval(checkInterval, 30000);
// update every 10 seconds
var updateSeriesStatus = setInterval(checkInterval, 10000);
})
break;
case 'instances':
Expand Down
13 changes: 13 additions & 0 deletions core/Store.js
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,19 @@ class Store {
}).then(this.errorHandler).then((x) => this.filterBroken(x, 'mark'));
}

countMarks(q) {
const suffix = 'Mark/count';
const url = this.base + suffix;
var query = {};
if (q) {
query = q;
}
return fetch(url + '?' + objToParamStr(query), {
credentials: 'include',
mode: 'cors',
}).then(this.errorHandler).then((x) => this.filterBroken(x, 'mark'));
}

findSlide(name, specimen, study, location, q) {
let query = {};
const suffix = 'Slide/find';
Expand Down

0 comments on commit 703dfbf

Please sign in to comment.