]> Creatis software - creaMaracasVisu.git/commitdiff
*** empty log message ***
authorEduardo Davila <Eduardo.Davila@creatis.insa-lyon.fr>
Mon, 14 Dec 2009 16:59:49 +0000 (16:59 +0000)
committerEduardo Davila <Eduardo.Davila@creatis.insa-lyon.fr>
Mon, 14 Dec 2009 16:59:49 +0000 (16:59 +0000)
bbtk/bbs/appli/ExampleShowNPoints.bbs
bbtk/src/bbmaracasvisuViewerNV.cxx
install/CMakeLists.txt
lib/maracasVisuLib/src/interface/wxWindows/Contour/ContourExtractData.cxx
lib/maracasVisuLib/src/interface/wxWindows/Contour/ContourExtractData.h
lib/maracasVisuLib/src/interface/wxWindows/Contour/Propagation.cxx
lib/maracasVisuLib/src/interface/wxWindows/widgets/vtkInteractorScrollZ.cxx
lib/maracasVisuLib/src/interface/wxWindows/widgets/vtkInteractorStyleBaseView.cxx
lib/maracasVisuLib/src/interface/wxWindows/widgets/wxVtkMPR3DView.cxx

index b1c51a31c5829e44fceef109407d29d927385a02..e353a3f38a732cdf57a1b7e59e8746cf029b7fb9 100644 (file)
@@ -23,17 +23,19 @@ new LoadHola reader
 
 # uncomment next lines to have a file selector
 # ---------------------------------------------
+/*
 new FileSelector openFileDialog
   set openFileDialog.Wildcard  "(*.mhd)|*.mhd"
 new MetaImageReader reader
    connect openFileDialog.Out reader.In
+*/
 
 # uncomment next lines to use Gimmick
 # -----------------------------------
-/*
+
 load creaImageIO
 new Gimmick reader
-*/
+
 
 new ViewerNV viewer
   connect reader.Out viewer.In
index 08c084b1c32eecf51f7e8864cc08587a848ac965..48b69e5da1d4eb06e22cbdb31c7c5c60033503ca 100644 (file)
@@ -63,6 +63,17 @@ void ViewerNV::Process()
 {      
 
        vtkImageData* img = bbGetInputIn();
+/*
+       double spc[3];
+       img->GetSpacing(spc);
+    printf ("EED ViewerNV::Process A %f %f %f \n", spc[0], spc[1], spc[2] );
+       img->SetSpacing( 1,1,1 );
+       img->Update(  );
+       img->GetSpacing(spc);
+       img->PrintSelf(std::cout,(vtkIndent)2);
+       img->Print(std::cout);
+    printf ("EED ViewerNV::Process B %f %f %f \n", spc[0], spc[1], spc[2] );
+*/
        std::vector<int> type = bbGetInputnTypeView();
 
 //     std::cout<<"img "<<img<<std::endl;
index 16fbe5306bd22df524e19c2557fb0b3bafa9a5ae..017c99b54139adac5153eac6c70bec2809ae575a 100644 (file)
@@ -70,7 +70,7 @@ IF(WIN32 AND NOT UNIX)
   SET(CPACK_NSIS_HELP_LINK "http://www.creatis.insa-lyon.fr/creatools/${PROJECT_NAME}")
   SET(CPACK_NSIS_URL_INFO_ABOUT "http://www.creatis.insa-lyon.fr/creatools/${PROJECT_NAME}")
   SET(CPACK_NSIS_CONTACT "info-dev@creatis.insa-lyon.fr")
-  #SET(CPACK_NSIS_MODIFY_PATH ON)
+  SET(CPACK_NSIS_MODIFY_PATH ON)
 ELSE(WIN32 AND NOT UNIX)
 #  SET(CPACK_STRIP_FILES "bin/bbi")
   SET(CPACK_SOURCE_STRIP_FILES "")
index 5c5f0d3c1bfdea5d35f0002e4d3fc7cee62a709f..422e0936245b08adacef5bd27b43c383966084d0 100644 (file)
@@ -23,6 +23,7 @@ ContourExtractData::~ContourExtractData()
 void ContourExtractData::SetImage( vtkImageData* imagedata)
 {
        this->imagedata                 = imagedata;
+       this->imagedata->GetScalarRange(scalarRange);
 
        // RaC 20-11-09 Changes in InitLstContoursLinesYPoints
        int ext[6];
@@ -421,14 +422,16 @@ void ContourExtractData::CalculateImageResult()
 
                                if ((i>=0) && (i<=ext[1]) && (j>=0) && (j<=ext[3]))
                                {
-                                       if (isInside(i,j,_typeOperation)==true)
+                  if (isInside(i,j,_typeOperation)==true)
                                        {
-                                               value = GetDataValue(i,j,zImage);
+                                         value = GetDataValue(i,j,zImage);
+                                         if ( (value>=scalarRange[0]) && (value<=scalarRange[1]) )
+                                         {
                                                PutVtkImageDataResultValue(i,j,zImage,  value );
-                                       } // if
-
-                               }//if
+                                         } // scalarRange
+                                       } // if isInside
 
+                               } // if ext
                        } // for i
                } // for j
 
@@ -442,10 +445,11 @@ void ContourExtractData::CalculateImageResult()
 }
 
 //------------------------------------------------------------------------
-void ContourExtractData::GetValuesInsideCrown(std::vector<double> *pLstValue,
-                                                                                         std::vector<double> *pLstValuePosX,
-                                                                                         std::vector<double> *pLstValuePosY,
-                                                                                         std::vector<double> *pLstValuePosZ)
+void ContourExtractData::GetValuesInsideCrown( int *numberOfPixels, 
+                                                                                               std::vector<double> *pLstValue,
+                                                                                               std::vector<double> *pLstValuePosX,
+                                                                                               std::vector<double> *pLstValuePosY,
+                                                                                               std::vector<double> *pLstValuePosZ)
 {
        pLstValue->clear();
        pLstValuePosX->clear();
@@ -461,7 +465,7 @@ void ContourExtractData::GetValuesInsideCrown(std::vector<double> *pLstValue,
        int maxPoint[2];
        int i,j;
        double value;
-
+       int acum=0;
 
        minPoint[0] = 999999;
        minPoint[1] = 999999;
@@ -481,34 +485,24 @@ void ContourExtractData::GetValuesInsideCrown(std::vector<double> *pLstValue,
 
                        if ((i>=0) && (i<=ext[1]) && (j>=0) && (j<=ext[3]))
                        {
-
-                               if (isInside(i,j,_typeOperation)==true)
+                   if (isInside(i,j,_typeOperation)==true)
                                {
-                                       value = GetDataValue(i,j,zImage);
-
-                                       // Borrame
-                                       //                              if (okImagesResults==true){
-                                       //                                      PutVtkImageDataResultValue(i,j,zImage,  value );
-                                       //                              }
-
-                                       pLstValue               -> push_back( value );
-                                       pLstValuePosX   -> push_back( i );
-                                       pLstValuePosY   -> push_back( j );
-                                       pLstValuePosZ   -> push_back( -1 );
-                               } // if
-
-                       } //if
 
+                                       acum++;
+                                       value = GetDataValue(i,j,zImage);
+                                       if ( (value>=scalarRange[0]) && (value<=scalarRange[1]) )
+                                       {
+                                               pLstValue               -> push_back( value );
+                                               pLstValuePosX   -> push_back( i );
+                                               pLstValuePosY   -> push_back( j );
+                                               pLstValuePosZ   -> push_back( -1 );
+                                       } // scalarRange
+                               } // if isInside
+                       } // if ext
                } // for
        } // for
 
-       // Borrame
-       //      if (this->okImagesResults==true){
-       //              imagedataValueResult->Modified();
-       //              imagedataMaskResult->Modified();
-       //      }
-
-
+       *numberOfPixels = acum;
 }
 
 //------------------------------------------------------------------------
@@ -656,9 +650,9 @@ void ContourExtractData::Statistics( std::vector<double> *inputLstValue,
                                acum_standardeviation = acum_standardeviation + tmp*tmp;
                        } // for standar deviation
                        standardeviation = sqrt(acum_standardeviation/size);
-                       SetVolumeStatistics(countRange, size,
-                               min,max,
-                               acum_average,acum_standardeviation);
+                       SetVolumeStatistics(countRange, (*rsize),
+                                                               min,max,
+                                                           acum_average,acum_standardeviation);
                } // if size
        } // if NULL
 
@@ -743,6 +737,12 @@ void ContourExtractData::InitLstContoursLinesYPoints()
 
 }
 
+void ContourExtractData::SetScalarRange(double min, double max)
+{
+       scalarRange[0]=min;
+       scalarRange[1]=max;
+}
+
 void ContourExtractData::SetSizeImageY(int pSizeImageY)
 {
        _sizeImageY=pSizeImageY;
index 6123e66b95c40b54b8481e4978c55e8ac90acd2b..7003fcd421b3f42b4bb63c5a86ebf38109d5d15b 100644 (file)
@@ -19,7 +19,8 @@
        void SetZtoBeAnalys( int z );
 
        void SetLstManualContourModel( std::vector<manualBaseModel*> lstManConMod);
-       void GetValuesInsideCrown(      std::vector<double> *pLstValue,
+       void GetValuesInsideCrown(      int *numberOfPixels,
+                                                               std::vector<double> *pLstValue,
                                                                std::vector<double> *pLstValuePosX,
                                                                std::vector<double> *pLstValuePosY,
                                                                std::vector<double> *pLstValuePosZ);
@@ -45,6 +46,7 @@
                                                                double *vol_average, double *vol_standardeviation);
          
          void ResetImageResult(int z);
+         void SetScalarRange(double min, double max);
          void InitLstContoursLinesYPoints();
          bool isInside(int x, int y, int typeOperation );
        
@@ -54,6 +56,7 @@
          void SetSizeImageY(int pSizeImageY);
          
   private:
+       double                                                          scalarRange[2];
        bool                                                            okImagesResults;
 
        //
index c6d2365481a9baa3806792f72baad6afc0ce0fb3..580863f9d39587b6deb7314fc62087962936f5da 100644 (file)
@@ -762,8 +762,8 @@ int PropContour::VectorDirection(std::vector<double>*InX, std::vector<double>*In
        {
                ax = (*InX)[i]-SumX;
                ay = (*InY)[i]-SumY;
-               bx = (*InX)[i+1]-SumX;
-               by = (*InY)[i+1]-SumY;
+               bx = (*InX)[(i+1)%size]-SumX;
+               by = (*InY)[(i+1)%size]-SumY;
                axb = (ax*by) - (bx*ay);
                if(axb > 0)
                {
@@ -1096,7 +1096,7 @@ void PropContour::SetKeyContours(std::vector<double>*InX, std::vector<double>*In
                                okFind=true;
                                i=sizeKeyContour;
                        }
-                       if ( (_KeyContourZ[i-1] != _KeyContourZ[i]) )
+                       if ( (i<sizeKeyContour) && (_KeyContourZ[i-1] != _KeyContourZ[i]) )
                        {
                                tmpIdKeyContSizes++;
                        }
index 14a9073c9015bfae3cbabc55533ceb622240adce..9dae4565a05ab56272bf84858cce028516e9a8ba 100644 (file)
@@ -17,9 +17,7 @@ vtkInteractorScrollZ::~vtkInteractorScrollZ()
 bool vtkInteractorScrollZ::OnRightButtonDown()
 {    
        vtkRenderWindowInteractor *interactor = _vtkInteractorStyleBaseView->GetInteractor();
-printf("EED %p vtkInteractorScrollZ::OnRightButtonDown A", this );
        if ((interactor->GetControlKey()==0) && (interactor->GetShiftKey()==0) ){
-printf("EED %p vtkInteractorScrollZ::OnRightButtonDown B", this );
                _stateFordware  = true;
                _fordwareX      = interactor->GetEventPosition()[0];
                _fordwareY      = interactor->GetEventPosition()[1];
@@ -40,7 +38,6 @@ bool vtkInteractorScrollZ::OnRightButtonUp()
 bool vtkInteractorScrollZ::OnMouseMove () 
 {
        if (_stateFordware==true){
-printf("EED %p vtkInteractorScrollZ::OnMouseMove \n", this);
            //int fx = _vtkInteractorStyleBaseView->GetInteractor()->GetEventPosition()[0];  // JPRx
         int fy = _vtkInteractorStyleBaseView->GetInteractor()->GetEventPosition()[1];
                int delta = (_fordwareY - fy)/3;
index 8cfed905075af35b7b3587986b68642d6637117c..fd8fa4c6e79967859dadefe381e4b8cf39a52d50 100644 (file)
@@ -131,16 +131,13 @@ void vtkInteractorStyleBaseView::CallLstInteractorStyleMaracas(int type)
 
        for (i=0;i<size;i++)
        {
-printf("EED %p vtkInteractorStyleBaseView A i=%d size=%d sizeLst%d\n", this, i, size, _lstInteractorStyleMaracas.size() );
                if (i < _lstInteractorStyleMaracas.size() )
                {
                        intStyMar = _lstInteractorStyleMaracas[i];
                } else {
                        intStyMar=NULL;
                }
-printf("EED %p vtkInteractorStyleBaseView B i=%d size=%d sizeLst%d\n", this, i, size, _lstInteractorStyleMaracas.size() );
                if (intStyMar!=NULL && intStyMar->GetActive()==true){
-printf("EED %p vtkInteractorStyleBaseView C i=%d size=%d sizeLst%d\n", this, i, size, _lstInteractorStyleMaracas.size() );
                        if (type ==1)
                        {  // OnRightButtonDown
                                if (intStyMar->OnRightButtonDown()==false)
index 1893f326b8bbe9d2e0eaf2f6c93a54ac882c4da4..cd40b5243bace01c74835373c4da0c036d54e1f2 100644 (file)
@@ -183,7 +183,6 @@ void wxVtkMPR3DView::Configure(){
 //-------------------------------------------------------------------
 wxVtkMPR3DView::~wxVtkMPR3DView()
 {
-       printf("EED wxVtkMPR3DView::~wxVtkMPR3DView\n");
        VisiblePointWidget( false );
        VisiblePlaneWidget( false );