pair-was operation on 3D image(3D matrix)
2 ビュー (過去 30 日間)
古いコメントを表示
I have 3D image, in fact it's slices of heart which is a 3D matrix(i.e N=640*640*64). I want to do an operation such as asb(diff) on all two-pixel combinations. it has N*N/2 computation. what is the best way to do it?
the max memory that I can use 100Gb, so the linear long vector computations is not possible.
2 件のコメント
回答 (2 件)
Walter Roberson
2022 年 6 月 22 日
findgroups() on the image. You probably are using uint8 so at most 256 different groups. Record the second output of findgroups() as well -- the unique associated values.
Now,
t = double(unique_values);
unique_diffs = abs(t - t.');
G3d = reshape(Group_IDs, size(YourImage)); %640 x 640 x 64 array of group numbers
At this point, to know what the absolute difference is betweeen YourImage(J1,K1,L1) and YourImage(J2,K2,L2) do
G1 = G3d(J1, K1, L1);
G2 = G3d(J2, K2, L2);
needed_difference = unique_diffs(G1, G2);
That is, all of the unique differences are pre-computed, you look up the indices, and you use the indices to look up the pre-computed results.
But frankly, if you were going to bother with this approach, you might as well just compute the values on the fly.
Walter Roberson
2022 年 6 月 22 日
You need to give up on the algorithm. If you were able to represent the results with one byte each, you would need 343597383680000 bytes of memory (but you need a minimum of 9 bits per entry, not 8 bits). 343597383680000 is more than 2^48 bytes of memory. The maximum amount of memory that can be addressed by any publicly known implementation of the x64 architecture is 2^48 bytes. Therefore your algorithm is requiring that you use an array larger than what can possibly be handled by any x64 architecture computer.
Although x64 is a 64 bit architecture, on all publicly known implementations, only 48 address bits are defined. This is a hard limit -- not only would you have to find all of that memory but you would have to get a custom CPU designed for it, and a custom operating system, and a custom MATLAB to run on that system.
Give up. This is not something you can accomplish.
0 件のコメント
参考
カテゴリ
Help Center および File Exchange で Matrix Indexing についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!