# vtkResliceImageViewer do not recognize the slice in z build from append from reslice

**URL:** https://discourse.vtk.org/t/vtkresliceimageviewer-do-not-recognize-the-slice-in-z-build-from-append-from-reslice/608
**Category:** Support
**Created:** [March 26, 2019, 4:55pm UTC](https://discourse.vtk.org/t/vtkresliceimageviewer-do-not-recognize-the-slice-in-z-build-from-append-from-reslice/608 "2019-03-26T16:55:18Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![zandarina](https://discourse.vtk.org/letter_avatar_proxy/v4/letter/z/4af34b/32.png) [@zandarina](https://discourse.vtk.org/u/zandarina)
#### Post date: [March 26, 2019, 4:55pm UTC](https://discourse.vtk.org/t/vtkresliceimageviewer-do-not-recognize-the-slice-in-z-build-from-append-from-reslice/608/1 "2019-03-26T16:55:18Z")

</div>

Dear all,

I have a question. I want to show using vtkResliceImageViewer the slices i  
have got from the reslicer  
filter. So i append in z the output and i call a fuction to show me the  
vtkImageData withh all the slices extracted from the reslicer filter. But my  
surprise is that only show one slice. But if i use the same  
vtkResliceImageViewer with the whole volume it works propertly. What can i  
do to show the slices obtained form the reslicer in the viewer.

Thanks

vtkImageAppend\* append1 = vtkImageAppend::New();  
//Define Stack in Z  
append1-\>SetAppendAxis(2);

…

```
            // done
            reslice->Update();

            //Append the slices into an image
            append1->AddInputData(reslice->GetOutput());
            append1->Update();

```

image\_paraxial = append1-\>GetOutput();

vtkNew image\_viewer\_;

vtkNew renderWindow;  
SetRenderWindow(renderWindow);

```
                    image_viewer_->SetRenderWindow(renderWindow);
                    image_viewer_->SetupInteractor(renderWindow->GetInteractor());

                    //vtkSmartPointer<vtkImageData> image_data = vtkImageData::SafeDownCast(
                            //scene.get_volume()->GetMapper()->GetInputDataObject(0, 0));

                    image_viewer_->SetInputData(image_data);
                    image_viewer_->SetSliceOrientationToXY();
                    image_viewer_->SetSlice(1);
                    image_viewer_->SetResliceModeToAxisAligned();

```

I checked the extent and it is correct in z from 0…11. But it doesnt recognize the z as a number of slices. Why can,t i scroll the vtkimagedata in the viewer?

cout \<\< "Slicer: Min = " \<\< MinSlice \<\< ", Max = " \<\< MaxSlice; It is always 0 !! Why if i did the append.

Thanks

---

<div class="post-metadata">

### Author: ![zandarina](https://discourse.vtk.org/letter_avatar_proxy/v4/letter/z/4af34b/32.png) [@zandarina](https://discourse.vtk.org/u/zandarina)
#### Post date: [March 26, 2019, 4:56pm UTC](https://discourse.vtk.org/t/vtkresliceimageviewer-do-not-recognize-the-slice-in-z-build-from-append-from-reslice/608/2 "2019-03-26T16:56:19Z")

</div>

> [@zandarina](#):
>
> cout \<\< "Slicer: Min = " \<\< MinSlice \<\< ", Max = " \<\< MaxSlice; It is always 0 !!

I do not understan why z is not recognized as an slice in the viewer. Any help?
