title: Paste 2D images in an arbitrary orientation into a 3D volume
body: <p>I'm reading a series of 2D images with a specific location and orientation in space and put them into a 3D volume (itkImage with 3 dimensions). I'm using ITK for that and so far it works but it's rather slow. </p>
  
  <p>Below is my code where img_data is a 2D image (itkImage) which is the source and vol_img is a 3D volume which is the destination. Both have an origin and an direction.</p>
  
  <pre><code>for i in range(0, width):
      for j in range(0, height):
          pixel_val = img_data.GetPixel(0, i, j)
          phys_point = img_data.TransformIndexToPhysicalPoint((0, i, j))
          img_point_vol = vol_img.TransformPhysicalPointToIndex(phys_point)
  
          vol_img.SetPixel(img_point_vol[0], img_point_vol[1], img_point_vol[2], pixel_val)
  </code></pre>
  
  <p>This method produces a 3D volume but is pretty slow. I also had a look to the sitk.Paste method but it doesn't allow to paste the image in an arbitrary orientation. I'm using python with SimpleITK</p>
  
  <p>Is there a more efficient method for doing this than iterating over all pixels in the source image?</p>