aboutsummaryrefslogtreecommitdiff
path: root/src/conversion/czi
diff options
context:
space:
mode:
authorcjd242018-04-02 04:37:05 +0100
committercjd242018-04-02 04:37:05 +0100
commit139b0299d016f8dab6738333c767a3add47bfc14 (patch)
treef1c87668aa3e23c9872b91135f415be967b03778 /src/conversion/czi
parentSwapped over the zoom tier section to use vips directly (diff)
downloadmedicine-139b0299d016f8dab6738333c767a3add47bfc14.tar.gz
medicine-139b0299d016f8dab6738333c767a3add47bfc14.zip

Working on converting to Vips, didnt commit czi in this one as is sadly broken

Diffstat (limited to 'src/conversion/czi')
-rw-r--r--src/conversion/czi/convertJxrs.py15
-rw-r--r--src/conversion/czi/pyramidWorker.ts2
2 files changed, 11 insertions, 6 deletions
diff --git a/src/conversion/czi/convertJxrs.py b/src/conversion/czi/convertJxrs.py
index d19a59a..2ba81b3 100644
--- a/src/conversion/czi/convertJxrs.py
+++ b/src/conversion/czi/convertJxrs.py
@@ -10,11 +10,16 @@ coutner = 0
def convertjxrs(filename):
global counter
global totalFiles
- asTif = filename.rsplit('.',1)[0] + ".tif"
- check_call(['./JxrDecApp', "-i", filename, "-o", asTif])
- check_call(['convert', asTif, filename.rsplit('.',1)[0] + ".png"])
- check_call(['rm', filename, asTif])
- counter += 1
+ try:
+ asTif = filename.rsplit('.',1)[0] + ".tif"
+ check_call(['JxrDecApp', "-i", filename, "-o", asTif])
+ check_call(['convert', asTif, filename.rsplit('.',1)[0] + ".png"])
+ check_call(['rm', filename, asTif])
+ counter += 1
+ except:
+ print ("Processing Failed. Probably couldn't find decoder due to invalid system environment path, check this before debugging.")
+ exit(0);
+
print (f"> Processed File: {counter}/{totalFiles} : {filename} --> {filename.rsplit('.',1)[0]}.png")
diff --git a/src/conversion/czi/pyramidWorker.ts b/src/conversion/czi/pyramidWorker.ts
index fdaa038..19acbf9 100644
--- a/src/conversion/czi/pyramidWorker.ts
+++ b/src/conversion/czi/pyramidWorker.ts
@@ -44,7 +44,7 @@ const getFinalTile: Function = async function(imageDir: string, imageTier: CZIHe
}
let outputFileName: string =`${imageDir}/tmp/${uuid.generate()}.png`
- require('shelljs').exec(`./vips arrayjoin "${involvedTiles}" ${outputFileName} --across ${imageTier.plane[0].length}`)
+ require('shelljs').exec(`vips arrayjoin "${involvedTiles}" ${outputFileName} --across ${imageTier.plane[0].length}`)
let extractionRegion = new TileBounds(
desiredRegion.left - imageTier.plane[0][0].width,