Mapping a plane onto a 3D matrix?

조회 수: 1 (최근 30일)
Naim
Naim 2017년 8월 16일
댓글: José-Luis 2017년 8월 16일
I have an empty 256x256x56 matrix I want to project onto
I have with two points of interest (156.66,114.66,32.66) and (132.33,122.33,30.33). The plane I want to define is orthogonal to these two points and lies on the first point. The normal vector created by these two points are (-24.33,7.66,-2.33). I then found the D value of 3.0093e+03 to satisty a*x+b*y+c*z+d=0 with (a,b,c) being my first value (156.66,114.66,32.66).
All that being said, I'm trying to map this plane onto my empty matrix. It would need to be the best approximation, as the matrix is discrete. Any ideas about the some next steps? I would love to hear some suggestions.
  댓글 수: 3
Guillaume
Guillaume 2017년 8월 16일
@José-Luis,
For lines (on a 2d plane) this usually results in very poorly rendered lines (with holes in parts, double thickness in others). It's also extremely slow.
But yes, if nothing more clever exists, that's the easy way to do it.
José-Luis
José-Luis 2017년 8월 16일
Thanks for the clarification.
Not really my field.

댓글을 달려면 로그인하십시오.

채택된 답변

Guillaume
Guillaume 2017년 8월 16일
The correct way to get the best approximation would be to find an equivalent to Bresenham's line algorithm (or Wu's or similar) that apply to planes/voxels instead of lines/pixels. I'm not enough into this field to know if one exists.
A cheap way would be to use your plane equation with a small tolerance to find the voxels close to your plane:
matrix = zeros(256,256,256)
[y, x, z] = ndgrid(1:size(matrix, 1), 1:size(matrix, 2), 1:size(matrix, 3));
onplane = abs(a*x+b*y+c*z+d) <= tolerance
yourmatrix(onplane) = 1;
I suspect this may leave some holes (too small a tolerance) or result in too thick a plane in some places (too high a tolerance).

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Images에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by