]> Creatis software - creaMaracasVisu.git/commitdiff
#3468 Refres for 3D+t Visu
authorEduardo DAVILA <eduardo.davila@creatis.insa-lyon.fr>
Fri, 25 Jun 2021 14:23:00 +0000 (16:23 +0200)
committerEduardo DAVILA <eduardo.davila@creatis.insa-lyon.fr>
Fri, 25 Jun 2021 14:23:00 +0000 (16:23 +0200)
bbtk/bbs/boxes/SliceImage-3DVisu.bbg
bbtk/bbs/boxes/SliceImage-3DVisu.bbs
bbtk/src/bbcreaMaracasVisuSliceImage.cxx
bbtk/src/bbcreaMaracasVisuSliceImage.h
bbtk/src/bbcreaMaracasVisuwxVtkBaseView_Info.cxx
bbtk/src/bbcreaMaracasVisuwxVtkBaseView_Info.h
bbtk/src/bbmaracasvisuDrawAxisTree3D.cxx
bbtk/src/bbmaracasvisuDrawAxisTree3D.h
bbtk/src/bbmaracasvisuViewerNV.cxx
lib/maracasVisuLib/src/interface/wxWindows/widgets/wxVtkMPR3DView.cxx

index f71ce6e553ff94b50a43b44f87572e79c40abc17..3bd56d1b2dc1d04dc6b596416cf376598dbbdc47 100644 (file)
@@ -13,9 +13,9 @@ PACKAGENAME:creaMaracasVisu
 COMPLEXOUTPUTS:1
 COMPLEX_PORT
 BoxChangeImageSlice
--103.179738:-315.738386:-900.000000
+-180.302777:-317.574649:-900.000000
 FIN_COMPLEX_PORT
-COMPLEXINPUTS:7
+COMPLEXINPUTS:9
 COMPLEX_PORT
 Direction
 -431.136158:282.815347:-900.000000
@@ -44,12 +44,20 @@ COMPLEX_PORT
 Render
 -100.149261:284.086627:-900.000000
 FIN_COMPLEX_PORT
+COMPLEX_PORT
+BorderActive
+-660.228760:278.316839:-900.000000
+FIN_COMPLEX_PORT
+COMPLEX_PORT
+Interpolation_mode
+43.962217:266.623739:-900.000000
+FIN_COMPLEX_PORT
 BOXES:43
 BOX
 creaMaracasVisu:SliceImage:Box00
 ISEXEC:FALSE
--193.219395:-71.815131:-900.000000
--155.994395:-81.815131:-900.000000
+-195.575128:-74.642011:-900.000000
+-158.350128:-84.642011:-900.000000
 PORT
 TypeOrientation:"1"
 FIN_BOX
@@ -63,13 +71,13 @@ BOX
 vtk:Transform:Box17
 ISEXEC:FALSE
 -320.706867:-77.874112:-900.000000
--221.593691:-87.874112:-900.000000
+-216.883834:-87.874112:-900.000000
 FIN_BOX
 BOX
 std:ConcatStrings:Box18
 ISEXEC:FALSE
 -272.546519:-70.682423:-900.000000
--195.023732:-80.682423:-900.000000
+-232.821519:-80.682423:-900.000000
 PORT
 In1:"0  "
 PORT
@@ -84,8 +92,8 @@ FIN_BOX
 BOX
 creaVtk:ScalarsToColors:Box22
 ISEXEC:FALSE
--439.528193:-206.813913:-900.000000
--398.003193:-216.813913:-900.000000
+-266.449667:-213.711970:-900.000000
+-211.174992:-223.711970:-900.000000
 PORT
 Type:"1"
 FIN_BOX
@@ -93,13 +101,13 @@ BOX
 vtk:Transform:Box32
 ISEXEC:FALSE
 -321.807500:-96.018762:-900.000000
--286.232500:-106.018762:-900.000000
+-217.103627:-106.018762:-900.000000
 FIN_BOX
 BOX
 creaMaracasVisu:DrawAxisTree3D:Box26
 ISEXEC:FALSE
--273.473729:-218.831241:-900.000000
--228.233729:-228.831241:-900.000000
+-516.159924:-217.577049:-900.000000
+-235.323332:-227.577049:-900.000000
 PORT
 Colour:"0 0 0"
 PORT
@@ -117,13 +125,13 @@ BOX
 vtk:Transform:Box27
 ISEXEC:FALSE
 -316.662998:-136.217224:-900.000000
--220.662861:-146.217224:-900.000000
+-216.004660:-146.217224:-900.000000
 FIN_BOX
 BOX
 std:CreateArithmeticSuiteVector:Box33
 ISEXEC:FALSE
 -531.652610:-47.521093:-900.000000
--477.677610:-57.521093:-900.000000
+-269.420233:-57.521093:-900.000000
 PORT
 Delta:"0"
 PORT
@@ -133,7 +141,7 @@ BOX
 std:GetVectorDoubleElement:Box34
 ISEXEC:FALSE
 -528.461121:-23.430170:-900.000000
--477.411121:-33.430170:-900.000000
+-268.760853:-33.430170:-900.000000
 PORT
 I:"0"
 FIN_BOX
@@ -141,7 +149,7 @@ BOX
 std:MathOperationVector:Box35
 ISEXEC:FALSE
 -532.115714:-65.685386:-900.000000
--484.590714:-75.685386:-900.000000
+-245.000026:-75.685386:-900.000000
 PORT
 In1:"0 1 1 0 0 "
 PORT
@@ -151,7 +159,7 @@ BOX
 std:CreateArithmeticSuiteVector:Box36
 ISEXEC:FALSE
 -461.446157:-46.434918:-900.000000
--260.565447:-56.434918:-900.000000
+-254.034698:-56.434918:-900.000000
 PORT
 Delta:"0"
 PORT
@@ -161,7 +169,7 @@ BOX
 std:MathOperationVector:Box37
 ISEXEC:FALSE
 -462.838158:-67.517853:-900.000000
--236.158155:-77.517853:-900.000000
+-229.614491:-77.517853:-900.000000
 PORT
 In1:"0 0 1 1 0 "
 PORT
@@ -177,7 +185,7 @@ BOX
 std:ConcatStrings:Box40
 ISEXEC:FALSE
 -451.527135:125.243442:-900.000000
--411.802135:115.243442:-900.000000
+-230.276764:115.243442:-900.000000
 PORT
 In1:"0"
 FIN_BOX
@@ -185,7 +193,7 @@ BOX
 std:StringSelect:Box41
 ISEXEC:FALSE
 -369.319073:-76.024573:-900.000000
--214.516358:-86.024573:-900.000000
+-209.173708:-86.024573:-900.000000
 PORT
 In0:"0 1 0 0"
 PORT
@@ -194,22 +202,10 @@ PORT
 In2:"-90 0 1 0"
 FIN_BOX
 BOX
-std:StringSelect:Box42
-ISEXEC:FALSE
--362.110000:-136.869133:-900.000000
--212.887406:-146.869133:-900.000000
-PORT
-In0:"0 1 0 0"
-PORT
-In1:"-90 0 0 1"
-PORT
-In2:"-90 0 0 1"
-FIN_BOX
-BOX
 std:GetVectorDoubleElement:Box44
 ISEXEC:FALSE
 -459.560548:-23.370210:-900.000000
--260.100032:-33.370210:-900.000000
+-253.595111:-33.370210:-900.000000
 PORT
 I:"1"
 FIN_BOX
@@ -241,19 +237,7 @@ BOX
 vtk:Transform:Box52
 ISEXEC:FALSE
 -312.196510:-56.034435:-900.000000
--219.732031:-66.034435:-900.000000
-FIN_BOX
-BOX
-std:StringSelect:Box53
-ISEXEC:FALSE
--357.946944:-52.565356:-900.000000
--211.723868:-62.565356:-900.000000
-PORT
-In0:"0 1 0 0"
-PORT
-In1:"0 1 0 0"
-PORT
-In2:"-90 0 1 0"
+-215.125487:-66.034435:-900.000000
 FIN_BOX
 BOX
 std:StringSelect:Box55
@@ -271,7 +255,7 @@ BOX
 std:ConcatStrings:Box57
 ISEXEC:FALSE
 -364.668989:127.201835:-900.000000
--324.943989:117.201835:-900.000000
+-211.154742:117.201835:-900.000000
 PORT
 In2:"  "
 FIN_BOX
@@ -293,7 +277,7 @@ BOX
 std:ConcatStrings:Box62
 ISEXEC:FALSE
 -297.110093:125.771424:-900.000000
--200.841419:115.771424:-900.000000
+-196.428586:115.771424:-900.000000
 PORT
 In1:"1 1 0"
 FIN_BOX
@@ -301,7 +285,7 @@ BOX
 std:GetVectorDoubleElement:Box64
 ISEXEC:FALSE
 -387.763181:205.752953:-900.000000
--243.345093:195.752953:-900.000000
+-336.713181:195.752953:-900.000000
 PORT
 I:"0"
 FIN_BOX
@@ -309,7 +293,7 @@ BOX
 std:ConcatStrings:Box65
 ISEXEC:FALSE
 -366.909956:245.293365:-900.000000
--216.898236:235.293365:-900.000000
+-327.184956:235.293365:-900.000000
 FIN_BOX
 BOX
 std:Div:Box66
@@ -323,7 +307,7 @@ BOX
 std:Add:Box67
 ISEXEC:FALSE
 -389.417275:153.273064:-900.000000
--246.890508:143.273064:-900.000000
+-241.289576:143.273064:-900.000000
 FIN_BOX
 BOX
 std:GetVectorDoubleElement:Box68
@@ -337,7 +321,7 @@ BOX
 std:Mul:Box69
 ISEXEC:FALSE
 -406.100940:175.438942:-900.000000
--250.846535:165.438942:-900.000000
+-376.300940:165.438942:-900.000000
 PORT
 In2:"-1"
 FIN_BOX
@@ -345,13 +329,13 @@ BOX
 std:Add:Box70
 ISEXEC:FALSE
 -345.592205:152.557386:-900.000000
--236.651379:142.557386:-900.000000
+-231.618668:142.557386:-900.000000
 FIN_BOX
 BOX
 std:MathOperation:Box72
 ISEXEC:FALSE
 -257.408453:-30.946538:-900.000000
--213.093120:-40.946538:-900.000000
+-209.196852:-40.946538:-900.000000
 PORT
 In1:"1"
 PORT
@@ -361,7 +345,7 @@ BOX
 std:MathOperation:Box73
 ISEXEC:FALSE
 -263.661305:-53.857110:-900.000000
--214.489365:-63.857110:-900.000000
+-210.515612:-63.857110:-900.000000
 PORT
 Type:"2"
 FIN_BOX
@@ -369,7 +353,7 @@ BOX
 std:StringSelect:Box74
 ISEXEC:FALSE
 -336.062237:53.397805:-900.000000
--293.902237:43.397805:-900.000000
+-201.920527:43.397805:-900.000000
 PORT
 In0:"2"
 PORT
@@ -381,13 +365,13 @@ BOX
 std:GetVectorDoubleElement:Box75
 ISEXEC:FALSE
 -261.893099:1.211259:-900.000000
--210.843099:-8.788741:-900.000000
+-210.076025:-8.788741:-900.000000
 FIN_BOX
 BOX
 vtk:Transform:Box79
 ISEXEC:FALSE
 -313.408336:-36.360191:-900.000000
--219.964739:-46.360191:-900.000000
+-215.345280:-46.360191:-900.000000
 PORT
 Scale:"1 1 1"
 FIN_BOX
@@ -403,7 +387,7 @@ BOX
 std:StringSelect:Box81
 ISEXEC:FALSE
 -474.548561:74.412243:-900.000000
--432.388561:64.412243:-900.000000
+-232.252011:64.412243:-900.000000
 PORT
 In0:"0"
 PORT
@@ -415,13 +399,25 @@ BOX
 std:MathOperationVector:Box82
 ISEXEC:FALSE
 -450.471349:8.131320:-900.000000
--233.365665:-1.868680:-900.000000
+-402.946349:-1.868680:-900.000000
 PORT
 In1:"-1    -1   -1"
 PORT
 Type:"0"
 FIN_BOX
-CONNECTIONS:65
+BOX
+std:MagicBox:Box83
+ISEXEC:FALSE
+-672.007424:211.414023:-900.000000
+-635.932424:201.414023:-900.000000
+FIN_BOX
+BOX
+std:MagicBox:Box78
+ISEXEC:FALSE
+28.546863:157.851551:-900.000000
+64.621863:147.851551:-900.000000
+FIN_BOX
+CONNECTIONS:67
 CONNECTION
 Box22:LookupTable:Box04:LookupTable
 NumberOfControlPoints:0
@@ -462,9 +458,6 @@ CONNECTION
 Box40:Out:Box41:In
 NumberOfControlPoints:0
 CONNECTION
-Box40:Out:Box42:In
-NumberOfControlPoints:0
-CONNECTION
 Box44:Out:Box36:FirstValue
 NumberOfControlPoints:0
 CONNECTION
@@ -486,9 +479,6 @@ CONNECTION
 Box52:Out:Box17:In
 NumberOfControlPoints:0
 CONNECTION
-Box40:Out:Box53:In
-NumberOfControlPoints:0
-CONNECTION
 Box40:Out:Box55:In
 NumberOfControlPoints:0
 CONNECTION
@@ -615,6 +605,18 @@ CONNECTION
 Box82:Out:Box34:In
 NumberOfControlPoints:0
 CONNECTION
-Box20:Size:Box44:In
+Box82:Out:Box44:In
+NumberOfControlPoints:0
+CONNECTION
+BorderActive:BorderActive:Box83:In
+NumberOfControlPoints:0
+CONNECTION
+Box83:Out:Box26:Active
+NumberOfControlPoints:0
+CONNECTION
+Interpolation_mode:Interpolation_mode:Box78:In
+NumberOfControlPoints:0
+CONNECTION
+Box78:Out:Box00:InterpolationMode
 NumberOfControlPoints:0
 APP_END
index b4a518da249c56bbac369f65329ba8dd539dfa4f..10a34a36efe8737d33a9b94e479a48696a891871 100644 (file)
@@ -74,11 +74,6 @@ new std:StringSelect Box41
   set Box41.In1 "90 1 0 0"
   set Box41.In2 "-90 0 1 0"
 
-new std:StringSelect Box42
-  set Box42.In0 "0 1 0 0"
-  set Box42.In1 "-90 0 0 1"
-  set Box42.In2 "-90 0 0 1"
-
 new std:GetVectorDoubleElement Box44
   set Box44.I "1"
 
@@ -94,11 +89,6 @@ new std:StringSelect Box46
 
 new vtk:Transform Box52
 
-new std:StringSelect Box53
-  set Box53.In0 "0 1 0 0"
-  set Box53.In1 "0 1 0 0"
-  set Box53.In2 "-90 0 1 0"
-
 new std:StringSelect Box55
   set Box55.In0 "1"
   set Box55.In1 "-1"
@@ -162,6 +152,10 @@ new std:MathOperationVector Box82
   set Box82.In1 "-1    -1   -1"
   set Box82.Type "0"
 
+new std:MagicBox Box83
+
+new std:MagicBox Box78
+
 
 connect Box22.LookupTable Box04.LookupTable
 connect Box32.Out Box04.Transform
@@ -176,7 +170,6 @@ connect Box37.Out Box26.lstPointY
 connect Box38.Out Box00.In
 connect Box38.Out Box20.In
 connect Box40.Out Box41.In
-connect Box40.Out Box42.In
 connect Box44.Out Box36.FirstValue
 connect Box40.Out Box45.In
 connect Box40.Out Box46.In
@@ -184,7 +177,6 @@ connect Box45.Out Box34.I
 connect Box46.Out Box44.I
 connect Box17.Out Box32.In
 connect Box52.Out Box17.In
-connect Box40.Out Box53.In
 connect Box40.Out Box55.In
 connect Box57.Out Box22.Range
 connect Box60.Out Box00.Slice
@@ -219,7 +211,9 @@ connect Box40.Out Box81.In
 connect Box81.Out Box00.TypeOrientation
 connect Box20.Size Box82.In0
 connect Box82.Out Box34.In
-connect Box20.Size Box44.In
+connect Box82.Out Box44.In
+connect Box83.Out Box26.Active
+connect Box78.Out Box00.InterpolationMode
 
 # Complex input ports
 input Direction Box40.In1 " "
@@ -229,6 +223,8 @@ input SliceDeep Box60.In1 " "
 input SliceOpacity Box04.Opacity " "
 input Render Box61.In " "
 input WindowColorLevel Box65.In1 " "
+input BorderActive Box83.In " "
+input Interpolation_mode Box78.In " "
 
 # Complex output ports
 output BoxChangeImageSlice Box04.BoxChange " "
index 653b0c85ddf15d75110fa2c9878cf5599f893222..2ffd69822a4fa39f7fabed10ab3e6e10e8c66b2d 100644 (file)
@@ -32,6 +32,7 @@ namespace bbcreaMaracasVisu
        
 BBTK_ADD_BLACK_BOX_TO_PACKAGE(creaMaracasVisu,SliceImage)
 BBTK_BLACK_BOX_IMPLEMENTATION(SliceImage,bbtk::AtomicBlackBox);
+
 void SliceImage::Process()
 {
        vtkImageData *imagedata=NULL;
@@ -42,21 +43,21 @@ void SliceImage::Process()
 
 //EED 2017-01-01 Migration VTK7
 #if VTK_MAJOR_VERSION <= 5
-         imageReslice->SetInput( bbGetInputIn() );
+               imageReslice->SetInput( bbGetInputIn() );
 #else
-         imageReslice->SetInputData( bbGetInputIn() );
+               imageReslice->SetInputData( bbGetInputIn() );
 #endif
 
-         imageReslice->SetInformationInput(bbGetInputIn() );
+               imageReslice->SetInformationInput(bbGetInputIn() );
 
-         double slice=bbGetInputSlice();
-         if (slice<0) 
-          
-               slice=0;
-          
-       
-         if (bbGetInputTypeOrientation()==3)
-         {
+               double slice=bbGetInputSlice();
+               if (slice<0) 
+       { 
+                       slice=0;
+       } 
+
+               if (bbGetInputTypeOrientation()==3)
+               {
                // Orientation 3 = FREE
                // v1 = [ v1x , v1y , v1z ]
                // v2 = [ v2x , v2y , v2z ]
@@ -107,8 +108,7 @@ void SliceImage::Process()
                // SetResliceAxesDirectionCosines(v1x,v2x,v3x,v1y,v2y,v3y,v1z,v2z,v3z);
               imageReslice->SetResliceAxesDirectionCosines( 1,0,0,   0,0,1,   0,-1,0 ); 
               imageReslice->SetResliceAxesOrigin(0, slice*bbGetInputIn()->GetSpacing()[1],0 );
-         } else    
-         {
+         } else    {
                // Orientation 0 = XY
                // v1 = [ 1 , 0 , 0 ]
                // v2 = [ 0 , 1 , 0 ]
@@ -118,16 +118,11 @@ void SliceImage::Process()
               imageReslice->SetResliceAxesOrigin(0,0, slice*bbGetInputIn()->GetSpacing()[2] );
          } 
          imageReslice->SetOutputDimensionality(2);
-         imageReslice->SetInterpolationModeToLinear();
-
-
-
-
-
-
-
-
 
+               if ( bbGetInputInterpolationMode()==0) { printf("EED neighbor\n"); imageReslice->SetInterpolationModeToNearestNeighbor();       }
+               if ( bbGetInputInterpolationMode()==1) { printf("EED linear\n"); imageReslice->SetInterpolationModeToLinear();                  }
+               if ( bbGetInputInterpolationMode()==2) { printf("EED Cubic\n"); imageReslice->SetInterpolationModeToCubic();                    }
+                       
 //EED 2017-01-01 Migration VTK7
 #if VTK_MAJOR_VERSION <= 5
          imagedata = imageReslice->GetOutput();
@@ -149,6 +144,7 @@ void SliceImage::Process()
                bbSetInputIn(NULL);
                bbSetInputZ(0);
                bbSetInputSlice(0);
+               bbSetInputInterpolationMode(2);  // Linear
                bbSetInputTypeOrientation(0);
                imageReslice=NULL;
                std::vector<double> lstCos;
index 618713cc2f2b286271cceace7ae279b7a73f7a54..9b5af65c50bd229c9af67c00d419c515595825ae 100644 (file)
@@ -43,6 +43,7 @@ class bbcreaMaracasVisu_EXPORT SliceImage
   BBTK_DECLARE_INPUT(In,vtkImageData*);
   BBTK_DECLARE_INPUT(Z, double );
   BBTK_DECLARE_INPUT(Slice, double );
+  BBTK_DECLARE_INPUT(InterpolationMode,int);
   BBTK_DECLARE_INPUT(TypeOrientation, int );
   BBTK_DECLARE_INPUT(ResliceAxesDirectionCosines, std::vector<double> );
   BBTK_DECLARE_OUTPUT(Out,vtkImageData*);
@@ -55,16 +56,20 @@ class bbcreaMaracasVisu_EXPORT SliceImage
 
 
 BBTK_BEGIN_DESCRIBE_BLACK_BOX(SliceImage,bbtk::AtomicBlackBox);
-BBTK_NAME("SliceImage");
-BBTK_AUTHOR("eduardo.davila@creatis.insa-lyon.fr");
-BBTK_DESCRIPTION("filter");
-BBTK_CATEGORY("");
-BBTK_INPUT(SliceImage,In,"Input image",vtkImageData *,"");
-BBTK_INPUT(SliceImage,Slice,"Slice",double,"");
-BBTK_INPUT(SliceImage,Z,"Z (deprecated)",double,"");
-BBTK_INPUT(SliceImage,ResliceAxesDirectionCosines,"ResliceAxesDirectionCosines [v1x,v1y,v1z,v2x,v2y,v2z,v3x,v3y,v3z],  ",std::vector<double>,"");
-BBTK_INPUT(SliceImage,TypeOrientation,"Type orientation (default 0) 0=XY, 1=X-Z, -1=XZ, 2=Y-Z, -2=ZY, 3=Free (Set the input ResliceAxesDirectionCosines)",int,"");
-BBTK_OUTPUT(SliceImage,Out,"Output image",vtkImageData *,"");
+  BBTK_NAME("SliceImage");
+  BBTK_AUTHOR("eduardo.davila@creatis.insa-lyon.fr");
+  BBTK_DESCRIPTION("filter");
+  BBTK_CATEGORY("");
+
+  BBTK_INPUT(SliceImage,In,"Input image",vtkImageData *,"");
+  BBTK_INPUT(SliceImage,Slice,"Slice",double,"");
+  BBTK_INPUT(SliceImage,Z,"Z (deprecated)",double,"");
+  BBTK_INPUT(SliceImage,InterpolationMode,"(default 1) 0=NearestNeighbor  1=Linear  2=Cubic",int,"");
+  BBTK_INPUT(SliceImage,ResliceAxesDirectionCosines,"ResliceAxesDirectionCosines [v1x,v1y,v1z,v2x,v2y,v2z,v3x,v3y,v3z],  ",std::vector<double>,"");
+  BBTK_INPUT(SliceImage,TypeOrientation,"Type orientation (default 0) 0=XY, 1=X-Z, -1=XZ, 2=Y-Z, -2=ZY, 3=Free (Set the input ResliceAxesDirectionCosines)",int,"");
+
+  BBTK_OUTPUT(SliceImage,Out,"Output image",vtkImageData *,"");
+
 BBTK_END_DESCRIBE_BLACK_BOX(SliceImage);
 }
 // EO namespace bbcreaMaracasVisu
index 81821f5c4adb4f43b4bd703db406f26e3b06f941..9a7c6600681ca7a618ac19a22b5d146b881272c0 100644 (file)
@@ -42,6 +42,12 @@ void wxVtkBaseView_Info::Process()
                        {
                                bbSetOutputImage( marimagedata->GetImageData() );                               
                        } // MarImageData
+                       std::vector<double> LstWindowColorLevel;
+                       LstWindowColorLevel.push_back( vtkbasedata->GetColorWindow() );
+                       LstWindowColorLevel.push_back( vtkbasedata->GetColorLevel() );
+                       bbSetOutputWindowColorLevel( LstWindowColorLevel );
+                       bbSetOutputInterpolation( vtkbasedata->GetInterpolate() );
+                       
                }  // BaseData
        }
 
@@ -55,8 +61,14 @@ void wxVtkBaseView_Info::bbUserSetDefaultValues()
 
 //  SET HERE THE DEFAULT INPUT/OUTPUT VALUES OF YOUR BOX 
 //    Here we initialize the input 'In' to 0
-   bbSetOutputDirection(2);
-   bbSetOutputvtkRenderer(NULL);
+
+       std::vector<double> LstWindowColorLevel;
+       LstWindowColorLevel.push_back( 1000 );
+       LstWindowColorLevel.push_back( 500 );
+       bbSetOutputWindowColorLevel( LstWindowColorLevel );
+    bbSetOutputDirection(2);
+    bbSetOutputInterpolation(true);
+    bbSetOutputvtkRenderer(NULL);
   
 }
 //===== 
index ada0390eada7a789a45d23c1eff752ec2971a006..379860abb8c5278fb65c1690b38acb2c58525ebe 100644 (file)
@@ -25,6 +25,9 @@ class bbcreaMaracasVisu_EXPORT wxVtkBaseView_Info
   BBTK_DECLARE_OUTPUT(vtkRenderer,vtkRenderer*);
   BBTK_DECLARE_OUTPUT(Direction,int);
   BBTK_DECLARE_OUTPUT(Image,vtkImageData*);
+  BBTK_DECLARE_OUTPUT(WindowColorLevel,std::vector<double>);
+  BBTK_DECLARE_OUTPUT(Interpolation,bool);
+  
   BBTK_PROCESS(Process);
   void Process();
 //===== 
@@ -43,6 +46,8 @@ BBTK_BEGIN_DESCRIBE_BLACK_BOX(wxVtkBaseView_Info,bbtk::AtomicBlackBox);
   BBTK_OUTPUT(wxVtkBaseView_Info,Direction,"Direction -1=3D 0=YZ  1=XZ  2=XY(default)",int,"");
   BBTK_OUTPUT(wxVtkBaseView_Info,vtkRenderer,"vtkRenderer default=NULL",vtkRenderer*,"");
   BBTK_OUTPUT(wxVtkBaseView_Info,Image,"vtkImageData",vtkImageData*,"");
+  BBTK_OUTPUT(wxVtkBaseView_Info,WindowColorLevel,"List [Window, Level]",std::vector<double>,"");
+  BBTK_OUTPUT(wxVtkBaseView_Info,Interpolation,"(default true) true/false",bool,"");
 
 BBTK_END_DESCRIBE_BLACK_BOX(wxVtkBaseView_Info);
 //===== 
index 0097329a0ed2305567e4eec2483475ca68a570ef..0164c6d695284e5943317d515377dfec977ba416 100644 (file)
@@ -222,69 +222,52 @@ void DrawAxisTree3D::Process()
 {
 printf("DrawAxisTree3D::Process Start >>   %s\n", bbGetFullName().c_str() );
 
-   if ( (bbGetInputlstPointX().size()==bbGetInputlstPointY().size()) && 
-               (bbGetInputlstPointX().size()==bbGetInputlstPointZ().size())      )
+       // Removing actors
+       int iActor,sizeActors = vecVtkActors.size();
+       for (iActor=0 ; iActor<sizeActors; iActor++)
        {
-               int iGeneral=0;
-               std::vector<int> lstIndexs = bbGetInputlstIndexs();
-               if ( bbGetInputlstIndexs().size()==0 )
-               {
-       //EED printf("2 ");
-                       lstIndexs.push_back( bbGetInputlstPointX().size() );
+               if (bbGetInputRenderer()!=NULL )
+               { 
+                       bbGetInputRenderer()->RemoveActor( vecVtkActors[iActor] );
+                       vecVtkPolyData[iActor]->Delete();
+                       vecVtkPolyDataMaper[iActor]->Delete();
+                       vecVtkActors[iActor]->Delete();
                } // if
-               int iAxis,sizeLstAxis=lstIndexs.size();
-               int iActor,sizeActors = vecVtkActors.size();
-               int numPoints;
-
-       //EED printf("3 ");
-
-       //    if (oldLstSize!=sizeLstAxis)
-       //       {
-       //        oldLstSize=sizeLstAxis;
-                    for (iActor=0 ; iActor<sizeActors; iActor++)
-                    {
-       //EED printf("4-%d ",iActor);
-                       if (bbGetInputRenderer()!=NULL )
-                       { 
-       //EED printf("5 ");
-                           bbGetInputRenderer()->RemoveActor( vecVtkActors[iActor] );
-                           vecVtkPolyData[iActor]->Delete();
-                           vecVtkPolyDataMaper[iActor]->Delete();
-                           vecVtkActors[iActor]->Delete();
-       //EED printf("6 ");
-                       } // if
-                    } // for iActor
-                    vecVtkPolyData.clear();
-                    vecVtkPolyDataMaper.clear();
-                    vecVtkActors.clear();
-       //EED printf("7 ");
-                    for ( iAxis=0 ; iAxis<sizeLstAxis ; iAxis++)
-                    {
-       //EED printf("8(%d) ",iAxis);
-                       numPoints = lstIndexs[iAxis];
-       //EED printf("9(%d) ",iAxis);
-                       DrawOneAxis(iGeneral,numPoints,iAxis);
-       //EED printf("10 ");   
-                       iGeneral = iGeneral+numPoints;
-               //              if ((iAxis % 1)==0)
-               //              {
-               //                      printf("EED  DrawAxisTree3D::Process  %d/%d\n", iAxis,sizeLstAxis );
-               //              }
-                    } // for iAxis
-
-       //EED printf("11 ");
-
-                   if ( bbGetInputiAxis() < (int)(vecVtkActors.size() ) )
-                   {
-                       bbSetOutputOutAxis( vecVtkActors[ bbGetInputiAxis() ] );            
-                   } else      {
-                       printf("DrawAxisTree3D .ERROR.  iAxis for exist in actors vector ...\n");
-                   } // if 
-        //   } else {// if oldLstSize
-       //    } // if oldLstSize
-       } else {
-               printf("\nDrawAxisTree3D .ERROR.  size of vectors lstPointX.size=%d lstPointY.size=%d lstPointZ.size=%d are not coherent \n\n",bbGetInputlstPointX().size(), bbGetInputlstPointY().size(), bbGetInputlstPointZ().size() );
-       }// size X Y Z
+       } // for iActor
+       vecVtkPolyData.clear();
+       vecVtkPolyDataMaper.clear();
+       vecVtkActors.clear();
+
+       // Adding actors
+       if (bbGetInputActive()==true)
+       {
+          if ( (bbGetInputlstPointX().size()==bbGetInputlstPointY().size()) && 
+                       (bbGetInputlstPointX().size()==bbGetInputlstPointZ().size())      )
+               {
+                       int iGeneral=0;
+                       std::vector<int> lstIndexs = bbGetInputlstIndexs();
+                       if ( bbGetInputlstIndexs().size()==0 )
+                       {
+                               lstIndexs.push_back( bbGetInputlstPointX().size() );
+                       } // if
+                       int iAxis,sizeLstAxis=lstIndexs.size();
+                       int numPoints;
+                       for ( iAxis=0 ; iAxis<sizeLstAxis ; iAxis++)
+                       {
+                               numPoints = lstIndexs[iAxis];
+                               DrawOneAxis(iGeneral,numPoints,iAxis);
+                               iGeneral = iGeneral+numPoints;
+                       } // for iAxis
+                       if ( bbGetInputiAxis() < (int)(vecVtkActors.size() ) )
+                       {
+                               bbSetOutputOutAxis( vecVtkActors[ bbGetInputiAxis() ] );            
+                       } else  {
+                               printf("DrawAxisTree3D .ERROR.  iAxis for exist in actors vector ...\n");
+                       } // if 
+               } else {
+                       printf("\nDrawAxisTree3D .ERROR.  size of vectors lstPointX.size=%d lstPointY.size=%d lstPointZ.size=%d are not coherent \n\n",bbGetInputlstPointX().size(), bbGetInputlstPointY().size(), bbGetInputlstPointZ().size() );
+               }// size X Y Z
+       } // if Active
 printf("DrawAxisTree3D::Process End \n");
 
 }
@@ -292,7 +275,6 @@ printf("DrawAxisTree3D::Process End \n");
 void DrawAxisTree3D::bbUserSetDefaultValues()
 {
     oldLstSize=-1;
-        bbSetInputiAxis(0);
      std::vector<double> colour;
         // 1- red
      colour.push_back(1.0);
@@ -320,6 +302,8 @@ void DrawAxisTree3D::bbUserSetDefaultValues()
      colour.push_back(0.5);
      colour.push_back(0.5);
 
+        bbSetInputActive(true);
+        bbSetInputiAxis(0);
      bbSetInputColour(colour);
      bbSetInputOpacity(1);
      bbSetInputLineWidth(0.5);
index 09fe7e9d5c1b95b07e95e78fa89519b31a5cc35d..af34f78e288bad4ed1c7b2bc9a75ba7dc57040fc 100644 (file)
@@ -46,6 +46,7 @@ class /*BBTK_EXPORT*/ DrawAxisTree3D
    public bbtk::AtomicBlackBox
 {
   BBTK_BLACK_BOX_INTERFACE(DrawAxisTree3D,bbtk::AtomicBlackBox);
+  BBTK_DECLARE_INPUT(Active    , bool);
   BBTK_DECLARE_INPUT(Renderer   , vtkRenderer*);
   BBTK_DECLARE_INPUT(lstIndexs  , std::vector<int>);
   BBTK_DECLARE_INPUT(lstPointX  , std::vector<double>);
@@ -77,6 +78,7 @@ BBTK_NAME("DrawAxisTree3D");
 BBTK_AUTHOR("InfoTeam CREATIS-LRMN");
 BBTK_DESCRIPTION("Draw Axis Tree 3D");
 BBTK_CATEGORY("actor");
+  BBTK_INPUT(DrawAxisTree3D,Active,"(default true) true/false",bool,"");
   BBTK_INPUT(DrawAxisTree3D,Renderer,"Renderer",vtkRenderer*,"");
   BBTK_INPUT(DrawAxisTree3D,lstIndexs,"Indexs",std::vector<int>,"");
   BBTK_INPUT(DrawAxisTree3D,lstPointX,"lstPointX",std::vector<double>,"");
index 1363744cb970cb6dfe92c0b39a0754ff5af1536c..a889cf5e0c4b7f5d1a6df04af05844f2a577cb9e 100644 (file)
@@ -44,10 +44,10 @@ bbwxMaracas_N_ViewersWidget::bbwxMaracas_N_ViewersWidget(ViewerNV* box,
                                                          std::vector<int> *nTypeView)
 :wxMaracas_N_ViewersWidget(parent,imagedata,nTypeView)
 {
-       mbbViewerNV=box;
-       backX=-9999;
-       backY=-9999;
-       backZ=-9999;
+       mbbViewerNV     = box;
+       backX           = -9999;
+       backY           = -9999;
+       backZ           = -9999;
 }
 
 //-------------------------------------------------------------
index db7a79f1cd1de8ac9b89632173b32ec0dcb038d8..80af2e1c15246effa43e1c4eb76070f7e08092ac 100644 (file)
@@ -332,8 +332,8 @@ void wxVtkMPR3DView::SetImage()
 #else
 
 
-       double colorWindow      = _vtkmpr3Ddataviewer->GetVtkMPRBaseData()->GetColorWindow();
-       double colorLevel       = _vtkmpr3Ddataviewer->GetVtkMPRBaseData()->GetColorLevel();
+//     double colorWindow      = _vtkmpr3Ddataviewer->GetVtkMPRBaseData()->GetColorWindow();
+//     double colorLevel       = _vtkmpr3Ddataviewer->GetVtkMPRBaseData()->GetColorLevel();
 
        double spc[3];
        vtkImageData *image = GetVtkMPR3DDataViewer()->GetVtkMPRBaseData()->GetImageData();
@@ -382,6 +382,11 @@ void wxVtkMPR3DView::SetImage()
        _planeWidgetY->SetSlicePosition( y*spc[1] );
        _planeWidgetZ->SetSlicePosition( z*spc[2] );
 
+       _planeWidgetX->GetTexture()->SetInterpolate( _vtkmpr3Ddataviewer->GetVtkMPRBaseData()->GetInterpolate() );
+       _planeWidgetY->GetTexture()->SetInterpolate( _vtkmpr3Ddataviewer->GetVtkMPRBaseData()->GetInterpolate() );
+       _planeWidgetZ->GetTexture()->SetInterpolate( _vtkmpr3Ddataviewer->GetVtkMPRBaseData()->GetInterpolate() );
+
+
        // -- Plane widget
        _probe->SetSourceData( imageData );
 #endif