aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ecosystem.config.js2
-rw-r--r--src/conversion/czi/pyramidWorker.ts6
-rw-r--r--src/conversion/types/helpers.ts14
3 files changed, 11 insertions, 11 deletions
diff --git a/ecosystem.config.js b/ecosystem.config.js
index 9510731..c1c3897 100644
--- a/ecosystem.config.js
+++ b/ecosystem.config.js
@@ -8,7 +8,7 @@ module.exports = {
name: 'JHBE4',
script: 'src/index.ts',
args: '',
- instances: 4,
+ instances: 2,
watch: false,
ignore_watch: '',
max_memory_restart: '1G',
diff --git a/src/conversion/czi/pyramidWorker.ts b/src/conversion/czi/pyramidWorker.ts
index 7adb747..00cb8b4 100644
--- a/src/conversion/czi/pyramidWorker.ts
+++ b/src/conversion/czi/pyramidWorker.ts
@@ -43,7 +43,7 @@ const findRelatedTiles: Function = function(plane: CZIHeightMap, desired: TileBo
};
export const getTile: Function = async function(imageDir: string, cVal: string, x:number = 0, y:number = 0, w:number = 1024, h:number = 1024, zoom: number = 1): Promise<CZITileRequest> {
- log = logger.for({component: "CZI Live Server", req: {imageDir: imageDir, cVal: cVal, x:x = 0, y:y = 0, w:w, h:h, zoom: zoom}});
+ log = logger.for({component: "CZI Live Server", req: {imageDir: imageDir, cVal: cVal, x:x, y:y, w:w, h:h, zoom: zoom}});
let layout: WholeCZIHierarchy = JSON.parse(await jobQueue.enqueue(2, readFile, null, imageDir + "layout.json", 'utf8'));
if (!layout.complete) {
@@ -85,7 +85,7 @@ const getFinalTile: Function = async function(imageDir: string, imageTier: CZIHe
let outputFileName: string = `${imageDir}tmp/${id}-out.png`
try {
await new Promise((res) => {
- shell.exec(`${execpaths} vips arrayjoin "${involvedTiles}" ${intermediateFileName} --across ${imageTier.plane[0].length} --vips-concurrency=2`);
+ shell.exec(`${execpaths} vips arrayjoin "${involvedTiles}" ${intermediateFileName} --across ${relatedTiles[0].length} --vips-concurrency=2`);
res();
});
} catch (err) {
@@ -118,7 +118,7 @@ const getFinalTile: Function = async function(imageDir: string, imageTier: CZIHe
}
})
- log.info(`Gen new Tile: ${outputFileName} X:${desiredRegion.left} Y:${desiredRegion.top} W:${desiredRegion.width()} H:${desiredRegion.height()} Z:${cVal}`);
+ log.debug(`Gen new Tile: X:${desiredRegion.left} Y:${desiredRegion.top} W:${desiredRegion.width()} H:${desiredRegion.height()} Z:${cVal}`);
return {
dimensions: new TileBounds(
0, extractionRegion.width(),
diff --git a/src/conversion/types/helpers.ts b/src/conversion/types/helpers.ts
index 4621bf6..6fd3be0 100644
--- a/src/conversion/types/helpers.ts
+++ b/src/conversion/types/helpers.ts
@@ -58,16 +58,16 @@ export class TileBounds {
return this.bottom - this.top;
}
public scaleDown(level: number) {
- this.left = Math.ceil(this.left / level),
- this.right = Math.ceil(this.right / level),
- this.top = Math.ceil(this.top / level),
- this.bottom = Math.ceil(this.bottom / level)
+ this.left = Math.floor(this.left / level),
+ this.right = Math.floor(this.right / level),
+ this.top = Math.floor(this.top / level),
+ this.bottom = Math.floor(this.bottom / level)
}
public scaleUp(level: number) {
this.left = Math.floor(this.left * level),
- this.right = Math.ceil(this.right * level),
- this.top = Math.ceil(this.top * level),
- this.bottom = Math.ceil(this.bottom * level)
+ this.right = Math.floor(this.right * level),
+ this.top = Math.floor(this.top * level),
+ this.bottom = Math.floor(this.bottom * level)
}
}