<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Sat, Jan 21, 2017 at 4:34 AM, Alessandro Volz <span dir="ltr"><<a href="mailto:alessandro.volz@gmail.com" target="_blank">alessandro.volz@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">I'm using vtkImageReslice to obtain a vtkImageData object that I read the output scalars from. All works fine.<br>
I'm now in a situation where it would make sense that I preallocate thee output buffer for the reslice to write into.<br>
Is there a way to do this?<br>
I thought I'd create a vtkImageData and SetScalarPointer on it, then SetOutput on the reslice. But I haven't been able to.<br>
Is there a way I could do this? Maybe I should create a vtkImageData subclass?</blockquote><div><br></div><div>Instead of subclassing vtkImageData, it might be better to subclass vtkImageReslice and override the AllocateOutputData() methods. See the current implementation of AllocateOutputData() here:</div><div><a href="https://gitlab.kitware.com/vtk/vtk/blob/master/Common/ExecutionModel/vtkImageAlgorithm.cxx#L198" target="_blank">https://gitlab.kitware.com/<wbr>vtk/vtk/blob/master/Common/<wbr>ExecutionModel/<wbr>vtkImageAlgorithm.cxx#L198</a><br></div><div><br></div><div>But your idea of calling SetOutput() should work as long as you provide a large enough output buffer of the correct data type.</div><div><br></div><div> - David</div><div><br></div></div></div></div>