I'm looking for the best way to convert some point cloud data into a 3D logical volume which I can use to compare with another (and see how similar they are).
I have imported some cartesian points into my workspace from Paraview, which are based on nodes from a 3d volumetric mesh. I wish to convert these values into a logical array so that I may compare them against some ground truth data (a Nifti file).
For context, the data I have imported represents points in an FEModel of someone's lung, where fibrosis has been predicted to occur. Therefore '1' will represent fibrosis and '0' will represent that it is not present at that location in the image. The points I have imported are only where fibrosis is (what I will convert into 1's) , on what I assume to be a non-uniform, 3D grid of interior nodes.
The code I have so far is something like this:
Ilog = (zeros(size(V)));
for n = 1:length(inxyz(:,1))
fs = inxyz(n,:);
Ilog(fs(1),fs(2),fs(3)) = 1;
I suspect that I may need to interpolate this data so that it is gridded regularly? What would be the best method to go about this? The ground truth data is based on a different image file to that which the mesh was generated from.
My original data (over 6000 points) is like:
517.147000000000 485.898000000000 -49.4057000000000
521.093000000000 479.477000000000 -49.4214000000000
521.109000000000 485.826000000000 -43.4537000000000
517.871000000000 479.697000000000 -44.1086000000000
474.643000000000 506.728000000000 -152.803000000000
481.293000000000 503.511000000000 -151.508000000000
474.973000000000 498.821000000000 -149.782000000000
476.078000000000 499.376000000000 -155.437000000000
513.859000000000 464.033000000000 -91.7537000000000
508.692000000000 463.357000000000 -84.7492000000000
507.955000000000 462.950000000000 -92.2188000000000
513.668000000000 458.050000000000 -89.3088000000000
518.775000000000 468.933000000000 -105.997000000000
518.595000000000 472.601000000000 -111.756000000000
523.501000000000 474.951000000000 -105.284000000000
526.364000000000 470.581000000000 -108.494000000000
...which makes my above code snippet not run without errors, since the array indexing needs positive integers (see z coords).