${${BBTK_PACKAGE_NAME}_LIBS}
${ITK_LIBRARIES}
)
+
+ #Need to add additional gdcm libraries provided by system
+ IF(WIN32)
+ IF(USE_GDCM2)
+ SET(${BBTK_PACKAGE_NAME}_LIBS
+ ${${BBTK_PACKAGE_NAME}_LIBS}
+ vtkgdcm gdcmIOD gdcmMSFF gdcmexpat gdcmCommon gdcmMEXD gdcmDSED gdcmDICT
+ gdcmjpeg8 gdcmjpeg12 gdcmjpeg16 socketxx gdcmopenjpeg gdcmcharls
+ )
+ ENDIF()
+ ENDIF(WIN32)
ENDIF(${BBTK_PACKAGE_NAME}_USE_ITK)
IF(${BBTK_PACKAGE_NAME}_USE_QT)
${${BBTK_PACKAGE_NAME}_LIBS}
${GDCM_LIBRARIES}
)
+
IF(USE_GDCM)
IF(USE_GDCM2)
message(FATAL_ERROR "You cannot select both GDCM and GDCM2 (DICOM library readers)")
IF(${BBTK_PACKAGE_NAME}_USE_GDCM2)
SET(USE_GDCM2 ON CACHE BOOL "Use GDCM2" FORCE)
SET(USE_GDCM2_VTK ON CACHE BOOL "Use GDCM2_VTK" FORCE)
- SET(${BBTK_PACKAGE_NAME}_LIBS
- ${${BBTK_PACKAGE_NAME}_LIBS}
- ${GDCM2_LIBRARIES}
- )
+ #For some reasons GDCM_LIBRARY is not defined for gdcm2 in windows
+ IF(WIN32)
+ SET(${BBTK_PACKAGE_NAME}_LIBS
+ ${${BBTK_PACKAGE_NAME}_LIBS}
+ vtkgdcm gdcmIOD gdcmMSFF gdcmexpat gdcmCommon gdcmMEXD gdcmDSED gdcmDICT
+ gdcmjpeg8 gdcmjpeg12 gdcmjpeg16 socketxx gdcmopenjpeg gdcmcharls
+ )
+ ELSE(WIN32)
+ SET(${BBTK_PACKAGE_NAME}_LIBS
+ ${${BBTK_PACKAGE_NAME}_LIBS}
+ ${GDCM_LIBRARY}
+ )
+ ENDIF(WIN32)
+
IF(USE_GDCM2)
IF(USE_GDCM)
message(FATAL_ERROR "You cannot select both GDCM and GDCM2 (DICOM library readers)")
)
#===========================================================================
-#===========================================================================
+IF(USE_GDCM)
SET(${BBTK_PACKAGE_NAME}_LIBS
- # LIST HERE THE ADDITIONAL LIBS TO LINK AGAINST
- # EXCEPT : the same libs than for INCLUDE_DIRS
vtkgdcm
- )
-#===========================================================================
+ )
+ENDIF(USE_GDCM)
+
#===========================================================================
SET(@BBTK_PACKAGE_NAME@_BUILD_VERSION @BBTK_PACKAGE_BUILD_VERSION@)
SET(@BBTK_PACKAGE_NAME@_INCLUDE_DIRS @BBTK_PACKAGE_INCLUDE_DIRS@)
SET(@BBTK_PACKAGE_NAME@_LIBS @BBTK_PACKAGE_LIBS@)
+
+
# A BBTK PACKAGE NEEDS BBTK
FIND_PACKAGE(BBTK REQUIRED)
# BBTK Package configuration file inclusion
#---------------------------------------------------------------------------
# Include src configuration cmake script
INCLUDE(${BBTK_CMAKE_DIR}/BBTKConfigurePackage_src.cmake)
-#EED 6Mars2010
+
+
add_dependencies(bb${BBTK_PACKAGE_NAME} bbfy)
#---------------------------------------------------------------------------
void GetInfoGdcmReader::bbUserSetDefaultValues()
{
#if defined USE_GDCM2
- read=NULL;
+ reader=NULL;
#endif
#if defined USE_GDCM
reader=NULL;
--- /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 "bbstdDoubleToInt.h"
+#include "bbstdPackage.h"
+namespace bbstd
+{
+
+BBTK_ADD_BLACK_BOX_TO_PACKAGE(std,DoubleToInt)
+BBTK_BLACK_BOX_IMPLEMENTATION(DoubleToInt,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 DoubleToInt::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( (int)bbGetInputIn() );
+
+}
+//=====
+// 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 DoubleToInt::bbUserSetDefaultValues()
+{
+
+// SET HERE THE DEFAULT INPUT/OUTPUT VALUES OF YOUR BOX
+// Here we initialize the input 'In' to 0
+ bbSetInputIn(0);
+
+}
+//=====
+// 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 DoubleToInt::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 DoubleToInt::bbUserFinalizeProcessing()
+{
+
+// THE FINALIZATION METHOD BODY :
+// Here does nothing
+// but this is where you should desallocate the internal/output pointers
+// if any
+
+}
+}
+// EO namespace bbstd
+
+
--- /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 __bbstdDoubleToInt_h_INCLUDED__
+#define __bbstdDoubleToInt_h_INCLUDED__
+#include "bbstd_EXPORT.h"
+#include "bbtkAtomicBlackBox.h"
+#include "iostream"
+
+namespace bbstd
+{
+
+class bbstd_EXPORT DoubleToInt
+ :
+ public bbtk::AtomicBlackBox
+{
+ BBTK_BLACK_BOX_INTERFACE(DoubleToInt,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,double);
+ BBTK_DECLARE_OUTPUT(Out,int);
+ 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(DoubleToInt,bbtk::AtomicBlackBox);
+BBTK_NAME("DoubleToInt");
+BBTK_AUTHOR("Claire Mouton");
+BBTK_DESCRIPTION("Converts a double to an int");
+BBTK_CATEGORY("");
+BBTK_INPUT(DoubleToInt,In,"Double input",double,"");
+BBTK_OUTPUT(DoubleToInt,Out,"Int output",int,"");
+BBTK_END_DESCRIBE_BLACK_BOX(DoubleToInt);
+//=====
+// 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 bbstd
+
+#endif // __bbstdDoubleToInt_h_INCLUDED__
+
FILE *ff1 = fopen( bbGetInputFileName().c_str() , "r+" );
if (ff1!=NULL)
{
+ if (!feof(ff1))
+ fscanf(ff1,"%s",tmpValue);
+
while (!feof(ff1))
{
for( i=0 ; i<bbGetInputDimension() ; i++)
{
- fscanf(ff1,"%s",tmpValue);
vecData=tlst[i];
vecData->push_back( atof(tmpValue) );
+ fscanf(ff1,"%s",tmpValue);
}
numberOfLines++;
}
void SphereList::Process()
{
- int iMin, iMax;
+ int iMin, iMax;
double px = 0.0;
double py = 0.0;
double pz = 0.0;
int last_valid_color_index = 0;
+
if (bbGetInputRenderer()!=NULL)
{
- if (bbGetInputSpacing().size()==3)
- {
+ // If it is not the first time Process is executed, the actors have already been created. The only thing to do is to update the opacity.
+ if (sphereActor.size() != 0)
+ {
+ for (int i = 0; i < sphereActor.size(); i++)
+ sphereActor[i] -> GetProperty() -> SetOpacity( bbGetInputOpacity() );
+ }
+ else
+ {
+ if (bbGetInputSpacing().size()==3)
+ {
spc[0]=bbGetInputSpacing()[0];
spc[1]=bbGetInputSpacing()[1];
spc[2]=bbGetInputSpacing()[2];
- } else {
+ }
+ else
+ {
spc[0]=spc[1]=spc[2]=1;
- }
-
- iMin=0;
- iMax=bbGetInputlstPointX().size();
- printf("EED SphereList::Process iMax=%d \n", iMax);
- // If the vector Y or respectively the vector Z has a different size from the vector X, the position value py or respectively pz is set to 0.
- for ( int i=iMin ; i<iMax ; i=i+1 )
- {
+ }
+
+ iMin=0;
+ iMax=bbGetInputlstPointX().size();
+ printf("EED SphereList::Process iMax=%d \n", iMax);
+ for (int i = 0; i < iMax; i++)
+ {
+ std::cout << "CM SphereList::Process i=" << i << " bbGetInputlstPointX()[i]=" << bbGetInputlstPointX()[i] << std::endl;
+ std::cout << "CM SphereList::Process i=" << i << " bbGetInputlstPointY()[i]=" << bbGetInputlstPointY()[i] << std::endl;
+ std::cout << "CM SphereList::Process i=" << i << " bbGetInputlstPointZ()[i]=" << bbGetInputlstPointZ()[i] << std::endl;
+ }
+ // If the vector Y or respectively the vector Z has a different size from the vector X, the position value py or respectively pz is set to 0.
+ for ( int i=iMin ; i<iMax; i=i+1 )
+ {
px = bbGetInputlstPointX()[i]*spc[0];
if (bbGetInputlstPointY().size() == bbGetInputlstPointX().size() )
{
// If the number of elements in the radio list is different from the number of X coordinates, the radio value is set to 1.
if (bbGetInputlstRadio().size() == bbGetInputlstPointX().size() )
- {
+ {
radio = bbGetInputlstRadio()[i];
- }
+ }
else
- {
- if (bbGetInputlstRadio().size()>=1){
- radio = bbGetInputlstRadio()[ bbGetInputlstRadio().size() - 1 ];
- } else {
- radio = 1.0;
- }
- }
+ {
+ if (bbGetInputlstRadio().size()>=1)
+ {
+ radio = bbGetInputlstRadio()[ bbGetInputlstRadio().size() - 1 ];
+ }
+ else
+ {
+ radio = 1.0;
+ }
+ }
// Sphere
vtkSphereSource * newSphere = vtkSphereSource::New();
- vtkSphere.push_back(newSphere);
newSphere -> SetThetaResolution(20);
newSphere -> SetPhiResolution(20);
newSphere -> SetRadius(radio);
vtkPolyDataMapper * newMapper = vtkPolyDataMapper::New();
- sphereMapper.push_back(newMapper);
newMapper -> SetInput( newSphere -> GetOutput() );
vtkActor * newActor = vtkActor::New();
unsigned int j = 3*i +2;
if (j < bbGetInputColour().size() )
- {
+ {
newActor -> GetProperty() -> SetColor( bbGetInputColour()[3*i] , bbGetInputColour()[3*i + 1] , bbGetInputColour()[3*i + 2] );
last_valid_color_index = 3*i;
- }
+ }
else
newActor -> GetProperty() -> SetColor( bbGetInputColour()[last_valid_color_index] , bbGetInputColour()[last_valid_color_index + 1] , bbGetInputColour()[last_valid_color_index + 2] );
if (bbGetInputRenderer()!=NULL)
- {
+ {
bbGetInputRenderer() -> AddActor( newActor );
- }
-
- } // for
-
- if (sphereActor.size() != 0)
- {
- // Sets the output.
- bbSetOutputActorList(sphereActor);
- }
+ }
- } // if (bbGetInputRenderer()!=NULL)
+ } // for
+ if (sphereActor.size() != 0)
+ {
+ // Sets the output.
+ bbSetOutputActorList(sphereActor);
+ }
+
+ } // if (bbGetInputRenderer()!=NULL)
+ } // if (sphereActor.size() != 0)
}
void SphereList::bbUserSetDefaultValues()
void Process();
std::vector<vtkActor *> sphereActor;
- std::vector<vtkPolyDataMapper *> sphereMapper;
- std::vector<vtkSphereSource *> vtkSphere;
};