--- /dev/null
+#include "bbPackRecalageDuplicateImageBox.h"
+#include "bbPackRecalagePackage.h"
+namespace bbPackRecalage
+{
+
+BBTK_ADD_BLACK_BOX_TO_PACKAGE(PackRecalage,DuplicateImageBox)
+BBTK_BLACK_BOX_IMPLEMENTATION(DuplicateImageBox,bbtk::AtomicBlackBox);
+void DuplicateImageBox::Process()
+{
+ vtkImageData *duplicate = vtkImageData::New();
+ bbGetInputIn()->ShallowCopy(duplicate);
+ bbSetOutputOut(duplicate);
+}
+void DuplicateImageBox::bbUserSetDefaultValues()
+{
+ bbSetInputIn(NULL);
+ bbSetOutputOut(NULL);
+}
+void DuplicateImageBox::bbUserInitializeProcessing()
+{
+
+// THE INITIALIZATION METHOD BODY :
+// Here does nothing
+// but this is where you should allocate the internal/output pointers
+// if any
+
+
+}
+void DuplicateImageBox::bbUserFinalizeProcessing()
+{
+
+// THE FINALIZATION METHOD BODY :
+// Here does nothing
+// but this is where you should desallocate the internal/output pointers
+// if any
+
+}
+}
+// EO namespace bbPackRecalage
+
+
--- /dev/null
+#ifndef __bbPackRecalageDuplicateImageBox_h_INCLUDED__
+#define __bbPackRecalageDuplicateImageBox_h_INCLUDED__
+#include "bbPackRecalage_EXPORT.h"
+#include "bbtkAtomicBlackBox.h"
+#include "iostream"
+
+#include "vtkImageData.h"
+
+namespace bbPackRecalage
+{
+
+class bbPackRecalage_EXPORT DuplicateImageBox
+ :
+ public bbtk::AtomicBlackBox
+{
+ BBTK_BLACK_BOX_INTERFACE(DuplicateImageBox,bbtk::AtomicBlackBox);
+ BBTK_DECLARE_INPUT(In,vtkImageData*);
+ BBTK_DECLARE_OUTPUT(Out,vtkImageData*);
+ BBTK_PROCESS(Process);
+ void Process();
+};
+
+BBTK_BEGIN_DESCRIBE_BLACK_BOX(DuplicateImageBox,bbtk::AtomicBlackBox);
+BBTK_NAME("DuplicateImageBox");
+BBTK_AUTHOR("jn.trillos44@uniandes.edu.co");
+BBTK_DESCRIPTION("Creates a shallow copy of its image input");
+BBTK_CATEGORY("__CATEGORY__");
+BBTK_INPUT(DuplicateImageBox,In,"Original Image",vtkImageData*,"");
+BBTK_OUTPUT(DuplicateImageBox,Out,"Duplicated Image",vtkImageData*,"");
+BBTK_END_DESCRIBE_BLACK_BOX(DuplicateImageBox);
+}
+// EO namespace bbPackRecalage
+
+#endif // __bbPackRecalageDuplicateImageBox_h_INCLUDED__
+
--- /dev/null
+#include "bbPackRecalageFileOpenSaveWidget.h"
+#include "bbPackRecalagePackage.h"
+namespace bbPackRecalage
+{
+
+BBTK_ADD_BLACK_BOX_TO_PACKAGE(PackRecalage,FileOpenSaveWidget)
+BBTK_BLACK_BOX_IMPLEMENTATION(FileOpenSaveWidget,bbtk::WxBlackBox);
+void FileOpenSaveWidget::Process()
+{
+
+ std::string msg;
+ if (bbGetInputTitle()!="")
+ {
+ msg = bbGetInputTitle()+": " + bbGetInputIn();
+ }
+ else
+ {
+ msg = bbGetInputIn();
+ }
+ ((wxStaticText*)bbGetOutputWidget())->SetLabel( bbtk::std2wx( msg ) );
+
+}
+void FileOpenSaveWidget::CreateWidget(wxWindow* parent)
+{
+
+ bbSetOutputWidget( new wxStaticText ( parent , -1 , _T("") ) );
+
+}
+void FileOpenSaveWidget::bbUserSetDefaultValues()
+{
+
+}
+void FileOpenSaveWidget::bbUserInitializeProcessing()
+{
+
+}
+void FileOpenSaveWidget::bbUserFinalizeProcessing()
+{
+
+}
+}
+// EO namespace bbPackRecalage
+
+
--- /dev/null
+#ifdef _USE_WXWIDGETS_
+#ifndef __bbPackRecalageFileOpenSaveWidget_h_INCLUDED__
+#define __bbPackRecalageFileOpenSaveWidget_h_INCLUDED__
+#include "bbPackRecalage_EXPORT.h"
+#include "bbtkWxBlackBox.h"
+
+namespace bbPackRecalage
+{
+
+class bbPackRecalage_EXPORT FileOpenSaveWidget
+ :
+ public bbtk::WxBlackBox
+{
+ BBTK_BLACK_BOX_INTERFACE(FileOpenSaveWidget,bbtk::WxBlackBox);
+ BBTK_DECLARE_INPUT(Title,std::string);
+ BBTK_DECLARE_INPUT(In,std::string);
+ BBTK_PROCESS(Process);
+ void Process();
+ BBTK_CREATE_WIDGET(CreateWidget);
+ void CreateWidget(wxWindow*);
+};
+
+BBTK_BEGIN_DESCRIBE_BLACK_BOX(FileOpenSaveWidget,bbtk::WxBlackBox);
+BBTK_NAME("FileOpenSaveWidget");
+BBTK_AUTHOR("jn.trillos44@uniandes.edu.co");
+BBTK_DESCRIPTION("A general Open and Save Widget that uses a file selector and writes and opens .xls files");
+BBTK_CATEGORY("__CategoryBlackBox__");
+BBTK_INPUT(FileOpenSaveWidget,Title,"Title prepended to the text",std::string,"");
+BBTK_INPUT(FileOpenSaveWidget,In,"Text",std::string,"");
+BBTK_END_DESCRIBE_BLACK_BOX(FileOpenSaveWidget);
+}
+// EO namespace bbPackRecalage
+
+#endif // __bbPackRecalageFileOpenSaveWidget_h_INCLUDED__
+#endif // _USE_WXWIDGETS_
+
--- /dev/null
+#include "bbPackRecalageResampleBox.h"
+#include "bbPackRecalagePackage.h"
+namespace bbPackRecalage
+{
+
+BBTK_ADD_BLACK_BOX_TO_PACKAGE(PackRecalage,ResampleBox)
+BBTK_BLACK_BOX_IMPLEMENTATION(ResampleBox,bbtk::AtomicBlackBox);
+void ResampleBox::Process()
+{
+ if(bbGetInputIn() != NULL && bbGetInputFactor() != 0)
+ {
+ double factor = bbGetInputFactor();
+ resample->SetInput(bbGetInputIn());
+ resample->SetAxisMagnificationFactor(0, factor);
+ resample->SetAxisMagnificationFactor(1, factor);
+ resample->SetAxisMagnificationFactor(2, factor);
+ resample->Update();
+ vtkImageData *image = resample->GetOutput();
+ std::cout << "NTU: new spacing!" << image->GetExtent()[1] << " " << image->GetExtent()[3] << " " << image->GetExtent()[5] << " " << image->GetSpacing()[0] << " " << image->GetSpacing()[1] << " " << image->GetSpacing()[2] << std::endl;
+ bbSetOutputOut(resample->GetOutput());
+ }
+ else
+ {
+ bbSetOutputOut(NULL);
+ }
+}
+void ResampleBox::bbUserSetDefaultValues()
+{
+ bbSetInputIn(NULL);
+ bbSetInputFactor(0);
+ bbSetOutputOut(NULL);
+}
+void ResampleBox::bbUserInitializeProcessing()
+{
+ resample = vtkImageResample::New();
+}
+void ResampleBox::bbUserFinalizeProcessing()
+{
+ resample->Delete();
+}
+}
+// EO namespace bbPackRecalage
+
+
--- /dev/null
+#ifndef __bbPackRecalageResampleBox_h_INCLUDED__
+#define __bbPackRecalageResampleBox_h_INCLUDED__
+#include "bbPackRecalage_EXPORT.h"
+#include "bbtkAtomicBlackBox.h"
+#include "iostream"
+#include "vtkImageResample.h"
+#include "vtkImageData.h"
+
+namespace bbPackRecalage
+{
+
+class bbPackRecalage_EXPORT ResampleBox
+ :
+ public bbtk::AtomicBlackBox
+{
+ BBTK_BLACK_BOX_INTERFACE(ResampleBox,bbtk::AtomicBlackBox);
+ BBTK_DECLARE_INPUT(In,vtkImageData *);
+ BBTK_DECLARE_INPUT(Factor,double);
+ BBTK_DECLARE_OUTPUT(Out,vtkImageData *);
+ BBTK_PROCESS(Process);
+ void Process();
+
+ vtkImageResample *resample;
+};
+
+BBTK_BEGIN_DESCRIBE_BLACK_BOX(ResampleBox,bbtk::AtomicBlackBox);
+BBTK_NAME("ResampleBox");
+BBTK_AUTHOR("jn.trillos44@uniandes.edu.co");
+BBTK_DESCRIPTION("Does resampling of an image, creating a copy of the original image with different extent and spacing");
+BBTK_CATEGORY("filter");
+BBTK_INPUT(ResampleBox,In,"Original image",vtkImageData *,"");
+BBTK_INPUT(ResampleBox,Factor,"Resampling factor",double,"");
+BBTK_OUTPUT(ResampleBox,Out,"Resampled image",vtkImageData *,"");
+BBTK_END_DESCRIBE_BLACK_BOX(ResampleBox);
+}
+// EO namespace bbPackRecalage
+
+#endif // __bbPackRecalageResampleBox_h_INCLUDED__
+