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
f36b4168
Commit
f36b4168
authored
8 years ago
by
Paul McCarthy
Browse files
Options
Downloads
Patches
Plain Diff
Helper function which does the neuro-radio test.
parent
9f4de0db
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
+16
-0
16 additions, 0 deletions
fsl/data/image.py
with
16 additions
and
0 deletions
fsl/data/image.py
+
16
−
0
View file @
f36b4168
...
...
@@ -271,6 +271,22 @@ class Nifti1(object):
return
nib
.
orientations
.
aff2axcodes
(
xform
,
inaxes
)
def
isNeurological
(
self
):
"""
Returns ``True`` if it looks like this ``Nifti1`` object is in
neurological orientation, ``False`` otherwise. This test is purely
based on the determinent of the voxel-to-mm transformation matrix -
if it has a positive determinant, the image is assumed to be in
neurological orientation, otherwise it is assumed to be in
radiological orientation.
http://fsl.fmrib.ox.ac.uk/fsl/fslwiki/FLIRT/FAQ#What_is_the_format_
\
of_the_matrix_used_by_FLIRT.2C_and_how_does_it_relate_to_the_
\
transformation_parameters.3F
"""
import
numpy.linalg
as
npla
return
npla
.
det
(
self
.
voxToWorldMat
)
>
0
def
getOrientation
(
self
,
axis
,
xform
):
"""
Returns a code representing the orientation of the specified data
axis in the coordinate system defined by the given transformation
...
...
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