Commit 98fec787 authored by Sean Fitzgibbon's avatar Sean Fitzgibbon
Browse files

Added config to chart_reg

parent abf641c7
......@@ -17,9 +17,11 @@
import os
import os.path as op
import json
import yaml
from scipy.ndimage.interpolation import affine_transform
from slider.external import neurolucida
from slider import util
import glymur
from skimage.measure import regionprops, label
......@@ -29,7 +31,16 @@ from matplotlib import patches
import numpy as np
import matplotlib.pyplot as plt
def register_chart_to_slide(chart, slide, slide_res, out, rlevel=4, boundary_key='outline'):
def register_chart_to_slide(chart, slide, slide_res, out, config=None):
if config is None:
config = util.get_resource('chart.yaml')
with open(config, 'r') as f:
config = yaml.load(f)
rlevel = config['slide']['resolution_level']
boundary_key = config['chart']['boundary_key']
# load chart
contour, cells = neurolucida.read(chart)
......
chart:
# key for the contour to use for aligning with image
boundary_key: outline
slide:
# set the resolution at which registration will be performed
# resolution = native-image-resolution * (2^resolution_level)
resolution_level: 4
\ No newline at end of file
......@@ -67,6 +67,9 @@ def add_chart_cli(subparsers):
parser.add_argument("--out", metavar="<dir>",
help="Output directory", default='./chart-to-slide.reg', type=str,
required=False)
parser.add_argument("--config", metavar="<config.yaml>",
help="configuration file", default=None, type=str,
required=False)
parser.set_defaults(method='chart')
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment