diff options
| author | cjd24 | 2018-04-21 14:02:33 +0100 |
|---|---|---|
| committer | cjd24 | 2018-04-21 14:02:33 +0100 |
| commit | 6d8328fcaeb01603a8ab2e45b0b3ac5f0801e58d (patch) | |
| tree | 9e8b6e0010da47c2db4b58aef8498e85064d5984 /src/conversion/leica/scn.ts | |
| parent | adding support for excel to csv stuff and fixed stage count of czi conversion (diff) | |
| download | medicine-6d8328fcaeb01603a8ab2e45b0b3ac5f0801e58d.tar.gz medicine-6d8328fcaeb01603a8ab2e45b0b3ac5f0801e58d.zip | |
apparent fix of CRITICAL czi bug, along with small redundancy based performance enhancements & minor changes to progress bar
Diffstat (limited to 'src/conversion/leica/scn.ts')
| -rw-r--r-- | src/conversion/leica/scn.ts | 17 |
1 files changed, 6 insertions, 11 deletions
diff --git a/src/conversion/leica/scn.ts b/src/conversion/leica/scn.ts index e2125e1..b235a79 100644 --- a/src/conversion/leica/scn.ts +++ b/src/conversion/leica/scn.ts @@ -2,7 +2,7 @@ import * as fs from 'fs'; import * as sharp from 'sharp'; // tslint:disable-next-line:no-duplicate-imports import { SharpInstance } from 'sharp'; -import { SupportedViews, TileBounds, writeJSONToFile, checkForOutputDirectories } from '../types/helpers'; +import { SupportedViews, TileBounds, writeJSONToFile, checkForOutputDirectories, execpaths } from '../types/helpers'; import { uuid } from '../../uuid' import { logger } from '../../logger'; @@ -14,13 +14,12 @@ const baseDirname: string = '/cs/scratch/cjd24/tifers/'; // Various constants for placing files and defining tiles const extensionBinariesDir: string = __dirname + `/../../../ext/bin/`; -const execpaths: string = `PATH="$PATH:${extensionBinariesDir}" LD_LIBRARY_PATH="$LD_LIBRARY_PATH:${extensionBinariesDir}../lib/" `; const tileOverlap: number = 0; // Overlap is only half implemented const tileSize: number = 512; -const crunchLeica: () => void = async (): Promise<void> => { +const crunchLeica: () => Promise<string> = async (): Promise<string> => { try { let output: string =`${baseDirname}${uuid.generate()}/`; @@ -84,17 +83,13 @@ const crunchLeica: () => void = async (): Promise<void> => { }) .toFile(`${output}output.dzi`); logger.success(`Finalised output of ${input} as .dzi`); + return `${output}output.dzi`; } catch (err) { logger.failure(`Lecia conversion failed with error: ${err}`) + return `Lecia conversion failed with error: ${err}`; } }; -/** - * Main function used to call the rest of the relevant code to crunch a CZI - * extraction. - */ -const main: () => void = (): void => { - crunchLeica(); -}; -main(); + +crunchLeica().then((ret:string) => console.log(ret)); |
