-
Notifications
You must be signed in to change notification settings - Fork 180
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
29 changed files
with
5,986 additions
and
815 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,99 @@ | ||
# .git-blame-ignore-revs | ||
# If you want this file to be utilised whener you utilise "git blame" on your local instance of the repository, | ||
# run the following command from its root directory: | ||
# git config blame.ignoreRevsFile .git-blame-ignore-revs | ||
|
||
9268f0874fc8b2c3af0a090b8084bd91707a115e | ||
#Author: Daan Christiaens <[email protected]> | ||
#Date: Fri Dec 11 14:41:03 2015 +0100 | ||
# Update copyright header in all source files, as discussed in #9 and #31. | ||
|
||
3024a116078eabd3b1353fc8329a73144632c86c | ||
#Author: Thijs Dhollander <[email protected]> | ||
#Date: Thu Nov 22 17:01:59 2018 +1100 | ||
# Copyright message update for next release (probably 2019-ish) | ||
# Also updated the warranty statement: it appears this was still a formulation left over from the previous GPL license. The new formulation comes directly from the MPL 2.0, but is also more comprehensive; I'm more comfortable with having this more comprehensive. Furthermore, apart from it apparently being quite important to have a warranty statement at the top of source code files, it's apparently also of little value if it's not either very comprehensive, or it also directly refers to the license where the full text can be found. Hence, I added that as a sentence. | ||
# Finally, also of note (and TODO) would be to add the copyright statement and a copy of the license somewhere on our (mrtrix.org) website. The final link is otherwise relatively useless in the context of the copyright and license statement. | ||
|
||
6c6c553ed9e9004ca8495ece436fec4db465d82b | ||
#Author: Thijs Dhollander <[email protected]> | ||
#Date: Wed Dec 13 15:09:37 2017 +1100 | ||
# Copyright update for upcoming RC which will probably end up around New Year's | ||
# Also includes a change of mention of MRtrix to MRtrix3, in line with the phrase MRtrix3 developers, which was already in there/ | ||
# Also includes removal of 2 .s, because they hindered clickability of the links in certain environments. | ||
|
||
654b7281c953f1068142d1f8a152f786862d8876 | ||
#Author: Thijs Dhollander <[email protected]> | ||
#Date: Wed Jan 25 17:57:11 2017 +1100 | ||
# header files | ||
|
||
b623e418e36de6884511d9c233b04392ecce89bb | ||
#Author: Thijs Dhollander <[email protected]> | ||
#Date: Wed Jan 25 17:06:35 2017 +1100 | ||
# Copyright for 2017 in headers | ||
|
||
95b144df3d9eb837fae08129cc292c3fb8490eac | ||
#Author: Robert Smith <[email protected]> | ||
#Date: Tue Oct 8 14:33:10 2019 +1100 | ||
# Add copyright notice to non-CPP files | ||
# Also includes some line ending conversions and indentation changes. | ||
|
||
be9a46286a9053fd1c1951fe5394206a95b61bfa | ||
#Author: MRtrixBot <[email protected]> | ||
#Date: Thu May 14 11:30:13 2020 +1000 | ||
# Initial commit of "update_copyright" changes | ||
|
||
5e3112eae6ba4027aba854b3385f032c67dbfedf | ||
#Author: MRtrixBot <[email protected]> | ||
#Date: Mon Feb 7 16:48:14 2022 +0000 | ||
# update copyright notice and corresponding docs | ||
|
||
e8edf6d946822c8ec23d077c2b1e9eef471b2539 | ||
#Author: MRtrixBot <[email protected]> | ||
#Date: Tue Jan 3 13:41:40 2023 +0100 | ||
# Update copyright notice | ||
|
||
74ff7cf0b76e2c9595b1341a7e4a49fa5491ce2f | ||
#Author: MRtrixBot <[email protected]> | ||
#Date: Wed Jan 6 12:50:54 2021 +0000 | ||
# Update copyright notice | ||
|
||
65b3ea5e549f3f66a9e3c5d9ebdabb2a9bb462b4 | ||
#Author: Thijs Dhollander <[email protected]> | ||
#Date: Thu Nov 22 17:30:36 2018 +1100 | ||
# Fixed typo in copyright/warranty statement. | ||
|
||
729dd6cfc1a773f0f16592b8533c6e9d89d03ac3 | ||
#Author: Thijs Dhollander <[email protected]> | ||
#Date: Mon May 15 10:33:05 2017 +1000 | ||
# copyright update and cleanup | ||
|
||
76ad4fbb3ea60ea56ec94e3debfce1b7a35a9535 | ||
#Author: rtabbara <[email protected]> | ||
#Date: Thu Feb 18 11:55:53 2016 +1100 | ||
# User docs: Update commands list with new copyright | ||
|
||
6552f6ebe4f9fda441255063230ef9f8d9912591 | ||
#Author: J-Donald Tournier <[email protected]> | ||
#Date: Wed Feb 5 12:50:53 2020 +0000 | ||
# remove carriage returns | ||
|
||
811361d3af3ecfec03e20c2ee0f342634810a9c2 | ||
#Author: Thijs Dhollander <[email protected]> | ||
#Date: Tue May 9 09:09:51 2017 +1000 | ||
# docs update | ||
|
||
1eb36099870a0fffbc307ac40523dd8b6e35436f | ||
#Author: Thijs Dhollander <[email protected]> | ||
#Date: Thu Feb 2 12:26:20 2017 +1100 | ||
# standardise number of blank lines between copyright header and the rest of a file (was getting a bit out of hand for some files; now it's 2 blank lines for all) | ||
|
||
e8edf6d946822c8ec23d077c2b1e9eef471b2539 | ||
#Author: MRtrixBot <[email protected]> | ||
#Date: Tue Jan 3 13:41:40 2023 +0100 | ||
# Update copyright notice | ||
|
||
aad44d847ac48d02bb7f8badf801dbfaa0ccdac0 | ||
#Author: MRtrixBot <[email protected]> | ||
#Date: Tue Jan 3 13:42:58 2023 +0100 | ||
# Update Copyright notice in command docs |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -30,17 +30,23 @@ DEFAULT_NL_LMAX = [ 2, 2, 2, 2, 2, 2, 2, 2, 4, 4, 4, 4, 4, 4, 4 | |
|
||
REGISTRATION_MODES = ['rigid', 'affine', 'nonlinear', 'rigid_affine', 'rigid_nonlinear', 'affine_nonlinear', 'rigid_affine_nonlinear'] | ||
|
||
AGGREGATION_MODES = ["mean", "median"] | ||
AGGREGATION_MODES = ['mean', 'median'] | ||
|
||
IMAGEEXT = 'mif nii mih mgh mgz img hdr'.split() | ||
IMAGEEXT = ['mif', 'nii', 'mih', 'mgh', 'mgz', 'img', 'hdr'] | ||
|
||
def usage(cmdline): #pylint: disable=unused-variable | ||
cmdline.set_author('David Raffelt ([email protected]) & Max Pietsch ([email protected]) & Thijs Dhollander ([email protected])') | ||
|
||
cmdline.set_synopsis('Generates an unbiased group-average template from a series of images') | ||
cmdline.add_description('First a template is optimised with linear registration (rigid and/or affine, both by default), then non-linear registration is used to optimise the template further.') | ||
cmdline.add_argument("input_dir", nargs='+', help='Input directory containing all images used to build the template') | ||
cmdline.add_argument("template", help='Corresponding output template image. For multi-contrast registration, provide multiple paired input_dir and template arguments. Example: WM_dir WM_template.mif GM_dir GM_template.mif') | ||
cmdline.add_argument('input_dir', nargs='+', help='Directory containing all input images of a given contrast') | ||
cmdline.add_argument('template', help='Output template image') | ||
|
||
cmdline.add_example_usage('Multi-contrast registration', | ||
'population_template input_WM_ODFs/ output_WM_template.mif input_GM_ODFs/ output_GM_template.mif', | ||
'When performing multi-contrast registration, the input directory and corresponding output template ' | ||
'image for a given contrast are to be provided as a pair, ' | ||
'with the pairs corresponding to different contrasts provided sequentially.') | ||
|
||
options = cmdline.add_argument_group('Multi-contrast options') | ||
options.add_argument('-mc_weight_initial_alignment', help='Weight contribution of each contrast to the initial alignment. Comma separated, default: 1.0') | ||
|
@@ -979,7 +985,7 @@ def execute(): #pylint: disable=unused-variable | |
elif cns.n_volumes[cid] == 1: | ||
run.function(copy, avh4d, 'average_header' + cns.suff[cid] + '.mif') | ||
else: | ||
run.command('mrcat ' + ' '.join([avh3d] * cns.n_volumes[cid]) + ' -axis 3 average_header' + cns.suff[cid] + '.mif') | ||
run.command(['mrcat', [avh3d] * cns.n_volumes[cid], '-axis', '3', 'average_header' + cns.suff[cid] + '.mif']) | ||
run.function(os.remove, avh3d) | ||
run.function(os.remove, avh4d) | ||
else: | ||
|
@@ -1075,7 +1081,7 @@ def execute(): #pylint: disable=unused-variable | |
datatype_option) | ||
progress.increment() | ||
# update average space of first contrast to new extent, delete other average space images | ||
run.command('mraverageheader ' + ' '.join([inp.ims_transformed[cid] + '_translated.mif' for inp in ins]) + ' average_header_tight.mif') | ||
run.command(['mraverageheader', [inp.ims_transformed[cid] + '_translated.mif' for inp in ins], 'average_header_tight.mif']) | ||
progress.done() | ||
|
||
if voxel_size is None: | ||
|
@@ -1235,12 +1241,12 @@ def execute(): #pylint: disable=unused-variable | |
# - If one subject's registration fails, this will affect the average and therefore the template which could result in instable behaviour. | ||
# - The template appearance changes slightly over levels, but the template and trafos are affected in the same way so should not affect template convergence. | ||
if not app.ARGS.linear_no_drift_correction: | ||
run.command('transformcalc ' + ' '.join([os.path.join('linear_transforms_initial', inp.uid + '.txt') for _inp in ins]) + | ||
' average linear_transform_average_init.txt -quiet', force=True) | ||
run.command('transformcalc ' + ' '.join([os.path.join('linear_transforms_%02i' % level, inp.uid + '.txt') for _inp in ins]) + | ||
' average linear_transform_average_%02i_uncorrected.txt -quiet' % level, force=True) | ||
run.command('transformcalc linear_transform_average_%02i_uncorrected.txt invert ' % level + | ||
'linear_transform_average_%02i_uncorrected_inv.txt -quiet' % level, force=True) | ||
run.command(['transformcalc', [os.path.join('linear_transforms_initial', inp.uid + '.txt') for _inp in ins], | ||
'average', 'linear_transform_average_init.txt', '-quiet'], force=True) | ||
run.command(['transformcalc', [os.path.join('linear_transforms_%02i' % level, inp.uid + '.txt') for _inp in ins], | ||
'average', 'linear_transform_average_%02i_uncorrected.txt' % level, '-quiet'], force=True) | ||
run.command(['transformcalc', 'linear_transform_average_%02i_uncorrected.txt' % level, | ||
'invert', 'linear_transform_average_%02i_uncorrected_inv.txt' % level, '-quiet'], force=True) | ||
|
||
transform_average_init = matrix.load_transform('linear_transform_average_init.txt') | ||
transform_average_current_inv = matrix.load_transform('linear_transform_average_%02i_uncorrected_inv.txt' % level) | ||
|
@@ -1259,8 +1265,8 @@ def execute(): #pylint: disable=unused-variable | |
matrix.save_transform(os.path.join('linear_transforms_%02i' % level, inp.uid + '.txt'), transform_updated, force=True) | ||
|
||
# compute average trafos and its properties for easier debugging | ||
run.command('transformcalc ' + ' '.join([os.path.join('linear_transforms_%02i' % level, _inp.uid + '.txt') for _inp in ins]) + | ||
' average linear_transform_average_%02i.txt -quiet' % level, force=True) | ||
run.command(['transformcalc', [os.path.join('linear_transforms_%02i' % level, _inp.uid + '.txt') for _inp in ins], | ||
'average', 'linear_transform_average_%02i.txt' % level, '-quiet'], force=True) | ||
run.command('transformcalc linear_transform_average_%02i.txt decompose linear_transform_average_%02i.dec' % (level, level), force=True) | ||
|
||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.