How to calculate 3d patch from 3d data which have 512 clices?
조회 수: 1 (최근 30일)
이전 댓글 표시
Hello I have a problem to calculate 3d patches(blocks) from my 3d dataset. I already know that how to calculate 2d patches like 20 by 20 patch from 2d slice. I want to know, how to make 3d patches from 3d data. like (20 by 20 by 5). If someone have a solution in matlab please share. Thanks
댓글 수: 0
답변 (1개)
Walter Roberson
2017년 7월 26일
"patch('Faces',F,'Vertices',V) creates one or more polygons where V specifies vertex values and F defines which vertices to connect. Specifying only unique vertices and their connection matrix can reduce the size of the data when there are many polygons. Specify one vertex per row in V. To create one polygon, specify F as a vector. To create multiple polygons, specify F as a matrix with one row per polygon. Each face does not have to have the same number of vertices. To specify different numbers of vertices, pad F with NaN values."
In my experience, the much harder part is figuring out what to connect between layers. It is not uncommon to have a larger object slice on one layer than on the next, and larger object slices have more points around the perimeter, so you might have more perimeter points on one slice than on the next slice.
댓글 수: 5
Walter Roberson
2017년 8월 3일
Note by the way that
patches{i,j} = Isub(:,xIdxs(j):xIdxs(j+1)-1);
patches {i, j} = reshape(patches{i,j},[1, x_axis_size * y_axes_size]);
patches{i, j} = (patches{i, j})';
can be expressed more compactly as just
patches{i,j} = reshape( Isub(:,xIdxs(j):xIdxs(j+1)-1), [], 1);
Walter Roberson
2017년 8월 3일
xsize = 19; ysize = 19; zsize = 4;
[nrows, ncols, npanes] = size(I);
if mod(nrows,ysize) ~= 0 || mod(ncol,xsize) ~= 0 || mod(npanes, zsize) ~= 0
error('Image size [%d, %d, %d] is not evenly divisible into blocks of size [%d, %d, %d]', nrows, ncols, npanes, ysize, xsize, zsize );
end
patches = mat2cell( I, ysize * ones(1, nrows/ysize), xsize * ones(1, ncol/xsize), zsize * ones(1, npanes / zsize) );
patches = reshape( cellfun(@(V) reshape(V,[],1), patches, 'Uniform', 0), 1, [] );
참고 항목
카테고리
Help Center 및 File Exchange에서 Polygons에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!