Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can not saving 3D tiff format for layer #6783

Open
jinxsfe opened this issue Mar 27, 2024 · 8 comments
Open

Can not saving 3D tiff format for layer #6783

jinxsfe opened this issue Mar 27, 2024 · 8 comments
Labels
bug Something isn't working

Comments

@jinxsfe
Copy link

jinxsfe commented Mar 27, 2024

馃悰 Bug Report

image
I try to create the label point and make annotation and process images, but when I do several of step,and I click save all layer or save select layer

File ~/miniconda3/envs/napari-env/lib/python3.10/site-packages/napari_svg/layer_to_xml.py:104, in image_to_xml(data=<class 'numpy.ndarray'> (140, 464, 464) float32, meta={'affine': <class 'numpy.ndarray'> (4, 4) float64, 'attenuation': 0.05, 'blending': 'translucent_no_depth', 'colormap': 'gray', 'contrast_limits': [-0.5080329775810242, 0.6496055126190186], 'custom_interpolation_kernel_2d': <class 'numpy.ndarray'> (1, 1) float32, 'depiction': 'volume', 'experimental_clipping_planes': [], 'gamma': 1, 'interpolation2d': 'nearest', ...})
102 # Check if more than 2 dimensional and if so error.
103 if data.ndim - int(rgb) > 2:
--> 104 raise ValueError(f'Image must be 2 dimensional, not {data.ndim - int(rgb)} to save as svg')
data = <class 'numpy.ndarray'> (140, 464, 464) float32
rgb = False
int(rgb) = 0
105 else:
106 image = data

ValueError: Image must be 2 dimensional, not 3 to save as svg

Does anyone know how to save 3D stack into tiff format?

best

馃挕 Steps to Reproduce

go to file
click save select layer or select all layer

Does anyone know how to save 3D stack into tiff format?

best

馃挕 Expected Behavior

give me some guidence

馃寧 Environment

linux ubuntu

馃挕 Additional Context

s

@jinxsfe jinxsfe added the bug Something isn't working label Mar 27, 2024
@jinxsfe
Copy link
Author

jinxsfe commented Mar 27, 2024

@jinxsfe
Copy link
Author

jinxsfe commented Mar 27, 2024

image
image
also I tried another way to export file, but also not working

@jinxsfe
Copy link
Author

jinxsfe commented Mar 27, 2024

image
data is 440440140, can not generate 3D image but csv file

@psobolewskiPhD
Copy link
Member

I'm not sure why the default is the svg writer (cc: @DragaDoncila ), but in the Save Selected or Save All dialog (File menu) you should be able to select Save to folder. Here's what it looks like on macOS:
image
You can give a name and napari will create a folder with that name and put your layers inside, e.g.:
image

Hope that helps!

@jinxsfe
Copy link
Author

jinxsfe commented Mar 27, 2024

Hi: appreciate for your help:
my machine is ubuntu, instead of mac OS.
and I try to save those file in my machine
image
image
image
it seems ok for now, but my confusion is that why I can not save points layer as tiff files? actually I want to annotate the data via point but seems only generate CSV files instaead of tiff format.

@jinxsfe
Copy link
Author

jinxsfe commented Mar 27, 2024

image
also my directory can save builtin save format

@Czaki
Copy link
Collaborator

Czaki commented Mar 27, 2024

Tiff is a format for storing n-dimensional arrays, not a list of points.
We currently support saving points to csv.

I do not even have idea how we could store points in tiff file.

@psobolewskiPhD
Copy link
Member

@jinxsfe
I've opened an issue regarding the svg writer:
#6846

Regarding the csv, they container the coordinates of the points--the points data.
(You can do viewer.layers['Points'].data to see it -- where Points is the name of the points layer.)
If you drag and drop the tiff of your image and the Points csv file on napari, you will get the points back.
The actual Points markers (the disc or diamond or whatever) only exists on the GPU. If you want to save that representation you need to use the napari screenshot options (File menu).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants