How do I obtain an oblique slice through a binary volume?
A sample of my code is below.
The problem very much appears to be with the obliqueslice function because the volume D is behaving as expected 512 x 512 x 152 int16 comprising 0s (background) and 1s volume.
The slice B is a 533 x 522 int16 comprising only 0s
I've tried changing the interpolation method for oblique slice (linear/nearest) and I've tried converting D to categorical or logical.
Any tips?
V = dicomreadVolume('dicomFolder');
labels = load('labels.mat');
fpm = (labels == 'Label1');
[y,x,z,D] = reducevolume(fpm,[1,1,1]);
[B,x,y,z] = obliqueslice(D,point2,normal, 'Method','nearest');
p1 = patch(isosurface(x,y,z, D),...
'FaceColor','red','EdgeColor','none');
title('Slice in 3-D Coordinate Space')
plot3(point1(1),point1(2),point1(3),'or','MarkerFaceColor','r');
plot3(point2(1),point2(2),point2(3),'or','MarkerFaceColor','r');
title('Slice in Image Plane')