~ubuntu-branches/ubuntu/trusty/arc-gui-clients/trusty

« back to all changes in this revision

Viewing changes to misc/python_example1/process.py

  • Committer: Package Import Robot
  • Author(s): Mattias Ellert
  • Date: 2013-05-08 22:45:38 UTC
  • mfrom: (1.1.1)
  • Revision ID: package-import@ubuntu.com-20130508224538-7kfhy97fg7ncfck0
Tags: 0.4.3-1
New release

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#!/bin/env python
 
2
 
 
3
import numpy as np
 
4
import scipy
 
5
import pylab
 
6
import pymorph
 
7
import mahotas
 
8
from scipy import ndimage
 
9
 
 
10
dna = mahotas.imread('dna.jpeg')
 
11
 
 
12
dnaf = ndimage.gaussian_filter(dna, 16)
 
13
rmax = pymorph.regmax(dnaf)
 
14
pylab.imshow(pymorph.overlay(dna, rmax))
 
15
seeds,nr_nuclei = ndimage.label(rmax)
 
16
print nr_nuclei
 
17
pylab.show()