Commit e6988a71 authored by Istvan N Huszar's avatar Istvan N Huszar
Browse files

Partial bugfix for TIRLFile object ID redundancy problem.

parents
{
"header": {
"title": "TIRL MND (Stage 2) Block-to-slice image registration routine",
"description": "Developed for the Oxford MND Post-Mortem Imaging Biomarkers study.",
"author": "Istvan N Huszar"
},
"general": {
"name": "block_to_slice",
"direction": "b2s",
"system": "linux",
"loglevel": "debug",
"logfile": "/Users/inhuszar/temp/stage2/logfile.log",
"paramlogfile": "/Users/inhuszar/temp/stage2/paramlog.log",
"verbose": false,
"outputdir": "/Users/inhuszar/temp/stage2",
"stages": ["rigid", "affine", "nonlinear"],
"warnings": false,
"cost": "MIND"
},
"block": {
"file": "/Users/inhuszar/temp/2_tissue_block/tissue_block.tif",
"storage": "mem",
"dtype": "f4",
"resolution": 0.05,
"mask": {
"file": null,
"normalise": true,
"function": null,
"automask": {
"thr": 0.1,
"uthr": 1.0
}
},
"preview": false,
"export": true,
"snapshot": true
},
"slice": {
"file": "/Users/inhuszar/temp/3_brain_slice/0.tif",
"storage": "mem",
"dtype": "f4",
"resolution": 0.05,
"mask": {
"file": null,
"normalise": true,
"function": null,
"automask": {
"thr": 0.1,
"uthr": 1
}
},
"preview": false,
"export": false,
"snapshot": false
},
"preprocessing": {
"block": ["block_preprocessing"],
"slice": ["slice_preprocessing"]
},
"regparams": {
"init": {
"scale": {
"x0": [1.0, 1.0],
"lb": [0.9, 0.9],
"ub": [1.1, 1.1]
},
"rotation": {
"x0": 0.0,
"mode": "deg",
"lb": -180,
"ub": 180
},
"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.8, -1.0, -5.0, -1.0, 0.8, -5.0],
"ub": [1.2, 1.0, 5.0, 1.0, 1.2, 5.0]
},
"nonlinear": {
"x0": 0.0,
"lb": null,
"ub": null
}
},
"sites": "/Users/inhuszar/temp/3_brain_slice/sites/sites.txt",
"jiggle": {
"scale": 0.1,
"xrange": [10.0, 10.0],
"xstops": [3, 3],
"rotsteps": 12,
"xtol_abs": [0.01, 0.1, 0.1],
"xtol_rel": 0.001,
"opt_step": [0.025, 1.0, 1.0],
"n_best": 3,
"visualise": false
},
"rigid": {
"scaling": [10, 5],
"smoothing": [0, 0],
"xtol_rel": 0.001,
"xtol_abs": [0.001, 0.001, 0.001, 0.05, 0.05],
"opt_step": [0.025, 0.1, 0.1, 1.0, 1.0],
"visualise": false
},
"affine": {
"scaling": [5, 2, 1],
"smoothing": [0, 0, 0, 0],
"xtol_rel": 0.001,
"xtol_abs": [0.001, 0.001, 0.01, 0.001, 0.001, 0.01],
"opt_step": [0.05, 0.05, 1.0, 0.05, 0.05, 1.0],
"visualise": false
},
"nonlinear": {
"scaling": [20, 10, 5],
"smoothing": [0, 0, 0],
"sigma": 1,
"truncate": 1.5,
"regweight": 0.3,
"maxiter": [20, 20, 20],
"xtol_abs": 0.1,
"xtol_rel": 0.01,
"visualise": false
}
}
}
{
"header": {
"title": "TIRL MND (Stage 3) Unified slice-to-volume image registration routine",
"description": "Developed for the Oxford MND Post-Mortem Imaging Biomarkers study.",
"author": "Istvan N Huszar"
},
"general": {
"name": "mnd.coronal",
"system": "linux",
"loglevel": "debug",
"logfile": null,
"paramlogfile": "/Users/inhuszar/temp/stage3/paramlogs.log",
"verbose": false,
"outputdir": "/Users/inhuszar/temp/stage3",
"stages": [1, 2, 3, 4, 5, 3, 4, 5],
"isotropic": true,
"cost": "MIND",
"warnings": false
},
"slice": {
"file": "/Users/inhuszar/temp/3_brain_slice/0.tif",
"storage": "mem",
"dtype": "f4",
"resolution": 0.05,
"mask": {
"file": null,
"normalise": true,
"function": null,
"automask": {
"thr": 0.1,
"uthr": 1.0
}
},
"preview": false,
"export": true,
"snapshot": true
},
"volume": {
"file": "/Users/inhuszar/temp/4_mri/mri.nii.gz",
"storage": "mem",
"dtype": "f4",
"resolution": null,
"usesqform": true,
"mask": {
"file": null,
"normalise": true,
"function": null,
"automask": {
"thr": 0.0,
"uthr": 1.0
}
},
"preview": false,
"export": true
},
"preprocessing": {
"slice": ["slice_preprocessing", "match_volume_resolution"],
"volume": ["volume_preprocessing"]
},
"regparams": {
"init": {
"scale2d": 1.0,
"rot2d": -90,
"trans2d": [0, 0],
"rot3d": [0, 0, 0],
"affine3d": [1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0],
"trans3d": [0, 0, 0]
},
"stage_1": {
"export": {
"timage": true,
"snapshot": true,
"target_mask": true,
"source_mask": false
},
"visualise": false,
"cleanup": true,
"slab": {
"centre": [2.2, 66.99, -6.3],
"normal": [0, 1, 0],
"offset": 0,
"thickness": 10,
"n_positions": 5,
"range": [0, 10, 10],
"n_orientations": [1, 3, 3]
},
"iterations": 1,
"n_cpu": -1,
"top": 0.3,
"slice_scaling": [2, 1],
"slice_smoothing": [0, 0],
"volume_scaling": [2, 1],
"volume_smoothing": [0, 0],
"constrained": true,
"try_unconstrained": false,
"opt_step": 0.1,
"stage_1a": {
"scale2d_lower_delta": 0.05,
"scale2d_upper_delta": 0.05,
"rot2d_lower_delta": 20.0,
"rot2d_upper_delta": 20.0,
"trans2d_lower_delta": [10.0, 10.0],
"trans2d_upper_delta": [10.0, 10.0],
"xtol_abs": [0.01, 0.01, 0.01, 0.01]
},
"stage_1b": {
"scale2d_lower_delta" : 0.05,
"scale2d_upper_delta" : 0.05,
"rot3d_lower_delta" : [5.0, 10.0, 10.0],
"rot3d_upper_delta" : [5.0, 10.0, 10.0],
"trans3d_lower_delta" : [3.0, 3.0, 3.0],
"trans3d_upper_delta" : [3.0, 3.0, 3.0],
"xtol_abs": [0.01, 0.01, 0.01, 0.01, 0.01, 0.01, 0.01]
}
},
"stage_2": {
"export": {
"timage": true,
"snapshot": true,
"costmap": true,
"target_mask": true,
"source_mask": false
},
"visualise": false,
"slice_scaling": [1],
"volume_scaling": [1],
"slice_smoothing": [0],
"volume_smoothing": [0],
"lower_delta": [0.1, 0.1, 0.1, 1.0, 0.1, 0.1, 0.1, 1.0, 0.1, 0.1, 0.1, 1.0],
"upper_delta": [0.1, 0.1, 0.1, 1.0, 0.1, 0.1, 0.1, 1.0, 0.1, 0.1, 0.1, 1.0],
"xtol_rel": 0.01,
"opt_step": 0.1
},
"stage_3": {
"export": {
"timage": true,
"snapshot": true,
"control_points": true,
"target_mask": true,
"source_mask": false
},
"visualise": false,
"support": {
"mode": "km",
"points": 16,
"mask": {
"file": null,
"normalise": true,
"automask": {
"thr": 0.01,
"uthr": 1
}
}
},
"optsize": 4,
"vectorder": "xy",
"slice_scaling": [1],
"slice_smoothing": [0],
"volume_scaling": [1],
"volume_smoothing": [0],
"lower_dxy": 5.0,
"upper_dxy": 5.0,
"regweight": 0,
"model": "multiquadric",
"opt_step": 0.1,
"xtol_abs": 0.01
},
"stage_4": {
"export": {
"timage": true,
"snapshot": true,
"control_points": true,
"target_mask": true,
"source_mask": false
},
"visualise": false,
"support": {
"mode": "km",
"points": 16,
"mask": {
"file": null,
"normalise": true,
"function": null,
"automask": {
"thr": 0.01,
"uthr": 1
}
}
},
"optsize": 4,
"vectorder": "xyz",
"slice_scaling": [1],
"slice_smoothing": [0],
"volume_scaling": [1],
"volume_smoothing": [0],
"lower_dxy": 3.0,
"lower_dz": 3.0,
"upper_dxy": 3.0,
"upper_dz": 3.0,
"regweight": 0,
"model": "multiquadric",
"opt_step": 0.1,
"xtol_abs": 0.01
},
"stage_5": {
"export": {
"timage": true,
"snapshot": true,
"target_mask": true,
"source_mask": false
},
"visualise": false,
"mask": {
"file": null,
"normalise": true,
"function": null,
"automask": {
"thr": 0.01,
"uthr": 1.0
}
}
}
}
}
#!/bin/sh
# Runs the example registration pipeline
EXAMPLE="."
tirl histology_to_block --config ${EXAMPLE}/config/1_histology_to_block.json --verbose
tirl find_sites ${EXAMPLE}/3_brain_slice/*.tif --verbose
tirl block_to_slice --config ${EXAMPLE}/config/2_block_to_slice.json --verbose
tirl slice_to_volume --config ${EXAMPLE}/config/3_slice_to_volume.json --verbose
tirl combine --histo ${EXAMPLE}/stage1/fixed4_nonlinear.timg --block ${EXAMPLE}/stage2/fixed4_nonlinear.timg --slice ${EXAMPLE}/stage3/4_stage4.timg --vol ${EXAMPLE}/stage3/volume.timg --out ${EXAMPLE}/combined
<?xml version="1.0" encoding="UTF-8"?>
<svg width="159.61mm" height="50.965mm" version="1.2" viewBox="0 0 452.43689 144.46855" xmlns="http://www.w3.org/2000/svg" xmlns:cc="http://creativecommons.org/ns#" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:xlink="http://www.w3.org/1999/xlink">
<metadata>
<rdf:RDF>
<cc:Work rdf:about="">
<dc:format>image/svg+xml</dc:format>
<dc:type rdf:resource="http://purl.org/dc/dcmitype/StillImage"/>
<dc:title/>
</cc:Work>
</rdf:RDF>
</metadata>
<defs>
<symbol id="glyph0-1" overflow="visible">
<path d="m79.266-93.062c0 1.3242-0.46094 1.9844-1.375 1.9844-1.4375 0-10.484-0.30469-27.141-0.92188-0.46094 15.594-0.6875 28.094-0.6875 37.5 0 5.875 0.21094 14.695 0.64062 26.453 0.4375 11.75 0.65625 20.562 0.65625 26.438 0 1.0742-0.74219 1.6094-2.2188 1.6094-0.91797 0-2.3242-0.070312-4.2188-0.21875-1.8867-0.15625-3.3203-0.23438-4.2969-0.23438-0.91797 0-2.3242 0.078125-4.2188 0.23438-1.8867 0.14844-3.2891 0.21875-4.2031 0.21875-1.2812 0-1.9219-0.64062-1.9219-1.9219 0-5.8203 0.23828-14.57 0.71875-26.25 0.48828-11.676 0.73438-20.453 0.73438-26.328 0-9.1016-0.28125-21.602-0.84375-37.5-13.188 0.82422-22.844 1.2344-28.969 1.2344-0.61719 0-0.92188-0.25391-0.92188-0.76562 0-0.91406 0.22656-2.2422 0.6875-3.9844 0.5625-2.25 0.89453-3.5781 1-3.9844 0.10156-1.7891 0.45703-4.2695 1.0625-7.4375 0.25781-0.66406 0.69531-1 1.3125-1l0.92188 0.0781c18.094 1.0742 30.023 1.6094 35.797 1.6094 5.1133 0 13.469-0.38281 25.062-1.1562 7.9258-0.50781 11.223-0.76563 9.8906-0.76563 1.332 0 2.0703 0.46485 2.2188 1.3906-0.09375-0.5625-0.14062 1.9141-0.14062 7.4219 0 0.66797 0.07031 1.7031 0.21875 3.1094 0.15625 1.4062 0.23438 2.4688 0.23438 3.1875z"/>
</symbol>
<symbol id="glyph0-2" overflow="visible">
<path d="m29.047-1.6094c0 1.0742-0.74219 1.6094-2.2188 1.6094-0.91797 0-2.3242-0.070312-4.2188-0.21875-1.8867-0.15625-3.2891-0.23438-4.2031-0.23438-0.98047 0-2.418 0.078125-4.3125 0.23438-1.8867 0.14844-3.2891 0.21875-4.2031 0.21875-1.2812 0-1.9219-0.58594-1.9219-1.7656 0-5.8203 0.26562-14.598 0.79688-26.328 0.53906-11.727 0.8125-20.531 0.8125-26.406 0-5.6758-0.27344-14.195-0.8125-25.562-0.53125-11.375-0.79688-19.898-0.79688-25.578 0-1.2695 0.58594-1.9062 1.7656-1.9062 0.96875 0 2.4453 0.0781 4.4375 0.23438 2 0.14844 3.5078 0.21875 4.5312 0.21875 0.91406 0 2.2969-0.0703 4.1406-0.21875 1.8438-0.15625 3.2227-0.23438 4.1406-0.23438 1.332 0 2 0.51172 2 1.5312 0 5.7188-0.21094 14.305-0.625 25.75-0.40625 11.449-0.60938 20.039-0.60938 25.766 0 5.875 0.21094 14.695 0.64062 26.453 0.4375 11.75 0.65625 20.562 0.65625 26.438z"/>
</symbol>
<symbol id="glyph0-3" overflow="visible">
<path d="m90.844-0.60938c0 0.40625-0.41406 0.60938-1.2344 0.60938-0.96875 0-2.4492-0.070312-4.4375-0.21875-1.9922-0.15625-3.4766-0.23438-4.4531-0.23438-1.0742 0-2.6719 0.078125-4.7969 0.23438-2.1172 0.14844-3.7109 0.21875-4.7812 0.21875-1.1797 0-2.0742-0.64062-2.6875-1.9219-1.6367-3.4688-6.2891-14.223-13.953-32.266-0.76172-1.8438-2.625-2.9688-5.5938-3.375-0.66797-0.05078-2.9922-0.07813-6.9688-0.07813-7.0547 0-11.246 0.10547-12.578 0.3125-1.0742 0.14844-1.6094 1.4492-1.6094 3.9062 0 3.5742 0.16406 8.9297 0.5 16.062 0.33203 7.125 0.5 12.453 0.5 15.984 0 1.0742-0.51172 1.6094-1.5312 1.6094-1.0234 0-2.5703-0.11719-4.6406-0.34375-2.0742-0.22656-3.6484-0.34375-4.7188-0.34375-0.86719 0-2.1953 0.078125-3.9844 0.23438-1.793 0.14844-3.1211 0.21876-3.9844 0.21876-1.2812 0-1.9219-0.58594-1.9219-1.7656 0-5.6641 0.26562-14.188 0.79688-25.562 0.53906-11.375 0.8125-19.895 0.8125-25.562 0-16.156-0.58984-33.379-1.7656-51.672l-0.0625-1.2344c-0.054688-1.0195 1.0195-1.5312 3.2188-1.5312 4.3945 0 10.973-0.11328 19.734-0.34375 8.7578-0.22656 15.312-0.34375 19.656-0.34375 11.352 0 20.453 2.7109 27.297 8.125 7.5625 5.9805 11.344 14.465 11.344 25.453 0 7.5625-1.0234 13.516-3.0625 17.859-2.1484 4.6055-6.1328 8.9766-11.953 13.109-0.98047 0.66797-1.4688 1.3086-1.4688 1.9219 0 0.71094 3.0508 7.5078 9.1562 20.391 6.1133 12.875 9.1719 19.727 9.1719 20.547zm-21-69.531c0-9.25-2.6641-15.438-7.9844-18.562-3.9297-2.2891-11.008-3.4375-21.234-3.4375-8.2734 0-12.484 0.66406-12.641 1.9844-0.36719 2.7617-0.54688 10.148-0.54688 22.156v14.641c0.15625 0.10547 0.48828 0.21094 1 0.3125 0.92578 0.10547 2.4375 0.23047 4.5312 0.375 4.8516 0.26172 10.086 0.39062 15.703 0.39062 14.113 0 21.172-5.9531 21.172-17.859z"/>
</symbol>
<symbol id="glyph0-4" overflow="visible">
<path d="m80.266-16.641c0 7.1562-0.38672 12.246-1.1562 15.266-0.35547 1.4766-1.2461 2.2188-2.6719 2.2188-3.793 0-9.4688-0.21875-17.031-0.65625-7.5625-0.42578-13.234-0.64062-17.016-0.64062-3.5742 0-8.9141 0.078125-16.016 0.23438-7.1055 0.14844-12.449 0.21875-16.031 0.21875-1.2734 0-1.9062-0.64062-1.9062-1.9219 0-5.5625 0.1875-13.961 0.5625-25.203 0.38281-11.25 0.57812-19.688 0.57812-25.312 0-5.9258-0.27344-14.805-0.8125-26.641-0.53125-11.832-0.79688-20.711-0.79688-26.641 0-1.125 0.64062-1.6875 1.9219-1.6875 0.91406 0 2.3164 0.0781 4.2031 0.23437 1.8945 0.15625 3.332 0.23438 4.3125 0.23438 0.91406 0 2.3438-0.0781 4.2812-0.23438 1.9453-0.15625 3.3789-0.23437 4.2969-0.23437 1.2266 0 1.8438 0.49219 1.8438 1.4688 0 5.418-0.21094 13.57-0.625 24.453-0.40625 10.887-0.60938 19.062-0.60938 24.531v12.109c-0.05469 5.418-0.07813 9.4531-0.07813 12.109 0 11.344 0.46094 17.016 1.3906 17.016 18.852 0 33.082-0.45703 42.688-1.375 0.46875-0.05078 1.6445-0.22656 3.5312-0.53125 1.5312-0.3125 2.707-0.46875 3.5312-0.46875 1.0703 0 1.6094 0.48438 1.6094 1.4531z"/>
</symbol>
</defs>
<g transform="translate(11.43 -70.616)">
<rect width="527" height="330" fill="#fff"/>
<path transform="matrix(7.874e-5 0 0 7.874e-5 22.5 106.5)" d="m0 0h9.398e5v9.398e5h-9.398e5z" fill="#fff" fill-rule="evenodd" stroke="#fff" stroke-miterlimit="8" stroke-width="12700"/>
<path transform="matrix(7.874e-5 0 0 7.874e-5 .5 83.5)" d="m0 0h1.2192e6v2.8396e5h-9.3816e5v9.4794e5h-2.8104e5z" fill="#bf0000" fill-rule="evenodd" stroke="#fff" stroke-miterlimit="8" stroke-width="12700"/>
<g>
<path transform="matrix(7.874e-5 0 0 7.874e-5 22.5 106.5)" d="m9.4794e5 0h2.8396e5v1.2192e6h-1.2319e6v-2.8104e5h9.4794e5z" fill-rule="evenodd" stroke="#fff" stroke-miterlimit="8" stroke-width="12700"/>
<use x="140.3833" y="201" width="100%" height="100%" xlink:href="#glyph0-1"/>
<use x="221.37959" y="201" width="100%" height="100%" xlink:href="#glyph0-2"/>
<use x="258.41589" y="201" width="100%" height="100%" xlink:href="#glyph0-3"/>
<use x="351.3833" y="201" width="100%" height="100%" xlink:href="#glyph0-4"/>
</g>
</g>
</svg>
1.111724205 0.08869408678 -0.01306969321 -46.17064971
-0.06570736495 1.020347151 0.3306439501 -24.12162853
0.05312200245 -0.3314455613 1.1613876 -11.42005154
0 0 0 1
Supports Markdown
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