murphygroup / CellSegmentationEvaluator

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

Example data and jupyter notebook #12

Open smith6jt-cop opened 7 months ago

smith6jt-cop commented 7 months ago

Running jupyter notebook exactly as is:

UnsupportedFileFormatError Traceback (most recent call last) Cell In[7], line 11 7 PCA_model = [] 8 # or give a specific model 9 #PCA_model = pickle.load( open( "2D_PCA_model.pickle", "rb" )) ---> 11 seg_metrics_2D = read_and_eval_seg(img_path, mask_path, PCA_model, output_directory) 13 print(seg_metrics_2D)

File ~/CSE/SimpleCSE/read_and_eval_seg.py:20, in read_and_eval_seg(img_path, mask_path, PCA_model, output_directory) 17 def read_and_eval_seg(img_path, mask_path, PCA_model, output_directory): 19 print('CellSegmentationEvaluator (SimpleCSE) v1.4') ---> 20 aimg = AICSImage(img_path) 21 img = {} 22 iheadtail = split(img_path)

File ~/anaconda3/envs/SegEval/lib/python3.10/site-packages/aicsimageio/aics_image.py:277, in AICSImage.init(self, image, reader, reconstruct_mosaic, fs_kwargs, kwargs) 267 def init( 268 self, 269 image: types.ImageLike, (...) 273 kwargs: Any, 274 ): 275 if reader is None: 276 # Determine reader class and create dask delayed array --> 277 ReaderClass = self.determine_reader(image, fs_kwargs=fs_kwargs, **kwargs) 278 else: 279 # Init reader 280 ReaderClass = reader

File ~/anaconda3/envs/SegEval/lib/python3.10/site-packages/aicsimageio/aics_image.py:250, in AICSImage.determine_reader(image, fs_kwargs, **kwargs) 231 raise exceptions.UnsupportedFileFormatError( 232 "AICSImage", 233 path, (...) 247 ), 248 ) 249 else: --> 250 raise exceptions.UnsupportedFileFormatError( 251 "AICSImage", 252 path, 253 ) 255 # If we haven't hit anything yet, we likely don't support this file / object 256 image_type = str(type(image))

UnsupportedFileFormatError: AICSImage does not support the image: '/home/smith6jt/CSE/SimpleCSE/example_data/imgs/2D_CODEX.ome.tiff'.

smith6jt-cop commented 7 months ago

Example data clones and downloads as 1kb file. Is necessary to manually download each example file.

smith6jt-cop commented 7 months ago

Running example data gives:

CellSegmentationEvaluator (SimpleCSE) v1.4 Calculating evaluation metrics v1.5 for 2D_CODEX.ome.tiff 1704 cells repaired out of 2657 Assuming OME pixel sizes are in microns...


FileNotFoundError Traceback (most recent call last) Cell In[4], line 11 7 PCA_model = [] 8 # or give a specific model 9 #PCA_model = pickle.load( open( "2D_PCA_model.pickle", "rb" )) ---> 11 seg_metrics_2D = read_and_eval_seg(img_path, mask_path, PCA_model, output_directory) 13 print(seg_metrics_2D)

File ~/CSE/SimpleCSE/read_and_eval_seg.py:70, in read_and_eval_seg(img_path, mask_path, PCA_model, output_directory) 67 #print(seg_metrics) 69 struct = {"Segmentation Evaluation Metrics v1.5": seg_metrics} ---> 70 with open( 71 output_directory / (img["name"] + "-seg_eval.json"), "w" 72 ) as json_file: 73 json.dump(struct, json_file, indent=4, sort_keys=True, cls=NumpyEncoder) 75 return seg_metrics

FileNotFoundError: [Errno 2] No such file or directory: 'results/2D_CODEX.ome.tiff-seg_eval.json'

smith6jt-cop commented 7 months ago

manually add results folder and program finishes