//=====
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
wxcontourmainframe->SetColorLayerImage( bbGetInputIn() );
} // InputIn
} // 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
-
-
+// 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
+
+}// EO namespace bbcreaContours
BBTK_ADD_BLACK_BOX_TO_PACKAGE(creaContours,SetFileLocation)
BBTK_BLACK_BOX_IMPLEMENTATION(SetFileLocation,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 SetFileLocation::Process()
{
-
// THE MAIN PROCESSING METHOD BODY
// Here we simply set the input 'In' value to the output 'Out'
// And print out the output value
// bbSetOutputOut( bbGetInputIn() );
// std::cout << "Output value = " <<bbGetOutputOut() << std::endl;
-
-
if (wxContourMainFrame::getInstance()!=NULL)
{
if (wxContourMainFrame::getInstance()->GetFileLocation().empty()==true)
wxContourMainFrame::getInstance()->deleteAllContours();
wxContourMainFrame::getInstance()->SetFileLocation( bbGetInputFileLocation() );
} // if FileLocaton
-
wxContourMainFrame::getInstance()->onLoad( false );
-
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 SetFileLocation::bbUserSetDefaultValues()
{
-
// SET HERE THE DEFAULT INPUT/OUTPUT VALUES OF YOUR BOX
// Here we initialize the input 'In' to 0
bbSetInputFileLocation("");
-
}
-//=====
+
+//=====
// 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 SetFileLocation::bbUserInitializeProcessing()
{
-
// THE INITIALIZATION METHOD BODY :
// Here does nothing
// but this is where you should allocate the internal/output pointers
-// if any
-
-
+// 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 SetFileLocation::bbUserFinalizeProcessing()
{
-
// THE FINALIZATION METHOD BODY :
// Here does nothing
// but this is where you should desallocate the internal/output pointers
// if any
-
}
-}
-// EO namespace bbcreaContours
+
+}// 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)
+//=====
+#include "bbcreaContourswxContourMainFrame_tool.h"
+#include "bbcreaContoursPackage.h"
+
+#include "wxContourMainFrame.h"
+
+namespace bbcreaContours
+{
+
+BBTK_ADD_BLACK_BOX_TO_PACKAGE(creaContours,wxContourMainFrame_tool)
+BBTK_BLACK_BOX_IMPLEMENTATION(wxContourMainFrame_tool,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 wxContourMainFrame_tool::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 (bbGetInputType()==1)
+ {
+ if (bbGetInputImage()!=NULL)
+ {
+ wxContourMainFrame::getInstance()->onSegmentationAllSlices2(10 ,128,5,2, bbGetInputImage() ); // step,isovalue,sampling,method
+ } // if Image
+ } // Type==1
+ }
+
+}
+//=====
+// 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 wxContourMainFrame_tool::bbUserSetDefaultValues()
+{
+// SET HERE THE DEFAULT INPUT/OUTPUT VALUES OF YOUR BOX
+// Here we initialize the input 'In' to 0
+ bbSetInputType(0);
+ bbSetInputImage(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 wxContourMainFrame_tool::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 wxContourMainFrame_tool::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 __bbcreaContourswxContourMainFrame_tool_h_INCLUDED__
+#define __bbcreaContourswxContourMainFrame_tool_h_INCLUDED__
+
+#include "bbcreaContours_EXPORT.h"
+#include "bbtkAtomicBlackBox.h"
+#include "iostream"
+
+#include "vtkImageData.h"
+
+namespace bbcreaContours
+{
+
+class bbcreaContours_EXPORT wxContourMainFrame_tool
+ :
+ public bbtk::AtomicBlackBox
+{
+ BBTK_BLACK_BOX_INTERFACE(wxContourMainFrame_tool,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( Type , int );
+ BBTK_DECLARE_INPUT( Param1, std::vector<double> );
+ BBTK_DECLARE_INPUT( Image , 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(wxContourMainFrame_tool,bbtk::AtomicBlackBox);
+ BBTK_NAME("wxContourMainFrame_tool");
+ BBTK_AUTHOR("InfoDev");
+ BBTK_DESCRIPTION("No Description.");
+ BBTK_CATEGORY("empty");
+ BBTK_INPUT(wxContourMainFrame_tool,Type,"(default 0) Type 0:nothing 1:Isovalue segmentation of Image",int,"");
+ BBTK_INPUT(wxContourMainFrame_tool,Param1,"List of parameters Type1:[isovalue] ", std::vector<double>,"");
+ BBTK_INPUT(wxContourMainFrame_tool,Image,"Image", vtkImageData*,"");
+// BBTK_OUTPUT(wxContourMainFrame_tool,Out,"First output",double,"");
+BBTK_END_DESCRIBE_BLACK_BOX(wxContourMainFrame_tool);
+//=====
+// 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 // __bbcreaContourswxContourMainFrame_tool_h_INCLUDED__
+
return wxContourMainFrame::getInstance()->GetImageDataSizeZ();
}
-void interfMainPanel::onSegmentationAllSlice(int minZ,int maxZ,int isovalue,int sampling,int method)
+void interfMainPanel::onSegmentationAllSlices(int minZ,int maxZ,int isovalue,int sampling,int method)
{
- wxContourMainFrame::getInstance()->onSegmentationAllSlice(minZ, maxZ,isovalue,sampling,method);
+ wxContourMainFrame::getInstance()->onSegmentationAllSlices(minZ, maxZ,isovalue,sampling,method);
}
void interfMainPanel::setLabelSegmentationPanelVTK(wxString tmpString)
void onSegmentationOneSlice(int isovalue,int sampling,int method);
void onSegmentationOneSliceITK(wxString distance, wxString sigma, wxString alfa, wxString beta, wxString propagation, wxString iterations, wxString inflation);
int GetImageDataSizeZ();
- void onSegmentationAllSlice(int minZ,int maxZ,int isovalue,int sampling,int method);
+ void onSegmentationAllSlices(int minZ,int maxZ,int isovalue,int sampling,int method);
void onMirrorPressed();
void onMirror();
void onMirrorAxisShow();
int isovalue = _isovalue->GetValue();
int sampling = _sampling->GetValue();
int method = methodRadiobox->GetSelection();
- interfMainPanel::getInstance()->onSegmentationAllSlice(minZ, maxZ, isovalue, sampling, method);
+ interfMainPanel::getInstance()->onSegmentationAllSlices(minZ, maxZ, isovalue, sampling, method);
}
void interfSegmentationPanelVTK::setLabel(wxString tmpString)
int x = _theViewPanel->GetX();
int y = _theViewPanel->GetY();
int z = _theViewPanel->GetZ();
- SegmentationOneSlice( x,y,z,isovalue, sampling, method );
+ SegmentationOneSlice( x,y,z,isovalue, sampling, method , getImageData() );
RefreshInterface();
}
-void wxContourMainFrame::SegmentationOneSlice( int x, int y, int z, int isovalue, int sampling, int method )
+void wxContourMainFrame::SegmentationOneSlice( int x, int y, int z, int isovalue, int sampling, int method , vtkImageData *imagedata)
{
int typeofcontour = 1;
//--Extracting Contour
- vtkImageData *imagedata = getImageData();
+// 2024-01-09
+// vtkImageData *imagedata = getImageData();
vtkImageReslice *imageReslice = vtkImageReslice::New();
//EED
_theViewPanel->GetImageDataRange(range);
}
-void wxContourMainFrame::onSegmentationAllSlice(int minZ,int maxZ,int isovalue,int sampling,int method)
+void wxContourMainFrame::onSegmentationAllSlices2(int step ,int isovalue,int sampling,int method,vtkImageData* imagedata)
+{
+ printf("wxContourMainFrame::onSegmentationAllSlices2 start\n");
+
+ //JCP 20-10-08 Undo redo implementation
+ saveState();
+ //JCP 20-10-08 Undo redo implementation
+ wxBusyCursor wait;
+// int x = _theViewPanel->GetX();
+// int y = _theViewPanel->GetY();
+ int z;
+// double porcent;
+// wxString tmpString;
+// double totalZ = maxZ-minZ+1;
+
+ int ext[6];
+ imagedata->GetExtent(ext);
+ int maxZ = ext[5]-ext[4]+1;
+ for( z=0 ; z<=maxZ ; z=z+step )
+ {
+ printf("wxContourMainFrame::onSegmentationAllSlices2 z=%d \n",z );
+// porcent = 100.0* (z-minZ)/totalZ;
+// tmpString.Printf(_T(" %d %c %d/%d %d"), (int)porcent , 37 , z-minZ+1, (int)totalZ,z );
+// interfMainPanel::getInstance()->setLabelSegmentationPanelVTK(tmpString);
+ //_staticTextSegmentation->SetLabel(tmpString);
+ SegmentationOneSlice( 100,100,z,isovalue, sampling,method , imagedata );
+ }
+// interfMainPanel::getInstance()->setLabelSegmentationPanelVTK(_T(" "));
+ RefreshInterface();
+ printf("wxContourMainFrame::onSegmentationAllSlices2 end\n");
+
+}
+
+void wxContourMainFrame::onSegmentationAllSlices(int minZ,int maxZ,int isovalue,int sampling,int method)
{
//JCP 20-10-08 Undo redo implementation
saveState();
tmpString.Printf(_T(" %d %c %d/%d %d"), (int)porcent , 37 , z-minZ+1, (int)totalZ,z );
interfMainPanel::getInstance()->setLabelSegmentationPanelVTK(tmpString);
//_staticTextSegmentation->SetLabel(tmpString);
- SegmentationOneSlice( x,y,z,isovalue, sampling,method );
+ SegmentationOneSlice( x,y,z,isovalue, sampling,method , getImageData() );
}
interfMainPanel::getInstance()->setLabelSegmentationPanelVTK(_T(" "));
RefreshInterface();
vtkImageData* getImageData();
void onSegmentationOneSlice(int isovalue,int sampling,int method);
void onSegmentationOneSliceITK(wxString distance, wxString sigma, wxString alfa, wxString beta, wxString propagation, wxString iterations, wxString inflation);
- void SegmentationOneSlice( int x, int y, int z, int isovalue, int sampling, int method );
+ void SegmentationOneSlice( int x, int y, int z, int isovalue, int sampling, int method , vtkImageData *imagedata);
void SegmentationOneSliceITK(int x, int y, int z, wxString distance, wxString sigma, wxString alfa, wxString beta, wxString propagation, wxString iterations, wxString inflation);
void Mirror( int x, int y, int z, int isovalue, int sampling, int method );
int GetImageDataSizeZ();
void GetImageDataRange(double *range);
- void onSegmentationAllSlice(int minZ,int maxZ,int isovalue,int sampling,int method);
+ void onSegmentationAllSlices(int minZ,int maxZ,int isovalue,int sampling,int method);
+ void onSegmentationAllSlices2(int step ,int isovalue,int samplsing,int method,vtkImageData* imagedata);
//AD
void referenceLine();