aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorcjd242018-04-25 07:18:25 +0100
committercjd242018-04-25 07:18:25 +0100
commit27e236316c1020518cf2f70cf4cbf2df5951cad6 (patch)
treee95e3ca02ce4dbae3ee9afae037938fdfb509cd7 /src
parentFixing lots of CZI integration things, to prep for server deployment for JH demo (diff)
downloadmedicine-27e236316c1020518cf2f70cf4cbf2df5951cad6.tar.gz
medicine-27e236316c1020518cf2f70cf4cbf2df5951cad6.zip

small fixes of fs.unlink and paths passed to c

Diffstat (limited to 'src')
-rw-r--r--src/conversion/czi/czi.ts12
-rw-r--r--src/conversion/types/exec.ts1
2 files changed, 7 insertions, 6 deletions
diff --git a/src/conversion/czi/czi.ts b/src/conversion/czi/czi.ts
index a618b5b..448d81c 100644
--- a/src/conversion/czi/czi.ts
+++ b/src/conversion/czi/czi.ts
@@ -13,7 +13,7 @@ import { uuid } from '../../uuid'
import { queue as jobQueue, Promiser as Job } from '../../ppq'
import { profiler } from '../../profiler';
import { exec } from '../types/exec'
-sharp.concurrency(4);
+sharp.concurrency(2);
let log: Logger;
const readFile = require('util').promisify(fs.readFile);
@@ -571,7 +571,7 @@ const zoomTier: (
await jobQueue.enqueue(5, fullTileQuadRef.toFile as Job<sharp.OutputInfo>, fullTileQuadRef,
`${outputImageDirectory}img-c${c}-p${p}-y${ys * tileSize}-x${xs * tileSize}.png`);
}
- fs.unlink(`rm ${outputFileName}`, (err) => {
+ fs.unlink(`${outputFileName}`, (err) => {
log.warn(fileName + ' Error when deleting redundant resource: \n' + err.stack)
});
@@ -838,8 +838,8 @@ const initialExtractAndConvert: (absFilePath: string, space: string) => Promise<
checkForOutputDirectories([outputImageData, extractDirectory]);
log.silly(`${fileName} > This will complete at roughly 2GB/min`);
- shell.exec(`${execpaths} CZICrunch ${absFilePath} ${extractDirectory}`);
- shell.exec(`${execpaths} python3 ./ext/bin/convertJxrs.py ${extractDirectory}`);
+ exec(`${execpaths} CZICrunch "${absFilePath}" "${extractDirectory}"`);
+ exec(`${execpaths} python3 ./ext/bin/convertJxrs.py "${extractDirectory}"`);
// let totalFiles: number = 0, counter: number = 0;
// console.log("=========== BEGIN JXR CONVERSION ===========")
@@ -931,8 +931,8 @@ log.notice("CZI Convertor Received new file: " + fileName);
-console.log("REMEMBER TO REMOVE THE MAIN CALL AGAIN MR GOOSEMUN!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!");
-main("/cs/scratch/cjd24/0701.czi", "/cs/scratch/cjd24/0701-extract");
+// console.log("REMEMBER TO REMOVE THE MAIN CALL AGAIN MR GOOSEMUN!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!");
+// main("/cs/scratch/cjd24/0701.czi", "/cs/scratch/cjd24/0701-extract");
// /* tslint:disable */
// async function main2() {
diff --git a/src/conversion/types/exec.ts b/src/conversion/types/exec.ts
index 3f294b7..e9038e9 100644
--- a/src/conversion/types/exec.ts
+++ b/src/conversion/types/exec.ts
@@ -11,6 +11,7 @@ export const exec = (cmd: string): Promise<{
if (code === 0) {
res(ret);
} else {
+ console.log("ERROR EXECING: " + ret)
rej(ret);
}
})