Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
synapsis
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
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
Lucy McNeill
synapsis
Commits
0c232da8
Commit
0c232da8
authored
3 years ago
by
Lucy McNeill
Browse files
Options
Downloads
Patches
Plain Diff
nd2 converter names files with antibody
parent
fcc55711
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
.DS_Store
+0
-0
0 additions, 0 deletions
.DS_Store
source/nd2converter.py
+46
-34
46 additions, 34 deletions
source/nd2converter.py
with
46 additions
and
34 deletions
.DS_Store
+
0
−
0
View file @
0c232da8
No preview for this file type
This diff is collapsed.
Click to expand it.
source/nd2converter.py
+
46
−
34
View file @
0c232da8
...
...
@@ -5,46 +5,58 @@ import os
import
glob
from
PIL
import
Image
parent_dir
=
'
data-folder/sharepoint
'
# location of the nd2 files to convert
parent_dir
=
'
data-folder/from-sharepoint/OneDrive_1_01-02-2021
'
filenames
=
[]
filenames_base
=
[]
for
file
in
glob
.
glob
(
os
.
path
.
join
(
parent_dir
,
'
*nd2
'
)):
filenames
.
append
(
file
)
filenames
=
sorted
(
filenames
)
print
(
filenames
)
for
name
in
filenames
:
base
=
os
.
path
.
basename
(
name
)
os
.
path
.
splitext
(
base
)
name_base
=
os
.
path
.
splitext
(
base
)[
0
]
new_name
=
parent_dir
+
'
/
'
+
str
(
name_base
)
print
(
new_name
)
with
ND2Reader
(
str
(
name
))
as
images
:
plt
.
figure
(
figsize
=
(
10
,
10
))
plt
.
gca
().
set_axis_off
()
plt
.
subplots_adjust
(
top
=
1
,
bottom
=
0
,
right
=
1
,
left
=
0
,
hspace
=
0
,
wspace
=
0
)
plt
.
margins
(
0
,
0
)
plt
.
gca
().
xaxis
.
set_major_locator
(
plt
.
NullLocator
())
plt
.
gca
().
yaxis
.
set_major_locator
(
plt
.
NullLocator
())
plt
.
imshow
(
images
[
0
],
cmap
=
'
gray
'
)
### keep metadata... e.g.
## savefig(fname, dpi=None, facecolor='w', edgecolor='w',
## orientation='portrait', papertype=None, format=None,
## transparent=False, bbox_inches=None, pad_inches=0.1,
## frameon=None, metadata=None)
plt
.
savefig
(
str
(
name
)
+
'
cells.jpeg
'
)
plt
.
figure
(
figsize
=
(
10
,
10
))
plt
.
gca
().
set_axis_off
()
plt
.
subplots_adjust
(
top
=
1
,
bottom
=
0
,
right
=
1
,
left
=
0
,
hspace
=
0
,
wspace
=
0
)
plt
.
margins
(
0
,
0
)
plt
.
gca
().
xaxis
.
set_major_locator
(
plt
.
NullLocator
())
plt
.
gca
().
yaxis
.
set_major_locator
(
plt
.
NullLocator
())
plt
.
imshow
(
images
[
1
],
cmap
=
'
gray
'
)
plt
.
savefig
(
str
(
name
)
+
'
foci.jpeg
'
)
plt
.
figure
(
figsize
=
(
10
,
10
))
plt
.
gca
().
set_axis_off
()
plt
.
subplots_adjust
(
top
=
1
,
bottom
=
0
,
right
=
1
,
left
=
0
,
try
:
with
ND2Reader
(
str
(
name
))
as
images
:
plt
.
figure
(
figsize
=
(
10
,
10
))
plt
.
gca
().
set_axis_off
()
plt
.
subplots_adjust
(
top
=
1
,
bottom
=
0
,
right
=
1
,
left
=
0
,
hspace
=
0
,
wspace
=
0
)
plt
.
margins
(
0
,
0
)
plt
.
gca
().
xaxis
.
set_major_locator
(
plt
.
NullLocator
())
plt
.
gca
().
yaxis
.
set_major_locator
(
plt
.
NullLocator
())
plt
.
imshow
(
images
[
0
],
cmap
=
'
gray
'
)
### keep metadata... e.g.
## savefig(fname, dpi=None, facecolor='w', edgecolor='w',
## orientation='portrait', papertype=None, format=None,
## transparent=False, bbox_inches=None, pad_inches=0.1,
## frameon=None, metadata=None)
plt
.
savefig
(
str
(
new_name
)
+
'
-DAPI.jpeg
'
)
plt
.
figure
(
figsize
=
(
10
,
10
))
plt
.
gca
().
set_axis_off
()
plt
.
subplots_adjust
(
top
=
1
,
bottom
=
0
,
right
=
1
,
left
=
0
,
hspace
=
0
,
wspace
=
0
)
plt
.
margins
(
0
,
0
)
plt
.
gca
().
xaxis
.
set_major_locator
(
plt
.
NullLocator
())
plt
.
gca
().
yaxis
.
set_major_locator
(
plt
.
NullLocator
())
plt
.
imshow
(
images
[
2
],
cmap
=
'
gray
'
)
plt
.
savefig
(
str
(
name
)
+
'
dna.jpeg
'
)
plt
.
margins
(
0
,
0
)
plt
.
gca
().
xaxis
.
set_major_locator
(
plt
.
NullLocator
())
plt
.
gca
().
yaxis
.
set_major_locator
(
plt
.
NullLocator
())
plt
.
imshow
(
images
[
1
],
cmap
=
'
gray
'
)
plt
.
savefig
(
str
(
new_name
)
+
'
-MLH3.jpeg
'
)
plt
.
figure
(
figsize
=
(
10
,
10
))
plt
.
gca
().
set_axis_off
()
plt
.
subplots_adjust
(
top
=
1
,
bottom
=
0
,
right
=
1
,
left
=
0
,
hspace
=
0
,
wspace
=
0
)
plt
.
margins
(
0
,
0
)
plt
.
gca
().
xaxis
.
set_major_locator
(
plt
.
NullLocator
())
plt
.
gca
().
yaxis
.
set_major_locator
(
plt
.
NullLocator
())
plt
.
imshow
(
images
[
2
],
cmap
=
'
gray
'
)
plt
.
savefig
(
str
(
new_name
)
+
'
-SYCP3.jpeg
'
)
except
:
print
(
"
Couldn
'
t open file
"
+
str
(
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