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
c8188800
Commit
c8188800
authored
5 years ago
by
Paul McCarthy
Browse files
Options
Downloads
Patches
Plain Diff
RF: Tweak bitmap data organisation
parent
857e255a
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/bitmap.py
+7
-5
7 additions, 5 deletions
fsl/data/bitmap.py
with
7 additions
and
5 deletions
fsl/data/bitmap.py
+
7
−
5
View file @
c8188800
...
@@ -64,9 +64,9 @@ class Bitmap(object):
...
@@ -64,9 +64,9 @@ class Bitmap(object):
raise
ValueError
(
'
unknown bitmap: {}
'
.
format
(
bmp
))
raise
ValueError
(
'
unknown bitmap: {}
'
.
format
(
bmp
))
# Make the array (w, h, c)
# Make the array (w, h, c)
data
=
data
.
transpose
((
1
,
0
,
2
))
data
=
np
.
fliplr
(
data
.
transpose
((
1
,
0
,
2
))
)
w
,
h
=
data
.
shape
[:
2
]
data
=
np
.
array
(
data
,
dtype
=
np
.
uint8
,
order
=
'
C
'
)
data
=
np
.
array
(
data
,
dtype
=
np
.
uint8
,
order
=
'
C
'
)
w
,
h
=
data
.
shape
[:
2
]
self
.
__data
=
data
self
.
__data
=
data
self
.
__dataSource
=
source
self
.
__dataSource
=
source
...
@@ -149,7 +149,9 @@ class Bitmap(object):
...
@@ -149,7 +149,9 @@ class Bitmap(object):
else
:
else
:
data
=
np
.
zeros
((
width
,
height
),
dtype
=
dtype
)
data
=
np
.
zeros
((
width
,
height
),
dtype
=
dtype
)
for
c
h
,
c
i
in
enumerate
(
dtype
.
names
):
for
c
i
,
c
h
in
enumerate
(
dtype
.
names
):
data
[
ch
]
=
self
.
data
[...,
ci
]
data
[
ch
]
=
self
.
data
[...,
ci
]
return
fslimage
.
Image
(
data
,
np
.
eye
(
4
))
data
=
np
.
array
(
data
,
order
=
'
F
'
,
copy
=
False
)
return
fslimage
.
Image
(
data
,
name
=
self
.
name
)
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