kreshuklab / plant-seg

A tool for cell instance aware segmentation in densely packed 3D volumetric images
https://kreshuklab.github.io/plant-seg/
MIT License
96 stars 31 forks source link

Run plant-seg GUI and set either "Save Raw Data" on causes error #108

Closed qin-yu closed 8 months ago

qin-yu commented 2 years ago

Default configs with patch 80x150x150 and 3D GASP

Error

2022-02-01 17:08:40,882 [ThreadPoolExecutor-0_0] INFO PlantSeg - Executing pipeline step: 'segmentation_postprocessing'. Parameters: '{'factor': [1.0, 1.0, 1.0], 'order': 0, 'save_raw': True, 'state': True, 'tiff': True}'. Files ['/g/kreshuk/yu/Datasets/YWang2021Embryo/test/HisRFP_GFPcaax_z80_02_02_membrane/PreProcessing/generic_confocal_3d_unet/GASP/HisRFP_GFPcaax_z80_02_02_membrane_t000_predictions_gasp_average.h5'].
2022-02-01 17:08:40,882 [ThreadPoolExecutor-0_0] INFO PlantSeg - Loading stack from /g/kreshuk/yu/Datasets/YWang2021Embryo/test/HisRFP_GFPcaax_z80_02_02_membrane/PreProcessing/generic_confocal_3d_unet/GASP/HisRFP_GFPcaax_z80_02_02_membrane_t000_predictions_gasp_average.h5
2022-02-01 17:08:40,887 [ThreadPoolExecutor-0_0] INFO PlantSeg - Found 'segmentation' dataset inside /g/kreshuk/yu/Datasets/YWang2021Embryo/test/HisRFP_GFPcaax_z80_02_02_membrane/PreProcessing/generic_confocal_3d_unet/GASP/HisRFP_GFPcaax_z80_02_02_membrane_t000_predictions_gasp_average.h5
2022-02-01 17:08:40,956 [ThreadPoolExecutor-0_0] INFO PlantSeg - Postprocessing files...
2022-02-01 17:08:40,956 [ThreadPoolExecutor-0_0] INFO PlantSeg - Saving results in /g/kreshuk/yu/Datasets/YWang2021Embryo/test/HisRFP_GFPcaax_z80_02_02_membrane/PreProcessing/generic_confocal_3d_unet/GASP/PostProcessing/HisRFP_GFPcaax_z80_02_02_membrane_t000_predictions_gasp_average.tiff
2022-02-01 17:08:41,176 [ThreadPoolExecutor-0_0] ERROR PlantSeg - Unable to open file (file signature not found)
Traceback (most recent call last):
  File "/g/kreshuk/yu/miniconda3/envs/plantseg/lib/python3.7/site-packages/plantseg/pipeline/executor.py", line 41, in _done_callback
    f.result()
  File "/g/kreshuk/yu/miniconda3/envs/plantseg/lib/python3.7/concurrent/futures/_base.py", line 428, in result
    return self.__get_result()
  File "/g/kreshuk/yu/miniconda3/envs/plantseg/lib/python3.7/concurrent/futures/_base.py", line 384, in __get_result
    raise self._exception
  File "/g/kreshuk/yu/miniconda3/envs/plantseg/lib/python3.7/concurrent/futures/thread.py", line 57, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/g/kreshuk/yu/miniconda3/envs/plantseg/lib/python3.7/site-packages/plantseg/pipeline/raw2seg.py", line 85, in raw2seg
    output_paths = pipeline_step()
  File "/g/kreshuk/yu/miniconda3/envs/plantseg/lib/python3.7/site-packages/plantseg/pipeline/steps.py", line 55, in __call__
    return [self.read_process_write(input_path) for input_path in self.input_paths]
  File "/g/kreshuk/yu/miniconda3/envs/plantseg/lib/python3.7/site-packages/plantseg/pipeline/steps.py", line 55, in <listcomp>
    return [self.read_process_write(input_path) for input_path in self.input_paths]
  File "/g/kreshuk/yu/miniconda3/envs/plantseg/lib/python3.7/site-packages/plantseg/pipeline/steps.py", line 83, in read_process_write
    self.save_raw_dataset(input_path, output_path, voxel_size)
  File "/g/kreshuk/yu/miniconda3/envs/plantseg/lib/python3.7/site-packages/plantseg/pipeline/steps.py", line 138, in save_raw_dataset
    with h5py.File(output_path, 'r+') as f:
  File "/g/kreshuk/yu/miniconda3/envs/plantseg/lib/python3.7/site-packages/h5py/_hl/files.py", line 445, in __init__
    swmr=swmr)
  File "/g/kreshuk/yu/miniconda3/envs/plantseg/lib/python3.7/site-packages/h5py/_hl/files.py", line 197, in make_fid
    fid = h5f.open(name, h5f.ACC_RDWR, fapl=fapl)
  File "h5py/_objects.pyx", line 54, in h5py._objects.with_phil.wrapper
  File "h5py/_objects.pyx", line 55, in h5py._objects.with_phil.wrapper
  File "h5py/h5f.pyx", line 96, in h5py.h5f.open
OSError: Unable to open file (file signature not found)
lorenzocerrone commented 2 years ago

Hi Qin!

So I checked the code and the save raw data option only works for h5 files, so the quick solution would be to use h5. I can fix this but I need to finish some other stuff first

Cheers, Lorenzo

qin-yu commented 8 months ago

I think things have changed after 2 years? Maybe we close it if this issue is no longer valid.