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’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Show only one channel when opening with Photoshop #21

Open
tlxfif opened this issue Aug 16, 2023 · 3 comments
Open

Show only one channel when opening with Photoshop #21

tlxfif opened this issue Aug 16, 2023 · 3 comments

Comments

@tlxfif
Copy link

tlxfif commented Aug 16, 2023

import numpy as np
from xtiff import to_tiff
def test_to_tiff(tmp_path):
    path = tmp_path + "test.ome.tiff"
    num_channels = 10
    img = np.zeros((1, 1, num_channels, 200, 200, 1))
    channel_names = [f"Channel {i + 1}" for i in range(num_channels)]
    print(channel_names)
    to_tiff(
        img,
        path,
        image_name="test.ome.tiff",
        channel_names=channel_names,
        pixel_size=1.0,
        pixel_depth=2.0,
    )
test_to_tiff("./")
@nilseling
Copy link

There's little info given to this issue. Are you trying to open a multichannel image with Photoshop? What if you use FIJI?

@tlxfif
Copy link
Author

tlxfif commented Aug 17, 2023

There's little info given to this issue. Are you trying to open a multichannel image with Photoshop? What if you use FIJI?

Yes, I need to open it in photoshop, and I need to display the custom channel name in photoshop, but I have tried tifffile, but I don’t understand, thank you for your suggestion, I will try it, thank you very much

@YammyHuang
Copy link

sorry~,I try to use this code to rename the channel names of my OME-TIFF file,however I found it add another axis which let my OME-TIFF cannot show up correctly.The shape of my original OME-TIFF is [1,1,5,7785,9289],however,after

import os
import numpy as np
from xtiff import to_tiff
labs = [
    'FoxP3',
    'Tryptase',
    'GZMB',
    'Ki67',
    'CollagenI'
]
def test_to_tiff(input_image_path, output_image_path):
    num_channels = 5
    img = np.zeros((1, 1, num_channels, 7785, 9279))
    channel_names = labs
    to_tiff(
        img,
        output_image_path,
        image_name=os.path.basename(output_image_path),
        channel_names=channel_names,
    )

input_image_path = "E:/tmp/DEMO/channel test.ome.tiff"
output_image_path = "E:/tmp/DEMO/channel test2.ome.tiff"
test_to_tiff(input_image_path, output_image_path)

file changed into[1,1,5,7785,9279,3] I don't know how to correct this, can you help me please.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants