-
Notifications
You must be signed in to change notification settings - Fork 193
DWI metadata handling fixes #2917
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
Merged
Merged
Changes from 9 commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
ad46893
First DWI metadata reimplementation passing all private tests
Lestropie 0c0f192
New namespace MR::Metadata
Lestropie b4ad5ab
Metadata: New source file for slice encoding
Lestropie 11a4439
Changes to header realignment handling
Lestropie 2fc1047
Multiple changes for altered metadata handling
Lestropie e38570c
Metadata::PhaseEncoding: Reduce unnecessary templating
Lestropie 54968cf
Metadata: Make use of realignment transform matrix
Lestropie e411e32
transformconvert flirt_import: Use on-disk transform
Lestropie 5aaec61
meshconvert -transform fs2real: Use on-disk transform
Lestropie bb0eb37
Merge remote-tracking branch 'origin/dev' into dwi_metadata
Lestropie 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
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 |
|---|---|---|
|
|
@@ -14,6 +14,7 @@ | |
| * For more details, see http://www.mrtrix.org/. | ||
| */ | ||
|
|
||
| #include "axes.h" | ||
| #include "command.h" | ||
| #include "file/key_value.h" | ||
| #include "file/matrix.h" | ||
|
|
@@ -64,15 +65,14 @@ void usage() { | |
| // clang-format on | ||
|
|
||
| transform_type get_flirt_transform(const Header &header) { | ||
| std::vector<size_t> axes; | ||
| transform_type nifti_transform = File::NIfTI::adjust_transform(header, axes); | ||
| if (nifti_transform.matrix().topLeftCorner<3, 3>().determinant() < 0.0) | ||
| return nifti_transform; | ||
| const transform_type ondisk_transform = header.realignment().orig_transform(); | ||
| if (ondisk_transform.matrix().topLeftCorner<3, 3>().determinant() < 0.0) | ||
| return ondisk_transform; | ||
| transform_type coord_switch; | ||
| coord_switch.setIdentity(); | ||
| coord_switch(0, 0) = -1.0f; | ||
| coord_switch(0, 3) = (header.size(axes[0]) - 1) * header.spacing(axes[0]); | ||
| return nifti_transform * coord_switch; | ||
| coord_switch(0, 3) = (header.size(header.realignment().permutation(0)) - 1) * header.spacing(header.realignment().permutation(0)); | ||
|
||
| return ondisk_transform * coord_switch; | ||
| } | ||
|
|
||
| // transform_type parse_surfer_transform (const Header& header) { | ||
|
|
||
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: constness of 'ondisk_transform' prevents automatic move [performance-no-automatic-move]
return ondisk_transform; ^