-
Notifications
You must be signed in to change notification settings - Fork 16
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
ENH: Add ITK-LTA conversion test #66
Merged
Merged
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
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 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
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,4 @@ | ||
0.99970585 -0.00953967 -0.02228683 -15.19269657 | ||
-0.00599674 0.79344094 -0.60861677 70.83446503 | ||
0.02348929 0.60857153 0.79315072 15.39251423 | ||
0.00000000 0.00000000 0.00000000 1.00000000 |
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,29 @@ | ||
type = 0 # LINEAR_VOX_TO_VOX | ||
nxforms = 1 | ||
mean = 0.0000 0.0000 0.0000 | ||
sigma = 1.0000 | ||
1 4 4 | ||
-3.124080896377563e+00 2.981145866215229e-02 8.914728462696075e-02 1.741926879882812e+02 | ||
-1.405486371368170e-02 1.859627604484558e+00 -1.825850725173950e+00 5.312585067749023e+01 | ||
5.505303665995598e-02 1.426339745521545e+00 2.379452466964722e+00 1.154438781738281e+01 | ||
0.000000000000000e+00 0.000000000000000e+00 0.000000000000000e+00 9.999998807907104e-01 | ||
src volume info | ||
valid = 1 # volume info valid | ||
filename = /home/oesteban/tmp/fmriprep-ds005/fprep-work/fmriprep_wf/single_subject_01_wf/func_preproc_task_mixedgamblestask_run_01_wf/bold_reg_wf/bbreg_wf/bbregister/uni_xform_masked.nii.gz | ||
volume = 64 64 34 | ||
voxelsize = 3.125000000000000e+00 3.125000000000000e+00 4.000000000000000e+00 | ||
xras = -1.000000000000000e+00 0.000000000000000e+00 0.000000000000000e+00 | ||
yras = 0.000000000000000e+00 1.000000000000000e+00 0.000000000000000e+00 | ||
zras = 0.000000000000000e+00 0.000000000000000e+00 1.000000000000000e+00 | ||
cras = 1.000000000000000e+00 2.800000000000000e+01 -3.100000000000000e+01 | ||
dst volume info | ||
valid = 1 # volume info valid | ||
filename = /oak/stanford/groups/russpold/data/openfmri/ds000005/sub-01/anat/sub-01_T1w.nii.gz | ||
volume = 160 192 192 | ||
voxelsize = 1.000000000000000e+00 1.333333015441895e+00 1.333333015441895e+00 | ||
xras = 1.000000000000000e+00 0.000000000000000e+00 0.000000000000000e+00 | ||
yras = 0.000000000000000e+00 1.000000000000000e+00 0.000000000000000e+00 | ||
zras = 0.000000000000000e+00 0.000000000000000e+00 1.000000000000000e+00 | ||
cras = -1.000000000000000e+00 -5.000030517578125e+00 -1.000030517578125e+00 | ||
subject sub-01 | ||
fscale 0.100000 |
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,5 @@ | ||
#Insight Transform File V1.0 | ||
#Transform 0 | ||
Transform: MatrixOffsetTransformBase_double_3_3 | ||
Parameters: 0.999706355364118 0.0059967416827344956 0.023489316177446647 0.009539669218827523 0.7934419194347854 -0.6085721629337524 -0.02228683774477952 0.6086173680484374 0.7931513449655613 -5.5388974668589555 -45.57406723091313 -48.80406464758718 | ||
FixedParameters: 0 0 0 |
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 |
---|---|---|
@@ -1,30 +1,28 @@ | ||
# transform file /home/oesteban/tmp/fmriprep-ds005/fprep-work/fmriprep_wf/single_subject_01_wf/anat_preproc_wf/surface_recon_wf/fsnative2t1w_xfm/T1_robustreg.lta | ||
# created by oesteban on Sat Mar 14 19:28:37 2020 | ||
|
||
type = 1 # LINEAR_RAS_TO_RAS | ||
nxforms = 1 | ||
mean = 129.0000 157.0000 132.0000 | ||
sigma = 10000.0000 | ||
1 4 4 | ||
9.999999403953552e-01 -1.698292035143822e-04 1.542967074783519e-04 -1.678466796875000e-04 | ||
1.698438863968477e-04 9.999999403953552e-01 -9.513227996649221e-05 -1.318359375000000e-02 | ||
-1.542805403005332e-04 9.515848068986088e-05 9.999999403953552e-01 -6.271362304687500e-03 | ||
0.000000000000000e+00 0.000000000000000e+00 0.000000000000000e+00 9.999999403953552e-01 | ||
1.000000000000000e+00 1.698439009487629e-04 -1.542805694043636e-04 1.691182987997308e-04 | ||
-1.698292180662975e-04 1.000000000000000e+00 9.515849524177611e-05 1.318416278809309e-02 | ||
1.542967220302671e-04 -9.513228724244982e-05 1.000000000000000e+00 6.270134821534157e-03 | ||
0.000000000000000e+00 0.000000000000000e+00 0.000000000000000e+00 1.000000000000000e+00 | ||
src volume info | ||
valid = 1 # volume info valid | ||
filename = /oak/stanford/groups/russpold/data/openfmri/derivatives/ds000005/freesurfer-6.0.1/sub-01/mri/T1.mgz | ||
volume = 256 256 256 | ||
voxelsize = 1.000000000000000e+00 1.000000000000000e+00 1.000000000000000e+00 | ||
xras = -9.999999403953552e-01 0.000000000000000e+00 0.000000000000000e+00 | ||
yras = 0.000000000000000e+00 0.000000000000000e+00 -9.999999403953552e-01 | ||
zras = 0.000000000000000e+00 9.999999403953552e-01 0.000000000000000e+00 | ||
cras = -9.999847412109375e-01 -5.000015258789062e+00 -1.000038146972656e+00 | ||
dst volume info | ||
valid = 1 # volume info valid | ||
filename = /oak/stanford/groups/russpold/data/openfmri/ds000005/sub-01/anat/sub-01_T1w.nii.gz | ||
volume = 160 192 192 | ||
voxelsize = 1.000000000000000e+00 1.333333015441895e+00 1.333333015441895e+00 | ||
xras = 1.000000000000000e+00 0.000000000000000e+00 0.000000000000000e+00 | ||
yras = 0.000000000000000e+00 1.000000000000000e+00 0.000000000000000e+00 | ||
zras = 0.000000000000000e+00 0.000000000000000e+00 1.000000000000000e+00 | ||
cras = -1.000000000000000e+00 -5.000030517578125e+00 -1.000030517578125e+00 | ||
dst volume info | ||
valid = 1 # volume info valid | ||
filename = /oak/stanford/groups/russpold/data/openfmri/derivatives/ds000005/freesurfer-6.0.1/sub-01/mri/T1.mgz | ||
volume = 256 256 256 | ||
voxelsize = 1.000000000000000e+00 1.000000000000000e+00 1.000000000000000e+00 | ||
xras = -9.999999403953552e-01 0.000000000000000e+00 0.000000000000000e+00 | ||
yras = 0.000000000000000e+00 0.000000000000000e+00 -9.999999403953552e-01 | ||
zras = 0.000000000000000e+00 9.999999403953552e-01 0.000000000000000e+00 | ||
cras = -9.999847412109375e-01 -5.000015258789062e+00 -1.000038146972656e+00 | ||
fscale 0.100000 |
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,5 @@ | ||
#Insight Transform File V1.0 | ||
#Transform 0 | ||
Transform: AffineTransform_double_3_3 | ||
Parameters: 1 -0.00016982921806629747 -0.00015429673658218235 0.00016984390094876289 1 9.5132294518407434e-05 0.00015428056940436363 -9.5158495241776109e-05 1 0.00016784669423941523 0.013183594681322575 -0.0062713632360100746 | ||
FixedParameters: 0 0 0 |
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,21 @@ | ||
# emacs: -*- mode: python-mode; py-indent-offset: 4; indent-tabs-mode: nil -*- | ||
# vi: set ft=python sts=4 ts=4 sw=4 et: | ||
"""Conversions between formats.""" | ||
import numpy as np | ||
from .. import linear as _l | ||
|
||
|
||
def test_conversions0(data_path): | ||
"""Check conversions between formats.""" | ||
lta = _l.load(data_path / "regressions" / "robust_register.lta", fmt="lta") | ||
itk = _l.load(data_path / "regressions" / "robust_register.tfm", fmt="itk") | ||
|
||
assert np.allclose(lta.matrix, itk.matrix) | ||
|
||
|
||
def test_conversions1(data_path): | ||
"""Check conversions between formats.""" | ||
lta = _l.load(data_path / "regressions" / "bbregister.lta", fmt="lta") | ||
itk = _l.load(data_path / "regressions" / "bbregister.tfm", fmt="itk") | ||
|
||
assert np.allclose(lta.matrix, itk.matrix) |
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.
Does this new file fail prior to #65?
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.
Yes, I have updated both because I had messed up when filing #64. The attached ITK file (in that issue) I believe is the inverse.
To be sure, I searched again for both (LTA, ITK) from the robust register node and subsequent nodes and replaced them.