User Tools

Site Tools


Sidebar

Top
Seminar
Courses -2016
Courses 2018-
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

RT @ArkThul: Finally out !! A little chapter : Structure and Fluorescence Intensity Measurements in Biofilms In the book: Computer Optimize…
About 2 days, 3 hours ago by: Kota Miura (@cmci_)

cmci_ avatar

RT @BioImagingUK: @UniofOxford is recruiting a Informatics Scientist/Developer duties will include developing analysis methodologies ba…
About 2 days, 3 hours ago by: Kota Miura (@cmci_)

cmci_ avatar

RT @AJPathology: #Pathology Image Analysis Using Segmentation Deep Learning Algorithms. FREE Review in AJP's newest topic area, #MachineLea…
About 2 days, 14 hours ago by: Kota Miura (@cmci_)

cmci_ avatar

RT @iamkenneyor: IMAGING AFRICA Microscopy and Image Analysis Workshop for African Researchers There is no application or registration fee…
About 2 days, 14 hours ago by: Kota Miura (@cmci_)

cmci_ avatar

RT @leandroscholz: BIAFLOWS: A collaborative framework to benchmark bioimage analysis workflows https://t.co/RqZRffE3PS
About 3 days, 12 hours ago by: Kota Miura (@cmci_)

cmci_ avatar

RT @christlet: 🚨 LUT alert 🌈 Turbo, a new and improved rainbow LUT from @GoogleAI: https://t.co/FPaQ2zZtzE Will get it into NeuroCyto LUTs…
About 4 days, 7 hours ago by: Kota Miura (@cmci_)
blogtng:blogtop
Algorithm FRAP Fiji ImageJ ImageJ Plugin ImageJ Plugin 3Dviewer Imaris Java Javascript Python R added 201904 Freiburg 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)