GithubHelp home page GithubHelp logo

som's Introduction

Cell segmentation self-organizing maps

Sort nucleis in H&E slides according to their shapes.

Usage

For testing on the example slide from input directory:

  1. Clone this repository
  2. Install requirements.txt for running example analysis notebook
  3. Run the segsom-example-notebook.ipynb notebook

For running analysis on your own image:

  1. Segment the HE using https://hub.docker.com/r/kidzik/he_cell_seg (or if you have NVIDIA GPU, use a GPU-accelerated version https://hub.docker.com/r/kidzik/he_cell_seg_gpu)
  2. Update file lecation and segmentation mask location in the notebook
  3. Run the segsom-example-notebook.ipynb notebook

Credits

Code in this repository by Edwin Yuan and Magdalena Matusiak.

Cell segmentation scripts and the neural network by Korsuk Sirinukunwattana.

som's People

Contributors

kidzik avatar

Stargazers

 avatar

Watchers

James Cloos avatar  avatar

som's Issues

The example notebook doesn't work. Example two mat files may be corrupted.

I cloned this repository and installed requirement.txt. Then I run segsom-example-notebook.ipynb.
But this error occured.

`
somhandle = SOM()
somhandle.readtrainedSOM('som_models/SOM_v3_12_13/trainedvecs7x7.mat')
somhandle.readPCAcoef('som_models/SOM_v3_12_13/vectors.mat')


ValueError Traceback (most recent call last)
/var/folders/gj/mr_1z3xs3zsgccyc2rllwj240000gn/T/ipykernel_6620/4268023471.py in
1 somhandle = SOM()
----> 2 somhandle.readtrainedSOM('som_models/SOM_v3_12_13/trainedvecs7x7.mat')
3 somhandle.readPCAcoef('som_models/SOM_v3_12_13/vectors.mat')

~/som/modules/SOMclass2.py in readtrainedSOM(self, path)
73 # Input:
74 # - path - path of the trained SOM vectors
---> 75 self.SOMvecs = loadmat(path)['trainedvecs7x7'].T #(1000,49)
76
77 def readPCAcoef(self, path):

~/opt/anaconda3/envs/som/lib/python3.8/site-packages/scipy/io/matlab/mio.py in loadmat(file_name, mdict, appendmat, **kwargs)
221 variable_names = kwargs.pop('variable_names', None)
222 with _open_file_context(file_name, appendmat) as f:
--> 223 MR, _ = mat_reader_factory(f, **kwargs)
224 matfile_dict = MR.get_variables(variable_names)
225

~/opt/anaconda3/envs/som/lib/python3.8/site-packages/scipy/io/matlab/mio.py in mat_reader_factory(file_name, appendmat, **kwargs)
70 """
71 byte_stream, file_opened = _open_file(file_name, appendmat)
---> 72 mjv, mnv = get_matfile_version(byte_stream)
73 if mjv == 0:
74 return MatFile4Reader(byte_stream, **kwargs), file_opened

~/opt/anaconda3/envs/som/lib/python3.8/site-packages/scipy/io/matlab/miobase.py in get_matfile_version(fileobj)
229 if maj_val in (1, 2):
230 return ret
--> 231 raise ValueError('Unknown mat file type, version %s, %s' % ret)
232
233

ValueError: Unknown mat file type, version 51, 55
`

And I run this code to check whether these mat files are corrupted.

`
import scipy.io
scipy.io.loadmat('som_models/SOM_v3_12_13/trainedvecs7x7.mat')


ValueError Traceback (most recent call last)
/var/folders/gj/mr_1z3xs3zsgccyc2rllwj240000gn/T/ipykernel_6620/3498248664.py in
1 import scipy.io
----> 2 scipy.io.loadmat('som_models/SOM_v3_12_13/trainedvecs7x7.mat')

~/opt/anaconda3/envs/som/lib/python3.8/site-packages/scipy/io/matlab/mio.py in loadmat(file_name, mdict, appendmat, **kwargs)
221 3.14159265+3.14159265j])
222 """
--> 223 variable_names = kwargs.pop('variable_names', None)
224 with _open_file_context(file_name, appendmat) as f:
225 MR, _ = mat_reader_factory(f, **kwargs)

~/opt/anaconda3/envs/som/lib/python3.8/site-packages/scipy/io/matlab/mio.py in mat_reader_factory(file_name, appendmat, **kwargs)
70 Whether the file was opened by this routine.
71
---> 72 """
73 byte_stream, file_opened = _open_file(file_name, appendmat)
74 mjv, mnv = get_matfile_version(byte_stream)

~/opt/anaconda3/envs/som/lib/python3.8/site-packages/scipy/io/matlab/miobase.py in get_matfile_version(fileobj)
229 if maj_val in (1, 2):
230 return ret
--> 231 raise ValueError('Unknown mat file type, version %s, %s' % ret)
232
233

ValueError: Unknown mat file type, version 51, 55
`

Thank you.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.