-
Notifications
You must be signed in to change notification settings - Fork 185
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merge SHARDRecon into main MRtrix3 codebase #2994
Open
dchristiaens
wants to merge
434
commits into
dev
Choose a base branch
from
merge_shard
base: dev
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 250 commits
Commits
Show all changes
434 commits
Select commit
Hold shift + click to select a range
38795b9
Merge branch 'master' into tvreg2
dchristiaens 52dc716
motionfilter: revert to median filtering.
dchristiaens cbecd53
motionfilter: support volume-level transformations.
dchristiaens 1e6ec97
Integrate motion filter in motion correction script. Parameters now u…
dchristiaens 1ef3bd9
mssh2amp: fix output gradient table at 4 columns.
dchristiaens 917be84
dwimotioncorrect: increment SVR progress bar less often.
dchristiaens 9f248d5
motionfilter: add unused options to support mrtrix script multi-threa…
dchristiaens 21c4ea0
Fix cubic interpolation kernel.
dchristiaens 79f8021
dwimotioncorrect: blur recon for registration.
dchristiaens 824c23c
motionfilter: catch numeric errors in matrix logarithm.
dchristiaens 9343d3d
dwimotioncorrect: add optional intensity matching.
dchristiaens f23c947
dwirecon: small bug fix in jacobian modulation.
dchristiaens 86ade6a
dwirecon: exploit multiband factor for efficient q-space basis evalua…
dchristiaens 467f538
dwirecon: bug fix in motion lookup and symbol renaming
dchristiaens e45b6b4
motionfilter: adapt to new motion file format.
dchristiaens f170a81
dwirecon: bug fix in MB loop indexing.
dchristiaens a4ce2a8
mrfieldunwarp: support motion tables of any multiband dimension.
dchristiaens 0b3ff55
dwirecon: print progress at info level.
dchristiaens 27e5f55
dwirecon: code cleanup.
dchristiaens 75e67fc
Working first prototype for Lie-algebra rigid registration.
dchristiaens 9e9709b
mrreg_asym: Fix Jacobian scaling.
dchristiaens 6b9a2f5
mrreg_asym: add mask.
dchristiaens 1a36b3d
mrreg_asym: code organization.
dchristiaens 489ab4b
mrreg_asym: interface improvements.
dchristiaens 07ff722
mrreg_asym: add user option for starting point.
dchristiaens ffbee9a
Framework for new slice-to-volume registrtaion command.
dchristiaens 8eb1506
dwislicealign: set up inrastructure for s2v registration.
dchristiaens 7b4b4c2
dwislicealign: implement registration.
dchristiaens 4f835de
dwislicealign: bug fixes
dchristiaens c33dc18
dwislicealign: add progress bar.
dchristiaens e7dcd62
dwimotioncorrect: integrate new registration command
dchristiaens af78fc8
dwislicealign: critical bug fix
dchristiaens 17533dd
mrfieldunwarp: add optional index for field alignment.
dchristiaens 224ef2b
dwimotioncorrect: cleanup
dchristiaens 7b34a79
dwisliceoutliers: use MB factor.
dchristiaens 993f854
dwimotioncorrect: reinstate multi-scale registration
dchristiaens c13c619
dwisliceoutliers: fix bug.
dchristiaens 7c6fa72
Merge branch 'master' into customreg
dchristiaens 803f99f
dwirecon: print residual error on console.
dchristiaens 94dee12
Merge branch 'customreg' into intensitymatching
dchristiaens e282b36
intensity matching: use rank-reduced prediction and mask
dchristiaens 172f2eb
intensity matching: separate outlier reweighting and bias field scali…
dchristiaens 65ad2f0
dwislicealign: incorporate SSP in registration.
dchristiaens 818121a
dwimotioncorrect: fix multi-level registration.
dchristiaens b892d2c
Merge branch 'customreg' into intensitymatching2
dchristiaens 76c2716
dwirecon: use custom SSP.
dchristiaens 3b289e0
Merge branch 'master' into customreg
dchristiaens 2827ca7
dwislicealign: use exact SSP.
dchristiaens e324f9d
Move SVR to namespace; clean PSF code.
dchristiaens 2d0d18f
dwimotioncorrect: switch everything to Lie representation.
dchristiaens dbb2399
maskslice: remove deprecated command
dchristiaens bb5874d
motionfiltter overhaul
dchristiaens bcedba2
dwislicealign: remove global scaling factor.
dchristiaens e08272e
dwimotioncorrect: enable motion filter only if slice order is explici…
dchristiaens dd83c37
dwirecon: disable minimum norm regularizer
dchristiaens deb4392
dwirecon: minimum norm regularizer at machine epsilon.
dchristiaens 4c15a41
dwirecon: normalise regularization weight to no. volumes in the data.
dchristiaens b15b703
mrfieldunwarp: bug fix and improvement in s2v setting.
dchristiaens 0430101
dwisliceoutliers: output 0 when mask is empty.
dchristiaens 745a972
Merge branch 'master' into intensitymatching3
dchristiaens 9771fe3
intensity matching: required operation order for motion filtering.
dchristiaens ec16911
intensity matching: normalise bias field in mask.
dchristiaens be0ef97
intensity matching: mask bias field.
dchristiaens a370b97
dwisliceoutliers: Correct loss function (derivative instead of ratio).
dchristiaens 4ecc49a
dwimotioncorrect: avoid double interpolation in field mapping.
dchristiaens af44e4a
dwirecon: try new Jacobian approximation
dchristiaens 5ebcfca
dwirecon: fix Jacobian modulation in field mapping.
dchristiaens 75a6f1b
dwimotioncorrect: revert to field unwarping before recon.
dchristiaens 9c59f91
slice-level intensity matching with normalisation
dchristiaens fdff015
Merge branch 'intensitymatching2a' into imscale2
dchristiaens 305acc4
dwimotioncorrect: include local intensity matching.
dchristiaens d43c458
intensity matching: normalise in mask.
dchristiaens f9788ce
intensity matching: get bias in full image, normalise in amsk only.
dchristiaens e10415e
intensity matching: make full user option.
dchristiaens 8092fd5
dwimotioncorrcet: increase no. inner iterations
dchristiaens 83f8664
dwimotioncorrect: first setup for svr config list
dchristiaens c7fcd63
dwimotioncorrect: bug fix
dchristiaens 343dfcf
dwirecon: switch to core library interpolators.
dchristiaens ba7faa8
dwirecon: clip at edges.
dchristiaens 19c8987
dwirecon: set boundary conditions in Laplacian regularization.
dchristiaens 383d94b
dwimotioncorrect: test single-shell recon.
dchristiaens 17c8ac6
msshsvd: apply Laplace-Beltrami filter defore decomposition.
dchristiaens 1d100d7
code cleanup
dchristiaens 17e385c
Merge branch 'dev' into recon-core
dchristiaens 981ce38
code cleanup
dchristiaens 7f0f6f8
Merge branch 'recon-core' into dev
dchristiaens 548ce88
dwimotioncorrect: multi-scale reconstruction using regularizer instea…
dchristiaens d4afe43
small bug fix
dchristiaens 5a91ac9
dwisliceoutliers: force mask to be 3-D.
dchristiaens 79ca22e
dwimotioncorrect: new default config with multi-scale reconstruction.
dchristiaens 2a650f8
dwimotioncorrect: revert multi-scale registrtaion to separate filtering.
dchristiaens cd7e8e3
dwirecon: fix edge case for SSP width = 0.
dchristiaens fe4a30e
dwimotioncorrect: update for dev-RC3
dchristiaens c9d4653
dwirecon: change to LoG regularizer.
dchristiaens a159b48
dwislicealign: avoid unnecessary memory allocation in multi-threading.
dchristiaens d122138
dwisliceoutliers: let mask move alongside the image.
dchristiaens 162a578
dwimotioncorrect: fix previous commit
dchristiaens 0dfa5e2
dwirecon: switch to DoG regularizer
dchristiaens 2a11cc6
dwirecon: code cleanup
dchristiaens cec1867
dwimotioncorrect: disable basis update in outer loop.
dchristiaens 7052089
dwirecon: further code cleanup
dchristiaens c9b44dd
dwisliceoutliers: let mask move alongside the image (for real this ti…
dchristiaens 5a6cd37
dwisliceoutliers: remove risk of race condition.
dchristiaens 9d99648
dwislicealign: align mask with recon, using initial motion estimate.
dchristiaens 210a7fb
dwirecon: switch to isotropic Laplacian regularizer at grid resolution.
dchristiaens a9b075e
dwimotioncorrect: fewer iterations in early stages
dchristiaens cb212fc
motionstats: new script for analysing motion trajectories and outliers.
dchristiaens 6c405fa
motionstats: bug fixes and improvements
dchristiaens 2e4f802
motionstats: measure intra-volume gradient dispersion.
dchristiaens 676f9a8
dwisliceoutliers: use RMSE with scaling from voxel-wise MAD.
dchristiaens fc36416
dwisliceoutliers: fix multi-threading bug
dchristiaens f8db1d6
dwisliceoutliers: fix bug in dynamic masking.
dchristiaens e1e3169
dwimotioncorrect: adapt optimization scheme for Chi2 outlier reweight…
dchristiaens 7f1dc56
dwirecon: incorporate slice-direction regularizer.
dchristiaens d60124e
Merge branch 'orchi2' into dev
dchristiaens 8f54c0f
dwirecon: lower default regularization values
dchristiaens cfd46cf
dwirecon: bug fix and update motion corrcetion script
dchristiaens 4cdce1d
dwimotioncorrect: take prior slice weights at input
dchristiaens b29fcdd
motionfilter: reinstate median filtering
dchristiaens 82a94cf
dwisliceoutliers2: new bayesian slice outlier detection.
dchristiaens 0d78288
dwisliceoutliers: avoid zero-division NaN.
dchristiaens a2514c3
dwisliceoutliers: trial new GMM-style OR.
dchristiaens 7734cba
dwisliceoutliers: bug fix and initialisation
dchristiaens acd300c
dwimotioncorrect: switch outlier rejection to log-normal distributions.
dchristiaens 8dffbac
Merge branch 'orprior' of gitlab.com:ChD/dwi-recon into orprior
dchristiaens 94f033c
dwisliceoutliers2: fix EM implementation
dchristiaens dbbaff8
dwisliceoutliers2: refactor.
dchristiaens 741e0d3
dwisliceoutliergmm: rename command
dchristiaens 6410a59
dwisliceoutliergmm: switch to log-normal distributions.
dchristiaens a6118df
dwimotioncorrect: integrate new dwisliceoutliergmm command.
dchristiaens 149ba3f
dwisliceoutliergmm: fix bugs.
dchristiaens 343a0b7
sliceoutliergmm: avoid NaN output due to numeric overflow.
dchristiaens bc48474
dwimotioncorrect: add support for fixed slice weights.
dchristiaens b391c62
dwirecon: revert Laplacial regularizer to minimal convolution filter.
dchristiaens 0eebd00
mrfieldunwarp: add option to disable Jacobian modulation.
dchristiaens 18a654b
dwirecon: code cleanup
dchristiaens ff99b72
dwisliceoutliergmm: fix GMM initialisation for log-normal data.
dchristiaens b871aef
dwirecon: normalise slice outlier weights in reconstruction.
dchristiaens 0375f5c
dwirecon: scale differential operators in regularization.
dchristiaens 23cc3eb
dwimotioncorrect: add flag for volume-level correction
dchristiaens ed5fc5a
Update README.md
dchristiaens 0705aa3
Merge branch 'master' of gitlab.com:ChD/dwi-recon
dchristiaens 52b185e
Remove deprecated commands
dchristiaens a8af209
Update copyright notice.
dchristiaens d64a289
Fix typo in copyright notice.
dchristiaens 2849313
msshsvd: simplify and speed-up
dchristiaens c016b16
dwirecon: add capability for voxel-level outlier weights
dchristiaens e19d2d3
dwimotioncorrect: unwarp voxel weights to ensure spatial correspondence.
dchristiaens 535f9f9
mrfieldunwarp: linear interpolation
dchristiaens bb8d2a4
dwirecon: fix bug with local outlier weight handling.
dchristiaens 062c74c
update gitignore
dchristiaens 55f60d5
dwirecon: switch to LSCG solver
dchristiaens 579fda1
dwirecon: use regularisers in LSCG
dchristiaens 180f7a0
dwirecon: balance weights symmetrically in LSCG solver
dchristiaens b5f127a
dwirecon: reinstate weight normalisation
dchristiaens 0fb8f40
dwirecon: code cleanup
dchristiaens cdeef45
dwislicealign: fix assert error
dchristiaens f209890
Merge branch 'master' into recon-refactoring
dchristiaens 1b74cf8
dwirecon: improve run time efficiency
dchristiaens 2bfb4ad
dwisliceoutliergmm: fix floating point rounding error
dchristiaens 8d4372d
Merge branch 'master' into recon-refactoring
dchristiaens f4a2001
dwirecon: fix byte alignment issues
dchristiaens f95ee97
dwirecon: encapsulate q-space basis in seperate class.
dchristiaens 1857204
dwirecon: start work on adapter pipes.
dchristiaens 2e42977
dwirecon: fix bugs introduced in the refactoring
dchristiaens 9281398
dwirecon: run time improvement
dchristiaens 49e71c8
dwirecon: continue refactoring
dchristiaens 4477273
dwirecon refactor: implement y->x mapping
dchristiaens 153e54d
dwirecon refactoring: first working version
dchristiaens 1ead869
dwirecon refactor: ensure thread safety
dchristiaens f604b0e
dwirecon refactor: fix bytesize allocation for atomic_flag
dchristiaens 684097f
dwirecon refactor: rename Cache adapter and use memset for speed.
dchristiaens 4e7c0f0
Merge branch 'recon-refactoring' of https://gitlab.com/ChD/dwi-recon …
dchristiaens 83fcef7
dwirecon refactor: fix bug in memset call
dchristiaens 6908626
dwirecon refactor: reinstate SSP handling
dchristiaens 8e0dc41
dwirecon refactor: run time optimization
dchristiaens 1bebda3
dwirecon refactor: improve (double) cache efficiency
dchristiaens 90505c9
dwirecon refactor: add recon_proj command for testing
dchristiaens b085569
Merge branch 'recon-refactoring' into voxelweights
dchristiaens e5b37e8
dwirecon: enable reconstruction on arbitrary grid.
dchristiaens a01e31a
dwirecon: fix issue with negative strides.
dchristiaens da4daba
dwirecon: fix issue with multi-resolution grid header
dchristiaens 7238592
Merge branch 'recon-refactoring' into voxelweights
dchristiaens 416b72a
dwirecon: clean up commented legacy code
dchristiaens 63fc542
dwimotioncorrect: refactor to new scripting syntax
dchristiaens db2a4c6
dwimotioncorrect: fix scripting bug due to use of 'global'
dchristiaens feaab19
Merge branch 'recon-refactoring' into voxelweights
dchristiaens 3c38ebe
dwimotioncorrect: fix bug in voxel weights file name handling
dchristiaens 6d890eb
dwimotioncorrect: add option to fix motion traces
dchristiaens 9339a42
dwimotioncorrect: make motion filter part of default setup
dchristiaens ffc98d3
Merge branch 'recon-refactoring' of gitlab.com:ChD/dwi-recon into rec…
dchristiaens dd1de50
Update codebase for MRtrix 3.0.0 interface.
dchristiaens 0fba182
dwimotioncorrect: temporarily increase no. iterations in default config
dchristiaens d279c5e
dwimotioncorrect: fix typo
dchristiaens 0a82b1d
msshsvd: fix segfault when no mask is provided
dchristiaens c43ab5b
Revert "dwimotioncorrect: temporarily increase no. iterations in defa…
dchristiaens 04fae54
dwimotioncorrect: set up config json file
dchristiaens 637f760
dwimotioncorrect: fix stupid and less stupid bugs
dchristiaens 9c1e126
dwirecon: allow dynamic SSP length
dchristiaens 9b91ec8
cosmetic changes and error checking
dchristiaens 6124301
dwimotioncorrect: override config with custom -reg and -zreg params
dchristiaens 13f18a9
dwirecon: compatibility with mrtrix 3.0.1
dchristiaens 3c95095
Update README.md
dchristiaens 27cac3f
dwimotioncorrect: error updated to mrtrix api
maxpietsch d51a898
README: fix install instructions
dchristiaens 576808a
Merge branch 'dwimotioncorrect_errorfix' into 'master'
dchristiaens bae4595
dwimotioncorrect: fix bug in config file handling
dchristiaens 2d5076e
mrfieldunwarp: warning when dimensions don't match
dchristiaens 9e1946b
mrfieldunwarp: improve docs
dchristiaens 71ab3c5
Merge pull request #5 from dchristiaens/fieldmap_checks
dchristiaens 0ce8a11
dwimotioncorrect: save command history to output
dchristiaens 821ab7b
README.md updates
dchristiaens 7cba1cd
dwirecon: fix segfault reported in #4
dchristiaens dc01d94
dwimotioncorrect: check scipy availability upfront
maxpietsch f878133
Merge pull request #7 from dchristiaens/save_cmdhistory
maxpietsch 82b2e6c
Merge pull request #8 from dchristiaens/fix_segfault
maxpietsch 55da420
dwimotioncorrect: use mssh as reference for command history
maxpietsch 162f921
added drift motion filter option
maxpietsch ab5c742
Merge pull request #12 from dchristiaens/save_cmdhistory
dchristiaens 5735923
Merge pull request #10 from dchristiaens/import_check
dchristiaens af087e4
dwimotioncorrect: default LB regularization 0.001
dchristiaens 4d58d97
add support for Eigen 3.3.7 and above
dchristiaens 219c93a
dwimotioncorrect: fix bug on NaN voxel size in 4th dimension
dchristiaens 9bf9ba2
mssh2amp: fix bug on [ 0 0 0 ] input directions.
dchristiaens 2beb61f
Merge branch 'master' of gitlab.com:ChD/dwi-recon
dchristiaens df699d7
dwirecon: support Eigen 3.4.0
dchristiaens d91962e
dwirecon: remove deprecated Loop({4,3}) syntax #8
dchristiaens d06c72b
Merge pull request #16 from dchristiaens/fix_loop
dchristiaens 0cbcd9d
fix nthreads
treanus 3dd671a
Merge pull request #17 from treanus/master
dchristiaens 30ac0b1
dwimotioncorrect: smarter default for -rlmax
dchristiaens 79afb72
dwimotioncorrect: smarter default for -lmax
dchristiaens dfcfaf1
Merge branch 'master' into drift_filter
dchristiaens 239a03d
Merge pull request #13 from dchristiaens/drift_filter
dchristiaens 0269bb9
dwimotioncorrect: bug fix
dchristiaens ca24e73
Merge pull request #19 from dchristiaens/rlmax_default
dchristiaens 49a6efa
Merge remote-tracking branch 'shard/master' into merge_shard
dchristiaens 8e4bd40
Remove command dwirecon_proj
dchristiaens f1f9770
Update C++ code for recent changes on dev.
dchristiaens 3d8f36f
Update Python code for recent changes on dev.
dchristiaens b80bb5d
Fix runtime errors.
dchristiaens 2cf67ed
motionstats: output mean rotation in degrees
dchristiaens 72b736a
shard: use constexpressions
dchristiaens 3659512
shard: use pragma once
dchristiaens 6f45946
shard: use nested namespaces
dchristiaens 6f011e4
dwirecon: remove deprecated -field option
dchristiaens ee8ffb9
shard: apply formatting rules
dchristiaens e7e0f61
Apply first batch of clang-tidy suggestions
dchristiaens cc51416
Apply second batch of clang-tidy suggestions
dchristiaens 2172535
Replace C-style casts with C++ casts in dwirecon
daljit46 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
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,137 @@ | ||
/* Copyright (c) 2017-2019 Daan Christiaens | ||
* | ||
* MRtrix and this add-on module are distributed in the hope | ||
* that it will be useful, but WITHOUT ANY WARRANTY; without | ||
* even the implied warranty of MERCHANTABILITY or FITNESS | ||
* FOR A PARTICULAR PURPOSE. | ||
*/ | ||
|
||
#include "command.h" | ||
#include "image.h" | ||
#include "thread_queue.h" | ||
#include "dwi/gradient.h" | ||
#include "file/matrix.h" | ||
|
||
#include "dwi/svr/register.h" | ||
#include "dwi/svr/psf.h" | ||
|
||
#define DEFAULT_SSPW 1.0f | ||
|
||
|
||
using namespace MR; | ||
using namespace App; | ||
|
||
|
||
void usage () | ||
{ | ||
AUTHOR = "Daan Christiaens ([email protected])"; | ||
|
||
SYNOPSIS = "Register multi-shell spherical harmonics image to DWI slices or volumes."; | ||
|
||
DESCRIPTION | ||
+ "This command takes DWI data and a multi-shell spherical harmonics (MSSH) signal " | ||
"prediction to estimate subject motion parameters with volume-to-slice registration."; | ||
|
||
ARGUMENTS | ||
+ Argument ("data", "the input DWI data.").type_image_in() | ||
|
||
+ Argument ("mssh", "the input MSSH prediction.").type_image_in() | ||
|
||
+ Argument ("out", "the output motion parameters.").type_file_out(); | ||
|
||
OPTIONS | ||
+ Option ("mask", "image mask") | ||
+ Argument ("m").type_image_in() | ||
|
||
+ Option ("mb", "multiband factor. (default = 0; v2v registration)") | ||
+ Argument ("factor").type_integer(0) | ||
|
||
+ Option ("ssp", "SSP vector or slice thickness in voxel units (default = 1).") | ||
+ Argument ("w").type_text() | ||
|
||
+ Option ("init", "motion initialisation") | ||
+ Argument ("motion").type_file_in() | ||
|
||
+ Option ("maxiter", "maximum no. iterations for the registration") | ||
+ Argument ("n").type_integer(0) | ||
|
||
+ DWI::GradImportOptions(); | ||
|
||
} | ||
|
||
|
||
using value_type = float; | ||
|
||
|
||
void run () | ||
{ | ||
// input data | ||
auto data = Image<value_type>::open(argument[0]); | ||
auto grad = DWI::get_DW_scheme (data); | ||
|
||
// input template | ||
auto mssh = Image<value_type>::open(argument[1]); | ||
if (mssh.ndim() != 5) | ||
throw Exception("5-D MSSH image expected."); | ||
|
||
// index shells | ||
auto bvals = parse_floats(mssh.keyval().find("shells")->second); | ||
|
||
// mask | ||
auto mask = Image<bool>(); | ||
auto opt = get_options("mask"); | ||
if (opt.size()) { | ||
dchristiaens marked this conversation as resolved.
Show resolved
Hide resolved
dchristiaens marked this conversation as resolved.
Show resolved
Hide resolved
|
||
mask = Image<bool>::open(opt[0][0]); | ||
check_dimensions(data, mask, 0, 3); | ||
} | ||
|
||
// multiband factor | ||
size_t mb = get_option_value("mb", 0); | ||
if (mb == 0 || mb == data.size(2)) { | ||
mb = data.size(2); | ||
INFO("volume-to-volume registration."); | ||
} else { | ||
if (data.size(2) % mb != 0) | ||
throw Exception ("multiband factor invalid."); | ||
} | ||
|
||
// SSP | ||
DWI::SVR::SSP<float> ssp (DEFAULT_SSPW); | ||
opt = get_options("ssp"); | ||
if (opt.size()) { | ||
dchristiaens marked this conversation as resolved.
Show resolved
Hide resolved
|
||
std::string t = opt[0][0]; | ||
dchristiaens marked this conversation as resolved.
Show resolved
Hide resolved
|
||
try { | ||
ssp = DWI::SVR::SSP<float>(std::stof(t)); | ||
} catch (std::invalid_argument& e) { | ||
try { | ||
Eigen::VectorXf v = File::Matrix::load_vector<float>(t); | ||
dchristiaens marked this conversation as resolved.
Show resolved
Hide resolved
|
||
ssp = DWI::SVR::SSP<float>(v); | ||
} catch (...) { | ||
throw Exception ("Invalid argument for SSP."); | ||
} | ||
} | ||
} | ||
|
||
// settings and initialisation | ||
size_t niter = get_option_value("maxiter", 0); | ||
dchristiaens marked this conversation as resolved.
Show resolved
Hide resolved
|
||
Eigen::MatrixXf init (data.size(3), 6); init.setZero(); | ||
opt = get_options("init"); | ||
if (opt.size()) { | ||
dchristiaens marked this conversation as resolved.
Show resolved
Hide resolved
dchristiaens marked this conversation as resolved.
Show resolved
Hide resolved
|
||
init = File::Matrix::load_matrix<float>(opt[0][0]); | ||
if (init.cols() != 6 || ((data.size(3)*data.size(2)) % init.rows())) | ||
throw Exception("dimension mismatch in motion initialisaton."); | ||
} | ||
|
||
// run registration | ||
DWI::SVR::SliceAlignSource source (data.size(3), data.size(2), mb, grad, bvals, init); | ||
DWI::SVR::SliceAlignPipe pipe (data, mssh, mask, mb, niter, ssp); | ||
DWI::SVR::SliceAlignSink sink (data.size(3), data.size(2), mb); | ||
Thread::run_queue(source, DWI::SVR::SliceIdx(), Thread::multi(pipe), DWI::SVR::SliceIdx(), sink); | ||
|
||
// output | ||
File::Matrix::save_matrix(sink.get_motion(), argument[2]); | ||
|
||
} | ||
|
||
|
||
|
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
warning: macro 'DEFAULT_SSPW' used to declare a constant; consider using a 'constexpr' constant [cppcoreguidelines-macro-usage]