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
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
QIM
Tools
qim3d
Merge requests
!131
Update saving docs
Code
Review changes
Check out branch
Open in Workspace
Download
Patches
Plain diff
Expand sidebar
Merged
Update saving docs
update-save-docs
into
main
Overview
0
Commits
1
Pipelines
0
Changes
1
Merged
s233039
requested to merge
update-save-docs
into
main
8 months ago
Overview
0
Commits
1
Pipelines
0
Changes
1
https://www.notion.so/qim-dtu/Update-save-documentation-123bab83b2f98000b4cdcd12b22db7a9
0
0
Merge request reports
Compare
main
main (base)
and
latest version
latest version
4beddb4e
1 commit,
8 months ago
1 file
+
9
−
1
Side-by-side
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
qim3d/io/saving.py
+
9
−
1
View file @ 4beddb4e
Edit in single-file editor
Open in Web IDE
Show full file
@@ -413,7 +413,8 @@ def save(
@@ -413,7 +413,8 @@ def save(
"""
Save data to a specified file path.
"""
Save data to a specified file path.
Args:
Args:
path (str): The path to save file to
path (str): The path to save file to. File format is chosen based on the extension.
Supported extensions are: <em>
'
.tif
'
,
'
.tiff
'
,
'
.nii
'
,
'
.nii.gz
'
,
'
.h5
'
,
'
.vol
'
,
'
.vgi
'
,
'
.dcm
'
,
'
.DCM
'
,
'
.zarr
'
,
'
.jpeg
'
,
'
.jpg
'
,
'
.png
'
</em>
data (numpy.ndarray): The data to be saved
data (numpy.ndarray): The data to be saved
replace (bool, optional): Specifies if an existing file with identical path should be replaced.
replace (bool, optional): Specifies if an existing file with identical path should be replaced.
Default is False.
Default is False.
@@ -425,6 +426,13 @@ def save(
@@ -425,6 +426,13 @@ def save(
as several files (only relevant for TIFF stacks). Default is 0, i.e., the first dimension.
as several files (only relevant for TIFF stacks). Default is 0, i.e., the first dimension.
**kwargs: Additional keyword arguments to be passed to the DataSaver constructor
**kwargs: Additional keyword arguments to be passed to the DataSaver constructor
Raises:
ValueError: If the provided path is an existing directory and self.basename is not provided <strong>OR</strong>
If the file format is not supported <strong>OR</strong>
If the provided path does not exist and self.basename is not provided <strong>OR</strong>
If a file extension is not provided <strong>OR</strong>
if a file with the specified path already exists and replace=False.
Example:
Example:
```python
```python
import qim3d
import qim3d
Loading