aboutsummaryrefslogtreecommitdiff
path: root/src/conversion/czi
diff options
context:
space:
mode:
authorcjd242018-03-29 12:47:59 +0100
committercjd242018-03-29 12:47:59 +0100
commit426befe551d563f7394f67e9053705a2bdd21126 (patch)
tree6ab6bd53da52f62cd1a4314e765463b9d9c3ef6e /src/conversion/czi
parentClean up some of czi.ts (diff)
downloadmedicine-426befe551d563f7394f67e9053705a2bdd21126.tar.gz
medicine-426befe551d563f7394f67e9053705a2bdd21126.zip

Small changes to fix up last type stuff

Diffstat (limited to 'src/conversion/czi')
-rw-r--r--src/conversion/czi/czi.ts13
-rw-r--r--src/conversion/czi/pyramidWorker.ts1
2 files changed, 9 insertions, 5 deletions
diff --git a/src/conversion/czi/czi.ts b/src/conversion/czi/czi.ts
index c2d88ab..5682586 100644
--- a/src/conversion/czi/czi.ts
+++ b/src/conversion/czi/czi.ts
@@ -3,7 +3,7 @@ import { CZIHeightMap, CZITile,
import { Dimension, Segment } from '../types/cziBinaryTypings';
import * as fs from 'fs';
import { SupportedViews, TileBounds } from '../types/helperCZITypes';
-import { logger } from '../../logging';
+import { logger } from '../../logger';
import * as sharp from 'sharp';
// tslint:disable-next-line:no-duplicate-imports
import { SharpInstance } from 'sharp';
@@ -351,7 +351,9 @@ const cleanSupportedViews: (view: SupportedViews) => void = (
view: SupportedViews
): void => {
for (const channel of view.scalable_image.channels) {
- channel.metadata = cleanSupportedViewObject(channel.metadata);
+ channel.metadata = cleanSupportedViewObject(
+ channel.metadata as parsexml.Node[]
+ );
}
};
@@ -553,7 +555,8 @@ const zoomTier: (
height: previousHeightMap.plane[ys][xs].height * 2,
file: `img-${filecounter++}`
});
- finalCZIJson.total_files++;
+ // tslint:disable-next-line:no-non-null-assertion
+ finalCZIJson.total_files!++;
}
newZoomTier.plane.push(cziRow);
@@ -695,7 +698,7 @@ const writeJSONToFile: (filePath: string, obj: object) => void = (
JSON.stringify(obj, null, 2),
(err: Error) => {
if (err) {
- logger.error(err);
+ logger.error(err.message);
throw err;
}
}
@@ -750,7 +753,7 @@ const buildCustomPyramids: () => Promise<void> = async(): Promise<void> => {
}).catch((err: Error) => {
// On error, write the error to console and set an error true.
if (err) {
- logger.error(err);
+ logger.error(err.message);
}
errorOccurred = true;
}
diff --git a/src/conversion/czi/pyramidWorker.ts b/src/conversion/czi/pyramidWorker.ts
index 459f8f9..81110e7 100644
--- a/src/conversion/czi/pyramidWorker.ts
+++ b/src/conversion/czi/pyramidWorker.ts
@@ -4,6 +4,7 @@ import { TileBounds } from '../types/helperCZITypes';
import * as sharp from 'sharp';
import { SharpInstance } from 'sharp';
import { isTileRelated, regionToExtract } from './tileExtraction';
+import { logger } from '../../logger';
const processedDirname: string = '/cs/scratch/cjd24/0701-extraction-processed/';
const processedImages: string = `${processedDirname}data/`;