-
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
dwicat: Support different voxel grids #2702
Conversation
The dwicat script now serves two key purposes. In addition to estimating a global intensity shift between two or more series based on the aggregate b=0 intensity, it will now also interrogate the voxel grids of the input images, and decide how best to combine those data; whether it be straight concatenation, rigid-body transformation to a central unbiased header, or resampling all data onto a new common voxel grid if necessary. Other changes to facilitate this / made in the process: - dwicat new command-line option -nointensity to disable the intensity matching functionality of the script. - mraverageheader: -resolution command-line option removed, and replaced with -spacing. There are now four options to choose from rather than two, and "resolution" was no longer the appropriate term to disambiguate them / describe the mechanism. In particular, the ability to set the voxel spacings based on either the minimum or mean of the input image axes closest to the average header axes, means that in the scenario where one has two DWI series with the same voxel spacing but different affine transforms, one can calculate an average voxel grid that lies between the two input voxel grids but has precisely the same voxel spacing, such that it is not necessary to perform interpolation to get the data from both series onto that common grid. - transformcalc: Tweaked example description of "header" function. Axes::get_permutation_to_make_axial(): Renamed to get_shuffle_to_make_axial() as the result is not constrained to axis permutations only, and also broke calculation of specifically the permutations into its own function as that could be used for the new functionalities in mraverageheader.
This change is necessary for dwicat to process successfully in the scenario where inputs must be conformed to a new average voxel grid, but one of the input series happens to contain a number of volumes corresponding to a spherical harmonic series.
Something I failed to previously report explicitly here: Because the default behaviour of |
Conflicts: cmd/mraverageheader.cpp core/math/average_space.cpp core/math/average_space.h
|
Conflicts: cmd/mraverageheader.cpp cmd/transformcalc.cpp docs/reference/commands/mraverageheader.rst
Code formatting bug exposed by pylint.
Not part of tests, but showcasing Inputs:
Outputs:
Note that " |
a57cdcc
to
479187e
Compare
This change reverts mraverageheader to use the method now referred to as "mean_projection", which was the default behaviour prior to #2702. Scripts dwicat and population_template explicitly request the "mean_nearest" method where deemed appropriate. Tests for mraverageheader updated to reflect change in default behaviour.
This change reverts mraverageheader to use the method now referred to as "mean_projection", which was the default behaviour prior to #2702. Scripts dwicat and population_template explicitly request the "mean_nearest" method where deemed appropriate. Tests for mraverageheader updated to reflect change in default behaviour.
9be5337
to
d686ba1
Compare
There was a trap here that is resolved in 9be5337. Before that, I had altered the default behaviour of average header calculation, such that the outcomes of There's an argument to be made about the generation of unbiased midway spaces in |
This change reverts mraverageheader to use the method now referred to as "mean_projection", which was the default behaviour prior to #2702. Scripts dwicat and population_template explicitly request the "mean_nearest" method where deemed appropriate. Tests for mraverageheader updated to reflect change in default behaviour.
Script was erroneously triggering the use of rigid body average header generation due to the input series containing different numbers of volumes.
d686ba1
to
7ed618e
Compare
Both test data repositories have been updated such that the |
Follows discussion in #1741.
Relates to question in #2697. Got around the uncertainty there by essentially preserving the current behaviour and implementing alternatives alongside them.
Needed to implement this to facilitate processing of a minority of session data coming through the lab, where series with opposing phase encoding directions aren't always on precisely the same voxel grid, but voxel spacings and axis dimensions are identical.
Plan is to use this to resolve bids-apps/MRtrix3_connectome#123.
1203d74 has an extensive description of changes.
I can't say that for DWI series with different voxel sizes this is 100% the best way to proceed, but I can at least say that it would proceed.