<div class="gmail_quote">I have created a class derived from vtkImageAlgorithm called<br>
vtkVoxelizePolyData.<br>
<br>
To set the output of the new filter, in RequestData (as usual) I did:<br>
<br>
vtkInformation *outInfo = outputVector->GetInformationObject(0);<br>
vtkImageData *output = vtkImageData::SafeDownCast(<br>
outInfo->Get(vtkDataObject::DATA_OBJECT()));<br>
<br>
vtkSmartPointer<vtkImageData> grid = vtkSmartPointer<vtkImageData>::New();<br>
<br>
.... fill grid....<br>
<br>
output->ShallowCopy(grid);<br>
<br>
I know 'grid' is valid at this point because just before the end of<br>
RequestData I did:<br>
<br>
vtkSmartPointer<vtkXMLImageDataWriter> writer =<br>
vtkSmartPointer<vtkXMLImageDataWriter>::New();<br>
writer->SetFileName("insideFilter.vti");<br>
writer->SetInput(grid);<br>
writer->Write();<br>
<br>
output->ShallowCopy(grid);<br>
<br>
and it looks correct in paraview.<br>
<br>
However, if I run the filter and write the file of the filter output,<br>
it is empty!<br>
<br>
vtkSmartPointer<vtkVoxelizePolyData> voxelize =<br>
vtkSmartPointer<vtkVoxelizePolyData>::New();<br>
voxelize->SetInput(reader->GetOutput());<br>
voxelize->Update();<br>
<br>
vtkImageData* voxelized = voxelize->GetOutput();<br>
<br>
vtkSmartPointer<vtkXMLImageDataWriter> writer =<br>
vtkSmartPointer<vtkXMLImageDataWriter>::New();<br>
writer->SetFileName(outputFilename.c_str());<br>
writer->SetInput(voxelized);<br>
writer->Write();<br>
<br>
Any thoughts on what could be going wrong here??<br>
<br>
Thanks,<br>
<font color="#888888"></font></div><div class="gmail_quote"><br></div><div class="gmail_quote">David</div>