Skip to content
This repository has been archived by the owner. It is now read-only.

Matlab's median function slow for big 3D stacks #1

Open
MPIBR-tushevg opened this issue Jun 20, 2017 · 0 comments
Open

Matlab's median function slow for big 3D stacks #1

MPIBR-tushevg opened this issue Jun 20, 2017 · 0 comments

Comments

@MPIBR-tushevg
Copy link
Collaborator

one can use a O(n) selection algorithm from:
https://de.mathworks.com/matlabcentral/fileexchange/29453-nth-element
to calculate median of a 3D image matrix in the following way

[h, w, z] = size(img);
tmp = reshape(img, h * w, z);
tmp = tmp';
tmp = fast_median(tmp);
med = reshape(tmp, h, w);

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

No branches or pull requests

1 participant