Commit 0c5e90bf authored by inhuszar's avatar inhuszar
Browse files

Bugfix in TImage destructor, updated config files.

parent b819164b
......@@ -12,13 +12,13 @@
"logfile": null,
"paramlogfile": null,
"verbose": false,
"outputdir": "/Users/inhuszar/temp/example/stage1",
"outputdir": "/home/inhuszar/Desktop/example/stage1",
"stages": ["rotation", "rigid", "affine", "nonlinear"],
"warnings": false,
"isotropic": true
},
"histology": {
"file": "/Users/inhuszar/temp/example/1_histology/histology.tif",
"file": "/home/inhuszar/Desktop/example/1_histology/histology.tif",
"storage": "mem",
"dtype": "f4",
"resolution": 0.008,
......@@ -36,7 +36,7 @@
"snapshot": true
},
"block": {
"file": null,
"file": "/home/inhuszar/Desktop/example/2_tissue_block/tissue_block.tif",
"storage": "mem",
"dtype": "f4",
"resolution": 0.05,
......@@ -122,4 +122,4 @@
"visualise": false
}
}
}
\ No newline at end of file
}
......@@ -9,15 +9,15 @@
"direction": "b2s",
"system": "linux",
"loglevel": "debug",
"logfile": null,
"paramlogfile": null,
"logfile": "/home/inhuszar/Desktop/example/stage2/logfile.log",
"paramlogfile": "/home/inhuszar/Desktop/example/stage2/paramlog.log",
"verbose": false,
"outputdir": "",
"outputdir": "/home/inhuszar/Desktop/example/stage2",
"stages": ["rigid", "affine", "nonlinear"],
"warnings": false
},
"block": {
"file": "/Users/inhuszar/temp/example/2_tissue_block/tissue_block.tif",
"file": "/home/inhuszar/Desktop/example/2_tissue_block/tissue_block.tif",
"storage": "mem",
"dtype": "f4",
"resolution": 0.05,
......@@ -35,7 +35,7 @@
"snapshot": true
},
"slice": {
"file": "/Users/inhuszar/temp/example/3_brain_slice/0.tif",
"file": "/home/inhuszar/Desktop/example/3_brain_slice/0.tif",
"storage": "mem",
"dtype": "f4",
"resolution": 0.05,
......@@ -85,7 +85,7 @@
"ub": null
}
},
"sites": "",
"sites": "/home/inhuszar/Desktop/example/3_brain_slice/sites/sites.txt",
"jiggle": {
"scale": 0.1,
"xrange": [10.0, 10.0],
......@@ -125,4 +125,4 @@
"visualise": false
}
}
}
\ No newline at end of file
}
......@@ -9,16 +9,16 @@
"system": "linux",
"loglevel": "debug",
"logfile": null,
"paramlogfile": "/Users/inhuszar/temp/example/stage3/paramlogs.log",
"paramlogfile": "/home/inhuszar/Desktop/example/stage3/paramlogs.log",
"verbose": false,
"outputdir": "/Users/inhuszar/temp/example/stage3",
"outputdir": "/home/inhuszar/Desktop/example/stage3",
"stages": [1, 2, 3, 4, 5, 3, 4, 5],
"isotropic": true,
"cost": "MIND",
"warnings": false
},
"slice": {
"file": "/Users/inhuszar/temp/example/3_brain_slice/0.tif",
"file": "/home/inhuszar/Desktop/example/3_brain_slice/0.tif",
"storage": "mem",
"dtype": "f4",
"resolution": 0.05,
......@@ -36,7 +36,7 @@
"snapshot": true
},
"volume": {
"file": "/Users/inhuszar/temp/example/4_mri/mri.nii.gz",
"file": "/home/inhuszar/Desktop/example/4_mri/mri.nii.gz",
"storage": "mem",
"dtype": "f4",
"resolution": null,
......@@ -79,13 +79,13 @@
"centre": [2.2, 66.99, -6.3],
"normal": [0, 1, 0],
"offset": 0,
"thickness": 20,
"n_positions": 11,
"range": [0, 20, 20],
"n_orientations": [1, 5, 5]
"thickness": 10,
"n_positions": 5,
"range": [0, 0, 0],
"n_orientations": [1, 1, 1]
},
"iterations": 1,
"n_cpu": 1,
"n_cpu": -1,
"top": 0.3,
"slice_scaling": [2, 1],
"slice_smoothing": [0, 0],
......@@ -221,4 +221,4 @@
}
}
}
}
\ No newline at end of file
}
{
"header": {
"title": "TIRL (Stage 1) Histology-to-block image registration routine",
"description": "Sparse histology-to-MRI registration pipeline; stage 1.",
"title": "TIRL MND (Stage 1) Histology-to-block image registration routine",
"description": "Developed for the Oxford MND Post-Mortem Imaging Biomarkers study.",
"author": "Istvan N Huszar"
},
"general": {
"name": "histology_to_block",
"direction": "h2b",
"system": "linux",
"verbosity": "debug",
"loglevel": "debug",
"logfile": null,
"paramlogfile": null,
"outputdir": "/storage/code/tirl/tirl/example/stage1",
"verbose": false,
"outputdir": "/home/inhuszar/Desktop/example/stage1",
"stages": ["rotation", "rigid", "affine", "nonlinear"],
"warnings": false
"warnings": false,
"isotropic": true
},
"histology": {
"file": "/storage/code/tirl/tirl/example/1_histology/histology.tif",
"file": "/home/inhuszar/Desktop/example/1_histology/histology.tif",
"storage": "mem",
"dtype": "<f4",
"dtype": "f4",
"resolution": 0.008,
"mask": {
"file": null,
......@@ -34,14 +36,14 @@
"snapshot": true
},
"block": {
"file": "/storage/code/tirl/tirl/example/2_tissue_block/tissue_block.tif",
"file": "/home/inhuszar/Desktop/example/2_tissue_block/tissue_block.tif",
"storage": "mem",
"dtype": "<f4",
"resolution": 0.050,
"dtype": "f4",
"resolution": 0.05,
"mask": {
"file": "/storage/code/tirl/tirl/example/2_tissue_block/tissue_block_mask.tif",
"file": null,
"normalise": true,
"function": null,
"function": "dilated_object_mask",
"automask": {
"thr": 0,
"uthr": 1
......@@ -52,15 +54,15 @@
"snapshot": false
},
"preprocessing": {
"histology": ["match_block_resolution", "histology_preprocessing"],
"histology": ["match_block_resolution", "histology_preprocessing", "pad"],
"block": ["block_preprocessing"]
},
"regparams": {
"init": {
"scale": {
"x0": [1.0, 1.0],
"lb": [0.9, 0.9],
"ub": [1.1, 1.1]
"x0": 1.0,
"lb": 0.9,
"ub": 1.1
},
"rotation": {
"x0": 0.0,
......@@ -75,8 +77,8 @@
},
"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]
"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": {
"x0": 0.0,
......@@ -85,36 +87,36 @@
}
},
"rotsearch": {
"coarse": 90,
"scale": 0.1,
"coarse": 30,
"scale": 0.125,
"visualise": false,
"xtol_rel": 0.01,
"xtol_abs": [0.01, 0.001, 0.001, 0.1, 0.1],
"opt_step": [0.1, 0.01, 0.01, 1.0, 1.0]
"xtol_abs": [0.001, 0.001, 0.001, 0.001],
"opt_step": 0.5
},
"rigid": {
"scaling": [30, 20],
"smoothing": [0, 0],
"scaling": [16, 8, 4],
"smoothing": [0, 0, 0],
"xtol_rel": 0.01,
"xtol_abs": [0.01, 0.001, 0.001, 0.1, 0.1],
"opt_step": [0.1, 0.01, 0.01, 1.0, 1.0],
"xtol_abs": [0.001, 0.001, 0.001, 0.001],
"opt_step": 0.1,
"visualise": false
},
"affine": {
"scaling": [20, 10, 5, 2],
"smoothing": [0, 0, 0, 0],
"scaling": [8, 4],
"smoothing": [0, 0],
"xtol_rel": 0.01,
"xtol_abs": [0.001, 0.1, 0.1, 0.1, 0.001, 0.1],
"opt_step": [0.01, 0.01, 1, 0.01, 0.01, 1],
"xtol_abs": [0.001, 0.001, 0.001, 0.001, 0.001, 0.001],
"opt_step": 0.1,
"visualise": false
},
"nonlinear": {
"scaling": [30, 20, 10, 5],
"smoothing": [0, 0, 0, 0],
"scaling": [16, 8, 4],
"smoothing": [0, 0, 0],
"sigma": 1,
"truncate": 1.5,
"regweight": 0.3,
"maxiter": [20, 20, 20, 20],
"maxiter": [20, 20, 20, 20, 5],
"xtol_abs": 0.1,
"xtol_rel": 0.01,
"visualise": false
......
{
"header": {
"title": "TIRL (Stage 2) Block-to-slice image registration routine",
"description": "Sparse histology-to-MRI registration pipeline; stage 2.",
"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",
"verbosity": "debug",
"logfile": null,
"paramlogfile": null,
"outputdir": "/storage/code/tirl/tirl/example/stage2",
"loglevel": "debug",
"logfile": "/home/inhuszar/Desktop/example/stage2/logfile.log",
"paramlogfile": "/home/inhuszar/Desktop/example/stage2/paramlog.log",
"verbose": false,
"outputdir": "/home/inhuszar/Desktop/example/stage2",
"stages": ["rigid", "affine", "nonlinear"],
"warnings": false
},
"block": {
"file": "/storage/code/tirl/tirl/example/2_tissue_block/tissue_block.tif",
"file": "/home/inhuszar/Desktop/example/2_tissue_block/tissue_block.tif",
"storage": "mem",
"dtype": "f4",
"resolution": 0.05,
"mask": {
"file": "/storage/code/tirl/tirl/example/2_tissue_block/tissue_block_mask.tif",
"file": null,
"normalise": true,
"function": null,
"automask": {
......@@ -34,7 +35,7 @@
"snapshot": true
},
"slice": {
"file": "/storage/code/tirl/tirl/example/3_brain_slice/0.tif",
"file": "/home/inhuszar/Desktop/example/3_brain_slice/0.tif",
"storage": "mem",
"dtype": "f4",
"resolution": 0.05,
......@@ -84,7 +85,7 @@
"ub": null
}
},
"sites": "/storage/code/tirl/tirl/example/3_brain_slice/sites/sites.txt",
"sites": "/home/inhuszar/Desktop/example/3_brain_slice/sites/sites.txt",
"jiggle": {
"scale": 0.1,
"xrange": [10.0, 10.0],
......@@ -113,15 +114,15 @@
"visualise": false
},
"nonlinear": {
"scaling": [20, 10],
"smoothing": [0, 0],
"scaling": [20, 10, 5],
"smoothing": [0, 0, 0],
"sigma": 1,
"truncate": 1.5,
"regweight": 0.6,
"maxiter": [20, 20, 20, 20],
"regweight": 0.3,
"maxiter": [20, 20, 20],
"xtol_abs": 0.1,
"xtol_rel": 0.01,
"visualise": true
"visualise": false
}
}
}
{
"header": {
"title": "TIRL (Stage 3) Unified slice-to-volume image registration routine",
"description": "Registration of coronal brain slices to whole-brain MRI.",
"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",
"verbosity": "debug",
"system": "linux",
"loglevel": "debug",
"logfile": null,
"paramlogfile": null,
"outputdir": "/storage/code/tirl/tirl/example/stage3",
"stages": [1, 2, 3, 4],
"paramlogfile": "/home/inhuszar/Desktop/example/stage3/paramlogs.log",
"verbose": false,
"outputdir": "/home/inhuszar/Desktop/example/stage3",
"stages": [1, 2, 3, 4, 5, 3, 4, 5],
"isotropic": true,
"cost": "MIND",
"warnings": false
},
"slice": {
"file": "/storage/code/tirl/tirl/example/3_brain_slice/0.tif",
"file": "/home/inhuszar/Desktop/example/3_brain_slice/0.tif",
"storage": "mem",
"dtype": "f4",
"resolution": 0.05,
......@@ -35,7 +36,7 @@
"snapshot": true
},
"volume": {
"file": "/storage/code/tirl/tirl/example/4_mri/mri.nii.gz",
"file": "/home/inhuszar/Desktop/example/4_mri/mri.nii.gz",
"storage": "mem",
"dtype": "f4",
"resolution": null,
......@@ -78,24 +79,24 @@
"centre": [2.2, 66.99, -6.3],
"normal": [0, 1, 0],
"offset": 0,
"thickness": 30,
"n_positions": 11,
"range": [0, 20, 20],
"n_orientations": [1, 5, 5]
"thickness": 10,
"n_positions": 5,
"range": [0, 0, 0],
"n_orientations": [1, 1, 1]
},
"iterations": 2,
"iterations": 1,
"n_cpu": -1,
"top": 0.5,
"slice_scaling": [4, 2, 1],
"slice_smoothing": [0, 0, 0],
"volume_scaling": [4, 2, 1],
"volume_smoothing": [0, 0, 0],
"top": 0.3,
"slice_scaling": [2, 1],
"slice_smoothing": [0, 0],
"volume_scaling": [2, 1],
"volume_smoothing": [0, 0],
"constrained": true,
"try_unconstrained": true,
"try_unconstrained": false,
"opt_step": 0.1,
"stage_1a": {
"scale2d_lower_delta": 0.2,
"scale2d_upper_delta": 0.2,
"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],
......@@ -103,8 +104,8 @@
"xtol_abs": [0.01, 0.01, 0.01, 0.01]
},
"stage_1b": {
"scale2d_lower_delta" : 0.1,
"scale2d_upper_delta" : 0.1,
"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],
......@@ -121,14 +122,14 @@
"source_mask": false
},
"visualise": false,
"slice_scaling": [2, 1],
"volume_scaling": [2, 1],
"slice_smoothing": [1, 0],
"volume_smoothing": [1, 0],
"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.5
"opt_step": 0.1
},
"stage_3": {
"export": {
......@@ -153,12 +154,15 @@
},
"optsize": 4,
"vectorder": "xy",
"slice_smoothing": [0],
"volume_smoothing": [0],
"lower_dxy": 3.0,
"upper_dxy": 3.0,
"slice_scaling": [2, 1],
"slice_smoothing": [0, 0],
"volume_scaling": [1, 1],
"volume_smoothing": [0, 0],
"lower_dxy": 5.0,
"upper_dxy": 5.0,
"regweight": 0,
"opt_step": 0.3,
"model": "multiquadric",
"opt_step": 0.1,
"xtol_abs": 0.01
},
"stage_4": {
......@@ -185,13 +189,16 @@
},
"optsize": 4,
"vectorder": "xyz",
"slice_smoothing": [0],
"volume_smoothing": [0],
"lower_dxy": 3.0,
"lower_dz": 3.0,
"upper_dxy": 3.0,
"upper_dz": 3.0,
"slice_scaling": [2, 1],
"slice_smoothing": [0, 0],
"volume_scaling": [1, 1],
"volume_smoothing": [0, 0],
"lower_dxy": 5.0,
"lower_dz": 5.0,
"upper_dxy": 5.0,
"upper_dz": 5.0,
"regweight": 0,
"model": "multiquadric",
"opt_step": 0.3,
"xtol_abs": 0.01
},
......
......@@ -1151,27 +1151,27 @@ class TImage(TField):
raise TypeError("Expected dictionary type for TImage header, "
"got {}".format(type(header)))
def __del__(self):
"""
TImage destructor. Releases all buffers.
"""
try:
del self._data
except:
pass
try:
del self._mask
except:
pass
try:
del self._resmgr._data
except:
pass
try:
del self._resmgr._mask
except:
pass
# def __del__(self):
# """
# TImage destructor. Releases all buffers.
#
# """
# try:
# del self._data
# except:
# pass
# try:
# del self._mask
# except:
# pass
# try:
# del self._resmgr._data
# except:
# pass
# try:
# del self._resmgr._mask
# except:
# pass
# def __getitem__(self, item):
......
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