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

s3seg fails on single-channel images #16

Open
ArtemSokolov opened this issue Sep 8, 2022 · 3 comments
Open

s3seg fails on single-channel images #16

ArtemSokolov opened this issue Sep 8, 2022 · 3 comments

Comments

@ArtemSokolov
Copy link
Collaborator

  • Download exemplar-001:
curl -f -o test.ome.tif https://mcmicro.s3.amazonaws.com/ci/exemplar-001-cycle6.ome.tif
  • Cut the image down to the first channel (recyze uses 0-based channel indexing):
nextflow run labsyspharm/mcmicro/roadie.nf --do recyze --in test.ome.tif --channels 0
  • Verify image dimensionality:
$ python -c "import tifffile; print(tifffile.TiffFile('test.ome.tif').series[0].shape)"
(4, 3139, 2511)

$ python -c "import tifffile; print(tifffile.TiffFile('test_crop.ome.tif').series[0].shape)"
(3139, 2511)
  • UnMicst runs fine on the single-channel image:
docker run --rm -v "$PWD":/data labsyspharm/unmicst:2.7.4 python /app/unmicstWrapper.py /data/test_crop.ome.tif --stackOutput --outputPath /data --channel 1
  • However, s3seg fails:
docker run --rm -v "$PWD":/data labsyspharm/s3segmenter:1.3.18 python /app/S3segmenter.py --imagePath /data/test_crop.ome.tif --stackProbPath /data/test_crop_Probabilities_1.tif --probMapChan 1 --outputPath /data

with an out-of-bounds errors:

Traceback (most recent call last):
  File "/app/S3segmenter.py", line 484, in <module>
    tissueCrop =tifffile.imread(imagePath,key=iChan)
  File "/usr/local/lib/python3.8/site-packages/tifffile/tifffile.py", line 800, in imread
    return tif.asarray(**kwargs)
  File "/usr/local/lib/python3.8/site-packages/tifffile/tifffile.py", line 3128, in asarray
    pages = self.pages._getlist(key)
  File "/usr/local/lib/python3.8/site-packages/tifffile/tifffile.py", line 5311, in _getlist
    return [getitem(key)]
  File "/usr/local/lib/python3.8/site-packages/tifffile/tifffile.py", line 5360, in _getitem
    self._seek(key)
  File "/usr/local/lib/python3.8/site-packages/tifffile/tifffile.py", line 5281, in _seek
    raise IndexError('index out of range')
IndexError: index out of range
@AlbertPlaPlanas
Copy link

@ArtemSokolov did you manage to find a solution for this error? We are experiencing the exact same issue.

@clarenceyapp
Copy link
Collaborator

clarenceyapp commented Oct 24, 2023 via email

@ArtemSokolov
Copy link
Collaborator Author

@AlbertPlaPlanas If you are running this through MCMICRO, adding the following to params.yml should address the issue:

options:
  s3seg: --TissueMaskChan 1

@clarenceyapp Would it make sense to make 1 be the default for that argument?

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