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

quantification: compatibility for other bioformats image files #234

Closed
clarenceyapp opened this issue Jan 12, 2021 · 1 comment
Closed

Comments

@clarenceyapp
Copy link
Collaborator

clarenceyapp commented Jan 12, 2021

I'm running some images through mcmicro that were stitched on the microscope. They are automatically saved as .btf which is bioformats compatible. Probability maps and segmentation run these fine but cannot be loaded into the quantification module. Can you replace whatever tiff reader you're using to something more versatile?

Error executing process > 'quantification (1)'

Caused by:
  Process `quantification (1)` terminated with an error exit status (1)

Command executed:

  python /app/CommandSingleCellExtraction.py --image unmicst-OP1181_colon_TUNEL_01.btf     --masks 'nucleiMask.tif' --output . --channel_names markers.csv

Command exit status:
  1

Command output:
  {'masks': ['nucleiMask.tif'], 'image': 'unmicst-OP1181_colon_TUNEL_01.btf', 'channel_names': 'markers.csv', 'output': '.'}
  Extracting single-cell data for unmicst-OP1181_colon_TUNEL_01.btf...

Command error:
  INFO:    Could not find any nv files on this host!
  Traceback (most recent call last):
    File "/app/CommandSingleCellExtraction.py", line 11, in <module>
      SingleCellDataExtraction.MultiExtractSingleCells(**args)
    File "/app/SingleCellDataExtraction.py", line 260, in MultiExtractSingleCells
      ExtractSingleCells(masks,image,channel_names,output)
    File "/app/SingleCellDataExtraction.py", line 245, in ExtractSingleCells
      scdata_z = MaskZstack(masks_loaded,image,channel_names_loaded_checked)
    File "/app/SingleCellDataExtraction.py", line 140, in MaskZstack
      image_loaded_z = PrepareData(image,z)
    File "/app/SingleCellDataExtraction.py", line 120, in PrepareData
      return image_loaded_z
  UnboundLocalError: local variable 'image_loaded_z' referenced before assignment

Work dir:
  /n/scratch3/users/c/cy101/work/c0/f09004c1bde75d93c54d9f5e89fe28

Tip: when you have fixed the problem you can continue the execution adding the option `-resume` to the run command line

UPDATE1: I tried loading btf files using skimage.io.imread and the same line from the quantification module locally and it reads in fine. So I'm not sure why it's not working in the quantification module in mcmicro. I'm using scikit-image 0.14.2 and tiffffile 2019.7.26.2.
UPDATE2: I converted the btf to tif in ImageJ and I still get an error (see below).


Error executing process > 'quantification (1)'

Caused by:
  Process `quantification (1)` terminated with an error exit status (1)

Command executed:

  python /app/CommandSingleCellExtraction.py --image unmicst-OP1181_colon_TUNEL_01.tif     --masks 'nucleiMask.tif' --output . --channel_names markers.csv

Command exit status:
  1

Command output:
  {'masks': ['nucleiMask.tif'], 'image': 'unmicst-OP1181_colon_TUNEL_01.tif', 'channel_names': 'markers.csv', 'output': '.'}
  Extracting single-cell data for unmicst-OP1181_colon_TUNEL_01.tif...
  Finished 0
  Finished 1

Command error:
  INFO:    Could not find any nv files on this host!
  TiffPage 0: incorrect StripByteCounts count
  TiffPage 0: incorrect StripOffsets count
  TiffPage 0: incorrect StripByteCounts count
  TiffPage 0: incorrect StripOffsets count
  TiffPage 1: incorrect StripByteCounts count
  TiffPage 1: incorrect StripOffsets count
  TiffPage 0: incorrect StripByteCounts count
  TiffPage 0: incorrect StripOffsets count
  Traceback (most recent call last):
    File "/app/CommandSingleCellExtraction.py", line 11, in <module>
      SingleCellDataExtraction.MultiExtractSingleCells(**args)
    File "/app/SingleCellDataExtraction.py", line 260, in MultiExtractSingleCells
      ExtractSingleCells(masks,image,channel_names,output)
    File "/app/SingleCellDataExtraction.py", line 245, in ExtractSingleCells
      scdata_z = MaskZstack(masks_loaded,image,channel_names_loaded_checked)
    File "/app/SingleCellDataExtraction.py", line 140, in MaskZstack
      image_loaded_z = PrepareData(image,z)
    File "/app/SingleCellDataExtraction.py", line 100, in PrepareData
      image_loaded_z = skimage.io.imread(image,img_num=z,plugin='tifffile')
    File "/usr/local/lib/python3.6/site-packages/skimage/io/_io.py", line 48, in imread
      img = call_plugin('imread', fname, plugin=plugin, **plugin_args)
    File "/usr/local/lib/python3.6/site-packages/skimage/io/manage_plugins.py", line 209, in call_plugin
      return func(*args, **kwargs)
    File "/usr/local/lib/python3.6/site-packages/skimage/io/_plugins/tifffile_plugin.py", line 37, in imread
      return tif.asarray(**kwargs)
    File "/usr/local/lib/python3.6/site-packages/tifffile/tifffile.py", line 2345, in asarray
      pages = self.pages._getlist(key)
    File "/usr/local/lib/python3.6/site-packages/tifffile/tifffile.py", line 3807, in _getlist
      return [getitem(key)]
    File "/usr/local/lib/python3.6/site-packages/tifffile/tifffile.py", line 3855, in _getitem
      self._seek(key)
    File "/usr/local/lib/python3.6/site-packages/tifffile/tifffile.py", line 3777, in _seek
      raise IndexError('index out of range')
  IndexError: index out of range

Work dir:
  /n/scratch3/users/c/cy101/work/3b/8561c1bba60ad9c8f93f77c626ea6a

Tip: view the complete command output by changing to the process work dir and entering the command `cat .command.out`

@DenisSch
Copy link
Collaborator

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

2 participants