Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
qim3d
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
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
QIM
Tools
qim3d
Commits
3a5c1428
Commit
3a5c1428
authored
1 year ago
by
fima
Browse files
Options
Downloads
Plain Diff
Merge branch 'load_bigtiff' into 'main'
Load bigtiff See merge request
!43
parents
0d152d17
570404b0
No related branches found
No related tags found
1 merge request
!43
Load bigtiff
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
qim3d/io/load.py
+7
-3
7 additions, 3 deletions
qim3d/io/load.py
with
7 additions
and
3 deletions
qim3d/io/load.py
+
7
−
3
View file @
3a5c1428
...
@@ -66,10 +66,14 @@ class DataLoader:
...
@@ -66,10 +66,14 @@ class DataLoader:
If
'
self.virtual_stack
'
is True, returns a numpy.memmap object.
If
'
self.virtual_stack
'
is True, returns a numpy.memmap object.
"""
"""
# Get the number of TIFF series (some BigTIFF have multiple series)
with
tifffile
.
TiffFile
(
path
)
as
tif
:
series
=
len
(
tif
.
series
)
if
self
.
virtual_stack
:
if
self
.
virtual_stack
:
vol
=
tifffile
.
memmap
(
path
)
vol
=
tifffile
.
memmap
(
path
)
else
:
else
:
vol
=
tifffile
.
imread
(
path
)
vol
=
tifffile
.
imread
(
path
,
key
=
range
(
series
)
if
series
>
1
else
None
)
log
.
info
(
"
Loaded shape: %s
"
,
vol
.
shape
)
log
.
info
(
"
Loaded shape: %s
"
,
vol
.
shape
)
...
@@ -215,7 +219,7 @@ class DataLoader:
...
@@ -215,7 +219,7 @@ class DataLoader:
"""
Load a TXRM/XRM/TXM file from the specified path.
"""
Load a TXRM/XRM/TXM file from the specified path.
Args:
Args:
path (str): The path to the
HDF5
file.
path (str): The path to the
TXRM/XRM/TXM
file.
Returns:
Returns:
numpy.ndarray or tuple: The loaded volume.
numpy.ndarray or tuple: The loaded volume.
...
@@ -412,7 +416,7 @@ def load(
...
@@ -412,7 +416,7 @@ def load(
log_memory_info
(
data
)
log_memory_info
(
data
)
else
:
else
:
# Only log if file type is not a np.ndarray, i.e., it is some kind of memmap object
# Only log if file type is not a np.ndarray, i.e., it is some kind of memmap object
if
not
isinstance
(
data
[
0
]
if
isinstance
(
data
,
tuple
)
else
data
,
np
.
ndarray
):
if
not
isinstance
(
type
(
data
[
0
]
)
if
isinstance
(
data
,
tuple
)
else
type
(
data
)
,
np
.
ndarray
):
log
.
info
(
"
Using virtual stack
"
)
log
.
info
(
"
Using virtual stack
"
)
else
:
else
:
log
.
warning
(
'
Virtual stack is not supported for this file format
'
)
log
.
warning
(
'
Virtual stack is not supported for this file format
'
)
...
...
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