murphygroup / CellSegmentationEvaluator

Evaluating the quality of a cell segmentation method without reference.
MIT License
7 stars 2 forks source link

AttributeError: 'loci.formats.ImageReader' object has no attribute 'pages' #2

Closed smith6jt-cop closed 9 months ago

smith6jt-cop commented 9 months ago

Hello,

I successfully ran the program with the 2D sample data to get an evaluation metric in WSL2, new conda env, python 3.8. I am getting an error with my 2D CODEX images and masks you can find here:

https://drive.google.com/file/d/1gVcyTuSwLg0-bTMXKL3D9fD55AWzoING/view?usp=sharing https://drive.google.com/file/d/1zH_ETFekRvnabLy_ESleKq-QP2QHyKm-/view?usp=sharing

I am using from terminal:

python seg_eval_main.py example_data/imgs/spleen.ome.tiff example_data/masks/stack.ome.tiff

The error I am getting is:

04-Dec-23 16:56:06 - bfio.bfio.BioReader - WARNING - Python backend only works for tiled OME Tiff files with minimum tile size of 1024x1024, switching to bioformats backend. 04-Dec-23 16:56:07 - bfio.bfio.BioReader - WARNING - Python backend only works for tiled OME Tiff files with minimum tile size of 1024x1024, switching to bioformats backend. Traceback (most recent call last): File "seg_eval_main.py", line 28, in seg_metrics = read_and_eval_seg (img_path, mask_path, PCA_model, output_directory) File "/home/smith6jt/CellSegmentationEvaluator/SimpleCSE/read_and_eval_seg.py", line 24, in read_and_eval_seg img["data"] = aimg.get_image_data() File "/home/smith6jt/anaconda3/envs/SegEval/lib/python3.8/site-packages/aicsimageio/aics_image.py", line 711, in get_image_data return self.data File "/home/smith6jt/anaconda3/envs/SegEval/lib/python3.8/site-packages/aicsimageio/aics_image.py", line 529, in data return self.xarray_data.data File "/home/smith6jt/anaconda3/envs/SegEval/lib/python3.8/site-packages/aicsimageio/aics_image.py", line 469, in xarray_data and dimensions.DimensionNames.MosaicTile in self.reader.dims.order File "/home/smith6jt/anaconda3/envs/SegEval/lib/python3.8/site-packages/aicsimageio/readers/reader.py", line 532, in dims self._dims = Dimensions(dims=self.xarray_dask_data.dims, shape=self.shape) File "/home/smith6jt/anaconda3/envs/SegEval/lib/python3.8/site-packages/aicsimageio/readers/reader.py", line 359, in xarray_dask_data self._xarray_dask_data = self._read_delayed() File "/home/smith6jt/anaconda3/envs/SegEval/lib/python3.8/site-packages/aicsimageio/readers/bfio_reader.py", line 208, in _read_delayed self._tiff_tags(), File "/home/smith6jt/anaconda3/envs/SegEval/lib/python3.8/site-packages/aicsimageio/readers/bfio_reader.py", line 218, in _tiff_tags for code, tag in self._rdr._backend._rdr.pages[0].tags.items() AttributeError: 'loci.formats.ImageReader' object has no attribute 'pages'

It would appear that the reason I was able to run the example data, but not my data is because my data requires the use of Bioformats, but when I do

conda install -c bioconda bioformats

I get:

Solving environment: / Found conflicts! Looking for incompatible packages. This can take several minutes. Press CTRL-C to abort. failed

UnsatisfiableError: The following specifications were found to be incompatible with the existing python installation in your environment:

Specifications:

Your python: python==3.8

If python is on the left-most side of the chain, that's the version you've asked for. When python appears to the right, that indicates that the thing on the left is somehow not available for the python version you are constrained to. Note that conda will not change your python version to a different minor version unless you explicitly specify that.

The following specifications were found to be incompatible with your system:

Your installed version is: 2.35

If you have a workaround for the dependencies or perhaps reformatting our images I would appreciate any help.

Thanks,

Justin

smith6jt-cop commented 9 months ago

This was probably a WSL issue and not anything to do with the code. There have been a lot of issues with WSL lately. Updating and upgrading WSL as well as a fresh install of CellSegmentationEvaluator fixed the problem for me.

rfmurphy commented 9 months ago

great, closing issue.