User Tools

Site Tools


Sidebar

Top
Seminar
Courses
Textbooks
Documents
Downloads (-2016)
Downloads (2016-)
Weblog
RSS aggregates
Discussions
Archives


EMBL BioImage Data Analysis

EuBIAS

NEUBIAS

—- Contact
CMCI Alumni
ALMF
EMBL Heidelberg
EMBL Intranet


Popularity Ranking


Timeline of @cmci_

cmci_ avatar

Anna getting ready for her talk @NEUBIAS_COST workshop starting in 3 min. https://t.co/Dl9ZI0NKDs
About 7 hours, 17 mins ago by: Kota Miura (@cmci_)

cmci_ avatar

RT @MIAP_Freiburg: @MIAP_Freiburg @UniFreiburg will host another basic Fiji @FijiSc/#ImageJ workshop on November 14th-15th 2018 with Kota M…
About 7 hours, 18 mins ago by: Kota Miura (@cmci_)

cmci_ avatar

RT @haesleinhuepf: Let's measure with @laure_plantard and #ImageJ at #NEUBIAS #TS8 🤘 https://t.co/oVpyDWP3HT
About 1 day, 1 hour ago by: Kota Miura (@cmci_)

cmci_ avatar

RT @haesleinhuepf: Tracking cells on steroids: @jytinevez introducing #Mamut just next door #NEUBIAS #TS9 https://t.co/cKYq55i2JU
About 1 day, 1 hour ago by: Kota Miura (@cmci_)

cmci_ avatar

RT @haesleinhuepf: Anna Klemm from @scilifelab lifting us to the next level: tracking objects #NEUBIAS #TS8 https://t.co/FSkyLXilAO
About 1 day, 1 hour ago by: Kota Miura (@cmci_)

cmci_ avatar

RT @dn_mason: Check out our latest @biorxivpreprint (/w @Rosalierrr @ViolaineSee, @raphavisses & Rachel Bearon)! A workflow for imaging, tr…
About 1 day, 4 hours ago by: Kota Miura (@cmci_)
blogtng:blogtop
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 testImgLib2.py 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:

http://developer.imagej.net/imglib-benchmarks

Thanks to Albert Cardona for commenting on this.

# first trial with ImageLib2
# iterations

from net.imglib2.img import ImagePlusAdapter

imp = IJ.openImage("http://imagej.nih.gov/ij/images/blobs.gif")
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()
cursor.fwd()
while cursor.hasNext():
	cursor.next()
#	print cursor.get()
	cursor.get()

t2 = System.currentTimeMillis()

t7 = System.currentTimeMillis()
for t in img:
#	print t.get()
	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)