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

Registration error for certain image sizes #38

Closed
swift505 opened this issue Jan 6, 2017 · 11 comments
Closed

Registration error for certain image sizes #38

swift505 opened this issue Jan 6, 2017 · 11 comments

Comments

@swift505
Copy link

swift505 commented Jan 6, 2017

Hi,

I'm getting errors during registration for certain values of image size. I therefore ran some tests, trying to register the same movie after cropping to different sizes.

My movie is 1024x1024 pixels x 881 frames. This works fine, and also registers if I crop to 767x768 or 512x512 pixels. However, 1023x1023 and 767x767 cause crashes as per below:


ERROR with 1023x1023 (x881 frames) and with 767x767 (x881 frames)::

running rigid registration
Error using .*
Array dimensions must match for binary
array op.

Error in BiDiPhaseOffsets (line 18)
cc = ifft(d1 .* d2,[],2);

Error in reg2P (line 44)
BiDiPhase = BiDiPhaseOffsets(IMG);


@marius10p
Copy link
Collaborator

Seems like this has to do with BiDiPhaseOffsets. Any ideas @carsen-stringer ?

@carsen-stringer
Copy link
Collaborator

ah yes sorry this was only working for frames with even pixels! try now

@swift505
Copy link
Author

swift505 commented Jan 9, 2017

Hi @carsen-stringer
I now no longer get the error messages, but the registered TIFFs show a strange 'scrolling' artefact where the image appears to translate vertically by approximately 1 row per frame. This only occurs for odd numbers of pixels.
768x768 works fine -0.2 0 0 0.1
1024x1024 works fine -0.2 0 0 0
767x767 scrolling effect -0.2 0 0 0.1
1023x1023 scrolling effect -0.2 0 0 0

@carsen-stringer
Copy link
Collaborator

Are they giving different bidiphase offsets depending on the number of pixels? Or is the bidiphase offset the same for both?

@swift505
Copy link
Author

swift505 commented Jan 9, 2017

Hi @carsen-stringer,
In all cases bidir offset = 0.

  • Isaac

@carsen-stringer
Copy link
Collaborator

that's strange, now it should avoid any pixel shifts if bidiphase=0. let me know if it works.

@swift505
Copy link
Author

swift505 commented Jan 9, 2017

Hi @carsen-stringer ,

I'm afraid the 'scrolling' problem still seems to persist. Also, if this helps diagnose the problem, as well as translating vertically 1 row per frame, the registered movie also appears to have jumped horizontally (by about 80 pixels). As usual, this did not happen with a 768x768 version of the same data.

My settings in master_file for registration are:
% registration options
ops0.doRegistration = 1; % skip (0) if data is already registered
ops0.showTargetRegistration = 1; % shows the image targets for all planes to be registered
ops0.PhaseCorrelation = 1; % set to 0 for non-whitened cross-correlation
ops0.SubPixel = Inf; % 2 is alignment by 0.5 pixel, Inf is the exact number from phase correlation
ops0.NimgFirstRegistration = 100; % was 500, number of images to include in the first registration pass
ops0.nimgbegend = 100; % was 250, frames to average at beginning and end of blocks
ops0.nonrigid = 0; % IHB added

The dataset I just tested that failed is 767x767 pixels, x 881 frames, 16-bit TIF.
The programme reported:


running rigid registration
bi-directional scanning offset = 0 pixels
Set 1, tiff 1 done in time 50.96
-0.2000 0 0 0.1000


  • Isaac

@carsen-stringer
Copy link
Collaborator

What are your ops.Ly and ops.Lx? Are they 767?

@swift505
Copy link
Author

@carsen-stringer
ops1.Lx and ops1.Ly are 767, yes.
(The command I'm running is ops1 = reg2P(ops);
ops itself doesn't seem to have an Lx/Ly field so I assume these are added by the registration function.)

@carsen-stringer
Copy link
Collaborator

Can you host this tiff on dropbox or google drive and share it with me (carsen.stringer@gmail.com)? Sorry I don't know where the script is failing

@carsen-stringer
Copy link
Collaborator

the error could not be replicated

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

3 participants