<div dir="ltr">Hi Bruno,<div><br></div><div>This looks like a mistake:</div><div><br></div><div>   auto rawData = filter->GetOutput();<br><div class="gmail_extra"><br></div><div class="gmail_extra">You need the output from vtkImageShiftScale (and you need to update first):</div><div class="gmail_extra"><br></div><div class="gmail_extra">  scale->Update();</div><div class="gmail_extra">  auto rawData = scale->GetOutput();</div><div class="gmail_extra"><br></div><div class="gmail_extra"> - David</div><div class="gmail_extra"><br></div><div class="gmail_extra"><br><div class="gmail_quote">On Fri, May 6, 2016 at 6:28 AM, Bruno Oliveira <span dir="ltr"><<a href="mailto:bruno.manata.oliveira@gmail.com" target="_blank">bruno.manata.oliveira@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div><div><div>Hello,<br><br></div>I need to get the zbuffer in double or single precision float. This is what I'm doing<br><br><br><br>    renderWindow->Render();<br><br>    vtkSmartPointer<vtkWindowToImageFilter> filter =<br>             vtkSmartPointer<vtkWindowToImageFilter>::New();<br>    vtkSmartPointer<vtkImageShiftScale> scale =<br>            vtkSmartPointer<vtkImageShiftScale>::New();<br><br>    // Filter Object Setup<br>    filter->SetInput(renderWindow);<br>    filter->SetMagnification(1);<br>    filter->SetInputBufferTypeToZBuffer();    //Extract z buffer value<br>    filter->ReadFrontBufferOff(); // read from the back buffer<br>    filter->Update();<br><br>    // Scale Object Setup<br>    scale->SetOutputScalarTypeToDouble();<br>    scale->SetInputConnection(filter->GetOutputPort());<br>    scale->SetShift(0);<br><br><br>    auto rawData = filter->GetOutput();<br>    rawData->Register(nullptr); // !!! Increase reference counter, make returned Image struct<br>                                // responsible for freeing the memory afterwards<br><br>    int dims[3];<br>    // Returns coords in (x, y) instead of (row, col)<br>    rawData->GetDimensions(dims);<br><br>    assert(rawData->GetNumberOfScalarComponents() == 1);<br><br><br></div>double *rawData = rawData->GetScalarPointer();<br><br></div></div></blockquote></div><br></div></div></div>