2 // Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost)
4 #include "bbcreaVtkXMLImageDataWriter.h"
5 #include "bbcreaVtkPackage.h"
7 #include "vtkJSONImageWriter.h"
8 #include "vtkXMLImageDataWriter.h"
9 #include "vtkXMLDataSetWriter.h"
10 #include "vtkDataSetWriter.h"
11 #include "vtkPDataSetWriter.h"
17 BBTK_ADD_BLACK_BOX_TO_PACKAGE(creaVtk,XMLImageDataWriter)
18 BBTK_BLACK_BOX_IMPLEMENTATION(XMLImageDataWriter,bbtk::AtomicBlackBox);
20 // Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost)
22 void XMLImageDataWriter::Process()
25 // THE MAIN PROCESSING METHOD BODY
26 // Here we simply set the input 'In' value to the output 'Out'
27 // And print out the output value
28 // INPUT/OUTPUT ACCESSORS ARE OF THE FORM :
29 // void bbSet{Input|Output}NAME(const TYPE&)
30 // const TYPE& bbGet{Input|Output}NAME() const
32 // * NAME is the name of the input/output
33 // (the one provided in the attribute 'name' of the tag 'input')
34 // * TYPE is the C++ type of the input/output
35 // (the one provided in the attribute 'type' of the tag 'input')
37 // bbSetOutputOut( bbGetInputIn() );
38 // std::cout << "Output value = " <<bbGetOutputOut() << std::endl;
41 auto writer = vtkXMLImageDataWriter::New();
42 writer->SetDataModeToBinary();
43 writer->SetFileName( bbGetInputFileName().c_str() );
44 writer->SetInputData( bbGetInputIn() );
49 auto writer = vtkJSONImageWriter::New();
50 writer->SetFileName( bbGetInputFileName().c_str() );
51 writer->SetInputData( bbGetInputIn() );
56 auto writer = vtkXMLDataSetWriter::New();
57 write->SetDataModeToBinary();
58 writer->SetFileName( bbGetInputFileName().c_str() );
59 writer->SetInputData( bbGetInputIn() );
64 auto writer = vtkDataSetWriter::New();
65 writer->SetFileTypeToBinary();
66 writer->SetFileName( bbGetInputFileName().c_str() );
67 writer->SetInputData( bbGetInputIn() );
73 // Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost)
75 void XMLImageDataWriter::bbUserSetDefaultValues()
78 // SET HERE THE DEFAULT INPUT/OUTPUT VALUES OF YOUR BOX
79 // Here we initialize the input 'In' to 0
84 // Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost)
86 void XMLImageDataWriter::bbUserInitializeProcessing()
89 // THE INITIALIZATION METHOD BODY :
91 // but this is where you should allocate the internal/output pointers
97 // Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost)
99 void XMLImageDataWriter::bbUserFinalizeProcessing()
102 // THE FINALIZATION METHOD BODY :
104 // but this is where you should desallocate the internal/output pointers
109 // EO namespace bbcreaVtk