COMPLEXBOX:TRUE
COMPLEXBOXNAME:ContourReferenceStep
PACKAGENAME:creaContours
-COMPLEXOUTPUTS:3
+COMPLEXOUTPUTS:4
COMPLEX_PORT
_widget
-63.491296:-134.823351:-900.000000
_iaxis
44.663851:-138.928196:-900.000000
FIN_COMPLEX_PORT
+COMPLEX_PORT
+_step
+-23.031012:-136.184078:-900.000000
+FIN_COMPLEX_PORT
COMPLEXINPUTS:11
COMPLEX_PORT
_point
BOX
std:ConcatStrings:Box317
ISEXEC:FALSE
--81.729138:71.218704:-900.000000
--58.969138:68.718704:-900.000000
+-60.909644:59.923021:-900.000000
+-38.149644:57.423021:-900.000000
FIN_BOX
BOX
std:StringSelect:Box318
PORT
Type:"2"
FIN_BOX
-CONNECTIONS:136
+CONNECTIONS:137
CONNECTION
Box86:Widget:Box84:Widget2
NumberOfControlPoints:0
CONNECTION
Box97:Out:Box436:In
NumberOfControlPoints:0
+CONNECTION
+Box317:Out:_step:_step
+NumberOfControlPoints:0
APP_END
output _widget Box456.Widget " "
output _initExec Box448.BoxChange " "
output _iaxis Box288.Out " "
+output _step Box317.Out " "
endefine
if (bbGetInputImage()!=NULL)
{
std::vector<double> param1=bbGetInputParam1();
- if (param1.size()==6)
+ if (param1.size()==6)
{
int step = param1[0];
double isovalue = param1[1];
}// size
} // if Image
} // Type==1
+
+ if (bbGetInputType()==2)
+ {
+ if (bbGetInputImage()!=NULL)
+ {
+ std::vector<double> param1=bbGetInputParam1();
+ if (param1.size()==3)
+ {
+ double isovalue = param1[0];
+ int sampling = param1[1];
+ int method = param1[2];
+
+
+ std::vector<int> tempVector;
+ wxContourMainFrame::getInstance()->getInstantVector( tempVector );
+ int step = 1;
+ int min = tempVector[1] ;
+ int max = tempVector[1] ;
+
+ wxContourMainFrame::getInstance()->onDeleteContoursActSlice();
+ wxContourMainFrame::getInstance()->onSegmentationAllSlices2(step ,isovalue,sampling,method,min,max, bbGetInputImage() ); // step,isovalue,sampling,method
+ } else {
+ printf("BBTK warnning!! wxContourMainFrame_tool box. In Type=1 the Param1 es not complite \n");
+ }// size
+ } // if Image
+ } // Type==1
+
+
+
+
+
}
}
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:[step,isovalue,sampling,method,min,max] ", std::vector<double>,"");
+ BBTK_INPUT(wxContourMainFrame_tool,Type,"(default 0) Type 0:nothing 1:Isovalue segmentation of Image 2:Isovalue segmentation actual slice",int,"");
+ BBTK_INPUT(wxContourMainFrame_tool,Param1,"List of parameters Type1:[step,isovalue,sampling,method,min,max] Replace all old contours Type2:[isovalue,sampling,method,iSlice] Replace acutal slice ", 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);
_contourextractdata = NULL;
}
-
void wxContourMainFrame::changeImage(int id, vtkImageData *img)
{
if ( id<_images.size() ) _images[id]=img;
kernelManager->changeImage(id,img);
_theViewPanel->changeImage(img);
// updateInstantImageData();
-
}
void wxContourMainFrame::configure(std::vector<vtkImageData*> imgs)
this->configurePanels( );
}
-
- wxContourMainFrame* wxContourMainFrame::getInstance(wxWindow* parent, wxWindowID id,const wxString& title,const wxPoint& pos,const wxSize& size,std::vector<vtkImageData*> images, long style,std::string datadir )
+wxContourMainFrame* wxContourMainFrame::getInstance(wxWindow* parent, wxWindowID id,const wxString& title,const wxPoint& pos,const wxSize& size,std::vector<vtkImageData*> images, long style,std::string datadir )
{
if(instance == NULL)
{
return instance;
}
- std::vector<vtkImageData*> wxContourMainFrame::getVectImages()
+std::vector<vtkImageData*> wxContourMainFrame::getVectImages()
{
return kernelManager->getVectImages();
}
- wxContourMainFrame* wxContourMainFrame::getInstance()
+wxContourMainFrame* wxContourMainFrame::getInstance()
{
return instance;
}
- void wxContourMainFrame::resetInstance()
+void wxContourMainFrame::resetInstance()
{
instance->Destroy();
}
- wxContourMainFrame::~wxContourMainFrame()
+wxContourMainFrame::~wxContourMainFrame()
{
delete _contourextractdata;
deleteAllContours();
#else
imageReslice->Update();
#endif
-
imagedata = imageReslice->GetOutput();
//EED 2017-01-01 Migration VTK7
#if VTK_MAJOR_VERSION <= 5
#else
// ..
#endif
-
vtkContourFilter* cntVTK = vtkContourFilter::New( );
//EED 2017-01-01 Migration VTK7
#if VTK_MAJOR_VERSION <= 5
#else
cntVTK->SetInputData( imagedata );
#endif
-
cntVTK->SetNumberOfContours( 1 );
//cntVTK->SetValue( 0, vmin );
// cntVTK->SetValue( 0, (range[1]*thr/100) );
// cntVTK->SetValue( 1, vmax );
cntVTK->Update( );
cntVTK->UpdateInformation();
-
vtkCleanPolyData* cpd = vtkCleanPolyData::New( );
//EED 2017-01-01 Migration VTK7
#if VTK_MAJOR_VERSION <= 5
cpd->ConvertLinesToPointsOff( );
cpd->Update( );
cpd->UpdateInformation();
-
vtkPolyDataConnectivityFilter* conn = vtkPolyDataConnectivityFilter::New( );
-
// conn->SetExtractionModeToPointSeededRegions();
// conn->SetExtractionModeToCellSeededRegions();
// conn->SetExtractionModeToSpecifiedRegions();
// conn->SetExtractionModeToLargestRegion();
// conn->SetExtractionModeToAllRegions();
-
conn->SetExtractionModeToClosestPointRegion();
-
//conn->SetMaxRecursionDepth( 3000 );
-
//EED 2017-01-01 Migration VTK7
#if VTK_MAJOR_VERSION <= 5
conn->SetInput( cpd->GetOutput( ) );
#else
conn->SetInputData( cpd->GetOutput( ) );
#endif
-
conn->SetClosestPoint( x, y, 0 );
conn->Update( );
conn->UpdateInformation();
-
vtkCleanPolyData* cpd2 = vtkCleanPolyData::New( );
//EED 2017-01-01 Migration VTK7
#if VTK_MAJOR_VERSION <= 5
#endif
vtkstripper->Update();
vtkstripper->UpdateInformation();
-
-
vtkPolyData* polyDataResult = vtkstripper->GetOutput();
-
//EED 2017-01-01 Migration VTK7
#if VTK_MAJOR_VERSION <= 5
polyDataResult->Update( );
void wxContourViewPanel::changeImage(vtkImageData* img)
{
theViewPanel->SetImage(img);
+ img->GetSpacing(last_spacing);
}
wxVtkMPR2DView * wxContourViewPanel::GetwxVtkMPR2DView()
wxDEFINE_EVENT(wxEVT_CHANGED_DEEP, wxCommandEvent);
- wxVtkBaseView_SceneManager :: wxVtkBaseView_SceneManager( wxVtkBaseView * theWxBaseViewToManage, wxEvtHandler * theEventHandler, double * spc )
+ wxVtkBaseView_SceneManager::wxVtkBaseView_SceneManager( wxVtkBaseView * theWxBaseViewToManage, wxEvtHandler * theEventHandler, double * spc )
{
_lastInteraction = NULL;
_lastInteractionName = "";
}
//------------------------------------------------------------------------------------------------------------
- wxVtkBaseView_SceneManager :: ~wxVtkBaseView_SceneManager()
+ wxVtkBaseView_SceneManager::~wxVtkBaseView_SceneManager()
{
std::map <std::string, ContourWrap_ViewControl *>::iterator iter = _contours_ViewControl->begin();
int size = _contours_ViewControl->size();
//------------------------------------------------------------------------------------------------------------
// Methods for sending events
//------------------------------------------------------------------------------------------------------------
- void wxVtkBaseView_SceneManager :: sendEnvent( WXTYPE theEventType, std::string text )
+ void wxVtkBaseView_SceneManager::sendEnvent( WXTYPE theEventType, std::string text )
{
if ( _eventHandler != NULL )
{
//------------------------------------------------------------------------------------------------------------
// Attributes getters and setters
//------------------------------------------------------------------------------------------------------------
- void wxVtkBaseView_SceneManager :: setWxEventHandler( wxEvtHandler * theEventHandler )
+ void wxVtkBaseView_SceneManager::setWxEventHandler( wxEvtHandler * theEventHandler )
{
_eventHandler = theEventHandler;
}
//------------------------------------------------------------------------------------------------------------
- void wxVtkBaseView_SceneManager :: setWxVtkViewBase( wxVtkBaseView * theBaseView )
+ void wxVtkBaseView_SceneManager::setWxVtkViewBase( wxVtkBaseView * theBaseView )
{
_wxVtk_BaseView = theBaseView;
}
//------------------------------------------------------------------------------------------------------------
- wxVtkBaseView * wxVtkBaseView_SceneManager :: getWxVtkViewBase()
+ wxVtkBaseView * wxVtkBaseView_SceneManager::getWxVtkViewBase()
{
return _wxVtk_BaseView;
}
manViewerContour = new manualViewContour();
}
-
-
_lastInteraction = insertWrap( theKeyName, manContourControl, manViewerContour );
_lastInteractionName = theKeyName;
-
//Configuring the relations between the contour members representation
manViewerContour->SetModel( manModelContour );
manViewerContour->SetWxVtkBaseView( _wxVtk_BaseView );
manViewerContour->SetRange( _widthOfControlPoint );
- manViewerContour->SetZ( -900 );
-
+ manViewerContour->SetZ( -900 );
manViewerContour->SetSpacing(spc);
-
manViewerContour->SetColorNormalContour(0, 0, 1);
manViewerContour->SetColorEditContour(0.5, 0.5, 0.5);
manViewerContour->SetColorSelectContour(1, 0.8, 0);
manViewerContour->SetWidthLine(_widthOfContour);
-
manContourControl->SetModelView( manModelContour , manViewerContour );
manContourControl->Configure();
int i,sizeLstPoints = manModelContour->GetSizeLstPoints();
for ( i=0; i<sizeLstPoints; i++ )
{
manViewerContour->AddPoint();
- }
-
+ } // for i
manContourControl->CreateNewManualContour();
manViewerContour->RefreshContour();
addToScene( theKeyName );