Commit 61b73395 authored by Sean Fitzgibbon's avatar Sean Fitzgibbon
Browse files

Ported json config to yaml

parent 98fec787
header:
author: Istvan N Huszar - adapted by Istvan & Amy Howard Mar 2021 - Adapted by Sean Fitz 2021
description: ''
title: TIRL MBP-to-NeuN image registration routine - adapted for histology-to-histology registration
# general settings
general:
isotropic: true
logfile: ./logfile.log
loglevel: debug
name: slice-to-slice
outputdir: ./reg
paramlogfile: ./paramlog.log
stages:
- rotation
- rigid
- affine
- nonlinear
system: linux
verbose: false
warnings: true
# moving image settings
moving:
dtype: f4
export: true
file: ''
mask:
automask:
thr: 0.0
uthr: 1.0
file: null
function: null
normalise: true
preview: false
resolution_level: 4
snapshot: true
storage: mem
# fixed image settings
fixed:
dtype: f4
export: false
file: ''
mask:
automask:
thr: 0.0
uthr: 1.0
file: null
function: null
normalise: true
preview: false
resolution_level: 4
snapshot: true
storage: mem
# preprocessing settings
preprocessing:
fixed: ["fixed_preprocessing"]
moving: ["moving_preprocessing", "match_fixed_resolution"]
# registration settings
regparams:
init:
scale:
lb: 0.95
ub: 1.05
x0: 1.0
rotation:
lb: -10
mode: deg
ub: 10
x0: 0.0
translation:
x0: [0.0, 0.0]
lb: [-5.0, -5.0]
ub: [5.0, 5.0]
affine:
x0: [1.0, 0.0, 0.0, 0.0, 1.0, 0.0]
lb: [0.95, -0.2, -1.0, -0.2, 0.95, -1.0]
ub: [1.05, 0.2, 1.0, 0.2, 1.05, 1.0]
nonlinear:
lb: null
ub: null
x0: 0.0
rotsearch:
coarse: 1
opt_step: 0.5
scale: 0.125
visualise: false
xtol_abs: [0.001, 0.001, 0.001, 0.001]
xtol_rel: 0.01
rigid:
opt_step: 0.1
scaling: [160, 80, 40, 20, 10, 5]
smoothing: [0, 0, 0, 0, 0]
visualise: false
xtol_abs: [0.001, 0.001, 0.001, 0.001]
xtol_rel: 0.01
affine:
opt_step: 0.1
scaling: [160, 80, 40, 20, 10, 5]
smoothing: [0, 0, 0]
visualise: false
xtol_abs: [0.001, 0.001, 0.001, 0.001]
xtol_rel: 0.01
nonlinear:
maxiter: [20, 20, 20, 20, 10, 5]
regweight: 0.4
scaling: [160, 80, 40, 20, 10, 5]
sigma: 1
smoothing: [0, 0, 0, 0, 0, 0]
truncate: 1.5
visualise: false
xtol_abs: 0.1
xtol_rel: 0.01
......@@ -99,7 +99,7 @@ __tirlscript__ = True
# DEPENDENCIES
import argparse
import json
import json, yaml
import logging
import os
import sys
......@@ -888,11 +888,11 @@ def register_slide_to_slide(moving, moving_res, fixed, fixed_res, out, config):
"""
if config is None:
config = util.get_resource('default.json')
config = util.get_resource('slide.yaml')
if os.path.isfile(config):
with open(config, "r") as fp:
config = dict(json.load(fp))
config = yaml.load(fp)
else:
raise FileNotFoundError(f"The provided configuration file "
f"does not exist: {config}")
......
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