[vtkusers] vtkImageWriter issue...

Ale notinmyhead at gmail.com
Mon May 21 11:07:23 EDT 2012


I try to use the vtkImageWriter because, in future, I'd like to set the file type as one among the supported types... Is it wrong?

Il giorno 21/mag/2012, alle ore 16.52, Hal Canary ha scritto:

> On 05/21/2012 06:54 AM, Ale wrote:
>> Hello,
>> 
>> I'd like to write an vtkImageData into a file (in order to check if a correctly made the import from ITK). I use VTK 5.10 under OSX and QT. I resort to this code (where vtkVolume is a vtkSmartPointer<vtkImageData>  correctly instatiated):
>> 
>>    vtkSmartPointer<vtkImageWriter>  writer = vtkSmartPointer<vtkImageWriter>::New();
>>    writer->SetInput(vtkVolume);
>>    writer->SetFileName ("/mydir/filename.tif");
>>    writer->Write();
>> 
>> When the program is run I get the program exit unexpected with this (portion) error:
>> 
>> Thread 0 Crashed:  Dispatch queue: com.apple.main-thread
>> 0   libvtkCommon.5.10.dylib       	0x0132a6f0 vtkObjectFactory::IsA(char const*) + 48 (vtkObjectFactory.h:113)
>> 1   libvtkFiltering.5.10.dylib    	0x0177a88c vtkImageAlgorithm::SetInput(int, vtkDataObject*) + 44 (vtkImageAlgorithm.cxx:410)
>> 2   libvtkFiltering.5.10.dylib    	0x0177a900 vtkImageAlgorithm::SetInput(vtkDataObject*) + 32 (vtkImageAlgorithm.cxx:403)
>> 
>> Thanks,
>> Ale
> 
> If you want to write a .tif file, why don't you call
> vtkSmartPointer<vtkTIFFWriter>::New() ?
> 
> 
> -- 
> Hal Canary
> _______________________________________________
> 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