From 7fa429f3fe29505edb15207db75b58d560922247 Mon Sep 17 00:00:00 2001 From: Eduardo DAVILA Date: Fri, 25 Jun 2021 16:23:00 +0200 Subject: [PATCH] #3468 Refres for 3D+t Visu --- bbtk/bbs/boxes/SliceImage-3DVisu.bbg | 136 +++++++++--------- bbtk/bbs/boxes/SliceImage-3DVisu.bbs | 22 ++- bbtk/src/bbcreaMaracasVisuSliceImage.cxx | 40 +++--- bbtk/src/bbcreaMaracasVisuSliceImage.h | 25 ++-- .../bbcreaMaracasVisuwxVtkBaseView_Info.cxx | 16 ++- .../src/bbcreaMaracasVisuwxVtkBaseView_Info.h | 5 + bbtk/src/bbmaracasvisuDrawAxisTree3D.cxx | 108 ++++++-------- bbtk/src/bbmaracasvisuDrawAxisTree3D.h | 2 + bbtk/src/bbmaracasvisuViewerNV.cxx | 8 +- .../wxWindows/widgets/wxVtkMPR3DView.cxx | 9 +- 10 files changed, 189 insertions(+), 182 deletions(-) diff --git a/bbtk/bbs/boxes/SliceImage-3DVisu.bbg b/bbtk/bbs/boxes/SliceImage-3DVisu.bbg index f71ce6e..3bd56d1 100644 --- a/bbtk/bbs/boxes/SliceImage-3DVisu.bbg +++ b/bbtk/bbs/boxes/SliceImage-3DVisu.bbg @@ -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 diff --git a/bbtk/bbs/boxes/SliceImage-3DVisu.bbs b/bbtk/bbs/boxes/SliceImage-3DVisu.bbs index b4a518d..10a34a3 100644 --- a/bbtk/bbs/boxes/SliceImage-3DVisu.bbs +++ b/bbtk/bbs/boxes/SliceImage-3DVisu.bbs @@ -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 " " diff --git a/bbtk/src/bbcreaMaracasVisuSliceImage.cxx b/bbtk/src/bbcreaMaracasVisuSliceImage.cxx index 653b0c8..2ffd698 100644 --- a/bbtk/src/bbcreaMaracasVisuSliceImage.cxx +++ b/bbtk/src/bbcreaMaracasVisuSliceImage.cxx @@ -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 lstCos; diff --git a/bbtk/src/bbcreaMaracasVisuSliceImage.h b/bbtk/src/bbcreaMaracasVisuSliceImage.h index 618713c..9b5af65 100644 --- a/bbtk/src/bbcreaMaracasVisuSliceImage.h +++ b/bbtk/src/bbcreaMaracasVisuSliceImage.h @@ -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 ); 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,""); -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,""); + 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 diff --git a/bbtk/src/bbcreaMaracasVisuwxVtkBaseView_Info.cxx b/bbtk/src/bbcreaMaracasVisuwxVtkBaseView_Info.cxx index 81821f5..9a7c660 100644 --- a/bbtk/src/bbcreaMaracasVisuwxVtkBaseView_Info.cxx +++ b/bbtk/src/bbcreaMaracasVisuwxVtkBaseView_Info.cxx @@ -42,6 +42,12 @@ void wxVtkBaseView_Info::Process() { bbSetOutputImage( marimagedata->GetImageData() ); } // MarImageData + std::vector 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 LstWindowColorLevel; + LstWindowColorLevel.push_back( 1000 ); + LstWindowColorLevel.push_back( 500 ); + bbSetOutputWindowColorLevel( LstWindowColorLevel ); + bbSetOutputDirection(2); + bbSetOutputInterpolation(true); + bbSetOutputvtkRenderer(NULL); } //===== diff --git a/bbtk/src/bbcreaMaracasVisuwxVtkBaseView_Info.h b/bbtk/src/bbcreaMaracasVisuwxVtkBaseView_Info.h index ada0390..379860a 100644 --- a/bbtk/src/bbcreaMaracasVisuwxVtkBaseView_Info.h +++ b/bbtk/src/bbcreaMaracasVisuwxVtkBaseView_Info.h @@ -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); + 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,""); + BBTK_OUTPUT(wxVtkBaseView_Info,Interpolation,"(default true) true/false",bool,""); BBTK_END_DESCRIBE_BLACK_BOX(wxVtkBaseView_Info); //===== diff --git a/bbtk/src/bbmaracasvisuDrawAxisTree3D.cxx b/bbtk/src/bbmaracasvisuDrawAxisTree3D.cxx index 0097329..0164c6d 100644 --- a/bbtk/src/bbmaracasvisuDrawAxisTree3D.cxx +++ b/bbtk/src/bbmaracasvisuDrawAxisTree3D.cxx @@ -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 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 ; iActorRemoveActor( 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 lstIndexs = bbGetInputlstIndexs(); + if ( bbGetInputlstIndexs().size()==0 ) + { + lstIndexs.push_back( bbGetInputlstPointX().size() ); + } // if + int iAxis,sizeLstAxis=lstIndexs.size(); + int numPoints; + for ( iAxis=0 ; iAxis 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); diff --git a/bbtk/src/bbmaracasvisuDrawAxisTree3D.h b/bbtk/src/bbmaracasvisuDrawAxisTree3D.h index 09fe7e9..af34f78 100644 --- a/bbtk/src/bbmaracasvisuDrawAxisTree3D.h +++ b/bbtk/src/bbmaracasvisuDrawAxisTree3D.h @@ -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); BBTK_DECLARE_INPUT(lstPointX , std::vector); @@ -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,""); BBTK_INPUT(DrawAxisTree3D,lstPointX,"lstPointX",std::vector,""); diff --git a/bbtk/src/bbmaracasvisuViewerNV.cxx b/bbtk/src/bbmaracasvisuViewerNV.cxx index 1363744..a889cf5 100644 --- a/bbtk/src/bbmaracasvisuViewerNV.cxx +++ b/bbtk/src/bbmaracasvisuViewerNV.cxx @@ -44,10 +44,10 @@ bbwxMaracas_N_ViewersWidget::bbwxMaracas_N_ViewersWidget(ViewerNV* box, std::vector *nTypeView) :wxMaracas_N_ViewersWidget(parent,imagedata,nTypeView) { - mbbViewerNV=box; - backX=-9999; - backY=-9999; - backZ=-9999; + mbbViewerNV = box; + backX = -9999; + backY = -9999; + backZ = -9999; } //------------------------------------------------------------- diff --git a/lib/maracasVisuLib/src/interface/wxWindows/widgets/wxVtkMPR3DView.cxx b/lib/maracasVisuLib/src/interface/wxWindows/widgets/wxVtkMPR3DView.cxx index db7a79f..80af2e1 100644 --- a/lib/maracasVisuLib/src/interface/wxWindows/widgets/wxVtkMPR3DView.cxx +++ b/lib/maracasVisuLib/src/interface/wxWindows/widgets/wxVtkMPR3DView.cxx @@ -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 -- 2.47.1