Open roshankern opened 2 years ago
thanks for opening this issue @roshankern ! Indeed, this file format has given us some trouble!
@bethac07 - would you know who can help us track this down? Would it be helpful for Roshan to attach the example file (test.ch5
) to this issue?
🤞 this is a simple fix!
@gwaygenomics @roshankern a test file would indeed be great. I also hope it's a simple fix but I can't promise that it is so.
Thank you for the help @bethac07! The test file is located here.
It seems the cd5 file can be manipulated in python after being opened with the pyimagej library. The code posted below saves the first frame of the .cd5 file in frame_1
. Is there any reason why opening through the pyimagej library would be worse than opening with python-bioformats?
from PIL import Image import matplotlib.pyplot as plt import numpy as np
Create an ImageJ2 gateway with the newest available version of ImageJ2.
import imagej ij = imagej.init('/home/roshankern/Desktop/Fiji.app')
Load an image.
path = '/home/roshankern/Desktop/NucleusMorphology/phenotypic_profiling/downloading/test.ch5' jimage = ij.io().open(path)
Convert the image from ImageJ2 to xarray
image = ij.py.from_java(jimage) frame_1 = Image.fromarray(image.values[0, :, :, 0])
There is no reason I can think of that it would be inherently worse; in terms of "how long does it take to open X image", I definitely haven't benchmarked it, but I have no reason to believe that they're substantially different and in terms of "days on the calendar until someone can be guaranteed to have it working", probably makes sense to do what's working right now
Sounds good, thank you for your help!
If it's ok, I'd like to keep this open to eventually be able to address the issue of opening it with p-b
Of course!
I am trying to analyze a .ch5 (CellH5) file in python. This file opens fine in ImageJ with the Bio Formats plugin, but python-bioformats throws an error when calling
bioformats.ImageReader(file.ch5)
. How can I resolve this error, or is there a better way to analyze .ch5 files with python? The output of the code is below. Thanks!CC @gwaygenomics to keep you in the loop