Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
F
fslpy
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Container Registry
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor 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
Michiel Cottaar
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):
...
@@ -271,6 +271,22 @@ class Nifti1(object):
return
nib
.
orientations
.
aff2axcodes
(
xform
,
inaxes
)
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
):
def
getOrientation
(
self
,
axis
,
xform
):
"""
Returns a code representing the orientation of the specified data
"""
Returns a code representing the orientation of the specified data
axis in the coordinate system defined by the given transformation
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