f = system.file( "extdata", "SampleFISHgray.jpg", package="FISHalyseR")
img = readImage(f)
t = calculateThreshold(img)
##Threshold image using the value computed via Otsu's method
img[img<t] <- 0
img[img>=t] <- 1
Run the code above in your browser using DataLab