[Insight-users] use of standard input and standard output

Luis Ibanez luis.ibanez at kitware.com
Wed Sep 1 09:17:16 EDT 2004


Hi Jian,


The current Input/Output architecture of ITK does not
offer you a simple way of sending an image through a
Unix pipe. Most of the ImageIO objects create their own
std::fstreams, so you will not have access to their file
descriptors.

You could of course, dig in to the source code and expose
the selection of the std::ofstreams and std::ifstreams in
order to change it for the standard std::cout, std::cin..

However this sounds like an undesirable feature if you think
how inconvenient it would be to throw a 100Mb DICOM image to
your console by accident.   :-)



If you are doing this just for playing with the examples,
you probably will find more interesting and useful the
exercise of merging the source code of the examples. That's
in fact the way of taking real advantage of the data pipeline
in ITK.


Please let us know if you have further questions.


   Thanks


     Luis



-----------------
Jian XIE wrote:

> Dear ITK users, I'm just wondering how do I use standard input/output in
> ITK. For all the example programs, you need to provide an input file and
> also specify an output file. is it possible to use the standard output so
> I can take advantage of the unix pipe to 'pipe' the current output as an
> input of the next program.
> 
> thanks
> Jian
> _______________________________________________
> Insight-users mailing list
> Insight-users at itk.org
> http://www.itk.org/mailman/listinfo/insight-users
> 






More information about the Insight-users mailing list