Sunday 15 June 2014

python - Image Analysis: Finding proteins in an image -



python - Image Analysis: Finding proteins in an image -

i attempting write programme automatically locate protein in image, used differentiate between 2 proteins of different heights present.

the white area on top of background membrane in proteins sit down , white blobs nowadays proteins. proteins have 2 lobes hence appear in pairs (actually 1 protein).

i have been writing script in republic of the fiji islands (jython) seek , locate proteins can work out height local background. far involves applying adaptive histogram equalisation , subtracting background rolling ball of radius 10 pixels. after have been applying kernel of sorts 10 pixels 10 pixels , works out average of 5 centre pixels , divides average of pixels on 4 edges of kernel ratio. if ratio above value candidate.

the output got image apart wrapping , sensitivity (ratio=2.0) issues seems ok. questions are:

is reasonable approach or there improve way of doing this? can suggest way on here? little stuck , not sure how proceed.

code if necessary: http://pastebin.com/d45lnjcu

thanks!

sam

how starting off bit more simple , using harris-point approach , observe local maxima. eg.

import numpy np import image scipy import ndimage import matplotlib.pyplot plt roi = 2.5 peak_threshold = 120 im = image.open('q766c.png'); image = im.copy() size = 2 * roi + 1 image_max = ndimage.maximum_filter(image, size=size, mode='constant') mask = (image == image_max) image *= mask # remove image borders image[:roi] = 0 image[-roi:] = 0 image[:, :roi] = 0 image[:, -roi:] = 0 # find peaks image_t = (image > peak_threshold) * 1 # coordinates of peaks f = np.transpose(image_t.nonzero()) # show img = plt.imshow(np.asarray(im)) plt.plot(f[:, 1], f[:, 0], 'o', markeredgewidth=0.45, markeredgecolor='b', markerfacecolor='none') plt.axis('off') plt.savefig('local_max.png', format='png', bbox_inches='tight') plt.show()

which gives this:

python image-processing imagej

No comments:

Post a Comment