wxSTLWidget_03::wxSTLWidget_03(wxWindow *parent)//, marInterface* mar)
: wxPanel( parent, -1)
{
- _wxMaracasMPR = NULL;
+ _imagedata=NULL;
+ cast2=NULL;
+ cast3=NULL;
+ cast4=NULL; // binary segmentation result
+ _thresh=NULL;
+ _thresh2=NULL;
+ _cast=NULL;
+ _connect=NULL;
+ _connect2=NULL;
+ _2_mapfinal=NULL;
+ _2_stripfinal=NULL;
+ _2_isoMapperMC6=NULL;
+ _2_isoActorMC6=NULL;
+ _2_isoMC6=NULL;
+ _loadSTLMapper=NULL;
+ _loadActorSTL=NULL;
+ sl_barrange_segmentation=NULL;
+ _imageviewer3D=NULL;
+ _wxMaracasMPR=NULL;
+ stlInterna=NULL;
+ stlExterna=NULL;
+ stlSliderDeltaGauss=NULL;
+ stlSliderMarchingCubes=NULL;
+ dsm1=NULL;
+ actorInternal=NULL;
+ stlSliderOpacityInternal=NULL;
+ dsm2=NULL;
+ actorExternal=NULL;
+ stlSliderOpacityExternal=NULL;
+ stlExtractor=NULL;
+ _sl_opacity_STL_file=NULL;
+ arteryImageData=NULL;
+ joiner=NULL;
+ joinMarchingCubes=NULL;
+ joinMapper=NULL;
+ joinActor=NULL;
_maxSize = 2000;
_minSize = 300;
- _imagedata = NULL;
+
_stlMarchingCubesLevel = 128;
_stlDeltaGaussLevel = 100;
// pnlSplitter -> SplitVertically( viewPanel, new wxPanel(pnlSplitter,-1) , 600 );
this -> SetSizer(sizer);
-
- // Result 2: Volume + Axis
-// _2_prgov = NULL;
- _2_mapfinal = NULL;
- _2_stripfinal = NULL;
- _2_isoMapperMC6 = NULL;
- _2_isoActorMC6 = NULL;
- _2_isoMC6 = NULL;
-
- _loadSTLMapper = NULL;
- _loadActorSTL = NULL;
-
-
- //JOIN REGIONS
- arteryImageData = NULL;
- joinMarchingCubes = NULL;
- joinMapper = NULL;
- joinActor = NULL;
-
- //DHC STL SURFACES
- stlExterna = NULL;
- stlInterna = NULL;
- dsm1=NULL;
- actorInternal = NULL;
- dsm2 = NULL;
- actorExternal=NULL;
- _thresh=NULL;
-
}
//-------------------------------------------------------------------
wxSTLWidget_03::~wxSTLWidget_03(){
- ResetTree2_JF();
- Reset_vtk_STLFile();
+ //ResetTree2_JF();
+ //Reset_vtk_STLFile();
+
+ if(_imagedata!=NULL){
+ _imagedata->Delete();
+ }
+ if(cast2){cast2->Delete();}
+ if(cast3){cast3->Delete();}
+ if(cast4){cast4->Delete();}
+ if(_thresh){_thresh->Delete();}
+ if(_thresh2){_thresh2->Delete();}
+ if(_cast){_cast->Delete();}
+ if(_connect){_connect->Delete();}
+ if(_connect2){_connect2->Delete();}
+ if(_2_mapfinal){_2_mapfinal->Delete();}
+ if(_2_stripfinal){_2_stripfinal->Delete();}
+ if(_2_isoMapperMC6){_2_isoMapperMC6->Delete();}
+ if(_2_isoActorMC6){_2_isoActorMC6->Delete();}
+ if(_2_isoMC6){_2_isoMC6->Delete();}
+ // Load STL file
+ if(_loadSTLMapper){_loadSTLMapper->Delete();}
+ if(_loadActorSTL){_loadActorSTL->Delete();}
+ if(sl_barrange_segmentation){delete sl_barrange_segmentation;}
+ if(_imageviewer3D){delete _imageviewer3D;}
+ if(_wxMaracasMPR){delete _wxMaracasMPR;}
+ if(stlInterna){stlInterna->Delete();}
+ if(stlExterna){stlExterna->Delete();}
+ if(dsm1){dsm1->Delete();}
+ if(actorInternal){actorInternal->Delete();}
+ if(dsm2){dsm2->Delete();}
+ if(actorExternal){actorExternal->Delete();}
+ //if(stlExtractor){stlExtractor->Delete();}
+ if(arteryImageData){arteryImageData->Delete();}
+ if(joiner){delete joiner;}
+ if(joinMarchingCubes){joinMarchingCubes->Delete();}
+ if(joinMapper){joinMapper->Delete(); }
+ if(joinActor){joinActor->Delete();}
}
//-------------------------------------------------------------------
wxPanel* wxSTLWidget_03::CreateViewPanel(wxWindow *parent)
try{
- vtkRenderer *ren = _wxMaracasMPR->GetWxvtkmpr3Dview_BB()->GetWxvtk3Dbaseview()->GetRenderer();
-
- if (_2_isoActorMC6){
- ren->RemoveActor(_2_isoActorMC6);
- }
- if (_2_stripfinal){
- ren->RemoveActor(_2_stripfinal);
- }
+
// Delete
// if (_2_prgov ) { _2_prgov -> Delete(); }
_2_isoMapperMC6 = NULL;
_2_isoActorMC6 = NULL;
_2_isoMC6 = NULL;
+
+
+ //vtkRenderer *ren = _wxMaracasMPR->GetWxvtkmpr3Dview_BB()->GetWxvtk3Dbaseview()->GetRenderer();
+
+ /*if (_2_isoActorMC6){
+ ren->RemoveActor(_2_isoActorMC6);
+ }
+ if (_2_stripfinal){
+ ren->RemoveActor(_2_stripfinal);
+ }*/
+
+
}catch(char* e){
std::cout<<e<<std::endl;
}