--- /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 "bbcreaContoursSetColorLayerImage.h"
+#include "bbcreaContoursPackage.h"
+
+#include "wxContourMainFrame.h"
+
+namespace bbcreaContours
+{
+
+BBTK_ADD_BLACK_BOX_TO_PACKAGE(creaContours,SetColorLayerImage)
+BBTK_BLACK_BOX_IMPLEMENTATION(SetColorLayerImage,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 SetColorLayerImage::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 (wxContourMainFrame::getInstance()!=NULL)
+ {
+ if (bbGetInputIn()!=NULL)
+ {
+ wxContourMainFrame::getInstance()->SetColorLayerImage( bbGetInputIn() );
+ } // InputIn
+/*
+ if (wxContourMainFrame::getInstance()->GetFileLocation().empty()==true)
+ {
+ wxContourMainFrame::getInstance()->SetFileLocation(bbGetInputFileLocation() );
+ }else {
+ wxContourMainFrame::getInstance()->onSave();
+ wxContourMainFrame::getInstance()->deleteAllContours();
+ wxContourMainFrame::getInstance()->SetFileLocation(bbGetInputFileLocation() );
+ } // if FileLocaton
+
+ wxContourMainFrame::getInstance()->onLoad();
+ wxContourMainFrame::getInstance()->RefreshInterface();
+*/
+ } // if Instance
+
+}
+//=====
+// 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 SetColorLayerImage::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 SetColorLayerImage::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 SetColorLayerImage::bbUserFinalizeProcessing()
+{
+
+// THE FINALIZATION METHOD BODY :
+// Here does nothing
+// but this is where you should desallocate the internal/output pointers
+// if any
+
+}
+}
+// EO namespace bbcreaContours
+
+
--- /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 __bbcreaContoursSetColorLayerImage_h_INCLUDED__
+#define __bbcreaContoursSetColorLayerImage_h_INCLUDED__
+
+#include "bbcreaContours_EXPORT.h"
+#include "bbtkAtomicBlackBox.h"
+#include "iostream"
+
+#include "vtkImageData.h"
+
+
+namespace bbcreaContours
+{
+
+class bbcreaContours_EXPORT SetColorLayerImage
+ :
+ public bbtk::AtomicBlackBox
+{
+ BBTK_BLACK_BOX_INTERFACE(SetColorLayerImage,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(wxContourMainFrame,wxContourMainFrame*);
+ BBTK_DECLARE_INPUT(In,vtkImageData*);
+// 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(SetColorLayerImage,bbtk::AtomicBlackBox);
+ BBTK_NAME("SetColorLayerImage");
+ BBTK_AUTHOR("InfoDev");
+ BBTK_DESCRIPTION("No Description.");
+ BBTK_CATEGORY("empty");
+
+// BBTK_INPUT(SetColorLayerImage,wxContourMainFrame,"wxContourMainFrame",wxContourMainFrame*,"");
+ BBTK_INPUT(SetColorLayerImage,In,"Input image",vtkImageData*,"");
+// BBTK_OUTPUT(SetColorLayerImage,Out,"First output",double,"");
+BBTK_END_DESCRIBE_BLACK_BOX(SetColorLayerImage);
+//=====
+// 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 bbcreaContours
+
+#endif // __bbcreaContoursSetColorLayerImage_h_INCLUDED__
+
return _viewColorLayerImagePanel;
}
+void wxContourMainFrame::SetColorLayerImage(vtkImageData* img)
+{
+ if (_viewColorLayerImagePanel!=NULL)
+ {
+ if (img!=NULL)
+ {
+ _viewColorLayerImagePanel->SetImage( img );
+ RefreshInterface();
+ } // img
+ } // _viewColorLayerImagePanel
+}
wxPanel *wxContourMainFrame::getThresholdImageViewPanel(wxWindow *parent)
{
{
double range[2];
_theViewPanel->getImageData()->GetScalarRange(range);
- int min = (int)floor (range[0]);
- int max = (int)ceil (range[1]);
- int start= (max+min)/2 - (max-min)*0.25;
- int end= (max+min)/2 + (max-min)*0.25;
- _viewThresholdImagePanel = new ThresholdImageViewPanel( parent, min, max, start, end , 1);
- _viewThresholdImage = new ThresholdImageView();
+ int min = (int)floor (range[0]);
+ int max = (int)ceil (range[1]);
+ int start = (max+min)/2 - (max-min)*0.25;
+ int end = (max+min)/2 + (max-min)*0.25;
+ _viewThresholdImagePanel = new ThresholdImageViewPanel( parent, min, max, start, end , 1);
+ _viewThresholdImage = new ThresholdImageView();
_viewThresholdImage->SetminMaxValue(start,end);
+// _viewThresholdImage->SetminMaxValue(range[0],range[1]);
_viewThresholdImage->SetImage( _theViewPanel->getImageData() );
std::vector<int> colorbarposition;
colorbarposition.push_back( 10 );
void SetContourGroup(int contourGroup);
wxPanel *getThresholdImageViewPanel(wxWindow *parent);
wxPanel *getColorLayerImageViewPanel(wxWindow *parent);
+ void SetColorLayerImage(vtkImageData*);
//CMRU 17-08-09-----------------------------------------------------------------------------------------------