Skip to content

Commit

Permalink
Merge pull request #661 from camicroscope/develop
Browse files Browse the repository at this point in the history
For 3.11.0
  • Loading branch information
birm authored Nov 17, 2023
2 parents c14569f + a46d702 commit 55d8db2
Show file tree
Hide file tree
Showing 47 changed files with 3,811 additions and 4,916 deletions.
1 change: 1 addition & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,4 @@ apps/landing/jquery.min.js
apps/landing/jquery.scrollex.min.js
apps/segment/opencv.js
common/bootstrap-tour-standalone/bootstrap-tour-standalone.min.js
apps/viewer/turf.min.js
7 changes: 3 additions & 4 deletions .github/workflows/node.js.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,16 +12,15 @@ jobs:

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

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
- run: npm ci
- run: npm install
- run: npm install jsdom
- run: npm install -g http-server
Expand Down
38 changes: 0 additions & 38 deletions .travis.yml

This file was deleted.

1 change: 0 additions & 1 deletion Caracal
Submodule Caracal deleted from 945e44
1 change: 0 additions & 1 deletion Distro
Submodule Distro deleted from 4f107a
27 changes: 6 additions & 21 deletions HISTORY.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,29 +5,14 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).


## Index
* **Version 3**
* [3.10.x](#camicroscope-3100)
* [3.9.x](#camicroscope-390)
* [3.8.x](#camicroscope-380)
* [3.7.x](#camicroscope-377)
* [3.7.x](#camicroscope-375)
* [3.6.x](#camicroscope-362)
* [3.5.x](#camicroscope-3510)
* [3.4.x](#camicroscope-343)
* [3.3.x](#camicroscope-334)
* [3.2.x](#camicroscope-322)
* [3.1.x](#camicroscope-311)
* [3.0.x](#camicroscope-300)
* **Version 2**
* [2.0.x](#camicroscope-201)
* **Version 1**
* [1.0.x](#camicroscope-10)

### caMicroscope [Unreleased](https://github.com/camicroscope/camicroscope/compare/v3.10.2...camicroscope:develop)
### caMicroscope [Unreleased](https://github.com/camicroscope/camicroscope/compare/v3.11.0...camicroscope:develop)
###### TBD

### caMicroscope [3.11.0](https://github.com/camicroscope/camicroscope/compare/v3.10.2...camicroscope:v3.11.0)
###### 2023-11-17
* Dicom and Bioformats Intergration (#647, #653, #655)
* Improved Machine Learning Toolkit (#658)

### caMicroscope [3.10.2](https://github.com/camicroscope/camicroscope/compare/v3.10.1...camicroscope:v3.10.2)
###### 2023-06-16
* point to point
Expand Down
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
BSD 3-Clause License

Copyright (c) 2012-2021, caMicroscope
Copyright (c) 2012-2023, caMicroscope
All rights reserved.

Redistribution and use in source and binary forms, with or without
Expand Down
25 changes: 20 additions & 5 deletions apps/batchloader/batchLoader.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ let finishUrl = '../../loader/upload/finish/';
let checkUrl = '../../loader/data/one/';
let chunkSize = 5*1024*1024;
let finishUploadSuccess = false;
const allowedExtensions = ['svs', 'tif', 'tiff', 'vms', 'vmu', 'ndpi', 'scn', 'mrxs', 'bif', 'svslide'];
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"];

// call on document ready
$(document).ready(function() {
Expand All @@ -21,8 +21,12 @@ $(document).ready(function() {
store.findSlide().then((response) => {
for (i=0; i<response.length; i++) {
existingSlides.push(response[i].name);
existingFiles.push((response[i].location).substring((response[i].location).lastIndexOf('/')+1,
if (response[i].filepath) {
existingFiles.push(response[i].filepath);
} else {
existingFiles.push((response[i].location).substring((response[i].location).lastIndexOf('/')+1,
(response[i].location).length));
}
}
}).catch((error) => {
console.log(error);
Expand Down Expand Up @@ -198,7 +202,7 @@ function checkNames() {
}
numErrors++;
} else if (!allowedExtensions.includes(fileNames[i].substring(fileNames[i].lastIndexOf('.')+1,
fileNames[i].length))) {
fileNames[i].length).toLowerCase())) {
let errorIcon = `<i id='fileNameError' class="fas fa-exclamation-circle text-danger" title='File extension not allowed'></i> &nbsp;&nbsp;`;
if ($('.fileNameEdit:eq('+i+')').prev().prev('#fileNameError').length == 0) {
$('.fileNameEdit:eq('+i+')').parent().prepend(errorIcon);
Expand Down Expand Up @@ -346,8 +350,11 @@ function finishBatch() {
}

async function handleUpload(selectedFile, filename, i) {
const token = await startUpload(filename);
const uploadMetadata = await startUpload(filename);
const token = uploadMetadata.upload_token;
tokens.push(token);
fileNames[i] = uploadMetadata.filename;
$('tr:eq('+(i+1)+') td:nth-child(2) span')[0].innerText = uploadMetadata.filename;
let j = 0;
$('.token').each(function() {
$(this).html(tokens[j++]);
Expand All @@ -371,7 +378,7 @@ async function startUpload(filename) {
}}).then((x)=>x.json());
try {
const a = await token;
return a['upload_token'];
return { upload_token: a['upload_token'], filename: a['filename'] };
} catch (e) {
console.log(e);
}
Expand All @@ -395,6 +402,14 @@ function finishUpload(token, filename, i) {
}});
regReq.then((x)=>x.json()).then((a)=>{
// changeStatus('UPLOAD | Finished', a, reset); reset = false;
if (a.filepath) {
const newName = a.filepath.slice(a.filepath.lastIndexOf('/')+1);
fileNames[i] = newName;
$('tr:eq('+(i+1)+') td:nth-child(2) span')[0].innerText = newName;
}
if (a.relpath) {
fileNames[i] = a.relpath;
}
if (typeof a === 'object' && a.error) {
finishUploadSuccess = false;
// $('#check_btn').hide();
Expand Down
2 changes: 1 addition & 1 deletion apps/batchloader/batchloader.html
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@
type="file"
class="custom-file-input"
id="filesInput"
accept=".svs, .tif, .tiff, .vms, .vmu, .ndpi, .scn, .mrxs, .bif, .svslide"
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"
multiple
required
/>
Expand Down
19 changes: 13 additions & 6 deletions apps/loader/chunked_upload.js
Original file line number Diff line number Diff line change
Expand Up @@ -59,12 +59,13 @@ async function readFileChunks(file, token) {
async function handleUpload(selectedFiles) {
selectedFile = selectedFiles[0];
const filename = selectedFiles[0]['name'];
const token = await startUpload(filename);
const uploadMetadata = await startUpload(filename);
const token = uploadMetadata.upload_token;
$('#tokenRow').show(300);
const callback = continueUpload(token);
readFileChunks(selectedFile, token);
// parseFile(selectedFile, callback, 0, x=>(changeStatus("UPLOAD", "Finished Reading File")))
updateFormOnUpload(selectedFiles[0]['name'], token);
updateFormOnUpload(uploadMetadata.filename, token);

document.getElementById('fileUploadInput').colSpan = selectedFiles.length;
document.getElementById('controlButtons').colSpan = selectedFiles.length+1;
Expand All @@ -78,7 +79,7 @@ async function startUpload(filename) {
try {
const a = await token;
changeStatus('UPLOAD', 'Begun upload - Token:' + a['upload_token']);
return a['upload_token'];
return {upload_token: a['upload_token'], filename: a['filename']}; ;
} catch (e) {
changeStatus('UPLOAD | ERROR;', e);
}
Expand Down Expand Up @@ -130,6 +131,13 @@ function finishUpload() {
regReq.then((x)=>x.json()).then((a)=>{
changeStatus('UPLOAD | Finished', a, reset); reset = false;
console.log(a);
if (a.relpath) {
document.getElementById('filename'+0).value = a.relpath;
} else if (a.filename) {
document.getElementById('filename'+0).value = a.filename;
} else if (a.filepath) {
document.getElementById('filename'+0).value = a.filepath.slice(a.filepath.lastIndexOf('/')+1);
}
if (typeof a === 'object' && a.error) {
finishUploadSuccess = false;
$('#check_btn').hide();
Expand All @@ -143,6 +151,7 @@ function finishUpload() {
$('#check_btn').show();
$('#post_btn').hide();
}
validateForm(CheckBtn);
}
});
regReq.then((e)=> {
Expand All @@ -153,8 +162,6 @@ function finishUpload() {
changeStatus('UPLOAD | ERROR;', e);
reset = true;
console.log(e);
} else {
validateForm(CheckBtn);
}
},
);
Expand All @@ -163,7 +170,7 @@ function finishUpload() {

async function handleUrlUpload(url) {
$('#uploadLoading').css('display', 'block');
const token = await startUpload(url);
const token = (await startUpload(url)).upload_token;
await continueUrlUpload(token, url);
}

Expand Down
36 changes: 20 additions & 16 deletions apps/loader/loader.js
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,20 @@ function changeStatus(step, text, reset=true) {
}
}
if (step == 'CHECK') {
// During check, thumbnail needs to be fetched & added to the table
// show post button
if (text['location']) {
// indicating successful check
checkSuccess = true;
if (finishUploadSuccess === true) {
$('#post_btn').show();
} else {
$('#post_btn').hide();
}
} else {
checkSuccess = false;
$('#post_btn').hide();
}
// fetch thumbnail and add to table as we can
// In this case, text[col[col.length - 1]] is the filename
fetch(thumbUrl + text[col[col.length - 1]], {credentials: 'same-origin'}).then(
(response) => response.json(), // if the response is a JSON object
Expand All @@ -69,18 +82,6 @@ function changeStatus(step, text, reset=true) {
const img = new Image();
img.src = x.slide;
tabCell.appendChild(img);
if (text['location']) {
// indicating successful check
checkSuccess = true;
if (finishUploadSuccess === true) {
$('#post_btn').show();
} else {
$('#post_btn').hide();
}
} else {
checkSuccess = false;
$('#post_btn').hide();
}
});
}
}
Expand Down Expand Up @@ -121,12 +122,15 @@ function handleDownload(id) {
store.getSlide(id)
.then((response) => {
if (response[0]) {
return response[0]['location'];
if (response[0]['filepath']) {
return response[0]['filepath'];
}
let location = response[0]['location'];
return location.substring(location.lastIndexOf('/')+1, location.length);
} else {
throw new Error('Slide not found');
}
}).then((location) => {
fileName = location.substring(location.lastIndexOf('/')+1, location.length);
}).then((fileName) => {
console.log(fileName);
return fileName;
}).then((fileName) =>{
Expand Down
14 changes: 8 additions & 6 deletions apps/model/model.js
Original file line number Diff line number Diff line change
Expand Up @@ -408,15 +408,17 @@ function initCore() {

$CAMIC.store.getSlide($D.params.slideId).then((response) => {
if (response[0]) {
return response[0]['location'];
if (response[0]['filepath']) {
return response[0]['filepath'];
}
return location.substring(
location.lastIndexOf('/') + 1,
location.length,
);
} else {
throw new Error('Slide not found');
}
}).then((location) => {
fileName = location.substring(
location.lastIndexOf('/') + 1,
location.length,
);
}).then((fileName) => {
console.log(fileName);
});

Expand Down
Loading

0 comments on commit 55d8db2

Please sign in to comment.