Login  Register

8-bit vs 16-bit ip.set() and ip.get() speed

Posted by Michael Doube on Dec 03, 2009; 1:27pm
URL: http://imagej.273.s1.nabble.com/8-bit-vs-16-bit-ip-set-and-ip-get-speed-tp3690234.html

Dear all

I've rewritten an old plugin that finds the principal axes of a stack
and creates an aligned copy of the stack, so that it can handle more
than just 16-bit images.

To do that, I use

targetIP.set(x, y, sourceStack.getProcessor(zA).get(xA,yA));

But this seems to be much slower on 8-bit images than 16-bit images.
For a test 256 x 256 x 256 stack, the 16-bit image processes in 6
seconds, while the 8-bit image takes close to 2.5 minutes.

Is there a neat trick I can use to make my 8-bit images process as fast
as my 16-bit images?  The code is at:

http://github.com/mdoube/BoneJ/blob/master/src/Moments_3D.java

in alignToPrincipalAxes()

Cheers,

Michael