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
1a6b131d
Commit
1a6b131d
authored
1 year ago
by
Christopher Randolph Rhodes
Browse files
Options
Downloads
Patches
Plain Diff
Clean test showing that modified HDF5 isn't providing correct results
parent
4da7a119
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
extensions/chaeo/examples/test_modify_object_classifier.py
+12
-7
12 additions, 7 deletions
extensions/chaeo/examples/test_modify_object_classifier.py
with
12 additions
and
7 deletions
extensions/chaeo/examples/test_modify_object_classifier.py
+
12
−
7
View file @
1a6b131d
...
...
@@ -7,17 +7,22 @@ import numpy as np
from
extensions.chaeo.accessors
import
MonoPatchStack
,
MonoPatchStackFromFile
from
extensions.chaeo.models
import
PatchStackObjectClassifier
def
modify_ilastik_object_classifier
(
template_ilp
:
Path
,
lane
=
0
):
where
=
template_ilp
.
parent
def
modify_ilastik_object_classifier
(
template_ilp
:
Path
,
lane
:
int
=
0
):
proj_dir
=
template_ilp
.
parent
proj_name
=
template_ilp
.
stem
new_ilp
=
shutil
.
copy
(
template_ilp
,
where
/
(
'
mod_
'
+
proj_name
+
'
.ilp
'
))
proj_
new_ilp
=
shutil
.
copy
(
template_ilp
,
proj_dir
/
(
'
mod_
'
+
proj_name
+
'
.ilp
'
))
with
h5py
.
File
(
where
/
new_ilp
,
'
r+
'
)
as
h5
:
with
h5py
.
File
(
where
/
proj_
new_ilp
,
'
r+
'
)
as
h5
:
# delete ObjectExtraction / RegionFeatures / 0000
# delete ObjectClassification/ClassifierForests
for
key
in
[
f
'
ObjectExtraction/RegionFeatures/
{
lane
:
04
d
}
'
,
'
ObjectExtraction/ClassifierForests
'
]:
if
(
key
)
in
h5
.
keys
():
keys_to_delete
=
[
f
'
ObjectExtraction/RegionFeatures/
{
lane
:
04
d
}
'
,
'
ObjectExtraction/ClassifierForests
'
]
for
key
in
keys_to_delete
:
if
key
in
h5
.
keys
():
del
h5
[
key
]
assert
key
not
in
h5
.
keys
()
...
...
@@ -33,7 +38,7 @@ def modify_ilastik_object_classifier(template_ilp: Path, lane=0):
h5
[
f
'
{
key
}
/filePath
'
]
=
rel_pa
assert
h5
[
f
'
{
key
}
/filePath
'
][()]
==
rel_pa
.
encode
()
return
new_ilp
return
proj_
new_ilp
if
__name__
==
'
__main__
'
:
...
...
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