User Tools

Site Tools


Courses 2018
Downloads (-2016)
Downloads (2016-)
RSS aggregates

EMBL BioImage Data Analysis



—- Contact
CMCI Alumni
EMBL Heidelberg
EMBL Intranet

Popularity Ranking

Timeline of @cmci_

cmci_ avatar

clij moved to a new house
About 3 hours, 42 mins ago by: Kota Miura (@cmci_)

cmci_ avatar

RT @regagino: My postdoc work with Sarah Woolner's lab @FBMH_UoM is out @CellReports! Decoupling the Roles of Cell Shape and Mechanical St…
About 19 hours, 3 mins ago by: Kota Miura (@cmci_)

cmci_ avatar

RT @sbarolo: #WomeninSTEM get a lot of “Reply Guys” who repeat the same unhelpful comments. @shrewshrew and I (a woman & a man in science)…
About 19 hours, 5 mins ago by: Kota Miura (@cmci_)

cmci_ avatar

RT @cohenlaboratory: Female with microscope? Add yourself to the list!
About 1 day, 18 hours ago by: Kota Miura (@cmci_)

cmci_ avatar

RT @Dr_Fluo: The mesmerizing real-time shuttling of protoplasm within the plasmodial syncitium of the #Physarum #SlimeMold. Scarily dynamic…
About 1 day, 22 hours ago by: Kota Miura (@cmci_)

cmci_ avatar

I did the same on Sunday hearing the news. Many of the monologues of the people were a bit remote to me when I was…
About 1 day, 22 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)