summaryrefslogtreecommitdiffstats
path: root/tests/roof.py
diff options
context:
space:
mode:
Diffstat (limited to 'tests/roof.py')
-rw-r--r--tests/roof.py22
1 files changed, 16 insertions, 6 deletions
diff --git a/tests/roof.py b/tests/roof.py
index 931c32f..1941aa8 100644
--- a/tests/roof.py
+++ b/tests/roof.py
@@ -14,7 +14,7 @@ class RoofConfig:
self.streams = 1
self.bit_depth = 8
self.convert = False if ((not args.output) or (re.compile('\.raw$').search(args.output))) else True
- self.build = "raw" if args.plain else "ufo" if self.convert else "sino"
+ self.build = "raw" if args.noroof else "ufo" if self.convert else "sino"
with open(config) as json_file:
cfg = json.load(json_file)
@@ -27,11 +27,13 @@ class RoofConfig:
self.bit_depth = cfg["hardware"]["bit_depth"]
parser = argparse.ArgumentParser()
-parser.add_argument('-c', '--config', dest="config", default="roof.json", help="ROOF configuration (JSON)")
-parser.add_argument('-o', '--output', dest="output", default=None, help="Output file")
-parser.add_argument('-n', '--number', dest="number", default=None, type=int, help="Specify number of frames to capture")
-parser.add_argument('-p', '--plain', dest="plain", default=False, type=bool, help="Plain network test (no ROOF structures)")
+parser.add_argument('-c', '--config', dest="config", default="roof.json", help="ROOF configuration (JSON)")
+parser.add_argument('-o', '--output', dest="output", default=None, help="Output file")
+parser.add_argument('-n', '--number', dest="number", default=None, type=int, help="Specify number of frames to capture (limits number of captured frames irrespective of further filtering)")
+parser.add_argument('-p', '--plane', dest="plane", default=None, type=int, help="Only process the specified detector plane (indexed from 1)")
+parser.add_argument( '--no-roof', dest="noroof", default=False, type=bool, help="Disable ROOF, only network testing (no sinogram building, store linearly)")
#parser.add_argument('-r', '--raw', dest="raw", default=False, type=bool, help="Store raw data, ignore processed")
+#parser.add_argument('-v', '--visualize', dest='visualize', default=False, type=bool, help="Visualize data")
args = parser.parse_args()
@@ -54,6 +56,9 @@ else:
build = pm.get_task('roof-build')
build.set_properties(config=args.config, number=args.number, build=cfg.build)
+plane = pm.get_task('roof-plane') if args.plane else None
+if plane: plane.set_properties(plane=args.plane)
+
for id in range(cfg.streams):
read = pm.get_task('roof-read')
read.set_properties(config=args.config, id=id)
@@ -62,7 +67,12 @@ for id in range(cfg.streams):
#read_task.set_properties(path='/home/data/*.tif', start=10, number=100)
#graph.connect_nodes_full(read, write, 0)
-graph.connect_nodes(build, write)
+
+if plane:
+ graph.connect_nodes(build, plane)
+ graph.connect_nodes(plane, write)
+else:
+ graph.connect_nodes(build, write)