|
From: | Tasos Papastylianou |
Subject: | get / set points corresponding to a surface within a 3D volume |
Date: | Sun, 10 Feb 2013 06:33:35 +0200 |
Let V be a volume (e.g. a 3D MRI dataset) with size(v) == [M N P]
Let X and Y form a 2D grid, where size(X) == size(Y) == [M N] Let Z be such that size(Z) = [M N] and Z defines a surface over the grid X,Y, which is within the bounds of V. Is there an 'indexing' operation IND with respect to the points on the surface Z such that I could do the conceptual equivalent of this? >> U = V(IND); and even >> V(IND) = V(IND) .^ 2; A 'hackish' way of achieving the first is as follows: Given, say: V = repmat(permute([1:100],[1 3 2]),[100 100 1]) .* repmat(magic(100),[1 1 100]) .* repmat(magic(100)',[1 1 100]); [X Y] = ndgrid(1:100,1:100); Z = X/2 + Y/2; We can do: |
[Prev in Thread] | Current Thread | [Next in Thread] |