Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
F
fslpy
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Analyze
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
FSL
fslpy
Commits
25145d18
Commit
25145d18
authored
8 years ago
by
Paul McCarthy
Browse files
Options
Downloads
Patches
Plain Diff
FNIRT-specific hack - using qform matrix for FNIRT output images.
parent
632d8ced
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
fsl/data/image.py
+19
-3
19 additions, 3 deletions
fsl/data/image.py
with
19 additions
and
3 deletions
fsl/data/image.py
+
19
−
3
View file @
25145d18
...
...
@@ -150,9 +150,25 @@ class Nifti1(object):
shape
,
pixdim
=
self
.
__determineShape
(
self
.
nibImage
)
self
.
shape
=
shape
self
.
pixdim
=
pixdim
self
.
voxToWorldMat
=
np
.
array
(
self
.
nibImage
.
get_affine
())
self
.
shape
=
shape
self
.
pixdim
=
pixdim
# We have to treat FSL/FNIRT images
# specially, as FNIRT clobbers the
# sform section of the NIFTI header
# to store other data. The hard coded
# numbers here are the intent codes
# output by FNIRT.
intent
=
self
.
nibImage
.
get_header
().
get
(
'
intent_code
'
,
-
1
)
if
intent
in
(
2006
,
2007
,
2008
,
2009
):
log
.
debug
(
'
FNIRT output image detected - using qform matrix
'
)
self
.
voxToWorldMat
=
self
.
nibImage
.
get_qform
()
# Otherwise we let nibabel decide
# which transform to use.
else
:
self
.
voxToWorldMat
=
np
.
array
(
self
.
nibImage
.
get_affine
())
self
.
worldToVoxMat
=
transform
.
invert
(
self
.
voxToWorldMat
)
if
loadData
:
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment