From 57d5f236154571948b2f4a868323979876a3b4c8 Mon Sep 17 00:00:00 2001 From: mwinding Date: Wed, 16 Dec 2020 14:16:20 +0000 Subject: [PATCH 1/6] added try-except block for KLB import --- python/imagej/tabulate_filepaths.py | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/python/imagej/tabulate_filepaths.py b/python/imagej/tabulate_filepaths.py index 086a7a31..8b46ac3f 100644 --- a/python/imagej/tabulate_filepaths.py +++ b/python/imagej/tabulate_filepaths.py @@ -24,7 +24,13 @@ import re import os import sys -from org.janelia.simview.klb import KLB + +try: # try-except block allows users with default FIJI to run the script without KLB installation + from org.janelia.simview.klb import KLB +except ImportError: + print "Warning: KLB format unavailable" + KLB = None + from net.imglib2.img.display.imagej import ImageJFunctions as IL @@ -142,6 +148,8 @@ def actionPerformed(self, event): def openImage(): print rel_path if rel_path.endswith(".klb"): + if(KLB==None): + print "Cannot open KLB due to missing module" try: klb = KLB.newInstance() img = klb.readFull(os.path.join(base_path, rel_path)) @@ -150,7 +158,7 @@ def openImage(): print sys.exc_info() else: print "via IJ.open" - IJ.open(os.path.join(base_path, rel_path)) + IJ.open(os.path.join(base_path, rel_path)) exe.submit(openImage) From 94b0819d3700453b726bf076b01ed45705ac2415 Mon Sep 17 00:00:00 2001 From: mwinding Date: Wed, 16 Dec 2020 14:25:24 +0000 Subject: [PATCH 2/6] minor whitespace change --- python/imagej/tabulate_filepaths.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/python/imagej/tabulate_filepaths.py b/python/imagej/tabulate_filepaths.py index 8b46ac3f..28d6cb1b 100644 --- a/python/imagej/tabulate_filepaths.py +++ b/python/imagej/tabulate_filepaths.py @@ -158,7 +158,7 @@ def openImage(): print sys.exc_info() else: print "via IJ.open" - IJ.open(os.path.join(base_path, rel_path)) + IJ.open(os.path.join(base_path, rel_path)) exe.submit(openImage) From c1e21313aa925cbb4644fe42f22efdf9900849fb Mon Sep 17 00:00:00 2001 From: mwinding Date: Wed, 16 Dec 2020 14:27:36 +0000 Subject: [PATCH 3/6] minor whitespace change --- python/imagej/tabulate_filepaths.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/python/imagej/tabulate_filepaths.py b/python/imagej/tabulate_filepaths.py index 28d6cb1b..f4c668c0 100644 --- a/python/imagej/tabulate_filepaths.py +++ b/python/imagej/tabulate_filepaths.py @@ -148,8 +148,8 @@ def actionPerformed(self, event): def openImage(): print rel_path if rel_path.endswith(".klb"): - if(KLB==None): - print "Cannot open KLB due to missing module" + if(KLB==None): + print "Cannot open KLB due to missing module" try: klb = KLB.newInstance() img = klb.readFull(os.path.join(base_path, rel_path)) From 007cbc2622605939ae5e36d99f5cbb2e9d621f1f Mon Sep 17 00:00:00 2001 From: mwinding Date: Wed, 16 Dec 2020 14:29:02 +0000 Subject: [PATCH 4/6] minor whitespace change --- python/imagej/tabulate_filepaths.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/python/imagej/tabulate_filepaths.py b/python/imagej/tabulate_filepaths.py index f4c668c0..e295fd49 100644 --- a/python/imagej/tabulate_filepaths.py +++ b/python/imagej/tabulate_filepaths.py @@ -149,7 +149,7 @@ def openImage(): print rel_path if rel_path.endswith(".klb"): if(KLB==None): - print "Cannot open KLB due to missing module" + print "Cannot open KLB due to missing module" try: klb = KLB.newInstance() img = klb.readFull(os.path.join(base_path, rel_path)) From ac937de8ea4a2343cb4244d98c61541d629e9fe7 Mon Sep 17 00:00:00 2001 From: mwinding Date: Wed, 16 Dec 2020 14:30:23 +0000 Subject: [PATCH 5/6] minor whitespace change --- python/imagej/tabulate_filepaths.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/python/imagej/tabulate_filepaths.py b/python/imagej/tabulate_filepaths.py index e295fd49..2cf4830f 100644 --- a/python/imagej/tabulate_filepaths.py +++ b/python/imagej/tabulate_filepaths.py @@ -26,10 +26,10 @@ import sys try: # try-except block allows users with default FIJI to run the script without KLB installation - from org.janelia.simview.klb import KLB + from org.janelia.simview.klb import KLB except ImportError: - print "Warning: KLB format unavailable" - KLB = None + print "Warning: KLB format unavailable" + KLB = None from net.imglib2.img.display.imagej import ImageJFunctions as IL From 7c5bf1a5fab9311492afab6a1e0a4b64253143c5 Mon Sep 17 00:00:00 2001 From: mwinding Date: Wed, 16 Dec 2020 14:42:25 +0000 Subject: [PATCH 6/6] updated the default paths for mac --- python/imagej/tabulate_filepaths.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/python/imagej/tabulate_filepaths.py b/python/imagej/tabulate_filepaths.py index 2cf4830f..98339537 100644 --- a/python/imagej/tabulate_filepaths.py +++ b/python/imagej/tabulate_filepaths.py @@ -41,8 +41,8 @@ base_path = None # Laptop via sshfs -#txt_file = "/home/albert/zstore1/barnesc/LarvalScreen.txt" -#base_path = "/home/albert/zstore1/barnesc/flylight-backups/LarvalScreen/" +txt_file = "/Volumes/zfs/barnesc/flylight-backups/LarvalScreen/manifest.txt" +base_path = "/Volumes/zfs/barnesc/flylight-backups/LarvalScreen/" # At LMB desktop: #txt_file = "/home/albert/LarvalScreen.txt"