]> Creatis software - bbtk.git/blob - packages/itk/src/bbitkImageToString.cxx
=== MAJOR RELEASE ====
[bbtk.git] / packages / itk / src / bbitkImageToString.cxx
1 #ifdef _USE_ITK_
2
3 #include "bbstdToString.h"
4 #include "bbitkImage.h"
5 #include "bbitkPackage.h"
6 #include <sstream>
7
8 namespace bbstd
9 {
10   
11   
12   //====================================================================
13   BBTK_BLACK_BOX_TEMPLATE_IMPLEMENTATION(ToString,
14                                          bbtk::AtomicBlackBox);
15   //====================================================================
16   
17   //====================================================================
18   template <> void ToString<bbtk::any<bbitk::ImagePointer> > ::DoIt()
19   {
20     std::ostringstream s;
21     itk::Object* o1 = bbGetInputIn().unsafe_get<itk::Object*>();
22     o1->Print(s);
23     
24     bbSetOutputOut( s.str() );
25   }
26   //====================================================================
27 } // namespace bbstd
28
29
30 using namespace bbstd;
31 namespace bbitk 
32 {
33   //  typedef bbstd::ToString ToString;
34   //====================================================================
35   // Add the specialized adaptors to the package
36   typedef bbitk::anyImagePointer anyItkImagePointer;
37   BBTK_ADD_TEMPLATE_BLACK_BOX_TO_PACKAGE(itk,ToString,
38                                          anyItkImagePointer);
39   //typedef const bbtk::itkImage* itkImageConstPointer;
40   //BBTK_ADD_TEMPLATE_BLACK_BOX_TO_PACKAGE(itkBase,ScalarToString,itkImageConstPointer);
41   
42 }
43
44
45 #endif //_USE_ITK_