Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
P
platy-browser-data
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
Container Registry
Model registry
Operate
Environments
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
Christian Tischer
platy-browser-data
Commits
f860222d
Commit
f860222d
authored
5 years ago
by
Constantin Pape
Browse files
Options
Downloads
Patches
Plain Diff
Update name lookup scripts
parent
410f6a1e
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
mmpb/files/__init__.py
+0
-2
0 additions, 2 deletions
mmpb/files/__init__.py
mmpb/files/migration.py
+6
-8
6 additions, 8 deletions
mmpb/files/migration.py
mmpb/files/name_lookup.py
+9
-9
9 additions, 9 deletions
mmpb/files/name_lookup.py
with
15 additions
and
19 deletions
mmpb/files/__init__.py
+
0
−
2
View file @
f860222d
from
.copy_helper
import
(
copy_tables
,
copy_segmentation
,
copy_image_data
,
copy_misc_data
,
copy_release_folder
)
from
.bdv_server
import
make_bdv_server_file
from
.folders
import
make_folder_structure
from
.sources
import
add_image
,
add_segmentation
,
add_postprocessing
,
add_source
...
...
This diff is collapsed.
Click to expand it.
mmpb/files/migration.py
+
6
−
8
View file @
f860222d
...
...
@@ -191,20 +191,20 @@ def migrate_version(version):
version_folder
=
os
.
path
.
join
(
ROOT
,
version
)
# 1.) make new folder structure
new_folder_structure
(
version_folder
)
#
new_folder_structure(version_folder)
# 2.) iterate over all images and segmentations, replace names (if necessary),
# move the files and make the new images.json dict
update_image_data
(
version_folder
)
#
update_image_data(version_folder)
# 3.) iterate over all table links and repair them
update_segmentation_data
(
version_folder
)
#
update_segmentation_data(version_folder)
# 4.) update the tables
update_tables
(
version_folder
)
# 5.) clean up:
clean_up
(
version_folder
)
#
clean_up(version_folder)
# migrate all the data in the raw folder
...
...
@@ -366,15 +366,13 @@ if __name__ == '__main__':
# change names and xmls in the rawfolder
# migrate_rawfolder()
#
version = '0.
0.1
'
#
migrate_version(version)
version
=
'
0.
6.5
'
migrate_version
(
version
)
version
=
'
0.6.5
'
copied
=
make_n5_files
(
version
)
with
open
(
'
/g/kreshuk/pape/copied_to_n5.json
'
,
'
w
'
)
as
f
:
json
.
dump
(
copied
,
f
)
# x = json.dumps(copied, indent=2, sort_keys=True)
# print(x)
# version = '0.6.5'
# update_n5_xmls(version)
This diff is collapsed.
Click to expand it.
mmpb/files/name_lookup.py
+
9
−
9
View file @
f860222d
...
...
@@ -50,6 +50,7 @@ DYNAMIC_SEGMENTATIONS = ['sbem-6dpf-1-whole-segmented-cells',
ROOT
=
'
/g/arendt/EM_6dpf_segmentation/platy-browser-data/data
'
FILE_NAME_LUT
=
{}
LUT_PATH
=
os
.
path
.
join
(
ROOT
,
'
new_name_lut.json
'
)
IMAGE_PROPERTIES
=
{}
...
...
@@ -60,18 +61,19 @@ IMAGE_PROPERTIES = {}
# - segmentations -> get rid of '-labels' postifx
def
update_name_lut
():
global
FILE_NAME_LUT
if
os
.
path
.
exists
(
LUT_PATH
):
with
open
(
LUT_PATH
,
'
r
'
)
as
f
:
FILE_NAME_LUT
.
update
(
json
.
load
(
f
))
return
# update files according to the last version folder
folder
=
os
.
path
.
join
(
ROOT
,
'
0.6.5
'
)
image_names
=
os
.
listdir
(
os
.
path
.
join
(
folder
,
'
images
'
))
image_names
=
[
os
.
path
.
splitext
(
name
)[
0
]
for
name
in
image_names
if
os
.
path
.
splitext
(
name
)[
1
]
==
'
.xml
'
]
if
os
.
path
.
exists
(
os
.
path
.
join
(
folder
,
'
segmentations
'
)):
seg_names
=
os
.
listdir
(
os
.
path
.
join
(
folder
,
'
segmentations
'
))
seg_names
=
[
os
.
path
.
splitext
(
name
)[
0
]
for
name
in
seg_names
if
os
.
path
.
splitext
(
name
)[
1
]
==
'
.xml
'
]
else
:
seg_names
=
[]
seg_names
=
os
.
listdir
(
os
.
path
.
join
(
folder
,
'
segmentations
'
))
seg_names
=
[
os
.
path
.
splitext
(
name
)[
0
]
for
name
in
seg_names
if
os
.
path
.
splitext
(
name
)[
1
]
==
'
.xml
'
]
file_names
=
image_names
+
seg_names
for
name
in
file_names
:
...
...
@@ -213,7 +215,5 @@ def get_dynamic_segmentation_properties(name):
if
__name__
==
'
__main__
'
:
# x = json.dumps(FILE_NAME_LUT, sort_keys=True, indent=2)
# print(x)
with
open
(
'
/g/kreshuk/pape/new_names.json
'
,
'
w
'
)
as
f
:
with
open
(
LUT_PATH
,
'
w
'
)
as
f
:
json
.
dump
(
FILE_NAME_LUT
,
f
,
sort_keys
=
True
,
indent
=
2
)
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