HolyLab / BlockRegistrationScheduler.jl

Multi-core image registration scheduler
1 stars 0 forks source link

Warp issue #19

Closed zhikai-liu closed 8 years ago

zhikai-liu commented 8 years ago

Errors when I try to warp the images in writing the .cam file.

ERROR: LoadError: Must have one ϕ per image in checkϕdims at /home/zhikai/.julia/v0.4/BlockRegistration/src/RegisterDeformation.jl:638 in warp! at /home/zhikai/.julia/v0.4/BlockRegistration/src/RegisterDeformation.jl:546 in anonymous at /home/zhikai/julia/image_ZL007R_02.jl:19 in open at iostream.jl:114 in include at ./boot.jl:261 in include_from_node1 at ./loading.jl:304 while loading /home/zhikai/julia/image_ZL007R_02.jl, in expression starting on line 18

Line 18 is open(string(basename, ".cam"), "w") do file warp!(Float32, file, img, ϕs; nworkers=3)

And ϕs is defined by ϕs = medfilt(griddeformations(u, knots), 3)

u and knots are defined by u = load(fileout, "u") roi = load(fileout2, "roi") knots = load(fileout2, "knots")

Cody-G commented 8 years ago

That error means that the number of deformations doesn't match the temporal size of img. Can you show us length(ϕs) and size(img, "t") ?

My guess is that you ran the earlier step of the registration (the one that produced fileout) with a different img.

zhikai-liu commented 8 years ago

Oh, I see. Thanks! I got it. By the way, how can I know which path has the function I want to use in Julia? For example, I find save_header is not defined when I run the script. How can I find the path?

timholy commented 8 years ago

In this case, the fact that it's written ImagineFormat.save_header means that it's in the ImagineFormat.jl package.

But in general, tools like @which foo(x,y) and @edit foo(x,y) are nice ways to discover which function is being used for a task.

zhikai-liu commented 8 years ago

But it seems there is no function called save_header in ImagineFormat I searched the functions following ImagineFormat., there are

BigEndian convert parse_bittypename Endian endian_dict parse_endian LittleEndian eval parse_header Micron field_key_dict parse_quantity _unit_string_dict float64_or_empty parse_quantity_or_empty bitname_dict imagine2nrrd parse_vector_int compound_fields nrrd_endian_dict

timholy commented 8 years ago

Oh, I may not have tagged an official release lately. Try Pkg.checkout("ImagineFormat") to get the very latest. (If you're curious, you can use gitk from within any repository directory to see how the tags line up with official releases.)

Sorry about the confusion.

zhikai-liu commented 8 years ago

I guess that is not the issue It says

INFO: No packages to install, update or remove

zhikai-liu commented 8 years ago

Sorry, I restarted julia and found it.. Thanks!