I want to make you aware of a bug I ran into in a python script that I wrote to re-scale all my images. In the following code the multiplication commanded by the IJ.run command does not occur.
Max = imp.getStatistics().max IJ.run(imp, "Divide...", "value="+str(Max)) IJ.run(imp, "Multiply...", "value = 65535")
User Iarganda suggested to me the following code as an alternative solution, this works:
# read processor (only works for 2D) ip = imp.getProcessor(); # divide by maximum value ip.multiply( 1.0/Max ) ip.resetMinAndMax() # multiply by new maximum ip.multiply( 65535 ) ip.resetMinAndMax()
Thanks to Iarganda for the help!