Dumping image

Hello,

is there a way to dump an image in an ostream& instead of directly to a file with itkImageFileWriter ?

Best regards,
Florian Bouillet

I don’t think so. ImageFileWriter is designed for writing to files. And it delegates this duty to different other libraries, usually one for each of the supported file formats.

Some of those libraries do have an ability to write to an open ostream&. But you will have to write extra code and probably also directly link to the library in question.

There are a number of ways to make standard output look like a file that are described at linux - pass stdout as file name for command line util? - Stack Overflow.

Ok thanks a lot