Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
SVLT
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
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
ALMF
SVLT
Commits
25ed7955
Commit
25ed7955
authored
1 year ago
by
Christopher Randolph Rhodes
Browse files
Options
Downloads
Patches
Plain Diff
Added method to cast patch as YXCZ array
parent
3dff7010
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
extensions/chaeo/accessors.py
+3
-0
3 additions, 0 deletions
extensions/chaeo/accessors.py
extensions/chaeo/tests/test_accessors.py
+8
-1
8 additions, 1 deletion
extensions/chaeo/tests/test_accessors.py
with
11 additions
and
1 deletion
extensions/chaeo/accessors.py
+
3
−
0
View file @
25ed7955
...
...
@@ -44,6 +44,9 @@ class MonoPatchStack(InMemoryDataAccessor):
def
iat
(
self
,
i
):
return
self
.
data
[:,
:,
0
,
i
]
def
iat_yxcz
(
self
,
i
):
return
np
.
expand_dims
(
self
.
iat
(
i
),
(
2
,
3
))
def
get_list
(
self
):
n
=
self
.
nz
return
[
self
.
data
[:,
:,
0
,
zi
]
for
zi
in
range
(
0
,
n
)]
...
...
This diff is collapsed.
Click to expand it.
extensions/chaeo/tests/test_accessors.py
+
8
−
1
View file @
25ed7955
...
...
@@ -43,4 +43,11 @@ class TestCziImageFileAccess(unittest.TestCase):
def
test_raises_filenotfound
(
self
):
from
extensions.chaeo.accessors
import
FileNotFoundError
with
self
.
assertRaises
(
FileNotFoundError
):
acc
=
MonoPatchStackFromFile
(
'
c:/fake/file/name.tif
'
)
\ No newline at end of file
acc
=
MonoPatchStackFromFile
(
'
c:/fake/file/name.tif
'
)
def
test_patch_as_yxcz_array
(
self
):
w
=
256
h
=
512
n
=
4
acc
=
MonoPatchStack
([
np
.
random
.
rand
(
h
,
w
)
for
_
in
range
(
0
,
4
)])
self
.
assertEqual
(
acc
.
iat_yxcz
(
0
).
shape
,
(
h
,
w
,
1
,
1
))
\ No newline at end of file
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