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

bug in GetRandFrames() due to reshape() #166

Open
MikaDia opened this issue Mar 18, 2019 · 7 comments
Open

bug in GetRandFrames() due to reshape() #166

MikaDia opened this issue Mar 18, 2019 · 7 comments

Comments

@MikaDia
Copy link

MikaDia commented Mar 18, 2019

Hi guys!

In lines 65 and 109 you reshape the data from a 3-dimensional array into a 4-dimensional array with dimensions: [Ly, Lx, nPlanes, nFrames]. Hence, the code crashes if the length of the 3rd dimension is not divisible by nplanes. For example, say you have a tiff file with 2000 frames and you want to sample from 7 planes.

@carsen-stringer
Copy link
Collaborator

Do you have target frame non-empty? I can see how that block could error (line 65 if min(ops.NimgFirstRegistration, numFrnplanesnchannels) is the ops.NimgFirstRegistration).

However, in the else statement (line 102), tiffs that don't have enough frames should be skipped. And if it has enough frames then nchannels*nplanes*nfmax should be divisible by nplanes correct? What are the ichanset values that you're getting? are those divisible by nplanes?

@MikaDia
Copy link
Author

MikaDia commented Mar 18, 2019 via email

@carsen-stringer
Copy link
Collaborator

ah okay, is numFr an integer? The line to check and change is 54. numFrnchannelsnplanes should be an integer and also less than the number of frames in your tiff.

@carsen-stringer
Copy link
Collaborator

sorry github changed formatting
numFr*nchannels*nplanes
should be an integer

@MikaDia
Copy link
Author

MikaDia commented Mar 18, 2019 via email

@carsen-stringer
Copy link
Collaborator

also if you figure out a fix can you please test it and then make a pull request with the fix :)

@MikaDia
Copy link
Author

MikaDia commented Mar 18, 2019 via email

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

2 participants