[vtkusers] vtkJPEGWriter not writing file

Bill Lorensen bill.lorensen at gmail.com
Tue Mar 16 13:41:25 EDT 2010


I would guess that not all scalar types are supported by the writer.
But it should warn.

What is the scalar type?

On Tue, Mar 16, 2010 at 9:41 AM, David Doria <daviddoria+vtk at gmail.com> wrote:
> I have used vtkJPEGWriter many times before with no problems. However,
> in this case it seems to simply do nothing. I can't reproduce the
> problem in a simple example (the writer writes like it is supposed to)
> so I'm assuming there is something wrong with the vtkImageData I am
> trying to write.
>
> I tried to make sure the imageData was valid with some outputs:
>
>  vtkImageData* outputImage = superPixelSegmentation->GetOutput();
>
>  int dims[3];
>  outputImage->GetDimensions(dims);
>  cout << "Dims: " << dims[0] << " " << dims[1] << " " << dims[2] << endl;
>
>  int extent[3];
>  outputImage->GetExtent(extent);
>  cout << "Extent: " << extent[0] << " " << extent[1] << " " <<
> extent[2]  << " " << extent[3] << " " << extent[4] << " " << extent[5]
> << endl;
>
>  cout << "number of points: " << outputImage->GetNumberOfPoints() << endl;
>
>  vtkSmartPointer<vtkJPEGWriter> writer =
>      vtkSmartPointer<vtkJPEGWriter>::New();
>  writer->DebugOn();
>  writer->SetFileName(outputFilename.c_str());
>  writer->SetInput(outputImage);
>  writer->Write();
>
>
> The output is:
>
> Dims: 1999 1080 1
> Extent: 0 1998 0 1079 0 0
> number of points: 2158920
>
> but the file is not written!? Any suggestions on what else to check
> before writing the file?
>
> Thanks,
>
> David
> _______________________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html
>
> Please keep messages on-topic and check the VTK FAQ at: http://www.vtk.org/Wiki/VTK_FAQ
>
> Follow this link to subscribe/unsubscribe:
> http://www.vtk.org/mailman/listinfo/vtkusers
>



More information about the vtkusers mailing list