--- /dev/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)
+//=====
+#include "bbcreaVtkConcatTransform.h"
+#include "bbcreaVtkPackage.h"
+
+#include "vtkTransform.h"
+
+namespace bbcreaVtk
+{
+
+BBTK_ADD_BLACK_BOX_TO_PACKAGE(creaVtk,ConcatTransform)
+BBTK_BLACK_BOX_IMPLEMENTATION(ConcatTransform,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 ConcatTransform::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 = " <<bbGetOutputOut() << std::endl;
+
+ vtkTransform *result = vtkTransform::New();
+ result->PostMultiply ();
+ result->Identity();
+ if (bbGetInputIn1()!=NULL) { result->Concatenate( bbGetInputIn1()->GetMatrix() ); }
+ if (bbGetInputIn2()!=NULL) { result->Concatenate( bbGetInputIn2()->GetMatrix() ); }
+ if (bbGetInputIn3()!=NULL) { result->Concatenate( bbGetInputIn3()->GetMatrix() ); }
+ if (bbGetInputIn4()!=NULL) { result->Concatenate( bbGetInputIn4()->GetMatrix() ); }
+ if (bbGetInputIn5()!=NULL) { result->Concatenate( bbGetInputIn5()->GetMatrix() ); }
+ if (bbGetInputIn6()!=NULL) { result->Concatenate( bbGetInputIn6()->GetMatrix() ); }
+ if (bbGetInputIn7()!=NULL) { result->Concatenate( bbGetInputIn7()->GetMatrix() ); }
+ if (bbGetInputIn8()!=NULL) { result->Concatenate( bbGetInputIn8()->GetMatrix() ); }
+ if (bbGetInputIn9()!=NULL) { result->Concatenate( bbGetInputIn9()->GetMatrix() ); }
+ result->Update();
+
+ bbSetOutputOut(result);
+}
+//=====
+// 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 ConcatTransform::bbUserSetDefaultValues()
+{
+
+// SET HERE THE DEFAULT INPUT/OUTPUT VALUES OF YOUR BOX
+// Here we initialize the input 'In' to 0
+ bbSetInputIn1(NULL);
+ bbSetInputIn2(NULL);
+ bbSetInputIn3(NULL);
+ bbSetInputIn4(NULL);
+ bbSetInputIn5(NULL);
+ bbSetInputIn6(NULL);
+ bbSetInputIn7(NULL);
+ bbSetInputIn8(NULL);
+ bbSetInputIn9(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 ConcatTransform::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 ConcatTransform::bbUserFinalizeProcessing()
+{
+
+// THE FINALIZATION METHOD BODY :
+// Here does nothing
+// but this is where you should desallocate the internal/output pointers
+// if any
+
+}
+}
+// EO namespace bbcreaVtk
+
+
--- /dev/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)
+//=====
+#ifndef __bbcreaVtkConcatTransform_h_INCLUDED__
+#define __bbcreaVtkConcatTransform_h_INCLUDED__
+#include "bbcreaVtk_EXPORT.h"
+#include "bbtkAtomicBlackBox.h"
+#include "iostream"
+
+#include "vtkLinearTransform.h"
+
+namespace bbcreaVtk
+{
+
+class bbcreaVtk_EXPORT ConcatTransform
+ :
+ public bbtk::AtomicBlackBox
+{
+ BBTK_BLACK_BOX_INTERFACE(ConcatTransform,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(In1,vtkLinearTransform*);
+ BBTK_DECLARE_INPUT(In2,vtkLinearTransform*);
+ BBTK_DECLARE_INPUT(In3,vtkLinearTransform*);
+ BBTK_DECLARE_INPUT(In4,vtkLinearTransform*);
+ BBTK_DECLARE_INPUT(In5,vtkLinearTransform*);
+ BBTK_DECLARE_INPUT(In6,vtkLinearTransform*);
+ BBTK_DECLARE_INPUT(In7,vtkLinearTransform*);
+ BBTK_DECLARE_INPUT(In8,vtkLinearTransform*);
+ BBTK_DECLARE_INPUT(In9,vtkLinearTransform*);
+ BBTK_DECLARE_OUTPUT(Out,vtkLinearTransform*);
+ 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(ConcatTransform,bbtk::AtomicBlackBox);
+ BBTK_NAME("ConcatTransform");
+ BBTK_AUTHOR("InfoDev");
+ BBTK_DESCRIPTION("No Description.");
+ BBTK_CATEGORY("empty");
+ BBTK_INPUT(ConcatTransform,In1,"vtkLinearTransform input",vtkLinearTransform*,"");
+ BBTK_INPUT(ConcatTransform,In2,"vtkLinearTransform input",vtkLinearTransform*,"");
+ BBTK_INPUT(ConcatTransform,In3,"vtkLinearTransform input",vtkLinearTransform*,"");
+ BBTK_INPUT(ConcatTransform,In4,"vtkLinearTransform input",vtkLinearTransform*,"");
+ BBTK_INPUT(ConcatTransform,In5,"vtkLinearTransform input",vtkLinearTransform*,"");
+ BBTK_INPUT(ConcatTransform,In6,"vtkLinearTransform input",vtkLinearTransform*,"");
+ BBTK_INPUT(ConcatTransform,In7,"vtkLinearTransform input",vtkLinearTransform*,"");
+ BBTK_INPUT(ConcatTransform,In8,"vtkLinearTransform input",vtkLinearTransform*,"");
+ BBTK_INPUT(ConcatTransform,In9,"vtkLinearTransform input",vtkLinearTransform*,"");
+ BBTK_OUTPUT(ConcatTransform,Out,"vtkLinearTransform output",vtkLinearTransform*,"");
+BBTK_END_DESCRIBE_BLACK_BOX(ConcatTransform);
+//=====
+// 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 // __bbcreaVtkConcatTransform_h_INCLUDED__
+
--- /dev/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)
+//=====
+#include "bbcreaVtkImageAccumulate.h"
+#include "bbcreaVtkPackage.h"
+namespace bbcreaVtk
+{
+
+BBTK_ADD_BLACK_BOX_TO_PACKAGE(creaVtk,ImageAccumulate)
+BBTK_BLACK_BOX_IMPLEMENTATION(ImageAccumulate,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 ImageAccumulate::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 = " <<bbGetOutputOut() << std::endl;
+
+ if (acc!=NULL)
+ {
+ acc->Delete();
+ }
+ acc = vtkImageAccumulate::New();
+ acc->SetInput( bbGetInputIn() );
+ acc->IgnoreZeroOn();
+ acc->Update();
+ bbSetOutputVoxelCount(acc->GetVoxelCount());
+}
+//=====
+// 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 ImageAccumulate::bbUserSetDefaultValues()
+{
+
+// SET HERE THE DEFAULT INPUT/OUTPUT VALUES OF YOUR BOX
+// Here we initialize the input 'In' to 0
+ acc=NULL;
+ 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 ImageAccumulate::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 ImageAccumulate::bbUserFinalizeProcessing()
+{
+
+// THE FINALIZATION METHOD BODY :
+// Here does nothing
+// but this is where you should desallocate the internal/output pointers
+// if any
+
+}
+}
+// EO namespace bbcreaVtk
+
+
--- /dev/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)
+//=====
+#ifndef __bbcreaVtkImageAccumulate_h_INCLUDED__
+#define __bbcreaVtkImageAccumulate_h_INCLUDED__
+#include "bbcreaVtk_EXPORT.h"
+#include "bbtkAtomicBlackBox.h"
+#include "iostream"
+
+#include "vtkImageData.h"
+#include "vtkImageAccumulate.h"
+
+namespace bbcreaVtk
+{
+
+class bbcreaVtk_EXPORT ImageAccumulate
+ :
+ public bbtk::AtomicBlackBox
+{
+ BBTK_BLACK_BOX_INTERFACE(ImageAccumulate,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_OUTPUT(VoxelCount,int);
+ BBTK_PROCESS(Process);
+ void Process();
+
+ vtkImageAccumulate *acc;
+
+
+//=====
+// 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(ImageAccumulate,bbtk::AtomicBlackBox);
+ BBTK_NAME("ImageAccumulate");
+ BBTK_AUTHOR("Info-Dev");
+ BBTK_DESCRIPTION("Count voxel (IgnoreZeroOn)");
+ BBTK_CATEGORY("empty");
+
+ BBTK_INPUT(ImageAccumulate,In,"Input image",vtkImageData*,"");
+
+ BBTK_OUTPUT(ImageAccumulate,VoxelCount,"VoxelCount",int,"");
+
+BBTK_END_DESCRIBE_BLACK_BOX(ImageAccumulate);
+//=====
+// 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 // __bbcreaVtkImageAccumulate_h_INCLUDED__
+
printf("EED ReadMHDPlane::Process Start\n");
+ std::string inputfilename;
+
+ if (bbGetInputDirectionPlane()=="XY")
+ {
+ inputfilename=bbGetInputFileName();
+ } // if XY
+
+
+ if ((bbGetInputDirectionPlane()=="YZ") || (bbGetInputDirectionPlane()=="ZX"))
+ {
+
+ //-- Split FileName
+ std::size_t found = bbGetInputFileName().find_last_of("/\\");
+ std::string path = bbGetInputFileName().substr(0,found+1);
+ std::string filename = bbGetInputFileName().substr(found+1);
+#ifdef _WIN32
+ path=path+"YZ_ZX\\";
+#else
+ path=path+"YZ_ZX/";
+#endif
+
+
+ if (bbGetInputDirectionPlane()=="YZ")
+ {
+ inputfilename = path+filename+"_YZ.mhd";
+ } // if YZ
+
+ if (bbGetInputDirectionPlane()=="ZX")
+ {
+ inputfilename = path+filename+"_ZX.mhd";
+ } // XZ
+ } // if YZ || XZ
+
vtkImageData *newImage;
long int newHeaderSize;
- std::string newFileName=bbGetInputFileName()+"-OneSlice";
+ std::string newFileName=inputfilename+"-OneSlice";
int sx,sy,sz;
char mystring[250];
char strTmp[20];
bool ok=true;
- FILE *ffIn = fopen(bbGetInputFileName().c_str(),"r");
+ FILE *ffIn = fopen(inputfilename.c_str(),"r");
if (ffIn!=NULL)
{
printf("EED ReadMHDPlane::Process 1\n");
} // if ok
} else {
ok=false;
- printf("EED ERROR: Problem openin:%s\n", bbGetInputFileName().c_str() );
+ printf("EED ERROR: Problem openin:%s\n", inputfilename.c_str() );
}
if (ok==false)
// Here we initialize the input 'In' to 0
bbSetInputFileName("");
bbSetInputSlice(0);
+ bbSetInputDirectionPlane("XY");
}
//=====
//=====
BBTK_DECLARE_INPUT(FileName,std::string);
BBTK_DECLARE_INPUT(Slice,int);
+ BBTK_DECLARE_INPUT(DirectionPlane,std::string);
BBTK_DECLARE_OUTPUT(Out,vtkImageData*);
BBTK_PROCESS(Process);
void Process();
BBTK_CATEGORY("empty");
BBTK_INPUT(ReadMHDPlane,FileName,"Image file name",std::string,"");
BBTK_INPUT(ReadMHDPlane,Slice,"Slice number",int,"");
+ BBTK_INPUT(ReadMHDPlane,DirectionPlane,"Direction plane: XY (default), YZ , XZ",std::string,"");
BBTK_OUTPUT(ReadMHDPlane,Out,"Image 2D",vtkImageData*,"");
BBTK_END_DESCRIBE_BLACK_BOX(ReadMHDPlane);
//=====
--- /dev/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)
+//=====
+#include "bbcreaVtkTransformVector.h"
+#include "bbcreaVtkPackage.h"
+namespace bbcreaVtk
+{
+
+BBTK_ADD_BLACK_BOX_TO_PACKAGE(creaVtk,TransformVector)
+BBTK_BLACK_BOX_IMPLEMENTATION(TransformVector,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 TransformVector::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 = " <<bbGetOutputOut() << std::endl;
+
+ double tmpA[3];
+ double *tmpB;
+ unsigned int i;
+ unsigned int XSize=bbGetInputInX().size();
+ unsigned int YSize=bbGetInputInY().size();
+ unsigned int ZSize=bbGetInputInZ().size();
+
+ std::vector<double> xVec;
+ std::vector<double> yVec;
+ std::vector<double> zVec;
+
+printf("TransformVector::Process START\n" );
+
+ bool ok=true;
+ if ((XSize!=YSize) || (XSize!=ZSize) )
+ {
+ ok=false;
+ printf("ERROR. TransformVector: The size of the tree vectors are not the same!\n");
+ }
+
+
+ if (ok==true)
+ {
+ if (bbGetInputTransform()!=NULL) { bbGetInputTransform()->Update(); }
+ for(i=0;i<XSize;i++)
+ {
+ tmpA[0]=bbGetInputInX()[i];
+ tmpA[1]=bbGetInputInY()[i];
+ tmpA[2]=bbGetInputInZ()[i];
+
+ if (bbGetInputTransform()!=NULL)
+ {
+ tmpB=bbGetInputTransform()->TransformDoublePoint(tmpA);
+ xVec.push_back( tmpB[0] );
+ yVec.push_back( tmpB[1] );
+ zVec.push_back( tmpB[2] );
+ } else {
+ printf("WARNNIG. TransformVector: The Transform is not set!\n");
+ xVec.push_back( tmpA[0] );
+ yVec.push_back( tmpA[1] );
+ zVec.push_back( tmpA[2] );
+ } // if Transform
+ }// for i
+ } // if ok
+ bbSetOutputOutX(xVec);
+ bbSetOutputOutY(yVec);
+ bbSetOutputOutZ(zVec);
+
+printf("TransformVector::Process END\n" );
+
+}
+//=====
+// 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 TransformVector::bbUserSetDefaultValues()
+{
+
+// SET HERE THE DEFAULT INPUT/OUTPUT VALUES OF YOUR BOX
+// Here we initialize the input 'In' to 0
+ bbSetInputTransform(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 TransformVector::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 TransformVector::bbUserFinalizeProcessing()
+{
+
+// THE FINALIZATION METHOD BODY :
+// Here does nothing
+// but this is where you should desallocate the internal/output pointers
+// if any
+
+}
+}
+// EO namespace bbcreaVtk
+
+
--- /dev/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)
+//=====
+#ifndef __bbcreaVtkTransformVector_h_INCLUDED__
+#define __bbcreaVtkTransformVector_h_INCLUDED__
+#include "bbcreaVtk_EXPORT.h"
+#include "bbtkAtomicBlackBox.h"
+#include "iostream"
+
+#include "vtkLinearTransform.h"
+
+namespace bbcreaVtk
+{
+
+class bbcreaVtk_EXPORT TransformVector
+ :
+ public bbtk::AtomicBlackBox
+{
+ BBTK_BLACK_BOX_INTERFACE(TransformVector,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(InX,std::vector<double>);
+ BBTK_DECLARE_INPUT(InY,std::vector<double>);
+ BBTK_DECLARE_INPUT(InZ,std::vector<double>);
+ BBTK_DECLARE_INPUT(Transform,vtkLinearTransform*);
+
+ BBTK_DECLARE_OUTPUT(OutX,std::vector<double>);
+ BBTK_DECLARE_OUTPUT(OutY,std::vector<double>);
+ BBTK_DECLARE_OUTPUT(OutZ,std::vector<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(TransformVector,bbtk::AtomicBlackBox);
+ BBTK_NAME("TransformVector");
+ BBTK_AUTHOR("Info-Dev");
+ BBTK_DESCRIPTION("No Description.");
+ BBTK_CATEGORY("empty");
+
+ BBTK_INPUT(TransformVector,InX,"Xvector input",std::vector<double>,"");
+ BBTK_INPUT(TransformVector,InY,"Yvector input",std::vector<double>,"");
+ BBTK_INPUT(TransformVector,InZ,"Zvector input",std::vector<double>,"");
+ BBTK_INPUT(TransformVector,Transform,"Transform",vtkLinearTransform*,"");
+
+ BBTK_OUTPUT(TransformVector,OutX,"Xvector output",std::vector<double>,"");
+ BBTK_OUTPUT(TransformVector,OutY,"Xvector output",std::vector<double>,"");
+ BBTK_OUTPUT(TransformVector,OutZ,"Xvector output",std::vector<double>,"");
+
+BBTK_END_DESCRIBE_BLACK_BOX(TransformVector);
+//=====
+// 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 // __bbcreaVtkTransformVector_h_INCLUDED__
+