title: vtkImageViewer2 - changing volume data slice spacing value
body: <p>I want to change the slice thickness of my dicom volume data. I'm using
  vtkImageViewer2. </p>
  
  <p>For example, the original data spacing is 2 and there are 200 slices, when I
  change the  slice thickness value to 4 I have to see 100 slices.</p>
  
  <pre><code>Original:  1,2,3,4,5...
  Modified:  1,  2,  3...
  </code></pre>
  
  <p>My code:</p>
  
  <pre><code>if ((modif &amp; InputEvent.BUTTON1_MASK) == InputEvent.BUTTON1_MASK) {
  
                  etat = 1;
                  int nb0 = imageViewer.GetSlice() + 1;
                  int nb1 = imageViewer.GetSlice() - 1;
                  int totSlice = imageViewer.GetSliceMax() + 1;
  
                  if (p1.y &gt; p2.y) {
  
                     String Newligne=System.getProperty("line.separator"); 
                      cornerAnnotation.SetText(0,"Slice:" + (nb0 + 1) + "/" + totSlice+Newligne+"Zoom: "+(int)(100)+"%"+Newligne+  "C:" + windowhight + " /  W:" +windowlevel+ Newligne+"Pixel:("+xs+":"+ys+")"+Newligne+reader.GetModality()+"("+reader.GetOutput().GetDimensions()[0]+"*"+reader.GetOutput().GetDimensions()[1]+")"+"-Axial"+Newligne);
  
                      imageViewer.SetSlice(nb0);
                      scrollBar.setValue(imageViewer.GetSlice());
  
                  } else {
  
                       String Newligne=System.getProperty("line.separator"); 
  
                      cornerAnnotation.SetText(0,"Slice:" + (nb1 + 1) + "/" + totSlice+Newligne+"Zoom: "+(int)(100)+"%"+Newligne+  "C:" + windowhight + " /  W:" +windowlevel+ Newligne+"Pixel:("+xs+":"+ys+")"+Newligne+reader.GetModality()+"("+reader.GetOutput().GetDimensions()[0]+"*"+reader.GetOutput().GetDimensions()[1]+")"+"-Axial"+Newligne);
  
                      imageViewer.SetSlice(nb1);
                      scrollBar.setValue(imageViewer.GetSlice());
  
                  }
  
              }
  </code></pre>