Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rigid Registration #27

Open
zhikai-liu opened this issue Oct 10, 2016 · 1 comment
Open

Rigid Registration #27

zhikai-liu opened this issue Oct 10, 2016 · 1 comment

Comments

@zhikai-liu
Copy link

zhikai-liu commented Oct 10, 2016

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?

@zhikai-liu
Copy link
Author

I don't know if this is the right way to do it, but I added using RegisterMismatchCommon at the beginning of RegisterWorkerRigid.jl. It still doesn't work. The error says:

WARNING: incremental output requested, but no modules defined during run
Cache file "/home/zhikai/.julia/lib/v0.4/RegisterMismatchCommon.ji" not found
WARNING: compilecache failed to create a usable precompiled cache file for module RegisterMismatchCommon.
WARNING: eval from module Main to RegisterWorkerRigid:
Expr(:call, Expr(:., :Base, :include_from_node1)::Any, "/home/zhikai/.julia/v0.4/BlockRegistration/src/RegisterMismatchCommon.jl")::Any
** incremental compilation may be broken for this module **

WARNING: requiring "RegisterMismatchCommon" in module "RegisterWorkerRigid" did not define a corresponding module.
WARNING: requiring "RegisterMismatchCommon" in module "Main" did not define a corresponding module.
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

Also, if I just go using RegisterMismatchCommon out of the script. There is a warning.

julia> using RegisterMismatchCommon
WARNING: requiring "RegisterMismatchCommon" in module "Main" did not define a corresponding module.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant