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
31618e5c
Commit
31618e5c
authored
5 years ago
by
Constantin Pape
Browse files
Options
Downloads
Patches
Plain Diff
Add script for legacy platy-browser export
parent
a082f5b6
No related branches found
No related tags found
1 merge request
!2
Merge versioning and scripts into master
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
legacy_export.py
+47
-0
47 additions, 0 deletions
legacy_export.py
with
47 additions
and
0 deletions
legacy_export.py
0 → 100644
+
47
−
0
View file @
31618e5c
import
os
# from pathlib import Path
from
shutil
import
copyfile
# TODO need to replace the name in xml to make this work out of the box
def
export_segmentation
(
folder
,
name
,
dest_folder
,
out_name
):
seg_file
=
os
.
path
.
join
(
folder
,
'
segmentations
'
,
'
%s.h5
'
%
name
)
xml_file
=
os
.
path
.
join
(
folder
,
'
segmentations
'
,
'
%s.xml
'
%
name
)
table_file
=
os
.
path
.
join
(
folder
,
'
tables
'
,
name
,
'
default.csv
'
)
assert
os
.
path
.
exists
(
seg_file
)
assert
os
.
path
.
exists
(
xml_file
)
assert
os
.
path
.
exists
(
table_file
),
table_file
seg_out
=
os
.
path
.
join
(
dest_folder
,
'
%s.h5
'
%
out_name
)
print
(
"
Copying segmentation from
"
,
seg_file
,
"
to
"
,
seg_out
)
copyfile
(
seg_file
,
seg_out
)
xml_out
=
os
.
path
.
join
(
dest_folder
,
'
%s.xml
'
%
out_name
)
print
(
"
Copying xml from
"
,
xml_file
,
"
to
"
,
xml_out
)
copyfile
(
xml_file
,
xml_out
)
table_out
=
os
.
path
.
join
(
dest_folder
,
'
tables
'
,
'
%s.csv
'
%
out_name
)
print
(
"
Copying table from
"
,
table_file
,
"
to
"
,
table_out
)
copyfile
(
table_file
,
table_out
)
def
export_tag
(
tag
,
export_cells
=
False
,
export_cilia
=
False
):
tag_folder
=
'
./data/%s
'
%
tag
assert
os
.
path
.
exists
(
tag_folder
)
dest_folder
=
'
/g/arendt/EM_6dpf_segmentation/EM-Prospr
'
if
export_cells
:
name
=
'
sbem-6dpf-1-whole-segmented-cells-labels
'
out_name
=
'
em-segmented-cells-new-labels
'
export_segmentation
(
tag_folder
,
name
,
dest_folder
,
out_name
)
if
export_cilia
:
name
=
'
sbem-6dpf-1-whole-segmented-cilia-labels
'
out_name
=
'
em-segmented-cilia-labels
'
export_segmentation
(
tag_folder
,
name
,
dest_folder
,
out_name
)
if
__name__
==
'
__main__
'
:
# export_tag('0.1.1', export_cells=True)
export_tag
(
'
0.1.0
'
,
export_cilia
=
True
)
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