wpids = addprocs(8) # use 8 worker processes (no CUDA)
using Images, SIUnits.ShortUnits, FixedSizeArrays, JLD, MAT
using BlockRegistration, BlockRegistrationScheduler
using RegisterWorkerRigid
fn = "Test_Beads_100um_Green_01.imagine"
fx = "Test_Beads_100um_Red_01.imagine"
img0 = load(fn, mode="r")
roi = (:, :, :)
img = subim(img0, roi...) # you could alternatively select a subset of times
fixed0= load(fx,mode="r")
ps = img["pixelspacing"]
sigmahp = Float64[25e-6m/x for x in ps]
sigmalp = [0,0,0] # lowpass filtering is not currently recommended
pp = PreprocessSNF(100, sigmalp, sigmahp)
fixed = copy(pp(fixed0)) # use copy because of julia #14625
λ = 0.01
algorithm = Rigid[Rigid(fixed; pid=wpids[i], correctbias=false) for i = 1:length(wipes)]
mon = monitor(algorithm, ())
basename = splitext(splitdir(fn)[2])[1]
@show basename
fileout = string(basename, ".register")
@time driver(fileout, algorithm, img, mon)
jldopen(fileout, "r+") do io
write(io, "imagefile", fn)
write(io, "roi", roi)
write(io, "fixedidx", fixedidx)
write(io, "knots", knots)
write(io, "sigmalp", sigmalp)
write(io, "sigmahp", sigmahp)
end
Hey,
I was trying to perform rigid registration to correct the mismatch between the Green and Red channels on OCPI2. I modified the algorithm from the "stack-by-stack registration example" in README.md as follows:
The error message:
I think I found the function
mismatch0inRegisterMismatchCommon. Should I add it to the beginning?