[vtkusers] vtk metaImageWriter bad allocation

Fabian Torres fabian.trobles at gmail.com
Thu May 24 13:09:54 EDT 2012


Hi.

I`m trying to save a 3-D vtkImageData to a .mhd and .raw file with a
vtkMetaImageWriter

vtkSmartPointer<vtkMetaImageWriter> writer =
vtkSmartPointer<vtkMetaImageWriter>::New();
writer->SetFileName(saveMhdFile);

writer->SetRAWFileName(saveRawFile);

writer->SetInputConnection(volumeData->GetProducerPort());
writer->Write()


When I save a volume of size 603x548x394 I am able to save the file without
problem.

But when I try to save a bigger volume of size 584x999x494 I get an
exception. After using try/catch in the Write() method


try{

writer->Write();

}catch( exception& e){

std::cout<<e.what()<<std::endl;

}

I receive "Bad allocation" message.

What does this mean? How can I fix this problem?

Thanks
-- 
Fabián Torres Robles
Maestria en Ciencias en Ingeniería Electrónica
Ingeniería en Sistemas Electrónicos
tel. 58081280, 0445534661338
e-mail fabian.trobles at gmail.com, dae.wong at gmail.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20120524/f23c9637/attachment.htm>


More information about the vtkusers mailing list