Skip to content

Rigid Registration #27

@zhikai-liu

Description

@zhikai-liu

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:

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

The error message:

basename = "Test_Beads_100um_Green_01"
From worker 2: Worker 2 is working on 1
ERROR: LoadError: On worker 2:
UndefVarError: mismatch0 not defined
in anonymous at /home/zhikai/.julia/v0.4/BlockRegistrationScheduler/src/RegisterWorkerRigid.jl:50
in map at abstractarray.jl:1305
in worker at /home/zhikai/.julia/v0.4/BlockRegistrationScheduler/src/RegisterWorkerRigid.jl:51
in worker at /home/zhikai/.julia/v0.4/BlockRegistrationScheduler/src/RegisterWorkerShell.jl:148
in anonymous at multi.jl:923
in run_work_thunk at multi.jl:661
[inlined code] from multi.jl:923
in anonymous at task.jl:63
in remotecall_fetch at multi.jl:747
[inlined code] from /home/zhikai/.julia/v0.4/BlockRegistrationScheduler/src/RegisterDriver.jl:85
in anonymous at task.jl:447
while loading /mnt/zhikai_003/20160923/registration_01.jl, in expression starting on line 155

I think I found the function mismatch0 in RegisterMismatchCommon. Should I add it to the beginning?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions