#include "ConceptDataWrap.h"
#include <creaWx.h>
+
+
//----------------------------------------------------------------------------------------------------------------
// Class implementation
//----------------------------------------------------------------------------------------------------------------
: wxPanel(parent, id, pos, size, style)
{
m_mgr.SetManagedWindow(this);
+ _contourGroup = 1;
_creatingContoursActive = false;
_theViewPanel = NULL;
// _modelManager = NULL;
//wxContour_ActionCommandsID a;
_contourextractdata = NULL;
+ _viewMaskImage = NULL;
+ _viewMaskImagePanel = NULL;
}
wxContourMainFrame :: wxContourMainFrame(wxWindow* parent, wxWindowID id,const wxString& title,const wxPoint& pos,const wxSize& size,std::vector<vtkImageData*> images, long style,std::string datadir)
: wxPanel(parent, id, pos, size, style)
{
m_mgr.SetManagedWindow(this);
+ _contourGroup = 1;
_creatingContoursActive = false;
_theViewPanel = NULL;
_thresholdMapper = NULL;
_thresholdActor = NULL;
_actorPresent = false;
+ _viewMaskImage = NULL;
+ _viewMaskImagePanel = NULL;
// set up default notebook style
m_notebook_style =wxAUI_NB_TAB_SPLIT | wxAUI_NB_TAB_EXTERNAL_MOVE | wxNO_BORDER;
kernelManager->setInstant(instantVect);
//_modelManager->setInstant( _actualInstant );
+
+ if(_viewMaskImage!=NULL){
+ int actualSlice = instantVect[1];
+ _viewMaskImage->SetZ(actualSlice);
+
+ if (_viewMaskImagePanel->IsVisible()==true)
+ {
+ vtkImageData *mask, *value;
+ getMaskValue(&mask,&value, _contourGroup , 0, -1, -1);
+ _viewMaskImage->onThreshold();
+ }
+ }
+
onThresholdChange();
updateInstantOutlines();
updateInstantImageData();
}
-void wxContourMainFrame::GenerateContourExtractData()
-{
- if (_contourextractdata==NULL) { _contourextractdata = new ContourExtractData(true); }
-}
-
void wxContourMainFrame::onInformationContourLabels(int typeContourGroup,int selection,int minimumZ,int maximumZ,int grayRangeMin, int grayRangeMax)
{
- GenerateContourExtractData();
+//EED01Juillet2009 GenerateContourExtractData();
wxString tempString;
int maxContourGroup = 0;
std::vector<int> tempVector;
_instantPanel->getInstant( tempVector );
- vtkImageData *imagedata = _theViewPanel->getImageData();
+//EED01Juillet2009 vtkImageData *imagedata = _theViewPanel->getImageData();
// int sizeZ = _theViewPanel->GetImageDataSizeZ();
int z;
int ii,sizeLstContourThings;
double porcent;
wxString tmpString;
-//?????
if (selection==0 ) // actual slice
{
totalZ = maxZ-minZ+1;
- _contourextractdata->SetImage( imagedata);
+//EED01Juillet2009 _contourextractdata->SetImage( imagedata);
_contourextractdata->InitVolumeStatistics();
fprintf(pFile,"\n\n" );
-// ??????
if (selection==0 ) // actual slice
{
void wxContourMainFrame::SaveValuesXYZ(std::string directory,std::string namefile,int typeContourGroup)
{
wxBusyCursor wait;
- GenerateContourExtractData();
+//EED01Juillet2009 GenerateContourExtractData();
//int typeContourGroup = this->_radiolstboxContourGroup->GetSelection();
_contourextractdata ->SetTypeOperation( typeContourGroup % 3 );
std::vector<int> tempVector;
_instantPanel->getInstant( tempVector );
- vtkImageData *imagedata = _theViewPanel->getSceneManager()->GetImageData();
+//EED01Juillet2009 vtkImageData *imagedata = _theViewPanel->getSceneManager()->GetImageData();
int sizeZ = _theViewPanel->getSceneManager()->GetImageDataSizeZ();
int z;
int ii,sizeLstContourThings;
maxZ = sizeZ;//_mbarrange->GetEnd();
totalZ = maxZ-minZ+1;
- _contourextractdata->SetImage( imagedata);
+//EED01Juillet2009 _contourextractdata->SetImage( imagedata);
// For each slice..
for ( z=0 ; z<sizeZ ; z++)
void wxContourMainFrame::getMaskValue(vtkImageData ** mask,vtkImageData ** value,int typeContourGroup, int selection, int minZ, int maxZ){
wxBusyCursor wait;
- GenerateContourExtractData();
+//EED01Juillet2009 GenerateContourExtractData();
//int typeContourGroup = this->_radiolstboxContourGroup->GetSelection();
if (typeContourGroup==3)
std::vector<int> tempVector;
_instantPanel->getInstant( tempVector );
- vtkImageData *imagedata = _theViewPanel->getImageData();
+ vtkImageData *imagedata = _theViewPanel->getImageData();
+ int ext[6];
+ imagedata->GetExtent(ext);
+ int sizeZimage = ext[5]-ext[4]+1;
int z;
int ii,sizeLstContourThings;
totalZ = maxZ-minZ;
- _contourextractdata->SetImage( imagedata);
+//EED01Juillet2009 _contourextractdata->SetImage( imagedata);
+ // cleanning image before range
+ for (z=0; z<minZ; z++){
+ _contourextractdata->ResetImageResult(z);
+ }
+ // cleanning image after range
+ for (z=maxZ+1; z<sizeZimage; z++){
+ _contourextractdata->ResetImageResult(z);
+ }
+
+
// For each slice..
for ( z=minZ ; z<=maxZ ; z++)
{
_pannew->Show(show);
}
+
+//EED01Juillet2009
+/*
+void wxContourMainFrame::GenerateContourExtractData()
+{
+ if (_contourextractdata==NULL) { }
+}
+*/
+
+
+wxPanel *wxContourMainFrame::getThresholdImageViewPanel(wxWindow *parent)
+{
+
+ if (_viewMaskImagePanel==NULL)
+ {
+ _contourextractdata = new ContourExtractData(true);
+ _contourextractdata->SetImage( _theViewPanel->getImageData() );
+
+ double range[2];
+ _theViewPanel->getImageData()->GetScalarRange(range);
+ //int min = (int)floor (range[0]);
+ //int max = (int)ceil (range[1]);
+ int min = 0;
+ int max = 255;
+
+ _viewMaskImagePanel = new ThresholdImageViewPanel( parent, min, max , 0);
+ _viewMaskImage = new ThresholdImageView();
+ _viewMaskImage->SetImage(_contourextractdata->GetVtkImageMaskResult() );
+ _viewMaskImage->SetminMaxValue( 254, 256);
+ _viewMaskImage->SetBaseColor( 0,0,1 );
+ _viewMaskImagePanel->SetThresholdImageView( _viewMaskImage );
+ _viewMaskImage->SetwxVtkBaseView( _theViewPanel->getWxVtkBaseView() );
+
+ }
+ return _viewMaskImagePanel;
+}
+
+void wxContourMainFrame::SetContourGroup(int contourGroup)
+{
+ printf("EED wxContourMainFrame::SetContourGroup \n");
+ _contourGroup = contourGroup;
+}
+
+
+
+