diff --git a/gifit/__init__.py b/gifit/__init__.py index 3cc0861..83beb49 100644 --- a/gifit/__init__.py +++ b/gifit/__init__.py @@ -1,4 +1,4 @@ -__version__ = '0.2.1' +__version__ = '0.3.0' DISPLAY_TITLE = r""" _ _ __ _ _ diff --git a/gifit/__main__.py b/gifit/__main__.py index ce69814..f4fcbae 100644 --- a/gifit/__main__.py +++ b/gifit/__main__.py @@ -21,7 +21,7 @@ formatter_class=ArgumentDefaultsHelpFormatter) parser.add_argument('--no-fail', dest='no_fail', action='store_true', help='Produce exit code 0 even if any subprocesses do not.') -parser.add_argument('-m', '--model', dest='model', type=str, default='e', +parser.add_argument('-m', '--model', dest='model', type=str, default='h', help='Name of built-in model to use, or a path to a custom CSV model.') parser.add_argument('-s', '--size', dest='size', type=int, default=81920, help='Output mesh size') diff --git a/gifit/model.py b/gifit/model.py index dfcd73d..91fb452 100644 --- a/gifit/model.py +++ b/gifit/model.py @@ -5,7 +5,7 @@ from typing import NewType, Self, Iterator _MODEL_PARAM_TYPES: defaultdict[str, type] = defaultdict(lambda: str) -_MODEL_PARAM_TYPES['approximate_age'] = int +_MODEL_PARAM_TYPES['approximate_age'] = float _MODEL_PARAM_TYPES['stage'] = int _MODEL_PARAM_TYPES['gyrification_index'] = float diff --git a/gifit/models/README b/gifit/models/README new file mode 100644 index 0000000..50a5582 --- /dev/null +++ b/gifit/models/README @@ -0,0 +1,6 @@ +f.csv is the same as e.csv, but with smaller stretch weight. + +g.csv implements the idea of fitting to one voxel deeper for old brains, +before re-expanding outwards back to the boundary. This can improve fitting +into tight sulci. + diff --git a/gifit/models/f.csv b/gifit/models/f.csv new file mode 100644 index 0000000..ee083cd --- /dev/null +++ b/gifit/models/f.csv @@ -0,0 +1,14 @@ +approximate_age,surface_area,gyrification_index,stage,iso_value,size,iter_outer,iter_inner,step_size,laplacian_weight,stretch_weight,self_weight,self_dist,oversample,taubin,comments +25,9500,1,0,10,20480,600,100,0.2,0.000002,100,0.5,0.005,0,10,Brains 23-25 clumped together +26,10000,1.02,0,10,20480,300,100,0.2,0.000002,40,0.5,0.005,0,10, +26,10000,1.02,1,10,20480,300,100,0.2,0.000002,40,0.5,0.005,0,10, +27,10000,1.05,0,10,20480,300,100,0.2,0.000002,30,0.5,0.005,0,10, +27,10000,1.05,1,10,20480,300,100,0.2,0.000002,30,0.5,0.005,0,10, +28,10000,1.07,0,10,20480,300,100,0.2,0.000002,20,0.5,0.005,0,10, +28,10000,1.07,1,10,20480,300,100,0.2,0.000002,20,0.5,0.005,0,10, +29,10000,1.12,0,10,20480,300,100,0.2,0.000002,4,0.5,0.005,0,10, +29,10000,1.12,1,10,20480,300,100,0.2,0.000002,1,0.5,0.005,0,10, +30,10000,1.17,0,10,20480,300,100,0.2,0.000002,4,0.5,0.005,0,10, +30,10000,1.17,1,10,20480,300,100,0.2,0.000002,1,0.5,0.005,0,10, +31,10000,1.2,0,10,20480,300,100,0.2,0.000002,4,0.5,0.005,0,10, +31,10000,1.2,1,10,20480,300,100,0.2,0.000002,1,0.5,0.005,0,10, diff --git a/gifit/models/g.csv b/gifit/models/g.csv new file mode 100644 index 0000000..33932c7 --- /dev/null +++ b/gifit/models/g.csv @@ -0,0 +1,16 @@ +approximate_age,surface_area,gyrification_index,stage,iso_value,size,iter_outer,iter_inner,step_size,laplacian_weight,stretch_weight,self_weight,self_dist,oversample,taubin,comments +25,9500,1,0,10,20480,600,100,0.2,0.000002,100,0.5,0.005,0,10,Brains 23-25 clumped together +26,10000,1.02,0,10,20480,300,100,0.2,0.000002,40,0.5,0.005,0,10, +26,10000,1.02,1,10,20480,300,100,0.2,0.000002,40,0.5,0.005,0,10, +27,10000,1.05,0,10,20480,300,100,0.2,0.000002,30,0.5,0.005,0,10, +27,10000,1.05,1,10,20480,300,100,0.2,0.000002,30,0.5,0.005,0,10, +27.5,10000,1.06,0,9,20480,600,100,0.2,0.000002,20,0.5,0.005,0,10,"older brains strategy: fit inwards one voxel deeper than boundary, then take small steps back outwards to boundary. May improve results in narrow sulci e.g. at calcarine and parieto-occipital sulcus" +27.5,10000,1.06,1,10,20480,100,100,0.05,0.000002,20,0.5,0.005,0,1, +28,10000,1.07,0,9,20480,600,100,0.2,0.000002,10,0.5,0.005,0,10, +28,10000,1.07,1,10,20480,100,100,0.05,0.000002,10,0.5,0.005,0,1, +29,10000,1.12,0,9,20480,600,100,0.2,0.000002,10,0.5,0.005,0,10, +29,10000,1.12,1,10,20480,100,100,0.05,0.000002,5,0.5,0.005,0,1, +30,10000,1.17,0,9,20480,600,100,0.2,0.000002,10,0.5,0.005,0,10, +30,10000,1.17,1,10,20480,100,100,0.05,0.000002,2,0.5,0.005,0,1, +31,10000,1.2,0,9,20480,600,100,0.2,0.000002,10,0.5,0.005,0,10, +31,10000,1.2,1,10,20480,100,100,0.05,0.000002,1,0.5,0.005,0,1, diff --git a/gifit/models/h.csv b/gifit/models/h.csv new file mode 100644 index 0000000..3517bc0 --- /dev/null +++ b/gifit/models/h.csv @@ -0,0 +1,16 @@ +approximate_age,surface_area,gyrification_index,stage,iso_value,size,iter_outer,iter_inner,step_size,laplacian_weight,stretch_weight,self_weight,self_dist,oversample,taubin,comments +25,9500,1,0,10,20480,600,100,0.2,0.000002,100,0.5,0.005,0,10,Brains 23-25 clumped together +26,10000,1.02,0,10,20480,300,100,0.2,0.000002,40,0.5,0.005,0,10, +26,10000,1.02,1,10,20480,300,100,0.2,0.000002,40,0.5,0.005,0,10, +27,10000,1.05,0,10,20480,300,100,0.2,0.000002,30,0.5,0.005,0,10, +27,10000,1.05,1,10,20480,300,100,0.2,0.000002,30,0.5,0.005,0,10, +27.5,10000,1.06,0,9,20480,600,100,0.2,0.000002,20,0.5,0.005,0,10,"older brains strategy: fit inwards one voxel deeper than boundary, then take small steps back outwards to boundary. May improve results in narrow sulci e.g. at calcarine and parieto-occipital sulcus" +27.5,10000,1.06,1,10,20480,100,100,0.05,0.000002,10,0.5,0.005,0,1, +28,10000,1.07,0,9,20480,600,100,0.2,0.000002,5,0.5,0.005,0,8, +28,10000,1.07,1,10,20480,100,100,0.05,0.000002,0.5,0.5,0.005,0,1, +29,10000,1.12,0,9,20480,600,100,0.2,0.000002,3,0.5,0.005,0,6, +29,10000,1.12,1,10,20480,100,100,0.05,0.000002,0.5,0.5,0.005,0,1, +30,10000,1.17,0,9,20480,600,100,0.2,0.000002,3,0.5,0.005,0,4, +30,10000,1.17,1,10,20480,100,100,0.05,0.000002,0.5,0.5,0.005,0,1, +31,10000,1.2,0,9,20480,600,100,0.2,0.000002,3,0.5,0.005,0,4, +31,10000,1.2,1,10,20480,100,100,0.05,0.000002,0.5,0.5,0.005,0,1,