title: Creating 3D volume from 2D slice set of grayscale images
body: <p>I am to create a 3D volume out of grayscale image set using Matlab. A set contains a continuous and quantized slices of 2D grayscale image. I am still considered myself a rookie in Matlab, but this is what I currently have in my mind:</p>
  
  <ul>
  <li>create an empty space for 3D volume.</li>
  <li>On each image, we perform all the preprocessing operation so that we only got the part that is of our interest. (In this question, assume that this preprocessing part always work flawlessly)</li>
  <li>Go through the image, each pixel's x and y coordinate on 2D will be transfer to the empty space. For z coordinate, we can use the slice number with respect to the distance between each slice. If a pixel is adjacent to another pixel, the 3D points will be connected together.</li>
  <li>Repeat the previous 2 steps until all slices are done. We will now have all the points connected just like in the 2D slices. </li>
  </ul>
  
  <p>But here comes the trouble, how can we connect the points between the slices, so that these points can become a volume? Or is there a more robust way to do in Matlab? Any suggestion is highly appreciated.</p>