ithron / CortidQCT

A tool for automatic cortical shape identification for QCT scans
Academic Free License v3.0
2 stars 0 forks source link

VoxelVolume visualization is off by one #60

Closed ithron closed 5 years ago

ithron commented 5 years ago

The visualization of a voxel volume using VoxelVolume.plot is off by one. This is caused by MATLAB's slice function.

Short example:

v = zeros(5, 5, 5);
v(3, 3, 3) = 1;
[X, Y, Z] = meshgrid(1:5);
slice(X, Y, Z, v, 3, 3, 3);
colormap gray;
axis equal;

One would expect the white to be centered in the plot, but it is not. This is kind of unintuitive, but it's the way slice works.

However, this leads to misinterpetations when overlaying such a plot with a mesh.