User Tools

Site Tools


Downloads (-2016)
Downloads (2016-)
RSS aggregates

EMBL BioImage Data Analysis



—- Contact
CMCI Alumni
EMBL Heidelberg
EMBL Intranet

Popularity Ranking

Timeline of @cmci_

cmci_ avatar

RT @jytinevez: LimeSeg on bioRXiv: LimeSeg: A coarsed-grained lipid membrane simulation for 3D image segmentation
About 9 hours, 27 mins ago by: Kota Miura (@cmci_)

cmci_ avatar

Impressive and swift moderation @helenajambor !
About 2 days, 14 hours ago by: Kota Miura (@cmci_)

cmci_ avatar

RT @LuisDVerde: Now available as a #ggplot2 geom thanks to @naupakaz
About 2 days, 14 hours ago by: Kota Miura (@cmci_)

cmci_ avatar

RT @helenajambor: awesome, within 2 days .@naupakaz made a code publicly available for anyone wanting to make the half-and-half-plot FYI @…
About 2 days, 14 hours ago by: Kota Miura (@cmci_)

cmci_ avatar

RT @dgaboriau: Thread on data visualisation: ggplots, boxplots and violin plots
About 2 days, 20 hours ago by: Kota Miura (@cmci_)

cmci_ avatar

RT @christlet: SUSHI from Valentin Nāgerl lab allows super-resolution microscopy of neuronal morphology by STED imaging of extracellular sp…
About 2 days, 23 hours ago by: Kota Miura (@cmci_)
Algorithm FRAP Fiji ImageJ ImageJ Plugin ImageJ Plugin 3Dviewer Imaris Java Javascript Python R bias blog dokuwiki fiji google imagej java libraries matlab meetings neubias news papers python references software webadmin

CMCI weblog

ImgLib2, first test

I pretty much enjoyed ImageJ User and Developer conference 2012 in Luxemburg. Interesting people from different areas in science, very exciting to see how people are doing image processing and analysis. Some of live notes could be found in my time line. One of the great contribution for the third day was Bene Schmidt's work intseg_3D, combining user clicking and active contour fitting in 3D.

One of the core topic there was ImgLib2, the generic image typ behind ImageJ2. After coming back home, I tested ImgLib2 with the Jython code below.

Results were: Started at Sun Oct 28 16:41:57 CET 2012

  • ImgLib2 cursor 333 millisec
  • ImgLib2 for : 138 millisec
  • ImagePlus 152 millisec
  • ImageProcessor 114 millisec
  • Pixel Array 59 millisec

for loop using Img iterator is a bit faster than going through ImagePlus using classic nested for-loop. Even with the classic nested for-loop, using ImageProcessor was a bit faster than Img. The fastest is of course accessing pixels via pixel array. I only did this via ImagePlus, but there should be also some methods to extract an array from Img, which I did not test.

Addendum: See also proper benchmark in the following link in ImageJ2 site:

Thanks to Albert Cardona for commenting on this.

# first trial with ImageLib2
# iterations

from net.imglib2.img import ImagePlusAdapter

imp = IJ.openImage("")
img = ImagePlusAdapter.wrapReal(imp)

# accessing via ImagePlus
t3 = System.currentTimeMillis()
for i in range(imp.getHeight()):
	for j in range(imp.getWidth()):
#		print imp.getPixel(j, i)[0]
		imp.getPixel(j, i)[0]
t4 = System.currentTimeMillis()

# accessing via ImageProcessor
t5 = System.currentTimeMillis()
ip = imp.getProcessor()
for i in range(imp.getHeight()):
	for j in range(imp.getWidth()):
#		print ip.getPixelValue(j, i)
		ip.getPixelValue(j, i)
t6 = System.currentTimeMillis()

# ImgLib2 cursor
t1 = System.currentTimeMillis()
cursor = img.cursor()
while cursor.hasNext():
#	print cursor.get()

t2 = System.currentTimeMillis()

t7 = System.currentTimeMillis()
for t in img:
#	print t.get()

t8 = System.currentTimeMillis()

# pixel array
t9 = System.currentTimeMillis()
pix = imp.getProcessor().getPixels()
for i in pix:
	i = i
#	print i

t10 = System.currentTimeMillis()	

print 'ImgLib2 cursor',(t2-t1), 'millisec'
print 'ImgLib2 for : ',(t8-t7), 'millisec'
print 'ImagePlus',(t4-t3), 'millisec'
print 'ImageProcessor',(t6-t5), 'millisec'
print 'Pixel Array',(t10-t9), 'millisec'

entry generator

Weblog Archive

blogtng/blogtop.txt · Last modified: 2016/05/24 05:46 (external edit)