Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
P
python3-imagej-tiff
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Elphel
python3-imagej-tiff
Commits
8c0d7f5d
Commit
8c0d7f5d
authored
Sep 06, 2018
by
Oleg Dzhimiev
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fixed empty array type to float32 instead of default
parent
684ce5dd
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
7 deletions
+4
-7
imagej_tiffwriter.py
imagej_tiffwriter.py
+4
-7
No files found.
imagej_tiffwriter.py
View file @
8c0d7f5d
...
@@ -100,7 +100,7 @@ def imagej_metadata_tags(metadata, byteorder):
...
@@ -100,7 +100,7 @@ def imagej_metadata_tags(metadata, byteorder):
#def save(path,images,force_stack=False,force_hyperstack=False):
#def save(path,images,force_stack=False,force_hyperstack=False):
def
save
(
path
,
images
,
labels
=
None
,
label_prefix
=
"Label"
):
def
save
(
path
,
images
,
labels
=
None
,
label_prefix
=
"Label
"
):
'''
'''
labels a list or None
labels a list or None
...
@@ -134,18 +134,15 @@ def save(path,images,labels=None,label_prefix="Label"):
...
@@ -134,18 +134,15 @@ def save(path,images,labels=None,label_prefix="Label"):
labels_list
=
[]
labels_list
=
[]
if
labels
is
None
:
if
labels
is
None
:
for
i
in
range
(
images
.
shape
[
0
]):
for
i
in
range
(
images
.
shape
[
0
]):
labels_list
.
append
(
label_prefix
+
str
(
i
))
labels_list
.
append
(
label_prefix
+
str
(
i
+
1
))
else
:
else
:
labels_list
=
labels
labels_list
=
labels
print
(
labels_list
)
ijtags
=
imagej_metadata_tags
({
'Labels'
:
labels_list
},
'<'
)
ijtags
=
imagej_metadata_tags
({
'Labels'
:
labels_list
},
'<'
)
with
tifffile
.
TiffWriter
(
path
,
bigtiff
=
False
,
imagej
=
True
)
as
tif
:
with
tifffile
.
TiffWriter
(
path
,
bigtiff
=
False
,
imagej
=
True
)
as
tif
:
for
i
in
range
(
images
.
shape
[
0
]):
for
i
in
range
(
images
.
shape
[
0
]):
print
(
images
[
i
]
.
shape
)
tif
.
save
(
images
[
i
],
metadata
=
{
'version'
:
'1.11a'
,
'loop'
:
False
},
extratags
=
ijtags
)
tif
.
save
(
images
[
i
],
metadata
=
{
'version'
:
'1.11a'
,
' loop'
:
False
},
extratags
=
ijtags
)
# Testing
# Testing
if
__name__
==
"__main__"
:
if
__name__
==
"__main__"
:
...
@@ -160,7 +157,7 @@ if __name__ == "__main__":
...
@@ -160,7 +157,7 @@ if __name__ == "__main__":
NX
=
512
NX
=
512
NY
=
512
NY
=
512
images
=
np
.
empty
((
NT
,
NY
,
NX
))
images
=
np
.
empty
((
NT
,
NY
,
NX
)
,
np
.
float32
)
import
time
import
time
print
(
str
(
time
.
time
())
+
": Generating test images"
)
print
(
str
(
time
.
time
())
+
": Generating test images"
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment