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
Package Registry
Model registry
Operate
Environments
Terraform modules
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
Evan Edmond
fslpy
Commits
b51fe1f5
Commit
b51fe1f5
authored
5 years ago
by
Paul McCarthy
Browse files
Options
Downloads
Patches
Plain Diff
RF: More sensible initial X5 version
parent
1d5d74cb
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/transform/x5.py
+10
-7
10 additions, 7 deletions
fsl/transform/x5.py
with
10 additions
and
7 deletions
fsl/transform/x5.py
+
10
−
7
View file @
b51fe1f5
...
@@ -326,14 +326,14 @@ import numpy as np
...
@@ -326,14 +326,14 @@ import numpy as np
import
nibabel
as
nib
import
nibabel
as
nib
import
h5py
import
h5py
import
fsl.version
as
version
import
fsl.version
as
fsl
version
import
fsl.data.image
as
fslimage
import
fsl.data.image
as
fslimage
from
.
import
affine
from
.
import
affine
from
.
import
nonlinear
from
.
import
nonlinear
X5_FORMAT
=
'
X5
'
X5_FORMAT
=
'
X5
'
X5_VERSION
=
'
0.
0.1
'
X5_VERSION
=
'
0.
1.0
'
class
X5Error
(
Exception
):
class
X5Error
(
Exception
):
...
@@ -454,11 +454,14 @@ def _readMetadata(group):
...
@@ -454,11 +454,14 @@ def _readMetadata(group):
:returns: A ``dict`` containing the metadata.
:returns: A ``dict`` containing the metadata.
"""
"""
format
=
group
.
attrs
.
get
(
'
Format
'
)
format
=
group
.
attrs
.
get
(
'
Format
'
)
version
=
group
.
attrs
.
get
(
'
Version
'
)
version
=
group
.
attrs
.
get
(
'
Version
'
)
meta
=
group
.
attrs
.
get
(
'
Metadata
'
)
meta
=
group
.
attrs
.
get
(
'
Metadata
'
)
if
(
format
!=
X5_FORMAT
)
or
(
version
!=
X5_VERSION
):
parserver
=
fslversion
.
parseVersion
(
X5_VERSION
)
filever
=
fslversion
.
parseVersion
(
version
)
if
(
format
!=
X5_FORMAT
)
or
(
filever
[
0
]
!=
parserver
[
0
]):
raise
X5Error
(
'
Incompatible format/version (required: {}/{},
'
raise
X5Error
(
'
Incompatible format/version (required: {}/{},
'
'
present: {}/{})
'
.
format
(
X5_FORMAT
,
X5_VERSION
,
'
present: {}/{})
'
.
format
(
X5_FORMAT
,
X5_VERSION
,
format
,
version
))
format
,
version
))
...
@@ -478,7 +481,7 @@ def _writeMetadata(group):
...
@@ -478,7 +481,7 @@ def _writeMetadata(group):
"""
"""
group
.
attrs
[
'
Format
'
]
=
X5_FORMAT
group
.
attrs
[
'
Format
'
]
=
X5_FORMAT
group
.
attrs
[
'
Version
'
]
=
X5_VERSION
group
.
attrs
[
'
Version
'
]
=
X5_VERSION
group
.
attrs
[
'
Metadata
'
]
=
json
.
dumps
({
'
fslpy
'
:
version
.
__version__
})
group
.
attrs
[
'
Metadata
'
]
=
json
.
dumps
({
'
fslpy
'
:
fsl
version
.
__version__
})
def
_readAffine
(
group
):
def
_readAffine
(
group
):
...
...
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