From: Eduardo DAVILA Date: Wed, 1 Dec 2021 15:29:58 +0000 (+0100) Subject: #3475 TIFFWiter box X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=commitdiff_plain;h=df2925129d5ae77c0dde30a6c8f72226ba671e47;p=creaVtk.git #3475 TIFFWiter box --- diff --git a/bbtk_creaVtk_PKG/src/bbcreaVtkTiffWriter.cxx b/bbtk_creaVtk_PKG/src/bbcreaVtkTiffWriter.cxx new file mode 100644 index 0000000..0eb1790 --- /dev/null +++ b/bbtk_creaVtk_PKG/src/bbcreaVtkTiffWriter.cxx @@ -0,0 +1,81 @@ +//===== +// 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) +//===== +#include "bbcreaVtkTiffWriter.h" +#include "bbcreaVtkPackage.h" + +#include + +namespace bbcreaVtk +{ + +BBTK_ADD_BLACK_BOX_TO_PACKAGE(creaVtk,TiffWriter) +BBTK_BLACK_BOX_IMPLEMENTATION(TiffWriter,bbtk::AtomicBlackBox); +//===== +// 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) +//===== +void TiffWriter::Process() +{ + +// THE MAIN PROCESSING METHOD BODY +// Here we simply set the input 'In' value to the output 'Out' +// And print out the output value +// INPUT/OUTPUT ACCESSORS ARE OF THE FORM : +// void bbSet{Input|Output}NAME(const TYPE&) +// const TYPE& bbGet{Input|Output}NAME() const +// Where : +// * NAME is the name of the input/output +// (the one provided in the attribute 'name' of the tag 'input') +// * TYPE is the C++ type of the input/output +// (the one provided in the attribute 'type' of the tag 'input') +// bbSetOutputOut( bbGetInputIn() ); +// std::cout << "Output value = " <SetInputData( bbGetInputIn() ); + writer->SetFileName( bbGetInputFileName().c_str() ); + writer->Write(); + } // if +} +//===== +// 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) +//===== +void TiffWriter::bbUserSetDefaultValues() +{ + +// SET HERE THE DEFAULT INPUT/OUTPUT VALUES OF YOUR BOX +// Here we initialize the input 'In' to 0 + bbSetInputIn(NULL); + +} +//===== +// 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) +//===== +void TiffWriter::bbUserInitializeProcessing() +{ + +// THE INITIALIZATION METHOD BODY : +// Here does nothing +// but this is where you should allocate the internal/output pointers +// if any + + +} +//===== +// 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) +//===== +void TiffWriter::bbUserFinalizeProcessing() +{ + +// THE FINALIZATION METHOD BODY : +// Here does nothing +// but this is where you should desallocate the internal/output pointers +// if any + +} +} +// EO namespace bbcreaVtk + + diff --git a/bbtk_creaVtk_PKG/src/bbcreaVtkTiffWriter.h b/bbtk_creaVtk_PKG/src/bbcreaVtkTiffWriter.h new file mode 100644 index 0000000..bbc23de --- /dev/null +++ b/bbtk_creaVtk_PKG/src/bbcreaVtkTiffWriter.h @@ -0,0 +1,51 @@ +//===== +// 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) +//===== +#ifndef __bbcreaVtkTiffWriter_h_INCLUDED__ +#define __bbcreaVtkTiffWriter_h_INCLUDED__ + +#include "bbcreaVtk_EXPORT.h" +#include "bbtkAtomicBlackBox.h" +#include "iostream" + +#include "vtkImageData.h" + + +namespace bbcreaVtk +{ + +class bbcreaVtk_EXPORT TiffWriter + : + public bbtk::AtomicBlackBox +{ + BBTK_BLACK_BOX_INTERFACE(TiffWriter,bbtk::AtomicBlackBox); +//===== +// 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) +//===== + BBTK_DECLARE_INPUT(In,vtkImageData*); + BBTK_DECLARE_INPUT(FileName,std::string); +// BBTK_DECLARE_OUTPUT(Out,double); + BBTK_PROCESS(Process); + void Process(); +//===== +// 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) +//===== +}; + +BBTK_BEGIN_DESCRIBE_BLACK_BOX(TiffWriter,bbtk::AtomicBlackBox); + BBTK_NAME("TiffWriter"); + BBTK_AUTHOR("InfoDev"); + BBTK_DESCRIPTION("No Description."); + BBTK_CATEGORY("empty"); + BBTK_INPUT(TiffWriter,In,"Image to be write",vtkImageData*,""); + BBTK_INPUT(TiffWriter,FileName,"File Name",std::string,""); +// BBTK_OUTPUT(TiffWriter,Out,"First output",double,""); +BBTK_END_DESCRIBE_BLACK_BOX(TiffWriter); +//===== +// 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) +//===== +} +// EO namespace bbcreaVtk + +#endif // __bbcreaVtkTiffWriter_h_INCLUDED__ +