Effacer les filtres
Effacer les filtres

limiting broadcast variable in a 3d block processing program

1 vue (au cours des 30 derniers jours)
tiwwexx
tiwwexx le 4 Oct 2022
Rouvert : tiwwexx le 8 Mar 2024
I have some 3D or 4D arrays that I want to run a block processing on. To do this I create a cell object that I can call that returns matricies of position values.
For example, ind_object{1} = [1 2 3 ; 1 2 3; 1 2 3].
I then call this index object in a parfor loop to pull out blocks of my image (sz_block(n) is the size of the block, on this example [3,3,3])
parfor n=1:numel(index_object)
block_im = pad_im(index_object{n}(1,1:sz_block(1)),index_object{n}(2,1:sz_block(2)),index_object{n}(3,1:sz_block(3)),:);
out(n) = run_some_function(block_im);
end
The problem with this is that my "pad_im" array ends up being a broadcast variable and it's rather large 512x512x300 so the memory swapping really slows down the calculation.
Does anyone have a reccomendation to get rid of the broadcasting of the pad_im array?
Or does anyone know how other programs (like C/C++ or python) do n-dimensional block processing?
Thanks for the info!

Réponses (0)

Catégories

En savoir plus sur Startup and Shutdown dans Help Center et File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by