Skip to content

Commit 55d8db2

Browse files
authored
Merge pull request camicroscope#661 from camicroscope/develop
For 3.11.0
2 parents c14569f + a46d702 commit 55d8db2

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

47 files changed

+3811
-4916
lines changed

.eslintignore

+1
Original file line numberDiff line numberDiff line change
@@ -12,3 +12,4 @@ apps/landing/jquery.min.js
1212
apps/landing/jquery.scrollex.min.js
1313
apps/segment/opencv.js
1414
common/bootstrap-tour-standalone/bootstrap-tour-standalone.min.js
15+
apps/viewer/turf.min.js

.github/workflows/node.js.yml

+3-4
Original file line numberDiff line numberDiff line change
@@ -12,16 +12,15 @@ jobs:
1212

1313
strategy:
1414
matrix:
15-
node-version: [14.x, 16.x, 18.x]
15+
node-version: [16.x, 18.x]
1616
# See supported Node.js release schedule at https://nodejs.org/en/about/releases/
1717

1818
steps:
19-
- uses: actions/checkout@v2
19+
- uses: actions/checkout@v4
2020
- name: Use Node.js ${{ matrix.node-version }}
21-
uses: actions/setup-node@v1
21+
uses: actions/setup-node@v3
2222
with:
2323
node-version: ${{ matrix.node-version }}
24-
- run: npm ci
2524
- run: npm install
2625
- run: npm install jsdom
2726
- run: npm install -g http-server

.travis.yml

-38
This file was deleted.

Caracal

-1
This file was deleted.

Distro

-1
This file was deleted.

HISTORY.md

+6-21
Original file line numberDiff line numberDiff line change
@@ -5,29 +5,14 @@ All notable changes to this project will be documented in this file.
55
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
66
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
77

8-
9-
## Index
10-
* **Version 3**
11-
* [3.10.x](#camicroscope-3100)
12-
* [3.9.x](#camicroscope-390)
13-
* [3.8.x](#camicroscope-380)
14-
* [3.7.x](#camicroscope-377)
15-
* [3.7.x](#camicroscope-375)
16-
* [3.6.x](#camicroscope-362)
17-
* [3.5.x](#camicroscope-3510)
18-
* [3.4.x](#camicroscope-343)
19-
* [3.3.x](#camicroscope-334)
20-
* [3.2.x](#camicroscope-322)
21-
* [3.1.x](#camicroscope-311)
22-
* [3.0.x](#camicroscope-300)
23-
* **Version 2**
24-
* [2.0.x](#camicroscope-201)
25-
* **Version 1**
26-
* [1.0.x](#camicroscope-10)
27-
28-
### caMicroscope [Unreleased](https://github.com/camicroscope/camicroscope/compare/v3.10.2...camicroscope:develop)
8+
### caMicroscope [Unreleased](https://github.com/camicroscope/camicroscope/compare/v3.11.0...camicroscope:develop)
299
###### TBD
3010

11+
### caMicroscope [3.11.0](https://github.com/camicroscope/camicroscope/compare/v3.10.2...camicroscope:v3.11.0)
12+
###### 2023-11-17
13+
* Dicom and Bioformats Intergration (#647, #653, #655)
14+
* Improved Machine Learning Toolkit (#658)
15+
3116
### caMicroscope [3.10.2](https://github.com/camicroscope/camicroscope/compare/v3.10.1...camicroscope:v3.10.2)
3217
###### 2023-06-16
3318
* point to point

LICENSE

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
BSD 3-Clause License
22

3-
Copyright (c) 2012-2021, caMicroscope
3+
Copyright (c) 2012-2023, caMicroscope
44
All rights reserved.
55

66
Redistribution and use in source and binary forms, with or without

apps/batchloader/batchLoader.js

+20-5
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ let finishUrl = '../../loader/upload/finish/';
1111
let checkUrl = '../../loader/data/one/';
1212
let chunkSize = 5*1024*1024;
1313
let finishUploadSuccess = false;
14-
const allowedExtensions = ['svs', 'tif', 'tiff', 'vms', 'vmu', 'ndpi', 'scn', 'mrxs', 'bif', 'svslide'];
14+
const allowedExtensions = ["svs", "tif", "tiff", "vms", "vmu", "ndpi", "scn", "mrxs", "bif", "svslide", "jpg", "png", "dcm", "v3draw", "ano", "cfg", "csv", "htm", "rec", "tim", "zpo", "dic", "dicom", "jp2", "j2ki", "j2kr", "raw", "ima", "cr2", "crw", "thm", "wav", "dv", "r3d", "r3d_d3d", "log", "mvd2", "aisf", "aiix", "dat", "atsf", "tf2", "tf8", "btf", "pbm", "pgm", "ppm", "xdce", "xml", "xlog", "apl", "tnb", "mtb", "im", "mea", "res", "aim", "arf", "psd", "al3d", "gel", "am", "amiramesh", "grey", "hx", "labels", "img", "hdr", "sif", "afi", "exp", "h5", "1sc", "pic", "ims", "ch5", "vsi", "ets", "pnl", "htd", "c01", "dib", "cxd", "v", "eps", "epsi", "ps", "flex", "xlef", "fits", "fts", "dm2", "dm3", "dm4", "naf", "his", "ndpis", "txt", "i2i", "hed", "mod", "inr", "ipl", "ipm", "fff", "ics", "ids", "seq", "ips", "ipw", "frm", "par", "j2k", "jpf", "jpk", "jpx", "klb", "xv", "bip", "sxm", "fli", "lim", "msr", "lif", "lof", "lei", "l2d", "mnc", "stk", "nd", "scan", "vff", "mrw", "stp", "mng", "nii", "nrrd", "nhdr", "nd2", "nef", "obf", "omp2info", "oib", "oif", "pty", "lut", "oir", "sld", "spl", "liff", "top", "pcoraw", "pcx", "pict", "pct", "df3", "im3", "qptiff", "bin", "env", "spe", "afm", "sm2", "sm3", "spc", "set", "sdt", "spi", "xqd", "xqf", "db", "vws", "pst", "inf", "tfr", "ffr", "zfr", "zfp", "2fl", "tga", "pr3", "dti", "fdf", "hdf", "xys", "html", "acff", "wat", "bmp", "wpi", "czi", "lms", "lsm", "mdb", "zvi", "mrc", "st", "ali", "map", "mrcs", "jpeg", "gif", "ptif"];
1515

1616
// call on document ready
1717
$(document).ready(function() {
@@ -21,8 +21,12 @@ $(document).ready(function() {
2121
store.findSlide().then((response) => {
2222
for (i=0; i<response.length; i++) {
2323
existingSlides.push(response[i].name);
24-
existingFiles.push((response[i].location).substring((response[i].location).lastIndexOf('/')+1,
24+
if (response[i].filepath) {
25+
existingFiles.push(response[i].filepath);
26+
} else {
27+
existingFiles.push((response[i].location).substring((response[i].location).lastIndexOf('/')+1,
2528
(response[i].location).length));
29+
}
2630
}
2731
}).catch((error) => {
2832
console.log(error);
@@ -198,7 +202,7 @@ function checkNames() {
198202
}
199203
numErrors++;
200204
} else if (!allowedExtensions.includes(fileNames[i].substring(fileNames[i].lastIndexOf('.')+1,
201-
fileNames[i].length))) {
205+
fileNames[i].length).toLowerCase())) {
202206
let errorIcon = `<i id='fileNameError' class="fas fa-exclamation-circle text-danger" title='File extension not allowed'></i> &nbsp;&nbsp;`;
203207
if ($('.fileNameEdit:eq('+i+')').prev().prev('#fileNameError').length == 0) {
204208
$('.fileNameEdit:eq('+i+')').parent().prepend(errorIcon);
@@ -346,8 +350,11 @@ function finishBatch() {
346350
}
347351

348352
async function handleUpload(selectedFile, filename, i) {
349-
const token = await startUpload(filename);
353+
const uploadMetadata = await startUpload(filename);
354+
const token = uploadMetadata.upload_token;
350355
tokens.push(token);
356+
fileNames[i] = uploadMetadata.filename;
357+
$('tr:eq('+(i+1)+') td:nth-child(2) span')[0].innerText = uploadMetadata.filename;
351358
let j = 0;
352359
$('.token').each(function() {
353360
$(this).html(tokens[j++]);
@@ -371,7 +378,7 @@ async function startUpload(filename) {
371378
}}).then((x)=>x.json());
372379
try {
373380
const a = await token;
374-
return a['upload_token'];
381+
return { upload_token: a['upload_token'], filename: a['filename'] };
375382
} catch (e) {
376383
console.log(e);
377384
}
@@ -395,6 +402,14 @@ function finishUpload(token, filename, i) {
395402
}});
396403
regReq.then((x)=>x.json()).then((a)=>{
397404
// changeStatus('UPLOAD | Finished', a, reset); reset = false;
405+
if (a.filepath) {
406+
const newName = a.filepath.slice(a.filepath.lastIndexOf('/')+1);
407+
fileNames[i] = newName;
408+
$('tr:eq('+(i+1)+') td:nth-child(2) span')[0].innerText = newName;
409+
}
410+
if (a.relpath) {
411+
fileNames[i] = a.relpath;
412+
}
398413
if (typeof a === 'object' && a.error) {
399414
finishUploadSuccess = false;
400415
// $('#check_btn').hide();

apps/batchloader/batchloader.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@
7070
type="file"
7171
class="custom-file-input"
7272
id="filesInput"
73-
accept=".svs, .tif, .tiff, .vms, .vmu, .ndpi, .scn, .mrxs, .bif, .svslide"
73+
accept=".svs, .tif, .tiff, .vms, .vmu, .ndpi, .scn, .mrxs, .bif, .svslide, .jpg, .png, .dcm, .v3draw, .ano, .cfg, .csv, .htm, .rec, .tim, .zpo, .dic, .dicom, .jp2, .j2ki, .j2kr, .raw, .ima, .cr2, .crw, .thm, .wav, .dv, .r3d, .r3d_d3d, .log, .mvd2, .aisf, .aiix, .dat, .atsf, .tf2, .tf8, .btf, .pbm, .pgm, .ppm, .xdce, .xml, .xlog, .apl, .tnb, .mtb, .im, .mea, .res, .aim, .arf, .psd, .al3d, .gel, .am, .amiramesh, .grey, .hx, .labels, .img, .hdr, .sif, .afi, .exp, .h5, .1sc, .pic, .ims, .ch5, .vsi, .ets, .pnl, .htd, .c01, .dib, .cxd, .v, .eps, .epsi, .ps, .flex, .xlef, .fits, .fts, .dm2, .dm3, .dm4, .naf, .his, .ndpis, .txt, .i2i, .hed, .mod, .inr, .ipl, .ipm, .fff, .ics, .ids, .seq, .ips, .ipw, .frm, .par, .j2k, .jpf, .jpk, .jpx, .klb, .xv, .bip, .sxm, .fli, .lim, .msr, .lif, .lof, .lei, .l2d, .mnc, .stk, .nd, .scan, .vff, .mrw, .stp, .mng, .nii, .nrrd, .nhdr, .nd2, .nef, .obf, .omp2info, .oib, .oif, .pty, .lut, .oir, .sld, .spl, .liff, .top, .pcoraw, .pcx, .pict, .pct, .df3, .im3, .qptiff, .bin, .env, .spe, .afm, .sm2, .sm3, .spc, .set, .sdt, .spi, .xqd, .xqf, .db, .vws, .pst, .inf, .tfr, .ffr, .zfr, .zfp, .2fl, .tga, .pr3, .dti, .fdf, .hdf, .xys, .html, .acff, .wat, .bmp, .wpi, .czi, .lms, .lsm, .mdb, .zvi, .mrc, .st, .ali, .map, .mrcs, .jpeg, .gif, .ptif"
7474
multiple
7575
required
7676
/>

apps/loader/chunked_upload.js

+13-6
Original file line numberDiff line numberDiff line change
@@ -59,12 +59,13 @@ async function readFileChunks(file, token) {
5959
async function handleUpload(selectedFiles) {
6060
selectedFile = selectedFiles[0];
6161
const filename = selectedFiles[0]['name'];
62-
const token = await startUpload(filename);
62+
const uploadMetadata = await startUpload(filename);
63+
const token = uploadMetadata.upload_token;
6364
$('#tokenRow').show(300);
6465
const callback = continueUpload(token);
6566
readFileChunks(selectedFile, token);
6667
// parseFile(selectedFile, callback, 0, x=>(changeStatus("UPLOAD", "Finished Reading File")))
67-
updateFormOnUpload(selectedFiles[0]['name'], token);
68+
updateFormOnUpload(uploadMetadata.filename, token);
6869

6970
document.getElementById('fileUploadInput').colSpan = selectedFiles.length;
7071
document.getElementById('controlButtons').colSpan = selectedFiles.length+1;
@@ -78,7 +79,7 @@ async function startUpload(filename) {
7879
try {
7980
const a = await token;
8081
changeStatus('UPLOAD', 'Begun upload - Token:' + a['upload_token']);
81-
return a['upload_token'];
82+
return {upload_token: a['upload_token'], filename: a['filename']}; ;
8283
} catch (e) {
8384
changeStatus('UPLOAD | ERROR;', e);
8485
}
@@ -130,6 +131,13 @@ function finishUpload() {
130131
regReq.then((x)=>x.json()).then((a)=>{
131132
changeStatus('UPLOAD | Finished', a, reset); reset = false;
132133
console.log(a);
134+
if (a.relpath) {
135+
document.getElementById('filename'+0).value = a.relpath;
136+
} else if (a.filename) {
137+
document.getElementById('filename'+0).value = a.filename;
138+
} else if (a.filepath) {
139+
document.getElementById('filename'+0).value = a.filepath.slice(a.filepath.lastIndexOf('/')+1);
140+
}
133141
if (typeof a === 'object' && a.error) {
134142
finishUploadSuccess = false;
135143
$('#check_btn').hide();
@@ -143,6 +151,7 @@ function finishUpload() {
143151
$('#check_btn').show();
144152
$('#post_btn').hide();
145153
}
154+
validateForm(CheckBtn);
146155
}
147156
});
148157
regReq.then((e)=> {
@@ -153,8 +162,6 @@ function finishUpload() {
153162
changeStatus('UPLOAD | ERROR;', e);
154163
reset = true;
155164
console.log(e);
156-
} else {
157-
validateForm(CheckBtn);
158165
}
159166
},
160167
);
@@ -163,7 +170,7 @@ function finishUpload() {
163170

164171
async function handleUrlUpload(url) {
165172
$('#uploadLoading').css('display', 'block');
166-
const token = await startUpload(url);
173+
const token = (await startUpload(url)).upload_token;
167174
await continueUrlUpload(token, url);
168175
}
169176

apps/loader/loader.js

+20-16
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,20 @@ function changeStatus(step, text, reset=true) {
5959
}
6060
}
6161
if (step == 'CHECK') {
62-
// During check, thumbnail needs to be fetched & added to the table
62+
// show post button
63+
if (text['location']) {
64+
// indicating successful check
65+
checkSuccess = true;
66+
if (finishUploadSuccess === true) {
67+
$('#post_btn').show();
68+
} else {
69+
$('#post_btn').hide();
70+
}
71+
} else {
72+
checkSuccess = false;
73+
$('#post_btn').hide();
74+
}
75+
// fetch thumbnail and add to table as we can
6376
// In this case, text[col[col.length - 1]] is the filename
6477
fetch(thumbUrl + text[col[col.length - 1]], {credentials: 'same-origin'}).then(
6578
(response) => response.json(), // if the response is a JSON object
@@ -69,18 +82,6 @@ function changeStatus(step, text, reset=true) {
6982
const img = new Image();
7083
img.src = x.slide;
7184
tabCell.appendChild(img);
72-
if (text['location']) {
73-
// indicating successful check
74-
checkSuccess = true;
75-
if (finishUploadSuccess === true) {
76-
$('#post_btn').show();
77-
} else {
78-
$('#post_btn').hide();
79-
}
80-
} else {
81-
checkSuccess = false;
82-
$('#post_btn').hide();
83-
}
8485
});
8586
}
8687
}
@@ -121,12 +122,15 @@ function handleDownload(id) {
121122
store.getSlide(id)
122123
.then((response) => {
123124
if (response[0]) {
124-
return response[0]['location'];
125+
if (response[0]['filepath']) {
126+
return response[0]['filepath'];
127+
}
128+
let location = response[0]['location'];
129+
return location.substring(location.lastIndexOf('/')+1, location.length);
125130
} else {
126131
throw new Error('Slide not found');
127132
}
128-
}).then((location) => {
129-
fileName = location.substring(location.lastIndexOf('/')+1, location.length);
133+
}).then((fileName) => {
130134
console.log(fileName);
131135
return fileName;
132136
}).then((fileName) =>{

apps/model/model.js

+8-6
Original file line numberDiff line numberDiff line change
@@ -408,15 +408,17 @@ function initCore() {
408408

409409
$CAMIC.store.getSlide($D.params.slideId).then((response) => {
410410
if (response[0]) {
411-
return response[0]['location'];
411+
if (response[0]['filepath']) {
412+
return response[0]['filepath'];
413+
}
414+
return location.substring(
415+
location.lastIndexOf('/') + 1,
416+
location.length,
417+
);
412418
} else {
413419
throw new Error('Slide not found');
414420
}
415-
}).then((location) => {
416-
fileName = location.substring(
417-
location.lastIndexOf('/') + 1,
418-
location.length,
419-
);
421+
}).then((fileName) => {
420422
console.log(fileName);
421423
});
422424

0 commit comments

Comments
 (0)