From: davila Date: Mon, 26 May 2014 06:04:29 +0000 (+0200) Subject: 2377 BBTK Bug New Normal box vtkUpdateRenderer test and initialice Renderer (NULL) X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=commitdiff_plain;h=560f6b3560c3d4062d4f2413d5202a1318acb801;p=bbtk.git 2377 BBTK Bug New Normal box vtkUpdateRenderer test and initialice Renderer (NULL) 2376 BBTK Feature New Normal new box: Crop Widget --- diff --git a/packages/itk/src/bbitkBinaryThresholdImageFilter.h b/packages/itk/src/bbitkBinaryThresholdImageFilter.h index dcc7ecd..0fa8e97 100644 --- a/packages/itk/src/bbitkBinaryThresholdImageFilter.h +++ b/packages/itk/src/bbitkBinaryThresholdImageFilter.h @@ -204,6 +204,7 @@ namespace bbitk template void BinaryThresholdImageFilterGeneric::Process() { +printf("EED BinaryThresholdImageFilterGeneric::Process Start\n"); bbtkDebugMessageInc("Core",9, "bbitk::BinaryThresholdImageFilterGeneric::Process<" <()<<">()"<bbSetOutputOut( f->bbGetOutputOut() ); bbtkDebugDecTab("Core",9); +printf("EED BinaryThresholdImageFilterGeneric::Process End\n"); } //=================================================== diff --git a/packages/toolsbbtk/bbs/boxes/Crop_Widget.bbg b/packages/toolsbbtk/bbs/boxes/Crop_Widget.bbg new file mode 100644 index 0000000..8801c43 --- /dev/null +++ b/packages/toolsbbtk/bbs/boxes/Crop_Widget.bbg @@ -0,0 +1,202 @@ +# ---------------------------------- +# - BBTKGEditor v 1.4 BBG BlackBox Diagram file +# - /home/davila/Creatis/creaTools/creatools_source/bbtk/packages/toolsbbtk/bbs/boxes/Crop_Widget.bbg +# ---------------------------------- + +APP_START +CATEGORY: +DESCRIPTION:Description ?? +AUTHOR:Author ?? +COMPLEXBOX:TRUE +COMPLEXBOXNAME:Crop_Widget +PACKAGENAME:toolsbbtk +COMPLEXOUTPUTS:2 +COMPLEX_PORT +Widget_Out +30.876207:-144.819734:-900.000000 +FIN_COMPLEX_PORT +COMPLEX_PORT +Image_Out +84.381059:-151.004812:-900.000000 +FIN_COMPLEX_PORT +COMPLEXINPUTS:1 +COMPLEX_PORT +Image +183.793384:187.565034:-900.000000 +FIN_COMPLEX_PORT +BOXES:13 +BOX +creaMaracasVisu:ViewerNV:Box03 +ISEXEC:FALSE +-40.613543:116.651836:-900.000000 +20.026457:106.651836:-900.000000 +PORT +nTypeView:"-1" +FIN_BOX +BOX +creaMaracasVisu:ContourVOI:Box05 +ISEXEC:FALSE +178.678745:91.171084:-900.000000 +224.253745:81.171084:-900.000000 +FIN_BOX +BOX +wx:LayoutSplit:Box06 +ISEXEC:FALSE +27.904814:-109.326892:-900.000000 +73.479814:-119.326892:-900.000000 +PORT +Proportion:"35" +FIN_BOX +BOX +wx:LayoutLine:Box07 +ISEXEC:FALSE +-56.158854:15.953735:-900.000000 +1.401146:5.953735:-900.000000 +PORT +WinTitle:"Crop" +FIN_BOX +BOX +wx:CommandButton:Box08 +ISEXEC:FALSE +58.225519:165.043527:-900.000000 +103.800519:155.043527:-900.000000 +PORT +Label:"Run Crop" +FIN_BOX +BOX +creaMaracasVisu:ImageChangeInformation:Box10 +ISEXEC:FALSE +67.701745:49.306194:-900.000000 +138.876745:39.306194:-900.000000 +FIN_BOX +BOX +wx:OutputText:Box14 +ISEXEC:FALSE +250.990475:-14.310989:-900.000000 +296.565475:-24.310989:-900.000000 +PORT +Title:"Index" +FIN_BOX +BOX +wx:OutputText:Box15 +ISEXEC:FALSE +224.783932:-33.505655:-900.000000 +270.358932:-43.505655:-900.000000 +PORT +Title:"Size" +FIN_BOX +BOX +wx:LayoutLine:Box16 +ISEXEC:FALSE +197.554904:-63.324479:-900.000000 +255.114904:-73.324479:-900.000000 +PORT +WinTitle:"Save" +FIN_BOX +BOX +vtk:ExtractVtkImageFilter:Box25 +ISEXEC:FALSE +76.212653:83.601063:-900.000000 +147.387653:73.601063:-900.000000 +FIN_BOX +BOX +toolsbbtk:SaveMHD_infoCrop-Button:Box26 +ISEXEC:FALSE +155.157235:18.780767:-900.000000 +226.332235:8.780767:-900.000000 +FIN_BOX +BOX +vtk:vtkImageDataPointerRelay:Box19 +ISEXEC:FALSE +203.411015:164.651483:-900.000000 +274.586015:154.651483:-900.000000 +FIN_BOX +BOX +wx:LayoutTab:Box20 +ISEXEC:FALSE +149.234786:-83.267653:-900.000000 +206.794786:-93.267653:-900.000000 +FIN_BOX +CONNECTIONS:27 +CONNECTION +Box03:Widget:Box06:Widget2 +NumberOfControlPoints:0 +CONNECTION +Box05:Widget:Box07:Widget1 +NumberOfControlPoints:0 +CONNECTION +Box08:Widget:Box07:Widget2 +NumberOfControlPoints:0 +CONNECTION +Box08:BoxChange:Box05:BoxExecute +NumberOfControlPoints:0 +CONNECTION +Box05:Index:Box14:In +NumberOfControlPoints:0 +CONNECTION +Box05:Size:Box15:In +NumberOfControlPoints:0 +CONNECTION +Box14:Widget:Box16:Widget1 +NumberOfControlPoints:0 +CONNECTION +Box15:Widget:Box16:Widget2 +NumberOfControlPoints:0 +CONNECTION +Box05:Index:Box25:Index +NumberOfControlPoints:0 +CONNECTION +Box05:Size:Box25:Size +NumberOfControlPoints:0 +CONNECTION +Box25:Out:Box10:In +NumberOfControlPoints:0 +CONNECTION +Box08:BoxChange:Box25:BoxExecute +NumberOfControlPoints:0 +CONNECTION +Box10:Out:Box26:In +NumberOfControlPoints:0 +CONNECTION +Box05:Size:Box26:Size +NumberOfControlPoints:0 +CONNECTION +Box05:Index:Box26:Index +NumberOfControlPoints:0 +CONNECTION +Box26:Widget:Box16:Widget3 +NumberOfControlPoints:0 +CONNECTION +Image:Image:Box19:In +NumberOfControlPoints:0 +CONNECTION +Box19:Out:Box05:In +NumberOfControlPoints:0 +CONNECTION +Box19:Out:Box25:In +NumberOfControlPoints:0 +CONNECTION +Box19:Out:Box03:In +NumberOfControlPoints:0 +CONNECTION +Box06:Widget:Widget_Out:Widget_Out +NumberOfControlPoints:0 +CONNECTION +Box10:Out:Image_Out:Image_Out +NumberOfControlPoints:0 +CONNECTION +Box03:wxVtkBaseView1:Box05:wxVtkBaseView +NumberOfControlPoints:0 +CONNECTION +Box16:Widget:Box20:Widget2 +NumberOfControlPoints:0 +CONNECTION +Box07:Widget:Box20:Widget1 +NumberOfControlPoints:0 +CONNECTION +Box20:Widget:Box06:Widget1 +NumberOfControlPoints:0 +CONNECTION +Box08:BoxChange:Box16:BoxExecute +NumberOfControlPoints:0 +APP_END diff --git a/packages/toolsbbtk/bbs/boxes/Crop_Widget.bbs b/packages/toolsbbtk/bbs/boxes/Crop_Widget.bbs new file mode 100644 index 0000000..758fa0e --- /dev/null +++ b/packages/toolsbbtk/bbs/boxes/Crop_Widget.bbs @@ -0,0 +1,87 @@ +# ---------------------------------- +# - BBTKGEditor v 1.4 BBS BlackBox Script (Complex Box) +# - /home/davila/Creatis/creaTools/creatools_source/bbtk/packages/toolsbbtk/bbs/boxes/Crop_Widget.bbs +# ---------------------------------- + +include std +include itkvtk +include creaMaracasVisu +include wx +include vtk +include toolsbbtk + +define Crop_Widget toolsbbtk + +author "Author ??" +description "Description ??" + +category "" + +new ViewerNV Box03 + set Box03.nTypeView "-1" + +new ContourVOI Box05 + +new LayoutSplit Box06 + set Box06.Proportion "35" + +new LayoutLine Box07 + set Box07.WinTitle "Crop" + +new CommandButton Box08 + set Box08.Label "Run Crop" + +new ImageChangeInformation Box10 + +new OutputText Box14 + set Box14.Title "Index" + +new OutputText Box15 + set Box15.Title "Size" + +new LayoutLine Box16 + set Box16.WinTitle "Save" + +new ExtractVtkImageFilter Box25 + +new SaveMHD_infoCrop-Button Box26 + +new vtkImageDataPointerRelay Box19 + +new LayoutTab Box20 + + +connect Box03.Widget Box06.Widget2 +connect Box05.Widget Box07.Widget1 +connect Box08.Widget Box07.Widget2 +connect Box08.BoxChange Box05.BoxExecute +connect Box05.Index Box14.In +connect Box05.Size Box15.In +connect Box14.Widget Box16.Widget1 +connect Box15.Widget Box16.Widget2 +connect Box05.Index Box25.Index +connect Box05.Size Box25.Size +connect Box25.Out Box10.In +connect Box08.BoxChange Box25.BoxExecute +connect Box10.Out Box26.In +connect Box05.Size Box26.Size +connect Box05.Index Box26.Index +connect Box26.Widget Box16.Widget3 +connect Box19.Out Box05.In +connect Box19.Out Box25.In +connect Box19.Out Box03.In +connect Box03.wxVtkBaseView1 Box05.wxVtkBaseView +connect Box16.Widget Box20.Widget2 +connect Box07.Widget Box20.Widget1 +connect Box20.Widget Box06.Widget1 +connect Box08.BoxChange Box16.BoxExecute + +# Complex input ports +input Image Box19.In " " + +# Complex output ports +output Widget_Out Box06.Widget " " +output Image_Out Box10.Out " " + + +endefine diff --git a/packages/vtk/src/bbvtkExtractVtkImageFilter.cxx b/packages/vtk/src/bbvtkExtractVtkImageFilter.cxx index efbbe22..7f6f7b3 100644 --- a/packages/vtk/src/bbvtkExtractVtkImageFilter.cxx +++ b/packages/vtk/src/bbvtkExtractVtkImageFilter.cxx @@ -40,6 +40,7 @@ BBTK_BLACK_BOX_IMPLEMENTATION(ExtractVtkImageFilter,bbtk::AtomicBlackBox); //===== void ExtractVtkImageFilter::Process() { +printf("EED ExtractVtkImageFilter::Process Start\n"); int voi[6]; voi[0] = bbGetInputIndex()[0]; @@ -55,6 +56,7 @@ void ExtractVtkImageFilter::Process() _extract->Modified(); _extract->Update(); bbSetOutputOut(_extract->GetOutput()); +printf("EED ExtractVtkImageFilter::Process End\n"); } //===== diff --git a/packages/vtk/src/bbvtkUpdateRender.cxx b/packages/vtk/src/bbvtkUpdateRender.cxx index d4031bc..ac4d109 100644 --- a/packages/vtk/src/bbvtkUpdateRender.cxx +++ b/packages/vtk/src/bbvtkUpdateRender.cxx @@ -33,16 +33,20 @@ namespace bbvtk { BBTK_ADD_BLACK_BOX_TO_PACKAGE(vtk, UpdateRender) BBTK_BLACK_BOX_IMPLEMENTATION(UpdateRender, bbtk::AtomicBlackBox); - void UpdateRender::Process() { - std::cout << "CM creaInteraction vtkUpdateRender::Process before if" << std::endl; - if(bbGetInputActive()){ - std::cout << "CM creaInteraction vtkUpdateRender::Process within if" << std::endl; - bbGetInputRenderer()->GetRenderWindow()->Render(); - } + void UpdateRender::Process() + { + if(bbGetInputActive()) + { + if (bbGetInputRenderer()!=NULL) + { + bbGetInputRenderer()->GetRenderWindow()->Render(); + } // Renderer + } // Active } void UpdateRender::bbUserSetDefaultValues() { bbSetInputActive(false); + bbSetInputRenderer(NULL); } void UpdateRender::bbUserInitializeProcessing() {