if(!bbGetInputPointsX1().empty() && !bbGetInputPointsX2().empty())
{
- _vector->SetData(bbGetInputPointsX1(), bbGetInputPointsX2(), bbGetInputPointsY1(), bbGetInputPointsY2(), bbGetInputPointsZ1(), bbGetInputPointsZ2());
- _vector->Run();
+ //Checks that all the vector points are defined
+ if(bbGetInputPointsX1()[1] != NULL && bbGetInputPointsX2()[1] != NULL)
+ {
+ _vector->SetData(bbGetInputPointsX1(), bbGetInputPointsX2(), bbGetInputPointsY1(), bbGetInputPointsY2(), bbGetInputPointsZ1(), bbGetInputPointsZ2());
+ _vector->Run();
- bbSetOutputOrigin(_vector->GetOrigin());
- bbSetOutputOriginReslicer(_vector->GetOriginReslicer());
+ bbSetOutputOrigin(_vector->GetOrigin());
+ bbSetOutputOriginReslicer(_vector->GetOriginReslicer());
+ }
}
}
void CalculateVectorBox::bbUserSetDefaultValues()
/*The rotation axis (this axis is defined by the cross product of the 2 vectors)*/
BBTK_DECLARE_OUTPUT(TransformAxis, std::vector<double>);
-
+ /*Scale difference in X*/
BBTK_DECLARE_OUTPUT(OutScaleX,int);
+
+ /*Scale difference in Y*/
BBTK_DECLARE_OUTPUT(OutScaleY,int);
+
+ /*Scale difference in Z*/
BBTK_DECLARE_OUTPUT(OutScaleZ,int);
+
+ /*Rotation Angle*/
BBTK_DECLARE_OUTPUT(OutAngle,double);
BBTK_PROCESS(Process);
void Process();
private:
+
VectorMath *_vector;
};
--- /dev/null
+#include "bbPackRecalageImageRecalageProperties.h"
+#include "bbPackRecalagePackage.h"
+namespace bbPackRecalage
+{
+
+BBTK_ADD_BLACK_BOX_TO_PACKAGE(PackRecalage,ImageRecalageProperties)
+BBTK_BLACK_BOX_IMPLEMENTATION(ImageRecalageProperties,bbtk::AtomicBlackBox);
+void ImageRecalageProperties::Process()
+{
+ image = bbGetInputIn();
+ if(image != NULL)
+ {
+ bbSetOutputLengthZ((int)image->GetDimensions()[2] - 1);
+ if(image->GetScalarType() == VTK_DOUBLE)
+ {
+ bbSetOutputColorLevel(50);
+ bbSetOutputMidColorLevel(25);
+ }
+ else if(image->GetScalarType() == VTK_UNSIGNED_SHORT)
+ {
+ bbSetOutputColorLevel(25000);
+ bbSetOutputMidColorLevel(12500);
+ }
+ else
+ {
+ bbSetOutputColorLevel(500);
+ bbSetOutputMidColorLevel(250);
+ }
+ }
+}
+void ImageRecalageProperties::bbUserSetDefaultValues()
+{
+ bbSetInputIn(NULL);
+ image = NULL;
+}
+void ImageRecalageProperties::bbUserInitializeProcessing()
+{
+
+// THE INITIALIZATION METHOD BODY :
+// Here does nothing
+// but this is where you should allocate the internal/output pointers
+// if any
+
+
+}
+void ImageRecalageProperties::bbUserFinalizeProcessing()
+{
+ image->Delete();
+}
+}
+// EO namespace bbPackRecalage
\ No newline at end of file
--- /dev/null
+#ifndef __bbPackRecalageImageRecalageProperties_h_INCLUDED__
+#define __bbPackRecalageImageRecalageProperties_h_INCLUDED__
+#include "bbPackRecalage_EXPORT.h"
+#include "bbtkAtomicBlackBox.h"
+#include "iostream"
+
+#include "vtkImageData.h"
+
+namespace bbPackRecalage
+{
+
+class bbPackRecalage_EXPORT ImageRecalageProperties
+ :
+ public bbtk::AtomicBlackBox
+{
+ BBTK_BLACK_BOX_INTERFACE(ImageRecalageProperties,bbtk::AtomicBlackBox);
+ BBTK_DECLARE_INPUT(In,vtkImageData*);
+ BBTK_DECLARE_OUTPUT(LengthZ,int);
+ BBTK_DECLARE_OUTPUT(ColorLevel,int);
+ BBTK_DECLARE_OUTPUT(MidColorLevel,int);
+ BBTK_PROCESS(Process);
+ void Process();
+
+ private:
+ vtkImageData *image;
+};
+
+BBTK_BEGIN_DESCRIBE_BLACK_BOX(ImageRecalageProperties,bbtk::AtomicBlackBox);
+BBTK_NAME("ImageRecalageProperties");
+BBTK_AUTHOR("jn.trillos44@uniandes.edu.co");
+BBTK_DESCRIPTION("Finds image properties necessary for image registration.");
+BBTK_CATEGORY("image");
+BBTK_INPUT(ImageRecalageProperties,In,"Image",vtkImageData*,"");
+BBTK_OUTPUT(ImageRecalageProperties,LengthZ,"Lenght in Z",int,"");
+BBTK_OUTPUT(ImageRecalageProperties,ColorLevel,"ColorLevel/WindowLevel range of the Image",int,"");
+BBTK_OUTPUT(ImageRecalageProperties,MidColorLevel,"Medium value of the ColorLevel/WindowLevel range of the Image",int,"");
+BBTK_END_DESCRIBE_BLACK_BOX(ImageRecalageProperties);
+}
+// EO namespace bbPackRecalage
+
+#endif // __bbPackRecalageImageRecalageProperties_h_INCLUDED__
+