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
a33a8492
Commit
a33a8492
authored
4 years ago
by
Paul McCarthy
Browse files
Options
Downloads
Patches
Plain Diff
ENH: New Nifti.niftiDataType property
parent
0c8a3325
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
fsl/data/constants.py
+30
-0
30 additions, 0 deletions
fsl/data/constants.py
fsl/data/image.py
+5
-0
5 additions, 0 deletions
fsl/data/image.py
with
35 additions
and
0 deletions
fsl/data/constants.py
+
30
−
0
View file @
a33a8492
...
...
@@ -98,6 +98,36 @@ NIFTI_UNITS_PPM = 40
NIFTI_UNITS_RADS
=
48
# NIFTI datatype codes
NIFTI_DT_NONE
=
0
NIFTI_DT_UNKNOWN
=
0
NIFTI_DT_BINARY
=
1
NIFTI_DT_UNSIGNED_CHAR
=
2
NIFTI_DT_SIGNED_SHORT
=
4
NIFTI_DT_SIGNED_INT
=
8
NIFTI_DT_FLOAT
=
16
NIFTI_DT_COMPLEX
=
32
NIFTI_DT_DOUBLE
=
64
NIFTI_DT_RGB
=
128
NIFTI_DT_ALL
=
255
NIFTI_DT_UINT8
=
2
NIFTI_DT_INT16
=
4
NIFTI_DT_INT32
=
8
NIFTI_DT_FLOAT32
=
16
NIFTI_DT_COMPLEX64
=
32
NIFTI_DT_FLOAT64
=
64
NIFTI_DT_RGB24
=
128
NIFTI_DT_INT8
=
256
NIFTI_DT_UINT16
=
512
NIFTI_DT_UINT32
=
768
NIFTI_DT_INT64
=
1024
NIFTI_DT_UINT64
=
1280
NIFTI_DT_FLOAT128
=
1536
NIFTI_DT_COMPLEX128
=
1792
NIFTI_DT_COMPLEX256
=
2048
NIFTI_DT_RGBA32
=
2304
# NIFTI file intent codes
NIFTI_INTENT_NONE
=
0
NIFTI_INTENT_CORREL
=
2
...
...
This diff is collapsed.
Click to expand it.
fsl/data/image.py
+
5
−
0
View file @
a33a8492
...
...
@@ -560,6 +560,11 @@ class Nifti(notifier.Notifier, meta.Meta):
"""
Returns the NIFTI intent code of this image.
"""
return
self
.
header
.
get
(
'
intent_code
'
,
constants
.
NIFTI_INTENT_NONE
)
@property
def
niftiDataType
(
self
):
"""
Returns the NIFTI data type code of this image.
"""
return
self
.
header
.
get
(
'
datatype
'
,
constants
.
NIFTI_DT_UNKNOWN
)
@intent.setter
def
intent
(
self
,
val
):
...
...
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