From: Eduardo DAVILA Date: Fri, 10 Sep 2021 13:12:29 +0000 (+0200) Subject: #3470 merge vtk8itk5wx3-mingw64 X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=commitdiff_plain;h=8b897e95b16fec9d4da9e687b750101f6f16e173;hp=54b6b0c0eb849a103538fb68c13417ce1f390fa7;p=creaVtk.git #3470 merge vtk8itk5wx3-mingw64 --- diff --git a/CMakeLists.txt b/CMakeLists.txt index 0e5b8f1..5308ece 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -61,6 +61,8 @@ SET(PROJECT_VERSION_DATE "11/02/2010") #ADD_DEFINITIONS( -DPROJECT_VERSION=${PROJECT_VERSION} ) #ADD_DEFINITIONS( -DPROJECT_VERSION_DATE=${PROJECT_VERSION_DATE} ) + + # JPR 4 mars 2011 set (CMAKE_MODULE_PATH ${CMAKE_INSTALL_PREFIX}/share/cmake/Module) @@ -203,3 +205,6 @@ ADD_SUBDIRECTORY(install) # ---- ADD_SUBDIRECTORY(bbtk_creaVtk_PKG) #ADD_SUBDIRECTORY(bbtk_creaVtkHeartAngles_PKG) + + + diff --git a/bbtk_creaVtk_PKG/bbs/appli/ExamplePointPicker.bbg b/bbtk_creaVtk_PKG/bbs/appli/ExamplePointPicker.bbg new file mode 100644 index 0000000..f8634e6 --- /dev/null +++ b/bbtk_creaVtk_PKG/bbs/appli/ExamplePointPicker.bbg @@ -0,0 +1,257 @@ +# ---------------------------------- +# - BBTKGEditor v 1.4 BBG BlackBox Diagram file +# - /home/davila/Creatis/C11/creatools_source/creaVtk/bbtk_creaVtk_PKG/bbs/appli/ExamplePointPicker.bbg +# ---------------------------------- + +APP_START +CATEGORY: +DESCRIPTION:Description ?? +AUTHOR:Author ?? +COMPLEXBOX:FALSE +COMPLEXINPUTS:0 +BOXES:19 +BOX +creaVtk:PointPicker:Box00 +ISEXEC:FALSE +42.388461:-60.890316:-900.000000 +79.338461:-70.890316:-900.000000 +FIN_BOX +BOX +vtk:SphereSource:Box01 +ISEXEC:FALSE +-86.646215:96.548464:-900.000000 +-46.821215:86.548464:-900.000000 +PORT +CenterX:"40" +PORT +CenterY:"40" +PORT +CenterZ:"40" +PORT +PhiResolution:"20" +PORT +Radius:"20" +PORT +ThetaResolution:"20" +FIN_BOX +BOX +vtk:PolyDataToActor:Box02 +ISEXEC:FALSE +-95.048252:31.209645:-900.000000 +-49.808252:21.209645:-900.000000 +FIN_BOX +BOX +creaMaracasVisu:ViewerNV:Box03 +ISEXEC:FALSE +8.401272:82.554547:-900.000000 +44.276272:72.554547:-900.000000 +FIN_BOX +BOX +wx:OutputText:Box04 +ISEXEC:FALSE +42.530164:-134.123521:-900.000000 +79.305164:-144.123521:-900.000000 +PORT +Title:"Point&&2P&&" +FIN_BOX +BOX +wx:LayoutLine:Box05 +ISEXEC:FALSE +-17.972686:-174.663538:-900.000000 +18.602314:-184.663538:-900.000000 +FIN_BOX +BOX +wx:Slider:Box07 +ISEXEC:FALSE +-147.867981:83.753544:-900.000000 +-96.467981:73.753544:-900.000000 +PORT +Label:"true" +PORT +Max:"100" +PORT +ReactiveOnTrack:"true" +PORT +Title:"Opacity" +FIN_BOX +BOX +vtk:LoadHola:Box08 +ISEXEC:FALSE +60.405272:125.283738:-900.000000 +95.955272:115.283738:-900.000000 +FIN_BOX +BOX +std:MathOperationVector:Box09 +ISEXEC:FALSE +140.121465:-78.587243:-900.000000 +187.646465:-88.587243:-900.000000 +PORT +Type:"3" +FIN_BOX +BOX +vtk:ImageVtkProperties:Box10 +ISEXEC:FALSE +137.805626:-58.052985:-900.000000 +183.155626:-68.052985:-900.000000 +FIN_BOX +BOX +creaMaracasVisu:SetPosition:Box11 +ISEXEC:FALSE +140.379252:-125.723679:-900.000000 +176.929252:-135.723679:-900.000000 +FIN_BOX +BOX +std:MathOperationVector:Box13 +ISEXEC:FALSE +146.565584:-95.540874:-900.000000 +194.090584:-105.540874:-900.000000 +PORT +Type:"23" +FIN_BOX +BOX +std:Div:Box14 +ISEXEC:FALSE +-108.350574:58.048497:-900.000000 +-79.025574:48.048497:-900.000000 +PORT +In2:"100" +FIN_BOX +BOX +wx:OutputText:Box15 +ISEXEC:FALSE +88.836059:-132.175947:-900.000000 +125.611059:-142.175947:-900.000000 +PORT +Title:"Round Point&&2P&&" +FIN_BOX +BOX +wx:CheckBox:Box16 +ISEXEC:FALSE +13.081332:16.677865:-900.000000 +49.406332:6.677865:-900.000000 +PORT +In:"true" +PORT +Title:"Point Picker Active" +FIN_BOX +BOX +creaVtk:OutputWindow:Box17 +ISEXEC:TRUE +-119.252058:-206.172997:-900.000000 +-78.652058:-216.172997:-900.000000 +FIN_BOX +BOX +wx:LayoutSplit:Box18 +ISEXEC:TRUE +-61.489869:-207.111169:-900.000000 +-24.814869:-217.111169:-900.000000 +PORT +Orientation:"H" +FIN_BOX +BOX +wx:ComboBox:Box19 +ISEXEC:FALSE +-39.256609:18.205522:-900.000000 +2.903391:8.205522:-900.000000 +PORT +In:"Nothing MouseMove ClickLeft DoubleClickLeft" +PORT +Selection:"2" +PORT +Title:"Event" +FIN_BOX +BOX +std:MultipleInputs:Box20 +ISEXEC:FALSE +-64.871846:-21.697611:-900.000000 +-25.171846:-31.697611:-900.000000 +FIN_BOX +CONNECTIONS:29 +CONNECTION +Box01:Out:Box02:In +NumberOfControlPoints:0 +CONNECTION +Box04:Widget:Box05:Widget2 +NumberOfControlPoints:0 +CONNECTION +Box03:Renderer1:Box02:Renderer +NumberOfControlPoints:0 +CONNECTION +Box03:Renderer1:Box00:Renderer +NumberOfControlPoints:0 +CONNECTION +Box07:Widget:Box05:Widget1 +NumberOfControlPoints:0 +CONNECTION +Box07:BoxChange:Box02:BoxExecute +NumberOfControlPoints:0 +CONNECTION +Box08:Out:Box03:In +NumberOfControlPoints:0 +CONNECTION +Box00:BoxChange:Box04:BoxExecute +NumberOfControlPoints:0 +CONNECTION +Box00:Point:Box09:In0 +NumberOfControlPoints:0 +CONNECTION +Box08:Out:Box10:In +NumberOfControlPoints:0 +CONNECTION +Box10:Spacing:Box09:In1 +NumberOfControlPoints:0 +CONNECTION +Box09:Out:Box04:In +NumberOfControlPoints:0 +CONNECTION +Box03:wxVtkBaseView1:Box11:wxVtkBaseView +NumberOfControlPoints:0 +CONNECTION +Box00:BoxChange:Box11:BoxExecute +NumberOfControlPoints:0 +CONNECTION +Box09:Out:Box13:In0 +NumberOfControlPoints:0 +CONNECTION +Box13:Out:Box11:Point +NumberOfControlPoints:0 +CONNECTION +Box07:Out:Box14:In1 +NumberOfControlPoints:0 +CONNECTION +Box14:Out:Box02:Opacity +NumberOfControlPoints:0 +CONNECTION +Box13:Out:Box15:In +NumberOfControlPoints:0 +CONNECTION +Box00:BoxChange:Box15:BoxExecute +NumberOfControlPoints:0 +CONNECTION +Box15:Widget:Box05:Widget3 +NumberOfControlPoints:0 +CONNECTION +Box16:Widget:Box05:Widget5 +NumberOfControlPoints:0 +CONNECTION +Box05:Widget:Box18:Widget1 +NumberOfControlPoints:0 +CONNECTION +Box03:Widget:Box18:Widget2 +NumberOfControlPoints:0 +CONNECTION +Box19:Widget:Box05:Widget6 +NumberOfControlPoints:0 +CONNECTION +Box19:Out:Box00:TypeEvent +NumberOfControlPoints:0 +CONNECTION +Box19:BoxChange:Box20:In1 +NumberOfControlPoints:0 +CONNECTION +Box16:BoxChange:Box20:In3 +NumberOfControlPoints:0 +CONNECTION +Box20:BoxChange:Box00:BoxExecute +NumberOfControlPoints:0 +APP_END diff --git a/bbtk_creaVtk_PKG/bbs/appli/ExamplePointPicker.bbs b/bbtk_creaVtk_PKG/bbs/appli/ExamplePointPicker.bbs new file mode 100644 index 0000000..0b66cb6 --- /dev/null +++ b/bbtk_creaVtk_PKG/bbs/appli/ExamplePointPicker.bbs @@ -0,0 +1,143 @@ +# ---------------------------------- +# - BBTKGEditor v 1.4 BBS BlackBox Script +# - /home/davila/Creatis/C11/creatools_source/creaVtk/bbtk_creaVtk_PKG/bbs/appli/ExamplePointPicker.bbs +# ---------------------------------- + +# BBTK GEditor Script +# ---------------------- + +include std +include itkvtk +include creaVtk +include vtk +include creaMaracasVisu +include wx +include std + +author "Author ??" +description "Description ??" +category "" + +new creaVtk:PointPicker Box00 + +new vtk:SphereSource Box01 + set Box01.CenterX "40" + set Box01.CenterY "40" + set Box01.CenterZ "40" + set Box01.PhiResolution "20" + set Box01.Radius "20" + set Box01.ThetaResolution "20" + +new vtk:PolyDataToActor Box02 + +new creaMaracasVisu:ViewerNV Box03 + +new wx:OutputText Box04 + set Box04.Title "Point:" + +new wx:LayoutLine Box05 + +new wx:Slider Box07 + set Box07.Label "true" + set Box07.Max "100" + set Box07.ReactiveOnTrack "true" + set Box07.Title "Opacity" + +new vtk:LoadHola Box08 + +new std:MathOperationVector Box09 + set Box09.Type "3" + +new vtk:ImageVtkProperties Box10 + +new creaMaracasVisu:SetPosition Box11 + +new std:MathOperationVector Box13 + set Box13.Type "23" + +new std:Div Box14 + set Box14.In2 "100" + +new wx:OutputText Box15 + set Box15.Title "Round Point:" + +new wx:CheckBox Box16 + set Box16.In "true" + set Box16.Title "Point Picker Active" + +new creaVtk:OutputWindow Box17 + +new wx:LayoutSplit Box18 + set Box18.Orientation "H" + +new wx:ComboBox Box19 + set Box19.In "Nothing MouseMove ClickLeft DoubleClickLeft" + set Box19.Selection "2" + set Box19.Title "Event" + +new std:MultipleInputs Box20 + + +connect Box01.Out Box02.In + +connect Box04.Widget Box05.Widget2 + +connect Box03.Renderer1 Box02.Renderer + +connect Box03.Renderer1 Box00.Renderer + +connect Box07.Widget Box05.Widget1 + +connect Box07.BoxChange Box02.BoxExecute + +connect Box08.Out Box03.In + +connect Box00.BoxChange Box04.BoxExecute + +connect Box00.Point Box09.In0 + +connect Box08.Out Box10.In + +connect Box10.Spacing Box09.In1 + +connect Box09.Out Box04.In + +connect Box03.wxVtkBaseView1 Box11.wxVtkBaseView + +connect Box00.BoxChange Box11.BoxExecute + +connect Box09.Out Box13.In0 + +connect Box13.Out Box11.Point + +connect Box07.Out Box14.In1 + +connect Box14.Out Box02.Opacity + +connect Box13.Out Box15.In + +connect Box00.BoxChange Box15.BoxExecute + +connect Box15.Widget Box05.Widget3 + +connect Box16.Widget Box05.Widget5 + +connect Box05.Widget Box18.Widget1 + +connect Box03.Widget Box18.Widget2 + +connect Box19.Widget Box05.Widget6 + +connect Box19.Out Box00.TypeEvent + +connect Box19.BoxChange Box20.In1 + +connect Box16.BoxChange Box20.In3 + +connect Box20.BoxChange Box00.BoxExecute + + + +# Complex input ports +exec Box17 +exec Box18 diff --git a/bbtk_creaVtk_PKG/bbs/appli/exampleBooleanOperationPolyDataFilter.bbg b/bbtk_creaVtk_PKG/bbs/appli/exampleBooleanOperationPolyDataFilter.bbg new file mode 100644 index 0000000..83f571a --- /dev/null +++ b/bbtk_creaVtk_PKG/bbs/appli/exampleBooleanOperationPolyDataFilter.bbg @@ -0,0 +1,108 @@ +# ---------------------------------- +# - BBTKGEditor v 1.4 BBG BlackBox Diagram file +# - /home/davila/Creatis/C8/creatools_source/creaVtk/bbtk_creaVtk_PKG/bbs/appli/exampleBooleanOperationPolyDataFilter.bbg +# ---------------------------------- + +APP_START +CATEGORY: +DESCRIPTION:Description ?? +AUTHOR:Author ?? +COMPLEXBOX:FALSE +COMPLEXINPUTS:0 +BOXES:8 +BOX +vtk:LoadHola:Box00 +ISEXEC:FALSE +20.514225:65.842216:-900.000000 +56.064225:55.842216:-900.000000 +FIN_BOX +BOX +creaMaracasVisu:ViewerNV:Box01 +ISEXEC:FALSE +10.074288:34.484577:-900.000000 +73.794288:24.484577:-900.000000 +FIN_BOX +BOX +creaVtk:BooleanOperationPolyDataFilter:Box02 +ISEXEC:FALSE +-84.931667:-3.883455:-900.000000 +-27.731667:-13.883455:-900.000000 +PORT +Operation:"2" +FIN_BOX +BOX +vtk:SphereSource:Box03 +ISEXEC:FALSE +-66.750036:38.292380:-900.000000 +-26.925036:28.292380:-900.000000 +PORT +CenterX:"50" +PORT +CenterY:"50" +PORT +CenterZ:"50" +PORT +Radius:"10" +FIN_BOX +BOX +vtk:SphereSource:Box04 +ISEXEC:FALSE +-115.429192:38.610324:-900.000000 +-75.604192:28.610324:-900.000000 +PORT +CenterX:"60" +PORT +CenterY:"60" +PORT +CenterZ:"60" +PORT +Radius:"15" +FIN_BOX +BOX +wx:LayoutSplit:Box05 +ISEXEC:TRUE +17.589025:-59.260516:-900.000000 +56.669025:-69.260516:-900.000000 +PORT +Orientation:"H" +FIN_BOX +BOX +wx:CommandButton:Box06 +ISEXEC:FALSE +-129.629226:-22.380301:-900.000000 +-86.854226:-32.380301:-900.000000 +PORT +Label:"Run" +FIN_BOX +BOX +vtk:PolyDataToActor:Box07 +ISEXEC:FALSE +-77.744753:-60.735724:-900.000000 +-35.344753:-70.735724:-900.000000 +FIN_BOX +CONNECTIONS:8 +CONNECTION +Box00:Out:Box01:In +NumberOfControlPoints:0 +CONNECTION +Box01:Widget:Box05:Widget2 +NumberOfControlPoints:0 +CONNECTION +Box06:Widget:Box05:Widget1 +NumberOfControlPoints:0 +CONNECTION +Box02:Out:Box07:In +NumberOfControlPoints:0 +CONNECTION +Box01:Renderer1:Box07:Renderer +NumberOfControlPoints:0 +CONNECTION +Box06:BoxChange:Box07:BoxExecute +NumberOfControlPoints:0 +CONNECTION +Box04:Out:Box02:In1 +NumberOfControlPoints:0 +CONNECTION +Box03:Out:Box02:In2 +NumberOfControlPoints:0 +APP_END diff --git a/bbtk_creaVtk_PKG/bbs/appli/exampleBooleanOperationPolyDataFilter.bbs b/bbtk_creaVtk_PKG/bbs/appli/exampleBooleanOperationPolyDataFilter.bbs new file mode 100644 index 0000000..cadee93 --- /dev/null +++ b/bbtk_creaVtk_PKG/bbs/appli/exampleBooleanOperationPolyDataFilter.bbs @@ -0,0 +1,67 @@ +# ---------------------------------- +# - BBTKGEditor v 1.4 BBS BlackBox Script +# - /home/davila/Creatis/C8/creatools_source/creaVtk/bbtk_creaVtk_PKG/bbs/appli/exampleBooleanOperationPolyDataFilter.bbs +# ---------------------------------- + +# BBTK GEditor Script +# ---------------------- + +include std +include itkvtk +include vtk +include creaMaracasVisu +include creaVtk +include wx + +author "Author ??" +description "Description ??" +category "" + +new vtk:LoadHola Box00 + +new creaMaracasVisu:ViewerNV Box01 + +new creaVtk:BooleanOperationPolyDataFilter Box02 + set Box02.Operation "2" + +new vtk:SphereSource Box03 + set Box03.CenterX "50" + set Box03.CenterY "50" + set Box03.CenterZ "50" + set Box03.Radius "10" + +new vtk:SphereSource Box04 + set Box04.CenterX "60" + set Box04.CenterY "60" + set Box04.CenterZ "60" + set Box04.Radius "15" + +new wx:LayoutSplit Box05 + set Box05.Orientation "H" + +new wx:CommandButton Box06 + set Box06.Label "Run" + +new vtk:PolyDataToActor Box07 + + +connect Box00.Out Box01.In + +connect Box01.Widget Box05.Widget2 + +connect Box06.Widget Box05.Widget1 + +connect Box02.Out Box07.In + +connect Box01.Renderer1 Box07.Renderer + +connect Box06.BoxChange Box07.BoxExecute + +connect Box04.Out Box02.In1 + +connect Box03.Out Box02.In2 + + + +# Complex input ports +exec Box05 diff --git a/bbtk_creaVtk_PKG/bbs/appli/exampleCutter.bbg b/bbtk_creaVtk_PKG/bbs/appli/exampleCutter.bbg new file mode 100644 index 0000000..8714098 --- /dev/null +++ b/bbtk_creaVtk_PKG/bbs/appli/exampleCutter.bbg @@ -0,0 +1,149 @@ +# ---------------------------------- +# - BBTKGEditor v 1.4 BBG BlackBox Diagram file +# - /home/davila/Creatis/C11/creatools_source/creaVtk/bbtk_creaVtk_PKG/bbs/appli/exampleCutter.bbg +# ---------------------------------- + +APP_START +CATEGORY: +DESCRIPTION:Description ?? +AUTHOR:Author ?? +COMPLEXBOX:FALSE +COMPLEXINPUTS:0 +BOXES:10 +BOX +creaVtk:Cutter:Box00 +ISEXEC:FALSE +-145.723171:32.668251:-900.000000 +-113.523171:22.668251:-900.000000 +FIN_BOX +BOX +vtk:SphereSource:Box01 +ISEXEC:FALSE +-111.028659:69.110634:-900.000000 +-71.203659:59.110634:-900.000000 +PORT +CenterX:"0" +PORT +CenterY:"0" +PORT +CenterZ:"0" +PORT +PhiResolution:"15" +PORT +Radius:"40" +PORT +ThetaResolution:"15" +FIN_BOX +BOX +creaMaracasVisu:ViewerNV:Box02 +ISEXEC:FALSE +-39.027712:25.464030:-900.000000 +24.692288:15.464030:-900.000000 +PORT +nTypeView:"7" +FIN_BOX +BOX +vtk:PolyDataToActor:Box04 +ISEXEC:FALSE +-160.865702:-7.231106:-900.000000 +-115.625702:-17.231106:-900.000000 +PORT +Colour:"1 0 0" +PORT +LineWidth:"2" +PORT +Opacity:"1" +PORT +Representation:"1" +FIN_BOX +BOX +wx:LayoutSplit:Box05 +ISEXEC:TRUE +-85.277640:-110.429457:-900.000000 +-46.197640:-120.429457:-900.000000 +PORT +Orientation:"H" +FIN_BOX +BOX +vtk:PolyDataToActor:Box09 +ISEXEC:FALSE +-118.071022:-28.000184:-900.000000 +-72.831022:-38.000184:-900.000000 +PORT +Opacity:"0.2" +PORT +Representation:"2" +FIN_BOX +BOX +vtk:UpdateRender:Box13 +ISEXEC:FALSE +-86.780672:-58.548149:-900.000000 +-46.455672:-68.548149:-900.000000 +PORT +Active:"true" +FIN_BOX +BOX +wx:CommandButton:Box15 +ISEXEC:FALSE +-191.766922:14.485134:-900.000000 +-148.991922:4.485134:-900.000000 +PORT +Label:"Refresh" +FIN_BOX +BOX +creaVtk:Plane:Box10 +ISEXEC:FALSE +-159.787919:55.095091:-900.000000 +-128.062919:45.095091:-900.000000 +PORT +Normal:"0 0 1" +PORT +Origin:"0 0 30" +FIN_BOX +BOX +vtk:LoadHola:Box11 +ISEXEC:FALSE +-22.628739:43.735282:-900.000000 +12.921261:33.735282:-900.000000 +FIN_BOX +CONNECTIONS:13 +CONNECTION +Box00:Out:Box04:In +NumberOfControlPoints:0 +CONNECTION +Box02:Renderer1:Box04:Renderer +NumberOfControlPoints:0 +CONNECTION +Box02:Widget:Box05:Widget2 +NumberOfControlPoints:0 +CONNECTION +Box02:Renderer1:Box09:Renderer +NumberOfControlPoints:0 +CONNECTION +Box02:Renderer1:Box13:Renderer +NumberOfControlPoints:0 +CONNECTION +Box15:BoxChange:Box04:BoxExecute +NumberOfControlPoints:0 +CONNECTION +Box04:BoxChange:Box09:BoxExecute +NumberOfControlPoints:0 +CONNECTION +Box09:BoxChange:Box13:BoxExecute +NumberOfControlPoints:0 +CONNECTION +Box01:Out:Box00:In +NumberOfControlPoints:0 +CONNECTION +Box01:Out:Box09:In +NumberOfControlPoints:0 +CONNECTION +Box15:Widget:Box05:Widget1 +NumberOfControlPoints:0 +CONNECTION +Box10:Out:Box00:ImplicitFunction +NumberOfControlPoints:0 +CONNECTION +Box11:Out:Box02:In +NumberOfControlPoints:0 +APP_END diff --git a/bbtk_creaVtk_PKG/bbs/appli/exampleCutter.bbs b/bbtk_creaVtk_PKG/bbs/appli/exampleCutter.bbs new file mode 100644 index 0000000..4626104 --- /dev/null +++ b/bbtk_creaVtk_PKG/bbs/appli/exampleCutter.bbs @@ -0,0 +1,88 @@ +# ---------------------------------- +# - BBTKGEditor v 1.4 BBS BlackBox Script +# - /home/davila/Creatis/C11/creatools_source/creaVtk/bbtk_creaVtk_PKG/bbs/appli/exampleCutter.bbs +# ---------------------------------- + +# BBTK GEditor Script +# ---------------------- + +include std +include itkvtk +include creaVtk +include vtk +include creaMaracasVisu +include wx + +author "Author ??" +description "Description ??" +category "" + +new creaVtk:Cutter Box00 + +new vtk:SphereSource Box01 + set Box01.CenterX "0" + set Box01.CenterY "0" + set Box01.CenterZ "0" + set Box01.PhiResolution "15" + set Box01.Radius "40" + set Box01.ThetaResolution "15" + +new creaMaracasVisu:ViewerNV Box02 + set Box02.nTypeView "7" + +new vtk:PolyDataToActor Box04 + set Box04.Colour "1 0 0" + set Box04.LineWidth "2" + set Box04.Opacity "1" + set Box04.Representation "1" + +new wx:LayoutSplit Box05 + set Box05.Orientation "H" + +new vtk:PolyDataToActor Box09 + set Box09.Opacity "0.2" + set Box09.Representation "2" + +new vtk:UpdateRender Box13 + set Box13.Active "true" + +new wx:CommandButton Box15 + set Box15.Label "Refresh" + +new creaVtk:Plane Box10 + set Box10.Normal "0 0 1" + set Box10.Origin "0 0 30" + +new vtk:LoadHola Box11 + + +connect Box00.Out Box04.In + +connect Box02.Renderer1 Box04.Renderer + +connect Box02.Widget Box05.Widget2 + +connect Box02.Renderer1 Box09.Renderer + +connect Box02.Renderer1 Box13.Renderer + +connect Box15.BoxChange Box04.BoxExecute + +connect Box04.BoxChange Box09.BoxExecute + +connect Box09.BoxChange Box13.BoxExecute + +connect Box01.Out Box00.In + +connect Box01.Out Box09.In + +connect Box15.Widget Box05.Widget1 + +connect Box10.Out Box00.ImplicitFunction + +connect Box11.Out Box02.In + + + +# Complex input ports +exec Box05 diff --git a/bbtk_creaVtk_PKG/bbs/appli/exampleDelaunay3D.bbg b/bbtk_creaVtk_PKG/bbs/appli/exampleDelaunay3D.bbg new file mode 100644 index 0000000..18ad355 --- /dev/null +++ b/bbtk_creaVtk_PKG/bbs/appli/exampleDelaunay3D.bbg @@ -0,0 +1,134 @@ +# ---------------------------------- +# - BBTKGEditor v 1.4 BBG BlackBox Diagram file +# - /home/davila/Creatis/C8/creatools_source/creaVtk/bbtk_creaVtk_PKG/bbs/appli/exampleDelaunay3D.bbg +# ---------------------------------- + +APP_START +CATEGORY: +DESCRIPTION:Description ?? +AUTHOR:Author ?? +COMPLEXBOX:FALSE +COMPLEXINPUTS:0 +BOXES:10 +BOX +creaVtk:Delaunay3D:Box03 +ISEXEC:FALSE +-2.472015:3.957655:-900.000000 +35.727985:-6.042345:-900.000000 +PORT +Alpha:"0" +PORT +Tolerance:"0" +FIN_BOX +BOX +creaMaracasVisu:ViewerNV:Box04 +ISEXEC:FALSE +-126.280141:32.405606:-900.000000 +-62.560141:22.405606:-900.000000 +FIN_BOX +BOX +vtk:LoadHola:Box05 +ISEXEC:FALSE +-120.467476:57.400064:-900.000000 +-84.917476:47.400064:-900.000000 +FIN_BOX +BOX +vtk:PolyDataToActor:Box06 +ISEXEC:FALSE +-5.919702:-30.569827:-900.000000 +36.480298:-40.569827:-900.000000 +PORT +Opacity:"0.4" +FIN_BOX +BOX +wx:LayoutSplit:Box07 +ISEXEC:TRUE +-161.991926:-50.380782:-900.000000 +-122.911926:-60.380782:-900.000000 +PORT +Orientation:"H" +FIN_BOX +BOX +wx:CommandButton:Box08 +ISEXEC:FALSE +-179.483711:26.604189:-900.000000 +-136.708711:16.604189:-900.000000 +PORT +Label:"Run" +FIN_BOX +BOX +creaMaracasVisu:DrawAxe3D:Box10 +ISEXEC:FALSE +-99.671144:-20.425965:-900.000000 +-61.971144:-30.425965:-900.000000 +PORT +Colour:"0 0 1" +FIN_BOX +BOX +std:ConcatStrings:Box11 +ISEXEC:FALSE +-67.014817:80.569084:-900.000000 +-27.289817:70.569084:-900.000000 +PORT +In1:"10 10 10 30 50" +FIN_BOX +BOX +std:ConcatStrings:Box12 +ISEXEC:FALSE +-31.127956:68.291016:-900.000000 +8.597044:58.291016:-900.000000 +PORT +In1:"80 20 10 30 50" +FIN_BOX +BOX +std:ConcatStrings:Box13 +ISEXEC:FALSE +-15.540973:57.652069:-900.000000 +24.184027:47.652069:-900.000000 +PORT +In1:"40 60 30 30 50" +FIN_BOX +CONNECTIONS:14 +CONNECTION +Box05:Out:Box04:In +NumberOfControlPoints:0 +CONNECTION +Box03:Out:Box06:In +NumberOfControlPoints:0 +CONNECTION +Box04:Widget:Box07:Widget2 +NumberOfControlPoints:0 +CONNECTION +Box08:Widget:Box07:Widget1 +NumberOfControlPoints:0 +CONNECTION +Box04:Renderer1:Box06:Renderer +NumberOfControlPoints:0 +CONNECTION +Box11:Out:Box10:lstPointX +NumberOfControlPoints:0 +CONNECTION +Box12:Out:Box10:lstPointY +NumberOfControlPoints:0 +CONNECTION +Box13:Out:Box10:lstPointZ +NumberOfControlPoints:0 +CONNECTION +Box11:Out:Box03:LstPointsX +NumberOfControlPoints:0 +CONNECTION +Box12:Out:Box03:LstPointsY +NumberOfControlPoints:0 +CONNECTION +Box13:Out:Box03:LstPointsZ +NumberOfControlPoints:0 +CONNECTION +Box04:Renderer1:Box10:Renderer +NumberOfControlPoints:0 +CONNECTION +Box08:BoxChange:Box10:BoxExecute +NumberOfControlPoints:0 +CONNECTION +Box08:BoxChange:Box06:BoxExecute +NumberOfControlPoints:0 +APP_END diff --git a/bbtk_creaVtk_PKG/bbs/appli/exampleDelaunay3D.bbs b/bbtk_creaVtk_PKG/bbs/appli/exampleDelaunay3D.bbs new file mode 100644 index 0000000..d488f3f --- /dev/null +++ b/bbtk_creaVtk_PKG/bbs/appli/exampleDelaunay3D.bbs @@ -0,0 +1,82 @@ +# ---------------------------------- +# - BBTKGEditor v 1.4 BBS BlackBox Script +# - /home/davila/Creatis/C8/creatools_source/creaVtk/bbtk_creaVtk_PKG/bbs/appli/exampleDelaunay3D.bbs +# ---------------------------------- + +# BBTK GEditor Script +# ---------------------- + +include std +include itkvtk +include creaVtk +include creaMaracasVisu +include vtk +include wx +include std + +author "Author ??" +description "Description ??" +category "" + +new creaVtk:Delaunay3D Box03 + set Box03.Alpha "0" + set Box03.Tolerance "0" + +new creaMaracasVisu:ViewerNV Box04 + +new vtk:LoadHola Box05 + +new vtk:PolyDataToActor Box06 + set Box06.Opacity "0.4" + +new wx:LayoutSplit Box07 + set Box07.Orientation "H" + +new wx:CommandButton Box08 + set Box08.Label "Run" + +new creaMaracasVisu:DrawAxe3D Box10 + set Box10.Colour "0 0 1" + +new std:ConcatStrings Box11 + set Box11.In1 "10 10 10 30 50" + +new std:ConcatStrings Box12 + set Box12.In1 "80 20 10 30 50" + +new std:ConcatStrings Box13 + set Box13.In1 "40 60 30 30 50" + + +connect Box05.Out Box04.In + +connect Box03.Out Box06.In + +connect Box04.Widget Box07.Widget2 + +connect Box08.Widget Box07.Widget1 + +connect Box04.Renderer1 Box06.Renderer + +connect Box11.Out Box10.lstPointX + +connect Box12.Out Box10.lstPointY + +connect Box13.Out Box10.lstPointZ + +connect Box11.Out Box03.LstPointsX + +connect Box12.Out Box03.LstPointsY + +connect Box13.Out Box03.LstPointsZ + +connect Box04.Renderer1 Box10.Renderer + +connect Box08.BoxChange Box10.BoxExecute + +connect Box08.BoxChange Box06.BoxExecute + + + +# Complex input ports +exec Box07 diff --git a/bbtk_creaVtk_PKG/bbs/appli/exampleFillHoles.bbg b/bbtk_creaVtk_PKG/bbs/appli/exampleFillHoles.bbg new file mode 100644 index 0000000..2ef10f0 --- /dev/null +++ b/bbtk_creaVtk_PKG/bbs/appli/exampleFillHoles.bbg @@ -0,0 +1,219 @@ +# ---------------------------------- +# - BBTKGEditor v 1.4 BBG BlackBox Diagram file +# - Creatis/C11/creatools_source/creaVtk/bbtk_creaVtk_PKG/bbs/appli/exampleFillHoles.bbg +# ---------------------------------- + +APP_START +CATEGORY: +DESCRIPTION:Description ?? +AUTHOR:Author ?? +COMPLEXBOX:FALSE +COMPLEXINPUTS:0 +BOXES:17 +BOX +creaVtk:Stripper:Box03 +ISEXEC:FALSE +6.762907:33.247744:-900.000000 +40.437907:23.247744:-900.000000 +FIN_BOX +BOX +creaMaracasVisu:ViewerNV:Box05 +ISEXEC:FALSE +23.670785:-15.139648:-900.000000 +87.390785:-25.139648:-900.000000 +FIN_BOX +BOX +vtk:LoadHola:Box06 +ISEXEC:FALSE +57.254540:51.170565:-900.000000 +92.804540:41.170565:-900.000000 +FIN_BOX +BOX +creaVtk:OutputWindow:Box08 +ISEXEC:TRUE +-66.866442:-103.666489:-900.000000 +-26.266442:-113.666489:-900.000000 +FIN_BOX +BOX +wx:LayoutSplit:Box09 +ISEXEC:TRUE +20.844703:-115.072869:-900.000000 +59.924703:-125.072869:-900.000000 +PORT +Orientation:"H" +FIN_BOX +BOX +vtk:PolyDataToActor:Box11 +ISEXEC:FALSE +-98.079015:-46.165323:-900.000000 +-52.839015:-56.165323:-900.000000 +PORT +Representation:"2" +FIN_BOX +BOX +vtk:UpdateRender:Box12 +ISEXEC:FALSE +-67.131351:-85.498261:-900.000000 +-26.806351:-95.498261:-900.000000 +PORT +Active:"true" +FIN_BOX +BOX +vtk:SphereSource:Box13 +ISEXEC:FALSE +-32.341283:37.565115:-900.000000 +7.483717:27.565115:-900.000000 +PORT +PhiResolution:"20" +PORT +Radius:"40" +PORT +ThetaResolution:"20" +FIN_BOX +BOX +creaVtk:MeshCutByAxis:Box14 +ISEXEC:FALSE +-47.918925:9.265731:-900.000000 +-6.843925:-0.734269:-900.000000 +PORT +InsideVol:"false" +PORT +Point:"0 0 0" +PORT +Type:"x" +FIN_BOX +BOX +creaVtk:FillHolesFilter:Box15 +ISEXEC:FALSE +-32.600910:-15.139242:-900.000000 +5.774090:-25.139242:-900.000000 +PORT +HoleSize:"500" +FIN_BOX +BOX +vtk:PolyDataToActor:Box16 +ISEXEC:FALSE +-10.056643:-64.330547:-900.000000 +35.183357:-74.330547:-900.000000 +PORT +Colour:"1 0 0" +PORT +Representation:"1" +FIN_BOX +BOX +wx:Slider:Box17 +ISEXEC:FALSE +-139.644776:80.915665:-900.000000 +-88.244776:70.915665:-900.000000 +PORT +In:"100" +PORT +Max:"100" +PORT +ReactiveOnTrack:"true" +FIN_BOX +BOX +std:Div:Box18 +ISEXEC:FALSE +-120.720951:61.339294:-900.000000 +-91.395951:51.339294:-900.000000 +PORT +In2:"100" +FIN_BOX +BOX +wx:LayoutLine:Box19 +ISEXEC:FALSE +-146.170233:11.745822:-900.000000 +-88.610233:1.745822:-900.000000 +FIN_BOX +BOX +wx:Slider:Box20 +ISEXEC:FALSE +-88.322583:75.792656:-900.000000 +-36.922583:65.792656:-900.000000 +PORT +In:"100" +PORT +Max:"100" +PORT +ReactiveOnTrack:"true" +FIN_BOX +BOX +std:Div:Box21 +ISEXEC:FALSE +-78.208125:56.542558:-900.000000 +-48.883125:46.542558:-900.000000 +PORT +In2:"100" +FIN_BOX +BOX +std:MultipleInputs:Box22 +ISEXEC:FALSE +-76.674118:-1.305091:-900.000000 +-36.974118:-11.305091:-900.000000 +FIN_BOX +CONNECTIONS:21 +CONNECTION +Box06:Out:Box05:In +NumberOfControlPoints:0 +CONNECTION +Box05:Widget:Box09:Widget2 +NumberOfControlPoints:0 +CONNECTION +Box05:Renderer1:Box11:Renderer +NumberOfControlPoints:0 +CONNECTION +Box05:Renderer1:Box12:Renderer +NumberOfControlPoints:0 +CONNECTION +Box13:Out:Box14:In +NumberOfControlPoints:0 +CONNECTION +Box14:Out:Box11:In +NumberOfControlPoints:0 +CONNECTION +Box14:Out:Box15:In +NumberOfControlPoints:0 +CONNECTION +Box15:Out:Box16:In +NumberOfControlPoints:0 +CONNECTION +Box05:Renderer1:Box16:Renderer +NumberOfControlPoints:0 +CONNECTION +Box11:BoxChange:Box16:BoxExecute +NumberOfControlPoints:0 +CONNECTION +Box16:BoxChange:Box12:BoxExecute +NumberOfControlPoints:0 +CONNECTION +Box17:Out:Box18:In1 +NumberOfControlPoints:0 +CONNECTION +Box17:Widget:Box19:Widget1 +NumberOfControlPoints:0 +CONNECTION +Box18:Out:Box11:Opacity +NumberOfControlPoints:0 +CONNECTION +Box20:Out:Box21:In1 +NumberOfControlPoints:0 +CONNECTION +Box20:Widget:Box19:Widget3 +NumberOfControlPoints:0 +CONNECTION +Box19:Widget:Box09:Widget1 +NumberOfControlPoints:0 +CONNECTION +Box21:Out:Box16:Opacity +NumberOfControlPoints:0 +CONNECTION +Box20:BoxChange:Box22:In2 +NumberOfControlPoints:0 +CONNECTION +Box17:BoxChange:Box22:In1 +NumberOfControlPoints:0 +CONNECTION +Box22:BoxChange:Box11:BoxExecute +NumberOfControlPoints:0 +APP_END diff --git a/bbtk_creaVtk_PKG/bbs/appli/exampleFillHoles.bbs b/bbtk_creaVtk_PKG/bbs/appli/exampleFillHoles.bbs new file mode 100644 index 0000000..30d3e77 --- /dev/null +++ b/bbtk_creaVtk_PKG/bbs/appli/exampleFillHoles.bbs @@ -0,0 +1,122 @@ +# ---------------------------------- +# - BBTKGEditor v 1.4 BBS BlackBox Script +# - Creatis/C11/creatools_source/creaVtk/bbtk_creaVtk_PKG/bbs/appli/exampleFillHoles.bbs +# ---------------------------------- + +# BBTK GEditor Script +# ---------------------- + +include std +include itkvtk +include creaVtk +include creaMaracasVisu +include vtk +include wx +include std + +author "Author ??" +description "Description ??" +category "" + +new creaVtk:Stripper Box03 + +new creaMaracasVisu:ViewerNV Box05 + +new vtk:LoadHola Box06 + +new creaVtk:OutputWindow Box08 + +new wx:LayoutSplit Box09 + set Box09.Orientation "H" + +new vtk:PolyDataToActor Box11 + set Box11.Representation "2" + +new vtk:UpdateRender Box12 + set Box12.Active "true" + +new vtk:SphereSource Box13 + set Box13.PhiResolution "20" + set Box13.Radius "40" + set Box13.ThetaResolution "20" + +new creaVtk:MeshCutByAxis Box14 + set Box14.InsideVol "false" + set Box14.Point "0 0 0" + set Box14.Type "x" + +new creaVtk:FillHolesFilter Box15 + set Box15.HoleSize "500" + +new vtk:PolyDataToActor Box16 + set Box16.Colour "1 0 0" + set Box16.Representation "1" + +new wx:Slider Box17 + set Box17.In "100" + set Box17.Max "100" + set Box17.ReactiveOnTrack "true" + +new std:Div Box18 + set Box18.In2 "100" + +new wx:LayoutLine Box19 + +new wx:Slider Box20 + set Box20.In "100" + set Box20.Max "100" + set Box20.ReactiveOnTrack "true" + +new std:Div Box21 + set Box21.In2 "100" + +new std:MultipleInputs Box22 + + +connect Box06.Out Box05.In + +connect Box05.Widget Box09.Widget2 + +connect Box05.Renderer1 Box11.Renderer + +connect Box05.Renderer1 Box12.Renderer + +connect Box13.Out Box14.In + +connect Box14.Out Box11.In + +connect Box14.Out Box15.In + +connect Box15.Out Box16.In + +connect Box05.Renderer1 Box16.Renderer + +connect Box11.BoxChange Box16.BoxExecute + +connect Box16.BoxChange Box12.BoxExecute + +connect Box17.Out Box18.In1 + +connect Box17.Widget Box19.Widget1 + +connect Box18.Out Box11.Opacity + +connect Box20.Out Box21.In1 + +connect Box20.Widget Box19.Widget3 + +connect Box19.Widget Box09.Widget1 + +connect Box21.Out Box16.Opacity + +connect Box20.BoxChange Box22.In2 + +connect Box17.BoxChange Box22.In1 + +connect Box22.BoxChange Box11.BoxExecute + + + +# Complex input ports +exec Box08 +exec Box09 diff --git a/bbtk_creaVtk_PKG/bbs/appli/exampleGetCameraInfo.bbg b/bbtk_creaVtk_PKG/bbs/appli/exampleGetCameraInfo.bbg new file mode 100644 index 0000000..89e2534 --- /dev/null +++ b/bbtk_creaVtk_PKG/bbs/appli/exampleGetCameraInfo.bbg @@ -0,0 +1,123 @@ +# ---------------------------------- +# - BBTKGEditor v 1.4 BBG BlackBox Diagram file +# - /tmpEED/creaTools/creatools_source/creaVtk/bbtk_creaVtk_PKG/bbs/appli/exampleGetCameraInfo.bbg +# ---------------------------------- + +APP_START +CATEGORY: +DESCRIPTION:Description ?? +AUTHOR:Author ?? +COMPLEXBOX:FALSE +COMPLEXINPUTS:0 +BOXES:9 +BOX +creaMaracasVisu:ViewerNV:Box00 +ISEXEC:FALSE +-0.450871:79.052673:-900.000000 +63.269129:69.052673:-900.000000 +FIN_BOX +BOX +wx:LayoutSplit:Box01 +ISEXEC:TRUE +8.265964:-80.254995:-900.000000 +53.840964:-90.254995:-900.000000 +PORT +Orientation:"H" +FIN_BOX +BOX +wx:LayoutLine:Box02 +ISEXEC:FALSE +-75.295416:-45.087076:-900.000000 +-17.735416:-55.087076:-900.000000 +FIN_BOX +BOX +wx:OutputText:Box03 +ISEXEC:FALSE +-87.919797:29.456889:-900.000000 +-42.344797:19.456889:-900.000000 +PORT +Title:"FocalPoint" +FIN_BOX +BOX +creaVtk:GetCameraInfo:Box04 +ISEXEC:FALSE +-49.144912:58.913779:-900.000000 +-3.569912:48.913779:-900.000000 +FIN_BOX +BOX +wx:OutputText:Box05 +ISEXEC:FALSE +-67.018056:11.583746:-900.000000 +-21.443056:1.583746:-900.000000 +PORT +Title:"Position" +FIN_BOX +BOX +wx:OutputText:Box06 +ISEXEC:FALSE +-40.405285:-7.191139:-900.000000 +5.169715:-17.191139:-900.000000 +PORT +Title:"ViewUp" +FIN_BOX +BOX +vtk:LoadHola:Box07 +ISEXEC:FALSE +-26.901955:98.590405:-900.000000 +18.673045:88.590405:-900.000000 +FIN_BOX +BOX +wx:CommandButton:Box08 +ISEXEC:FALSE +-118.579009:79.353253:-900.000000 +-73.004009:69.353253:-900.000000 +PORT +In:"Refresh" +FIN_BOX +CONNECTIONS:15 +CONNECTION +Box00:Widget:Box01:Widget2 +NumberOfControlPoints:0 +CONNECTION +Box02:Widget:Box01:Widget1 +NumberOfControlPoints:0 +CONNECTION +Box06:Widget:Box02:Widget3 +NumberOfControlPoints:0 +CONNECTION +Box05:Widget:Box02:Widget2 +NumberOfControlPoints:0 +CONNECTION +Box03:Widget:Box02:Widget1 +NumberOfControlPoints:0 +CONNECTION +Box00:Renderer1:Box04:vtkRenderer +NumberOfControlPoints:0 +CONNECTION +Box04:FocalPoint:Box03:In +NumberOfControlPoints:0 +CONNECTION +Box04:Position:Box05:In +NumberOfControlPoints:0 +CONNECTION +Box04:ViewUp:Box06:In +NumberOfControlPoints:0 +CONNECTION +Box07:Out:Box00:In +NumberOfControlPoints:0 +CONNECTION +Box08:Widget:Box02:Widget4 +NumberOfControlPoints:0 +CONNECTION +Box08:BoxChange:Box03:BoxExecute +NumberOfControlPoints:0 +CONNECTION +Box08:BoxChange:Box05:BoxExecute +NumberOfControlPoints:0 +CONNECTION +Box08:BoxChange:Box06:BoxExecute +NumberOfControlPoints:0 +CONNECTION +Box08:BoxChange:Box04:BoxExecute +NumberOfControlPoints:0 +APP_END diff --git a/bbtk_creaVtk_PKG/bbs/appli/exampleGetCameraInfo.bbs b/bbtk_creaVtk_PKG/bbs/appli/exampleGetCameraInfo.bbs new file mode 100644 index 0000000..a9d2ba5 --- /dev/null +++ b/bbtk_creaVtk_PKG/bbs/appli/exampleGetCameraInfo.bbs @@ -0,0 +1,77 @@ +# ---------------------------------- +# - BBTKGEditor v 1.4 BBS BlackBox Script +# - /tmpEED/creaTools/creatools_source/creaVtk/bbtk_creaVtk_PKG/bbs/appli/exampleGetCameraInfo.bbs +# ---------------------------------- + +# BBTK GEditor Script +# ---------------------- + +include std +include itkvtk +include creaMaracasVisu +include wx +include creaVtk +include vtk + +author "Author ??" +description "Description ??" +category "" + +new creaMaracasVisu:ViewerNV Box00 + +new wx:LayoutSplit Box01 + set Box01.Orientation "H" + +new wx:LayoutLine Box02 + +new wx:OutputText Box03 + set Box03.Title "FocalPoint" + +new creaVtk:GetCameraInfo Box04 + +new wx:OutputText Box05 + set Box05.Title "Position" + +new wx:OutputText Box06 + set Box06.Title "ViewUp" + +new vtk:LoadHola Box07 + +new wx:CommandButton Box08 + set Box08.In "Refresh" + + +connect Box00.Widget Box01.Widget2 + +connect Box02.Widget Box01.Widget1 + +connect Box06.Widget Box02.Widget3 + +connect Box05.Widget Box02.Widget2 + +connect Box03.Widget Box02.Widget1 + +connect Box00.Renderer1 Box04.vtkRenderer + +connect Box04.FocalPoint Box03.In + +connect Box04.Position Box05.In + +connect Box04.ViewUp Box06.In + +connect Box07.Out Box00.In + +connect Box08.Widget Box02.Widget4 + +connect Box08.BoxChange Box03.BoxExecute + +connect Box08.BoxChange Box05.BoxExecute + +connect Box08.BoxChange Box06.BoxExecute + +connect Box08.BoxChange Box04.BoxExecute + + + +# Complex input ports +exec Box01 diff --git a/bbtk_creaVtk_PKG/bbs/appli/exampleHausdorffDistancePointSetFilter.bbg b/bbtk_creaVtk_PKG/bbs/appli/exampleHausdorffDistancePointSetFilter.bbg new file mode 100644 index 0000000..b0ee2f2 --- /dev/null +++ b/bbtk_creaVtk_PKG/bbs/appli/exampleHausdorffDistancePointSetFilter.bbg @@ -0,0 +1,492 @@ +# ---------------------------------- +# - BBTKGEditor v 1.4 BBG BlackBox Diagram file +# - /home/davila/Creatis/C11/creatools_source/creaVtk/bbtk_creaVtk_PKG/bbs/appli/exampleHausdorffDistancePointSetFilter.bbg +# ---------------------------------- + +APP_START +CATEGORY: +DESCRIPTION:Description ?? +AUTHOR:Author ?? +COMPLEXBOX:FALSE +COMPLEXINPUTS:0 +BOXES:35 +BOX +creaMaracasVisu:ViewerNV:Box02 +ISEXEC:FALSE +296.629210:12.955195:-900.000000 +360.349210:2.955195:-900.000000 +PORT +nTypeView:"6" +FIN_BOX +BOX +vtk:LoadHola:Box03 +ISEXEC:FALSE +157.002336:46.757753:-900.000000 +192.552336:36.757753:-900.000000 +FIN_BOX +BOX +creaVtk:OutputWindow:Box06 +ISEXEC:TRUE +1.434151:-390.631803:-900.000000 +42.034151:-400.631803:-900.000000 +FIN_BOX +BOX +wx:LayoutSplit:Box07 +ISEXEC:TRUE +84.617219:-387.180899:-900.000000 +123.697219:-397.180899:-900.000000 +PORT +Orientation:"H" +PORT +Proportion:"30" +FIN_BOX +BOX +wx:LayoutLine:Box08 +ISEXEC:FALSE +28.433535:-355.027567:-900.000000 +85.993535:-365.027567:-900.000000 +FIN_BOX +BOX +vtk:UpdateRender:Box10 +ISEXEC:FALSE +53.348954:-232.163398:-900.000000 +93.673954:-242.163398:-900.000000 +PORT +Active:"true" +FIN_BOX +BOX +creaVtk:HausdorffDistancePointSetFilter:Box13 +ISEXEC:FALSE +-4.243130:-64.340632:-900.000000 +51.631870:-74.340632:-900.000000 +FIN_BOX +BOX +vtk:PolyDataToActor:Box14 +ISEXEC:FALSE +-5.815841:-151.204618:-900.000000 +39.424159:-161.204618:-900.000000 +PORT +Colour:"1 0 1" +PORT +ScalarVisibility:"true" +PORT +ScalarVisibilityOn_NameColorArray:"Distance" +FIN_BOX +BOX +std:MultipleInputs:Box15 +ISEXEC:FALSE +-14.222548:-181.438246:-900.000000 +25.477452:-191.438246:-900.000000 +FIN_BOX +BOX +wx:Slider:Box17 +ISEXEC:FALSE +-268.774700:-17.240416:-900.000000 +-217.374700:-27.240416:-900.000000 +PORT +In:"0" +PORT +Label:"true" +PORT +Max:"100" +PORT +ReactiveOnTrack:"true" +PORT +Title:"Opacity" +FIN_BOX +BOX +std:Div:Box18 +ISEXEC:FALSE +-239.724516:-35.067991:-900.000000 +-210.399516:-45.067991:-900.000000 +PORT +In2:"100" +FIN_BOX +BOX +creaVtk:ScalarsToColors:Box19 +ISEXEC:FALSE +92.332707:-30.067916:-900.000000 +133.857707:-40.067916:-900.000000 +PORT +Type:"100" +FIN_BOX +BOX +wx:LayoutLine:Box21 +ISEXEC:FALSE +-244.045924:-76.548342:-900.000000 +-186.485924:-86.548342:-900.000000 +PORT +Orientation:"H" +PORT +WinTitle:"Surface A" +FIN_BOX +BOX +creaVtk:ScalarBarActor:Box23 +ISEXEC:FALSE +-98.492869:-129.189186:-900.000000 +-57.667869:-139.189186:-900.000000 +PORT +DisplayPosition:"5 30" +PORT +Title:"DistAtoB" +FIN_BOX +BOX +std:ConcatStrings:Box26 +ISEXEC:FALSE +40.116283:-131.073416:-900.000000 +79.841283:-141.073416:-900.000000 +PORT +In1:"0" +PORT +In2:" " +FIN_BOX +BOX +wx:CheckBox:Box27 +ISEXEC:FALSE +-230.713713:-50.042390:-900.000000 +-194.388713:-60.042390:-900.000000 +PORT +In:"true" +PORT +Title:"Hausdorff" +FIN_BOX +BOX +vtk:PolyDataToActor:Box28 +ISEXEC:FALSE +144.583506:-160.381381:-900.000000 +189.823506:-170.381381:-900.000000 +PORT +Colour:"1 1 0" +PORT +ScalarVisibility:"true" +PORT +ScalarVisibilityOn_NameColorArray:"Distance" +FIN_BOX +BOX +wx:Slider:Box29 +ISEXEC:FALSE +-151.123182:7.444080:-900.000000 +-99.723182:-2.555920:-900.000000 +PORT +In:"0" +PORT +Label:"true" +PORT +Max:"100" +PORT +ReactiveOnTrack:"true" +PORT +Title:"Opacity" +FIN_BOX +BOX +std:Div:Box30 +ISEXEC:FALSE +-126.614422:-18.282583:-900.000000 +-97.289422:-28.282583:-900.000000 +PORT +In2:"100" +FIN_BOX +BOX +wx:LayoutLine:Box31 +ISEXEC:FALSE +-143.091108:-78.667405:-900.000000 +-85.531108:-88.667405:-900.000000 +PORT +Orientation:"H" +FIN_BOX +BOX +wx:CheckBox:Box32 +ISEXEC:FALSE +-69.062463:-23.402224:-900.000000 +-32.737463:-33.402224:-900.000000 +PORT +In:"true" +PORT +Title:"Hausdorff" +FIN_BOX +BOX +wx:LayoutTab:Box33 +ISEXEC:FALSE +-242.607538:-103.970480:-900.000000 +-185.047538:-113.970480:-900.000000 +FIN_BOX +BOX +wx:LayoutTab:Box34 +ISEXEC:FALSE +-144.671933:-105.710866:-900.000000 +-87.111933:-115.710866:-900.000000 +PORT +WinTitle:"Surface B" +FIN_BOX +BOX +std:ConcatStrings:Box35 +ISEXEC:FALSE +184.752770:-123.184507:-900.000000 +224.477770:-133.184507:-900.000000 +PORT +In1:"0" +PORT +In2:" " +FIN_BOX +BOX +creaVtk:ScalarsToColors:Box36 +ISEXEC:FALSE +154.166636:-25.865345:-900.000000 +195.691636:-35.865345:-900.000000 +PORT +Type:"100" +FIN_BOX +BOX +creaVtk:ScalarBarActor:Box37 +ISEXEC:FALSE +172.652599:-65.711863:-900.000000 +213.477599:-75.711863:-900.000000 +PORT +Title:"DistBtoA" +FIN_BOX +BOX +vtk:MarchingCubes:Box38 +ISEXEC:FALSE +85.703833:23.290306:-900.000000 +127.503833:13.290306:-900.000000 +PORT +Value:"2000" +FIN_BOX +BOX +vtk:MarchingCubes:Box39 +ISEXEC:FALSE +138.163210:20.820758:-900.000000 +179.963210:10.820758:-900.000000 +PORT +Value:"1550" +FIN_BOX +BOX +wx:LayoutLine:Box40 +ISEXEC:FALSE +-168.946872:-272.505294:-900.000000 +-111.386872:-282.505294:-900.000000 +FIN_BOX +BOX +wx:OutputText:Box43 +ISEXEC:FALSE +-192.398986:-249.561605:-900.000000 +-155.623986:-259.561605:-900.000000 +PORT +Title:"Retative Distance A to B" +FIN_BOX +BOX +wx:OutputText:Box44 +ISEXEC:FALSE +-150.058217:-249.000135:-900.000000 +-113.283217:-259.000135:-900.000000 +PORT +Title:"Retative Distance B to A" +FIN_BOX +BOX +wx:OutputText:Box45 +ISEXEC:FALSE +-105.995753:-246.824890:-900.000000 +-69.220753:-256.824890:-900.000000 +PORT +Title:"Hausdorff Distance" +FIN_BOX +BOX +wx:OutputText:Box46 +ISEXEC:FALSE +-232.606583:-249.953591:-900.000000 +-195.831583:-259.953591:-900.000000 +FIN_BOX +BOX +std:MultipleInputs:Box47 +ISEXEC:FALSE +-166.604357:-58.947810:-900.000000 +-126.904357:-68.947810:-900.000000 +FIN_BOX +BOX +std:MultipleInputs:Box48 +ISEXEC:FALSE +-83.122100:-53.867603:-900.000000 +-43.422100:-63.867603:-900.000000 +FIN_BOX +CONNECTIONS:60 +CONNECTION +Box03:Out:Box02:In +NumberOfControlPoints:0 +CONNECTION +Box02:Widget:Box07:Widget2 +NumberOfControlPoints:0 +CONNECTION +Box08:Widget:Box07:Widget1 +NumberOfControlPoints:0 +CONNECTION +Box02:Renderer1:Box10:Renderer +NumberOfControlPoints:0 +CONNECTION +Box15:BoxChange:Box10:BoxExecute +NumberOfControlPoints:0 +CONNECTION +Box17:Out:Box18:In1 +NumberOfControlPoints:0 +CONNECTION +Box18:Out:Box14:Opacity +NumberOfControlPoints:0 +CONNECTION +Box02:Renderer1:Box14:Renderer +NumberOfControlPoints:0 +CONNECTION +Box19:LookupTable:Box14:ScalarVisibilityOn_LookupTable +NumberOfControlPoints:0 +CONNECTION +Box17:Widget:Box21:Widget3 +NumberOfControlPoints:0 +CONNECTION +Box02:Renderer1:Box23:Renderer +NumberOfControlPoints:0 +CONNECTION +Box19:LookupTable:Box23:LookupTable +NumberOfControlPoints:0 +CONNECTION +Box17:BoxChange:Box14:BoxExecute +NumberOfControlPoints:0 +CONNECTION +Box14:BoxChange:Box15:In5 +NumberOfControlPoints:0 +CONNECTION +Box13:OutA:Box14:In +NumberOfControlPoints:0 +CONNECTION +Box26:Out:Box14:ScalarVisibilityOn_ScalarRange +NumberOfControlPoints:0 +CONNECTION +Box13:RelativeDistanceAtoB:Box26:In3 +NumberOfControlPoints:0 +CONNECTION +Box27:Out:Box14:ScalarVisibility +NumberOfControlPoints:0 +CONNECTION +Box27:Widget:Box21:Widget4 +NumberOfControlPoints:0 +CONNECTION +Box29:Out:Box30:In1 +NumberOfControlPoints:0 +CONNECTION +Box29:Widget:Box31:Widget3 +NumberOfControlPoints:0 +CONNECTION +Box32:Widget:Box31:Widget4 +NumberOfControlPoints:0 +CONNECTION +Box21:Widget:Box33:Widget1 +NumberOfControlPoints:0 +CONNECTION +Box33:Widget:Box08:Widget2 +NumberOfControlPoints:0 +CONNECTION +Box31:Widget:Box34:Widget1 +NumberOfControlPoints:0 +CONNECTION +Box34:Widget:Box08:Widget4 +NumberOfControlPoints:0 +CONNECTION +Box30:Out:Box28:Opacity +NumberOfControlPoints:0 +CONNECTION +Box29:BoxChange:Box28:BoxExecute +NumberOfControlPoints:0 +CONNECTION +Box28:BoxChange:Box15:In7 +NumberOfControlPoints:0 +CONNECTION +Box13:RelativeDistanceBtoA:Box35:In3 +NumberOfControlPoints:0 +CONNECTION +Box35:Out:Box28:ScalarVisibilityOn_ScalarRange +NumberOfControlPoints:0 +CONNECTION +Box13:OutB:Box28:In +NumberOfControlPoints:0 +CONNECTION +Box02:Renderer1:Box28:Renderer +NumberOfControlPoints:0 +CONNECTION +Box32:Out:Box28:ScalarVisibility +NumberOfControlPoints:0 +CONNECTION +Box36:LookupTable:Box28:ScalarVisibilityOn_LookupTable +NumberOfControlPoints:0 +CONNECTION +Box36:LookupTable:Box37:LookupTable +NumberOfControlPoints:0 +CONNECTION +Box02:Renderer1:Box37:Renderer +NumberOfControlPoints:0 +CONNECTION +Box03:Out:Box38:In +NumberOfControlPoints:0 +CONNECTION +Box03:Out:Box39:In +NumberOfControlPoints:0 +CONNECTION +Box38:Out:Box13:InA +NumberOfControlPoints:0 +CONNECTION +Box39:Out:Box13:InB +NumberOfControlPoints:0 +CONNECTION +Box40:Widget:Box08:Widget7 +NumberOfControlPoints:0 +CONNECTION +Box44:Widget:Box40:Widget3 +NumberOfControlPoints:0 +CONNECTION +Box13:HausdorffDistance:Box45:In +NumberOfControlPoints:0 +CONNECTION +Box13:RelativeDistanceAtoB:Box43:In +NumberOfControlPoints:0 +CONNECTION +Box13:RelativeDistanceBtoA:Box44:In +NumberOfControlPoints:0 +CONNECTION +Box45:Widget:Box40:Widget5 +NumberOfControlPoints:0 +CONNECTION +Box43:Widget:Box40:Widget2 +NumberOfControlPoints:0 +CONNECTION +Box46:Widget:Box40:Widget1 +NumberOfControlPoints:0 +CONNECTION +Box27:Out:Box23:Active +NumberOfControlPoints:0 +CONNECTION +Box47:BoxChange:Box23:BoxExecute +NumberOfControlPoints:0 +CONNECTION +Box17:BoxChange:Box47:In2 +NumberOfControlPoints:0 +CONNECTION +Box27:BoxChange:Box47:In4 +NumberOfControlPoints:0 +CONNECTION +Box32:BoxChange:Box48:In2 +NumberOfControlPoints:0 +CONNECTION +Box29:BoxChange:Box48:In4 +NumberOfControlPoints:0 +CONNECTION +Box48:BoxChange:Box37:BoxExecute +NumberOfControlPoints:0 +CONNECTION +Box32:Out:Box37:Active +NumberOfControlPoints:0 +CONNECTION +Box27:BoxChange:Box15:In2 +NumberOfControlPoints:0 +CONNECTION +Box37:BoxChange:Box15:In3 +NumberOfControlPoints:0 +CONNECTION +Box23:BoxChange:Box15:In1 +NumberOfControlPoints:0 +APP_END diff --git a/bbtk_creaVtk_PKG/bbs/appli/exampleHausdorffDistancePointSetFilter.bbs b/bbtk_creaVtk_PKG/bbs/appli/exampleHausdorffDistancePointSetFilter.bbs new file mode 100644 index 0000000..12aadc4 --- /dev/null +++ b/bbtk_creaVtk_PKG/bbs/appli/exampleHausdorffDistancePointSetFilter.bbs @@ -0,0 +1,260 @@ +# ---------------------------------- +# - BBTKGEditor v 1.4 BBS BlackBox Script +# - /home/davila/Creatis/C11/creatools_source/creaVtk/bbtk_creaVtk_PKG/bbs/appli/exampleHausdorffDistancePointSetFilter.bbs +# ---------------------------------- + +# BBTK GEditor Script +# ---------------------- + +include std +include itkvtk +include creaMaracasVisu +include vtk +include creaVtk +include wx +include std + +author "Author ??" +description "Description ??" +category "" + +new creaMaracasVisu:ViewerNV Box02 + set Box02.nTypeView "6" + +new vtk:LoadHola Box03 + +new creaVtk:OutputWindow Box06 + +new wx:LayoutSplit Box07 + set Box07.Orientation "H" + set Box07.Proportion "30" + +new wx:LayoutLine Box08 + +new vtk:UpdateRender Box10 + set Box10.Active "true" + +new creaVtk:HausdorffDistancePointSetFilter Box13 + +new vtk:PolyDataToActor Box14 + set Box14.Colour "1 0 1" + set Box14.ScalarVisibility "true" + set Box14.ScalarVisibilityOn_NameColorArray "Distance" + +new std:MultipleInputs Box15 + +new wx:Slider Box17 + set Box17.In "0" + set Box17.Label "true" + set Box17.Max "100" + set Box17.ReactiveOnTrack "true" + set Box17.Title "Opacity" + +new std:Div Box18 + set Box18.In2 "100" + +new creaVtk:ScalarsToColors Box19 + set Box19.Type "100" + +new wx:LayoutLine Box21 + set Box21.Orientation "H" + set Box21.WinTitle "Surface A" + +new creaVtk:ScalarBarActor Box23 + set Box23.DisplayPosition "5 30" + set Box23.Title "DistAtoB" + +new std:ConcatStrings Box26 + set Box26.In1 "0" + set Box26.In2 " " + +new wx:CheckBox Box27 + set Box27.In "true" + set Box27.Title "Hausdorff" + +new vtk:PolyDataToActor Box28 + set Box28.Colour "1 1 0" + set Box28.ScalarVisibility "true" + set Box28.ScalarVisibilityOn_NameColorArray "Distance" + +new wx:Slider Box29 + set Box29.In "0" + set Box29.Label "true" + set Box29.Max "100" + set Box29.ReactiveOnTrack "true" + set Box29.Title "Opacity" + +new std:Div Box30 + set Box30.In2 "100" + +new wx:LayoutLine Box31 + set Box31.Orientation "H" + +new wx:CheckBox Box32 + set Box32.In "true" + set Box32.Title "Hausdorff" + +new wx:LayoutTab Box33 + +new wx:LayoutTab Box34 + set Box34.WinTitle "Surface B" + +new std:ConcatStrings Box35 + set Box35.In1 "0" + set Box35.In2 " " + +new creaVtk:ScalarsToColors Box36 + set Box36.Type "100" + +new creaVtk:ScalarBarActor Box37 + set Box37.Title "DistBtoA" + +new vtk:MarchingCubes Box38 + set Box38.Value "2000" + +new vtk:MarchingCubes Box39 + set Box39.Value "1550" + +new wx:LayoutLine Box40 + +new wx:OutputText Box43 + set Box43.Title "Retative Distance A to B" + +new wx:OutputText Box44 + set Box44.Title "Retative Distance B to A" + +new wx:OutputText Box45 + set Box45.Title "Hausdorff Distance" + +new wx:OutputText Box46 + +new std:MultipleInputs Box47 + +new std:MultipleInputs Box48 + + +connect Box03.Out Box02.In + +connect Box02.Widget Box07.Widget2 + +connect Box08.Widget Box07.Widget1 + +connect Box02.Renderer1 Box10.Renderer + +connect Box15.BoxChange Box10.BoxExecute + +connect Box17.Out Box18.In1 + +connect Box18.Out Box14.Opacity + +connect Box02.Renderer1 Box14.Renderer + +connect Box19.LookupTable Box14.ScalarVisibilityOn_LookupTable + +connect Box17.Widget Box21.Widget3 + +connect Box02.Renderer1 Box23.Renderer + +connect Box19.LookupTable Box23.LookupTable + +connect Box17.BoxChange Box14.BoxExecute + +connect Box14.BoxChange Box15.In5 + +connect Box13.OutA Box14.In + +connect Box26.Out Box14.ScalarVisibilityOn_ScalarRange + +connect Box13.RelativeDistanceAtoB Box26.In3 + +connect Box27.Out Box14.ScalarVisibility + +connect Box27.Widget Box21.Widget4 + +connect Box29.Out Box30.In1 + +connect Box29.Widget Box31.Widget3 + +connect Box32.Widget Box31.Widget4 + +connect Box21.Widget Box33.Widget1 + +connect Box33.Widget Box08.Widget2 + +connect Box31.Widget Box34.Widget1 + +connect Box34.Widget Box08.Widget4 + +connect Box30.Out Box28.Opacity + +connect Box29.BoxChange Box28.BoxExecute + +connect Box28.BoxChange Box15.In7 + +connect Box13.RelativeDistanceBtoA Box35.In3 + +connect Box35.Out Box28.ScalarVisibilityOn_ScalarRange + +connect Box13.OutB Box28.In + +connect Box02.Renderer1 Box28.Renderer + +connect Box32.Out Box28.ScalarVisibility + +connect Box36.LookupTable Box28.ScalarVisibilityOn_LookupTable + +connect Box36.LookupTable Box37.LookupTable + +connect Box02.Renderer1 Box37.Renderer + +connect Box03.Out Box38.In + +connect Box03.Out Box39.In + +connect Box38.Out Box13.InA + +connect Box39.Out Box13.InB + +connect Box40.Widget Box08.Widget7 + +connect Box44.Widget Box40.Widget3 + +connect Box13.HausdorffDistance Box45.In + +connect Box13.RelativeDistanceAtoB Box43.In + +connect Box13.RelativeDistanceBtoA Box44.In + +connect Box45.Widget Box40.Widget5 + +connect Box43.Widget Box40.Widget2 + +connect Box46.Widget Box40.Widget1 + +connect Box27.Out Box23.Active + +connect Box47.BoxChange Box23.BoxExecute + +connect Box17.BoxChange Box47.In2 + +connect Box27.BoxChange Box47.In4 + +connect Box32.BoxChange Box48.In2 + +connect Box29.BoxChange Box48.In4 + +connect Box48.BoxChange Box37.BoxExecute + +connect Box32.Out Box37.Active + +connect Box27.BoxChange Box15.In2 + +connect Box37.BoxChange Box15.In3 + +connect Box23.BoxChange Box15.In1 + + + +# Complex input ports +exec Box06 +exec Box07 diff --git a/bbtk_creaVtk_PKG/bbs/appli/exampleKMeans.bbg b/bbtk_creaVtk_PKG/bbs/appli/exampleKMeans.bbg new file mode 100644 index 0000000..6dea424 --- /dev/null +++ b/bbtk_creaVtk_PKG/bbs/appli/exampleKMeans.bbg @@ -0,0 +1,85 @@ +# ---------------------------------- +# - BBTKGEditor v 1.4 BBG BlackBox Diagram file +# - /home/davila/Creatis/C11/creatools_source/creaVtk/bbtk_creaVtk_PKG/bbs/appli/exampleKMeans.bbg +# ---------------------------------- + +APP_START +CATEGORY: +DESCRIPTION:Description ?? +AUTHOR:Author ?? +COMPLEXBOX:FALSE +COMPLEXINPUTS:0 +BOXES:7 +BOX +creaVtk:KMeansStatistics:Box00 +ISEXEC:FALSE +-38.722672:-3.319086:-900.000000 +3.477328:-13.319086:-900.000000 +PORT +NumberOfClusters:"5" +FIN_BOX +BOX +vtk:LoadHola:Box01 +ISEXEC:FALSE +-59.901602:70.965223:-900.000000 +-24.351602:60.965223:-900.000000 +FIN_BOX +BOX +creaMaracasVisu:ViewerNV:Box02 +ISEXEC:FALSE +-11.853879:-34.929430:-900.000000 +51.866121:-44.929430:-900.000000 +FIN_BOX +BOX +vtk:ExtractVtkImageFilter:Box08 +ISEXEC:FALSE +-62.588481:45.993051:-900.000000 +-15.713481:35.993051:-900.000000 +PORT +Index:"0 0 40" +PORT +Size:"100 100 2" +FIN_BOX +BOX +creaMaracasVisu:ViewerNV:Box09 +ISEXEC:FALSE +-95.219704:-34.527844:-900.000000 +-31.499704:-44.527844:-900.000000 +FIN_BOX +BOX +creaMaracasVisu:ImageChangeInformation:Box11 +ISEXEC:FALSE +-66.065619:24.814120:-900.000000 +-14.540619:14.814120:-900.000000 +FIN_BOX +BOX +wx:LayoutSplit:Box07 +ISEXEC:TRUE +-49.154085:-72.545740:-900.000000 +-10.074085:-82.545740:-900.000000 +PORT +Orientation:"H" +FIN_BOX +CONNECTIONS:7 +CONNECTION +Box01:Out:Box08:In +NumberOfControlPoints:0 +CONNECTION +Box00:Out:Box02:In +NumberOfControlPoints:0 +CONNECTION +Box08:Out:Box11:In +NumberOfControlPoints:0 +CONNECTION +Box11:Out:Box00:In +NumberOfControlPoints:0 +CONNECTION +Box11:Out:Box09:In +NumberOfControlPoints:0 +CONNECTION +Box09:Widget:Box07:Widget1 +NumberOfControlPoints:0 +CONNECTION +Box02:Widget:Box07:Widget2 +NumberOfControlPoints:0 +APP_END diff --git a/bbtk_creaVtk_PKG/bbs/appli/exampleKMeans.bbs b/bbtk_creaVtk_PKG/bbs/appli/exampleKMeans.bbs new file mode 100644 index 0000000..16cf8f0 --- /dev/null +++ b/bbtk_creaVtk_PKG/bbs/appli/exampleKMeans.bbs @@ -0,0 +1,56 @@ +# ---------------------------------- +# - BBTKGEditor v 1.4 BBS BlackBox Script +# - /home/davila/Creatis/C11/creatools_source/creaVtk/bbtk_creaVtk_PKG/bbs/appli/exampleKMeans.bbs +# ---------------------------------- + +# BBTK GEditor Script +# ---------------------- + +include std +include itkvtk +include creaVtk +include vtk +include creaMaracasVisu +include wx + +author "Author ??" +description "Description ??" +category "" + +new creaVtk:KMeansStatistics Box00 + set Box00.NumberOfClusters "5" + +new vtk:LoadHola Box01 + +new creaMaracasVisu:ViewerNV Box02 + +new vtk:ExtractVtkImageFilter Box08 + set Box08.Index "0 0 40" + set Box08.Size "100 100 2" + +new creaMaracasVisu:ViewerNV Box09 + +new creaMaracasVisu:ImageChangeInformation Box11 + +new wx:LayoutSplit Box07 + set Box07.Orientation "H" + + +connect Box01.Out Box08.In + +connect Box00.Out Box02.In + +connect Box08.Out Box11.In + +connect Box11.Out Box00.In + +connect Box11.Out Box09.In + +connect Box09.Widget Box07.Widget1 + +connect Box02.Widget Box07.Widget2 + + + +# Complex input ports +exec Box07 diff --git a/bbtk_creaVtk_PKG/bbs/appli/exampleMeshCutByAxis.bbg b/bbtk_creaVtk_PKG/bbs/appli/exampleMeshCutByAxis.bbg new file mode 100644 index 0000000..b947543 --- /dev/null +++ b/bbtk_creaVtk_PKG/bbs/appli/exampleMeshCutByAxis.bbg @@ -0,0 +1,168 @@ +# ---------------------------------- +# - BBTKGEditor v 1.4 BBG BlackBox Diagram file +# - /home/davila/Creatis/C11/creatools_source/creaVtk/bbtk_creaVtk_PKG/bbs/appli/exampleMeshCutByAxis.bbg +# ---------------------------------- + +APP_START +CATEGORY: +DESCRIPTION:Description ?? +AUTHOR:Author ?? +COMPLEXBOX:FALSE +COMPLEXINPUTS:0 +BOXES:12 +BOX +vtk:LoadHola:Box00 +ISEXEC:FALSE +42.970380:121.375067:-900.000000 +78.520380:111.375067:-900.000000 +FIN_BOX +BOX +creaMaracasVisu:ViewerNV:Box01 +ISEXEC:FALSE +12.381685:53.142024:-900.000000 +48.256685:43.142024:-900.000000 +PORT +nTypeView:"6 1 2 0" +FIN_BOX +BOX +wx:LayoutSplit:Box02 +ISEXEC:TRUE +-21.881348:-68.528094:-900.000000 +14.793652:-78.528094:-900.000000 +PORT +Orientation:"H" +FIN_BOX +BOX +wx:LayoutLine:Box03 +ISEXEC:FALSE +-89.318321:28.465101:-900.000000 +-52.743321:18.465101:-900.000000 +FIN_BOX +BOX +vtk:PolyDataToActor:Box05 +ISEXEC:FALSE +49.016284:-54.225839:-900.000000 +91.416284:-64.225839:-900.000000 +PORT +Colour:"1 0 0" +FIN_BOX +BOX +wx:Slider:Box06 +ISEXEC:FALSE +-88.015958:64.249653:-900.000000 +-56.440958:54.249653:-900.000000 +PORT +In:"100" +PORT +Max:"100" +PORT +Min:"0" +PORT +ReactiveOnTrack:"true" +FIN_BOX +BOX +std:Div:Box07 +ISEXEC:FALSE +-32.712798:46.677489:-900.000000 +-3.387798:36.677489:-900.000000 +PORT +In2:"100" +FIN_BOX +BOX +creaVtk:MeshCutByAxis:Box08 +ISEXEC:FALSE +80.897806:-31.255502:-900.000000 +121.972806:-41.255502:-900.000000 +PORT +InsideVol:"true" +PORT +Point:"30 30 30" +FIN_BOX +BOX +vtk:MarchingCubes:Box14 +ISEXEC:FALSE +74.384670:4.520731:-900.000000 +116.184670:-5.479269:-900.000000 +PORT +Value:"500" +FIN_BOX +BOX +wx:RadioButton:Box17 +ISEXEC:FALSE +-36.357203:77.589847:-900.000000 +1.542797:67.589847:-900.000000 +PORT +In0:"Inside" +PORT +In1:"Outside" +FIN_BOX +BOX +vtk:ImageVtkProperties:Box18 +ISEXEC:FALSE +111.800931:65.662813:-900.000000 +157.150931:55.662813:-900.000000 +FIN_BOX +BOX +std:MathOperationVector:Box19 +ISEXEC:FALSE +113.596399:21.834168:-900.000000 +161.121399:11.834168:-900.000000 +PORT +Type:"2" +FIN_BOX +CONNECTIONS:18 +CONNECTION +Box00:Out:Box01:In +NumberOfControlPoints:0 +CONNECTION +Box01:Widget:Box02:Widget2 +NumberOfControlPoints:0 +CONNECTION +Box03:Widget:Box02:Widget1 +NumberOfControlPoints:0 +CONNECTION +Box01:Renderer1:Box05:Renderer +NumberOfControlPoints:0 +CONNECTION +Box06:Widget:Box03:Widget1 +NumberOfControlPoints:0 +CONNECTION +Box06:Out:Box07:In1 +NumberOfControlPoints:0 +CONNECTION +Box07:Out:Box05:Opacity +NumberOfControlPoints:0 +CONNECTION +Box08:Out:Box05:In +NumberOfControlPoints:0 +CONNECTION +Box01:BoxChange:Box08:BoxExecute +NumberOfControlPoints:0 +CONNECTION +Box01:BoxChange:Box05:BoxExecute +NumberOfControlPoints:0 +CONNECTION +Box00:Out:Box14:In +NumberOfControlPoints:0 +CONNECTION +Box14:Out:Box08:In +NumberOfControlPoints:0 +CONNECTION +Box17:Widget:Box03:Widget2 +NumberOfControlPoints:0 +CONNECTION +Box17:Out:Box08:InsideVol +NumberOfControlPoints:0 +CONNECTION +Box00:Out:Box18:In +NumberOfControlPoints:0 +CONNECTION +Box18:Spacing:Box19:In1 +NumberOfControlPoints:0 +CONNECTION +Box01:Point:Box19:In0 +NumberOfControlPoints:0 +CONNECTION +Box19:Out:Box08:Point +NumberOfControlPoints:0 +APP_END diff --git a/bbtk_creaVtk_PKG/bbs/appli/exampleMeshCutByAxis.bbs b/bbtk_creaVtk_PKG/bbs/appli/exampleMeshCutByAxis.bbs new file mode 100644 index 0000000..9453d7d --- /dev/null +++ b/bbtk_creaVtk_PKG/bbs/appli/exampleMeshCutByAxis.bbs @@ -0,0 +1,99 @@ +# ---------------------------------- +# - BBTKGEditor v 1.4 BBS BlackBox Script +# - /home/davila/Creatis/C11/creatools_source/creaVtk/bbtk_creaVtk_PKG/bbs/appli/exampleMeshCutByAxis.bbs +# ---------------------------------- + +# BBTK GEditor Script +# ---------------------- + +include std +include itkvtk +include vtk +include creaMaracasVisu +include wx +include std +include creaVtk + +author "Author ??" +description "Description ??" +category "" + +new vtk:LoadHola Box00 + +new creaMaracasVisu:ViewerNV Box01 + set Box01.nTypeView "6 1 2 0" + +new wx:LayoutSplit Box02 + set Box02.Orientation "H" + +new wx:LayoutLine Box03 + +new vtk:PolyDataToActor Box05 + set Box05.Colour "1 0 0" + +new wx:Slider Box06 + set Box06.In "100" + set Box06.Max "100" + set Box06.Min "0" + set Box06.ReactiveOnTrack "true" + +new std:Div Box07 + set Box07.In2 "100" + +new creaVtk:MeshCutByAxis Box08 + set Box08.InsideVol "true" + set Box08.Point "30 30 30" + +new vtk:MarchingCubes Box14 + set Box14.Value "500" + +new wx:RadioButton Box17 + set Box17.In0 "Inside" + set Box17.In1 "Outside" + +new vtk:ImageVtkProperties Box18 + +new std:MathOperationVector Box19 + set Box19.Type "2" + + +connect Box00.Out Box01.In + +connect Box01.Widget Box02.Widget2 + +connect Box03.Widget Box02.Widget1 + +connect Box01.Renderer1 Box05.Renderer + +connect Box06.Widget Box03.Widget1 + +connect Box06.Out Box07.In1 + +connect Box07.Out Box05.Opacity + +connect Box08.Out Box05.In + +connect Box01.BoxChange Box08.BoxExecute + +connect Box01.BoxChange Box05.BoxExecute + +connect Box00.Out Box14.In + +connect Box14.Out Box08.In + +connect Box17.Widget Box03.Widget2 + +connect Box17.Out Box08.InsideVol + +connect Box00.Out Box18.In + +connect Box18.Spacing Box19.In1 + +connect Box01.Point Box19.In0 + +connect Box19.Out Box08.Point + + + +# Complex input ports +exec Box02 diff --git a/bbtk_creaVtk_PKG/bbs/appli/exampleScreenShot.bbg b/bbtk_creaVtk_PKG/bbs/appli/exampleScreenShot.bbg new file mode 100644 index 0000000..0958f47 --- /dev/null +++ b/bbtk_creaVtk_PKG/bbs/appli/exampleScreenShot.bbg @@ -0,0 +1,67 @@ +# ---------------------------------- +# - BBTKGEditor v 1.4 BBG BlackBox Diagram file +# - /tmpEED/creaTools/creatools_source/creaVtk/bbtk_creaVtk_PKG/bbs/appli/exampleScreenShot.bbg +# ---------------------------------- + +APP_START +CATEGORY: +DESCRIPTION:Description ?? +AUTHOR:Author ?? +COMPLEXBOX:FALSE +COMPLEXINPUTS:0 +BOXES:5 +BOX +creaVtk:ScreenShot:Box00 +ISEXEC:FALSE +-38.417136:17.257698:-900.000000 +7.157864:7.257698:-900.000000 +PORT +FileName:"ScreenShot.png" +PORT +Scale:"2 2" +FIN_BOX +BOX +vtk:LoadHola:Box01 +ISEXEC:FALSE +15.306828:70.981662:-900.000000 +60.881828:60.981662:-900.000000 +FIN_BOX +BOX +creaMaracasVisu:ViewerNV:Box02 +ISEXEC:FALSE +6.302811:43.969613:-900.000000 +70.022811:33.969613:-900.000000 +FIN_BOX +BOX +wx:LayoutSplit:Box03 +ISEXEC:TRUE +-32.414459:-30.763722:-900.000000 +13.160541:-40.763722:-900.000000 +PORT +Orientation:"H" +FIN_BOX +BOX +wx:CommandButton:Box04 +ISEXEC:FALSE +-99.044179:44.569881:-900.000000 +-53.469179:34.569881:-900.000000 +PORT +Label:"ScreenShot" +FIN_BOX +CONNECTIONS:5 +CONNECTION +Box01:Out:Box02:In +NumberOfControlPoints:0 +CONNECTION +Box02:Renderer1:Box00:vtkRenderer +NumberOfControlPoints:0 +CONNECTION +Box02:Widget:Box03:Widget2 +NumberOfControlPoints:0 +CONNECTION +Box04:Widget:Box03:Widget1 +NumberOfControlPoints:0 +CONNECTION +Box04:BoxChange:Box00:BoxExecute +NumberOfControlPoints:0 +APP_END diff --git a/bbtk_creaVtk_PKG/bbs/appli/exampleScreenShot.bbs b/bbtk_creaVtk_PKG/bbs/appli/exampleScreenShot.bbs new file mode 100644 index 0000000..062ab04 --- /dev/null +++ b/bbtk_creaVtk_PKG/bbs/appli/exampleScreenShot.bbs @@ -0,0 +1,48 @@ +# ---------------------------------- +# - BBTKGEditor v 1.4 BBS BlackBox Script +# - /tmpEED/creaTools/creatools_source/creaVtk/bbtk_creaVtk_PKG/bbs/appli/exampleScreenShot.bbs +# ---------------------------------- + +# BBTK GEditor Script +# ---------------------- + +include std +include itkvtk +include creaVtk +include vtk +include creaMaracasVisu +include wx + +author "Author ??" +description "Description ??" +category "" + +new creaVtk:ScreenShot Box00 + set Box00.FileName "ScreenShot.png" + set Box00.Scale "2 2" + +new vtk:LoadHola Box01 + +new creaMaracasVisu:ViewerNV Box02 + +new wx:LayoutSplit Box03 + set Box03.Orientation "H" + +new wx:CommandButton Box04 + set Box04.Label "ScreenShot" + + +connect Box01.Out Box02.In + +connect Box02.Renderer1 Box00.vtkRenderer + +connect Box02.Widget Box03.Widget2 + +connect Box04.Widget Box03.Widget1 + +connect Box04.BoxChange Box00.BoxExecute + + + +# Complex input ports +exec Box03 diff --git a/bbtk_creaVtk_PKG/bbs/appli/exampleSetCameraInfo.bbg b/bbtk_creaVtk_PKG/bbs/appli/exampleSetCameraInfo.bbg new file mode 100644 index 0000000..06f0cfd --- /dev/null +++ b/bbtk_creaVtk_PKG/bbs/appli/exampleSetCameraInfo.bbg @@ -0,0 +1,134 @@ +# ---------------------------------- +# - BBTKGEditor v 1.4 BBG BlackBox Diagram file +# - /tmpEED/creaTools/creatools_source/creaVtk/bbtk_creaVtk_PKG/bbs/appli/exampleSetCameraInfo.bbg +# ---------------------------------- + +APP_START +CATEGORY: +DESCRIPTION:Description ?? +AUTHOR:Author ?? +COMPLEXBOX:FALSE +COMPLEXINPUTS:0 +BOXES:10 +BOX +vtk:LoadHola:Box00 +ISEXEC:FALSE +-21.909773:76.684205:-900.000000 +23.665227:66.684205:-900.000000 +FIN_BOX +BOX +creaMaracasVisu:ViewerNV:Box01 +ISEXEC:FALSE +-61.227311:54.474299:-900.000000 +2.492689:44.474299:-900.000000 +PORT +nTypeView:"5" +FIN_BOX +BOX +creaMaracasVisu:ViewerNV:Box02 +ISEXEC:FALSE +20.000000:54.365329:-900.000000 +83.720000:44.365329:-900.000000 +PORT +nTypeView:"5" +FIN_BOX +BOX +wx:LayoutLine:Box03 +ISEXEC:FALSE +24.010710:-20.859304:-900.000000 +81.570710:-30.859304:-900.000000 +PORT +Orientation:"H" +FIN_BOX +BOX +wx:LayoutSplit:Box04 +ISEXEC:TRUE +-62.427846:-61.977645:-900.000000 +-16.852846:-71.977645:-900.000000 +PORT +Orientation:"H" +FIN_BOX +BOX +wx:LayoutLine:Box05 +ISEXEC:FALSE +-112.250070:-27.162116:-900.000000 +-54.690070:-37.162116:-900.000000 +FIN_BOX +BOX +wx:CommandButton:Box06 +ISEXEC:FALSE +-125.155826:53.273763:-900.000000 +-79.580826:43.273763:-900.000000 +PORT +Label:"Refresh" +FIN_BOX +BOX +creaVtk:GetCameraInfo:Box07 +ISEXEC:FALSE +-86.138423:36.466266:-900.000000 +-40.563423:26.466266:-900.000000 +FIN_BOX +BOX +creaVtk:SetCameraInfo:Box09 +ISEXEC:FALSE +-77.734674:16.057162:-900.000000 +-32.159674:6.057162:-900.000000 +FIN_BOX +BOX +vtk:UpdateRender:Box10 +ISEXEC:FALSE +-68.430524:-2.851272:-900.000000 +-22.855524:-12.851272:-900.000000 +PORT +Active:"true" +FIN_BOX +CONNECTIONS:16 +CONNECTION +Box00:Out:Box01:In +NumberOfControlPoints:0 +CONNECTION +Box00:Out:Box02:In +NumberOfControlPoints:0 +CONNECTION +Box01:Widget:Box03:Widget1 +NumberOfControlPoints:0 +CONNECTION +Box02:Widget:Box03:Widget2 +NumberOfControlPoints:0 +CONNECTION +Box03:Widget:Box04:Widget2 +NumberOfControlPoints:0 +CONNECTION +Box05:Widget:Box04:Widget1 +NumberOfControlPoints:0 +CONNECTION +Box06:Widget:Box05:Widget1 +NumberOfControlPoints:0 +CONNECTION +Box01:Renderer1:Box07:vtkRenderer +NumberOfControlPoints:0 +CONNECTION +Box02:Renderer1:Box09:vtkRenderer +NumberOfControlPoints:0 +CONNECTION +Box07:ViewUp:Box09:ViewUp +NumberOfControlPoints:0 +CONNECTION +Box07:Position:Box09:Position +NumberOfControlPoints:0 +CONNECTION +Box07:FocalPoint:Box09:FocalPoint +NumberOfControlPoints:0 +CONNECTION +Box06:BoxChange:Box07:BoxExecute +NumberOfControlPoints:0 +CONNECTION +Box02:Renderer1:Box10:Renderer +NumberOfControlPoints:0 +CONNECTION +Box07:BoxChange:Box09:BoxExecute +NumberOfControlPoints:0 +CONNECTION +Box09:BoxChange:Box10:BoxExecute +NumberOfControlPoints:0 +APP_END diff --git a/bbtk_creaVtk_PKG/bbs/appli/exampleSetCameraInfo.bbs b/bbtk_creaVtk_PKG/bbs/appli/exampleSetCameraInfo.bbs new file mode 100644 index 0000000..cf7b31a --- /dev/null +++ b/bbtk_creaVtk_PKG/bbs/appli/exampleSetCameraInfo.bbs @@ -0,0 +1,82 @@ +# ---------------------------------- +# - BBTKGEditor v 1.4 BBS BlackBox Script +# - /tmpEED/creaTools/creatools_source/creaVtk/bbtk_creaVtk_PKG/bbs/appli/exampleSetCameraInfo.bbs +# ---------------------------------- + +# BBTK GEditor Script +# ---------------------- + +include std +include itkvtk +include vtk +include creaMaracasVisu +include wx +include creaVtk + +author "Author ??" +description "Description ??" +category "" + +new vtk:LoadHola Box00 + +new creaMaracasVisu:ViewerNV Box01 + set Box01.nTypeView "5" + +new creaMaracasVisu:ViewerNV Box02 + set Box02.nTypeView "5" + +new wx:LayoutLine Box03 + set Box03.Orientation "H" + +new wx:LayoutSplit Box04 + set Box04.Orientation "H" + +new wx:LayoutLine Box05 + +new wx:CommandButton Box06 + set Box06.Label "Refresh" + +new creaVtk:GetCameraInfo Box07 + +new creaVtk:SetCameraInfo Box09 + +new vtk:UpdateRender Box10 + set Box10.Active "true" + + +connect Box00.Out Box01.In + +connect Box00.Out Box02.In + +connect Box01.Widget Box03.Widget1 + +connect Box02.Widget Box03.Widget2 + +connect Box03.Widget Box04.Widget2 + +connect Box05.Widget Box04.Widget1 + +connect Box06.Widget Box05.Widget1 + +connect Box01.Renderer1 Box07.vtkRenderer + +connect Box02.Renderer1 Box09.vtkRenderer + +connect Box07.ViewUp Box09.ViewUp + +connect Box07.Position Box09.Position + +connect Box07.FocalPoint Box09.FocalPoint + +connect Box06.BoxChange Box07.BoxExecute + +connect Box02.Renderer1 Box10.Renderer + +connect Box07.BoxChange Box09.BoxExecute + +connect Box09.BoxChange Box10.BoxExecute + + + +# Complex input ports +exec Box04 diff --git a/bbtk_creaVtk_PKG/bbs/appli/exampleStripper.bbg b/bbtk_creaVtk_PKG/bbs/appli/exampleStripper.bbg new file mode 100644 index 0000000..a9c759c --- /dev/null +++ b/bbtk_creaVtk_PKG/bbs/appli/exampleStripper.bbg @@ -0,0 +1,292 @@ +# ---------------------------------- +# - BBTKGEditor v 1.4 BBG BlackBox Diagram file +# - /home/davila/Creatis/C11/creatools_source/creaVtk/bbtk_creaVtk_PKG/bbs/appli/exampleStripper.bbg +# ---------------------------------- + +APP_START +CATEGORY: +DESCRIPTION:Description ?? +AUTHOR:Author ?? +COMPLEXBOX:FALSE +COMPLEXINPUTS:0 +BOXES:21 +BOX +creaVtk:Stripper:Box03 +ISEXEC:FALSE +-11.080041:-28.602722:-900.000000 +22.594959:-38.602722:-900.000000 +FIN_BOX +BOX +creaMaracasVisu:ViewerNV:Box05 +ISEXEC:FALSE +69.707883:6.867455:-900.000000 +133.427883:-3.132545:-900.000000 +FIN_BOX +BOX +vtk:LoadHola:Box06 +ISEXEC:FALSE +77.511222:77.041163:-900.000000 +113.061222:67.041163:-900.000000 +FIN_BOX +BOX +creaVtk:OutputWindow:Box08 +ISEXEC:TRUE +-31.378810:-187.920863:-900.000000 +9.221190:-197.920863:-900.000000 +FIN_BOX +BOX +wx:LayoutSplit:Box09 +ISEXEC:TRUE +-95.327818:-189.758498:-900.000000 +-56.247818:-199.758498:-900.000000 +PORT +Orientation:"H" +FIN_BOX +BOX +vtk:PolyDataToActor:Box11 +ISEXEC:FALSE +-102.646835:-36.050865:-900.000000 +-57.406835:-46.050865:-900.000000 +PORT +Representation:"2" +FIN_BOX +BOX +vtk:UpdateRender:Box12 +ISEXEC:FALSE +-65.173714:-134.156961:-900.000000 +-24.848714:-144.156961:-900.000000 +PORT +Active:"true" +FIN_BOX +BOX +vtk:SphereSource:Box13 +ISEXEC:FALSE +1.890546:75.328227:-900.000000 +41.715546:65.328227:-900.000000 +PORT +PhiResolution:"20" +PORT +Radius:"40" +PORT +ThetaResolution:"20" +FIN_BOX +BOX +creaVtk:MeshCutByAxis:Box14 +ISEXEC:FALSE +-3.502359:32.303106:-900.000000 +37.572641:22.303106:-900.000000 +PORT +InsideVol:"false" +PORT +Point:"0 0 0" +FIN_BOX +BOX +vtk:PolyDataToActor:Box16 +ISEXEC:FALSE +-93.582490:-73.466187:-900.000000 +-48.342490:-83.466187:-900.000000 +PORT +Colour:"1 0 0" +PORT +Representation:"1" +FIN_BOX +BOX +wx:Slider:Box17 +ISEXEC:FALSE +-164.947235:74.138978:-900.000000 +-113.547235:64.138978:-900.000000 +PORT +In:"30" +PORT +Label:"true" +PORT +Max:"100" +PORT +ReactiveOnTrack:"true" +PORT +Title:"Surface" +FIN_BOX +BOX +std:Div:Box18 +ISEXEC:FALSE +-117.898202:45.100858:-900.000000 +-88.573202:35.100858:-900.000000 +PORT +In2:"100" +FIN_BOX +BOX +wx:LayoutLine:Box19 +ISEXEC:FALSE +-150.477035:4.926720:-900.000000 +-92.917035:-5.073280:-900.000000 +FIN_BOX +BOX +wx:Slider:Box20 +ISEXEC:FALSE +-87.903471:71.768822:-900.000000 +-36.503471:61.768822:-900.000000 +PORT +In:"30" +PORT +Label:"true" +PORT +Max:"100" +PORT +ReactiveOnTrack:"true" +PORT +Title:"Surface + cutter" +FIN_BOX +BOX +std:Div:Box21 +ISEXEC:FALSE +-64.112323:45.768018:-900.000000 +-34.787323:35.768018:-900.000000 +PORT +In2:"100" +FIN_BOX +BOX +std:MultipleInputs:Box22 +ISEXEC:FALSE +-76.674118:-1.305091:-900.000000 +-36.974118:-11.305091:-900.000000 +FIN_BOX +BOX +creaVtk:Cutter:Box24 +ISEXEC:FALSE +-9.135640:-4.567820:-900.000000 +23.064360:-14.567820:-900.000000 +FIN_BOX +BOX +creaVtk:Plane:Box25 +ISEXEC:FALSE +27.533219:17.245608:-900.000000 +59.258219:7.245608:-900.000000 +PORT +Origin:"0 0 10" +FIN_BOX +BOX +vtk:PolyDataToActor:Box26 +ISEXEC:FALSE +-73.286561:-101.665584:-900.000000 +-28.046561:-111.665584:-900.000000 +PORT +Colour:"0 1 1" +PORT +Representation:"1" +FIN_BOX +BOX +wx:Slider:Box27 +ISEXEC:FALSE +-223.463982:73.636316:-900.000000 +-172.063982:63.636316:-900.000000 +PORT +In:"30" +PORT +Label:"true" +PORT +Max:"100" +PORT +ReactiveOnTrack:"true" +PORT +Title:"Surface + cutter + stripper" +FIN_BOX +BOX +std:Div:Box28 +ISEXEC:FALSE +-213.575990:47.651098:-900.000000 +-184.250990:37.651098:-900.000000 +PORT +In2:"100" +FIN_BOX +CONNECTIONS:30 +CONNECTION +Box06:Out:Box05:In +NumberOfControlPoints:0 +CONNECTION +Box05:Widget:Box09:Widget2 +NumberOfControlPoints:0 +CONNECTION +Box05:Renderer1:Box11:Renderer +NumberOfControlPoints:0 +CONNECTION +Box05:Renderer1:Box12:Renderer +NumberOfControlPoints:0 +CONNECTION +Box13:Out:Box14:In +NumberOfControlPoints:0 +CONNECTION +Box14:Out:Box11:In +NumberOfControlPoints:0 +CONNECTION +Box05:Renderer1:Box16:Renderer +NumberOfControlPoints:0 +CONNECTION +Box11:BoxChange:Box16:BoxExecute +NumberOfControlPoints:0 +CONNECTION +Box17:Out:Box18:In1 +NumberOfControlPoints:0 +CONNECTION +Box17:Widget:Box19:Widget1 +NumberOfControlPoints:0 +CONNECTION +Box18:Out:Box11:Opacity +NumberOfControlPoints:0 +CONNECTION +Box20:Out:Box21:In1 +NumberOfControlPoints:0 +CONNECTION +Box20:Widget:Box19:Widget3 +NumberOfControlPoints:0 +CONNECTION +Box19:Widget:Box09:Widget1 +NumberOfControlPoints:0 +CONNECTION +Box21:Out:Box16:Opacity +NumberOfControlPoints:0 +CONNECTION +Box20:BoxChange:Box22:In2 +NumberOfControlPoints:0 +CONNECTION +Box17:BoxChange:Box22:In1 +NumberOfControlPoints:0 +CONNECTION +Box22:BoxChange:Box11:BoxExecute +NumberOfControlPoints:0 +CONNECTION +Box14:Out:Box24:In +NumberOfControlPoints:0 +CONNECTION +Box25:Out:Box24:ImplicitFunction +NumberOfControlPoints:0 +CONNECTION +Box24:Out:Box16:In +NumberOfControlPoints:0 +CONNECTION +Box24:Out:Box03:In +NumberOfControlPoints:0 +CONNECTION +Box05:Renderer1:Box26:Renderer +NumberOfControlPoints:0 +CONNECTION +Box03:Out:Box26:In +NumberOfControlPoints:0 +CONNECTION +Box16:BoxChange:Box26:BoxExecute +NumberOfControlPoints:0 +CONNECTION +Box26:BoxChange:Box12:BoxExecute +NumberOfControlPoints:0 +CONNECTION +Box27:Out:Box28:In1 +NumberOfControlPoints:0 +CONNECTION +Box27:Widget:Box19:Widget6 +NumberOfControlPoints:0 +CONNECTION +Box27:BoxChange:Box22:In6 +NumberOfControlPoints:0 +CONNECTION +Box28:Out:Box26:Opacity +NumberOfControlPoints:0 +APP_END diff --git a/bbtk_creaVtk_PKG/bbs/appli/exampleStripper.bbs b/bbtk_creaVtk_PKG/bbs/appli/exampleStripper.bbs new file mode 100644 index 0000000..ea9421f --- /dev/null +++ b/bbtk_creaVtk_PKG/bbs/appli/exampleStripper.bbs @@ -0,0 +1,159 @@ +# ---------------------------------- +# - BBTKGEditor v 1.4 BBS BlackBox Script +# - /home/davila/Creatis/C11/creatools_source/creaVtk/bbtk_creaVtk_PKG/bbs/appli/exampleStripper.bbs +# ---------------------------------- + +# BBTK GEditor Script +# ---------------------- + +include std +include itkvtk +include creaVtk +include creaMaracasVisu +include vtk +include wx +include std + +author "Author ??" +description "Description ??" +category "" + +new creaVtk:Stripper Box03 + +new creaMaracasVisu:ViewerNV Box05 + +new vtk:LoadHola Box06 + +new creaVtk:OutputWindow Box08 + +new wx:LayoutSplit Box09 + set Box09.Orientation "H" + +new vtk:PolyDataToActor Box11 + set Box11.Representation "2" + +new vtk:UpdateRender Box12 + set Box12.Active "true" + +new vtk:SphereSource Box13 + set Box13.PhiResolution "20" + set Box13.Radius "40" + set Box13.ThetaResolution "20" + +new creaVtk:MeshCutByAxis Box14 + set Box14.InsideVol "false" + set Box14.Point "0 0 0" + +new vtk:PolyDataToActor Box16 + set Box16.Colour "1 0 0" + set Box16.Representation "1" + +new wx:Slider Box17 + set Box17.In "30" + set Box17.Label "true" + set Box17.Max "100" + set Box17.ReactiveOnTrack "true" + set Box17.Title "Surface" + +new std:Div Box18 + set Box18.In2 "100" + +new wx:LayoutLine Box19 + +new wx:Slider Box20 + set Box20.In "30" + set Box20.Label "true" + set Box20.Max "100" + set Box20.ReactiveOnTrack "true" + set Box20.Title "Surface + cutter" + +new std:Div Box21 + set Box21.In2 "100" + +new std:MultipleInputs Box22 + +new creaVtk:Cutter Box24 + +new creaVtk:Plane Box25 + set Box25.Origin "0 0 10" + +new vtk:PolyDataToActor Box26 + set Box26.Colour "0 1 1" + set Box26.Representation "1" + +new wx:Slider Box27 + set Box27.In "30" + set Box27.Label "true" + set Box27.Max "100" + set Box27.ReactiveOnTrack "true" + set Box27.Title "Surface + cutter + stripper" + +new std:Div Box28 + set Box28.In2 "100" + + +connect Box06.Out Box05.In + +connect Box05.Widget Box09.Widget2 + +connect Box05.Renderer1 Box11.Renderer + +connect Box05.Renderer1 Box12.Renderer + +connect Box13.Out Box14.In + +connect Box14.Out Box11.In + +connect Box05.Renderer1 Box16.Renderer + +connect Box11.BoxChange Box16.BoxExecute + +connect Box17.Out Box18.In1 + +connect Box17.Widget Box19.Widget1 + +connect Box18.Out Box11.Opacity + +connect Box20.Out Box21.In1 + +connect Box20.Widget Box19.Widget3 + +connect Box19.Widget Box09.Widget1 + +connect Box21.Out Box16.Opacity + +connect Box20.BoxChange Box22.In2 + +connect Box17.BoxChange Box22.In1 + +connect Box22.BoxChange Box11.BoxExecute + +connect Box14.Out Box24.In + +connect Box25.Out Box24.ImplicitFunction + +connect Box24.Out Box16.In + +connect Box24.Out Box03.In + +connect Box05.Renderer1 Box26.Renderer + +connect Box03.Out Box26.In + +connect Box16.BoxChange Box26.BoxExecute + +connect Box26.BoxChange Box12.BoxExecute + +connect Box27.Out Box28.In1 + +connect Box27.Widget Box19.Widget6 + +connect Box27.BoxChange Box22.In6 + +connect Box28.Out Box26.Opacity + + + +# Complex input ports +exec Box08 +exec Box09 diff --git a/bbtk_creaVtk_PKG/bbs/appli/exampleVoiMPR.bbg b/bbtk_creaVtk_PKG/bbs/appli/exampleVoiMPR.bbg new file mode 100644 index 0000000..6a221e9 --- /dev/null +++ b/bbtk_creaVtk_PKG/bbs/appli/exampleVoiMPR.bbg @@ -0,0 +1,70 @@ +# ---------------------------------- +# - BBTKGEditor v 1.4 BBG BlackBox Diagram file +# - /home/davila/Creatis/C8/creatools_source/creaVtk/bbtk_creaVtk_PKG/bbs/appli/exampleVoiMPR.bbg +# ---------------------------------- + +APP_START +CATEGORY: +DESCRIPTION:Description ?? +AUTHOR:Author ?? +COMPLEXBOX:FALSE +COMPLEXINPUTS:0 +BOXES:4 +BOX +creaVtk:VoiMPR-Widget:Box00 +ISEXEC:FALSE +-21.477436:-25.903727:-900.000000 +19.722564:-35.903727:-900.000000 +FIN_BOX +BOX +vtk:LoadHola:Box01 +ISEXEC:FALSE +-31.631200:58.927159:-900.000000 +3.918800:48.927159:-900.000000 +FIN_BOX +BOX +creaMaracasVisu:ViewerNV:Box02 +ISEXEC:FALSE +17.822656:30.988942:-900.000000 +81.542656:20.988942:-900.000000 +FIN_BOX +BOX +wx:LayoutSplit:Box03 +ISEXEC:TRUE +12.006697:-66.365397:-900.000000 +51.086697:-76.365397:-900.000000 +PORT +Orientation:"H" +FIN_BOX +CONNECTIONS:10 +CONNECTION +Box01:Out:Box00:image +NumberOfControlPoints:0 +CONNECTION +Box01:Out:Box02:In +NumberOfControlPoints:0 +CONNECTION +Box02:Point:Box00:Point +NumberOfControlPoints:0 +CONNECTION +Box02:Renderer2:Box00:RenderYZ +NumberOfControlPoints:0 +CONNECTION +Box02:BoxChange:Box00:execute +NumberOfControlPoints:0 +CONNECTION +Box02:Renderer3:Box00:RenderXZ +NumberOfControlPoints:0 +CONNECTION +Box02:Renderer4:Box00:RenderXY +NumberOfControlPoints:0 +CONNECTION +Box02:wxVtkBaseView1:Box00:wxVtkBaseView +NumberOfControlPoints:0 +CONNECTION +Box02:Widget:Box03:Widget2 +NumberOfControlPoints:0 +CONNECTION +Box00:Widget:Box03:Widget1 +NumberOfControlPoints:0 +APP_END diff --git a/bbtk_creaVtk_PKG/bbs/appli/exampleVoiMPR.bbs b/bbtk_creaVtk_PKG/bbs/appli/exampleVoiMPR.bbs new file mode 100644 index 0000000..234dab1 --- /dev/null +++ b/bbtk_creaVtk_PKG/bbs/appli/exampleVoiMPR.bbs @@ -0,0 +1,53 @@ +# ---------------------------------- +# - BBTKGEditor v 1.4 BBS BlackBox Script +# - /home/davila/Creatis/C8/creatools_source/creaVtk/bbtk_creaVtk_PKG/bbs/appli/exampleVoiMPR.bbs +# ---------------------------------- + +# BBTK GEditor Script +# ---------------------- + +include std +include itkvtk +include creaVtk +include vtk +include creaMaracasVisu +include wx + +author "Author ??" +description "Description ??" +category "" + +new creaVtk:VoiMPR-Widget Box00 + +new vtk:LoadHola Box01 + +new creaMaracasVisu:ViewerNV Box02 + +new wx:LayoutSplit Box03 + set Box03.Orientation "H" + + +connect Box01.Out Box00.image + +connect Box01.Out Box02.In + +connect Box02.Point Box00.Point + +connect Box02.Renderer2 Box00.RenderYZ + +connect Box02.BoxChange Box00.execute + +connect Box02.Renderer3 Box00.RenderXZ + +connect Box02.Renderer4 Box00.RenderXY + +connect Box02.wxVtkBaseView1 Box00.wxVtkBaseView + +connect Box02.Widget Box03.Widget2 + +connect Box00.Widget Box03.Widget1 + + + +# Complex input ports +exec Box03 diff --git a/bbtk_creaVtk_PKG/bbs/appli/example_BoxWidget_ClipPolydata.bbg b/bbtk_creaVtk_PKG/bbs/appli/example_BoxWidget_ClipPolydata.bbg new file mode 100644 index 0000000..f68c584 --- /dev/null +++ b/bbtk_creaVtk_PKG/bbs/appli/example_BoxWidget_ClipPolydata.bbg @@ -0,0 +1,104 @@ +# ---------------------------------- +# - BBTKGEditor v 1.4 BBG BlackBox Diagram file +# - /home/davila/Creatis/C8/creatools_source/creaVtk/bbtk_creaVtk_PKG/bbs/appli/example_BoxWidget_ClipPolydata.bbg +# ---------------------------------- + +APP_START +CATEGORY: +DESCRIPTION:Description ?? +AUTHOR:Author ?? +COMPLEXBOX:FALSE +COMPLEXINPUTS:0 +BOXES:8 +BOX +vtk:LoadHola:Box00 +ISEXEC:FALSE +-13.850748:68.721067:-900.000000 +21.699252:58.721067:-900.000000 +FIN_BOX +BOX +creaMaracasVisu:ViewerNV:Box01 +ISEXEC:FALSE +-19.979284:45.126531:-900.000000 +43.740716:35.126531:-900.000000 +FIN_BOX +BOX +creaVtk:BoxWidget:Box02 +ISEXEC:FALSE +-38.184214:4.379120:-900.000000 +-1.509214:-5.620880:-900.000000 +FIN_BOX +BOX +wx:LayoutSplit:Box03 +ISEXEC:TRUE +11.848896:-90.117759:-900.000000 +50.928896:-100.117759:-900.000000 +PORT +Orientation:"H" +FIN_BOX +BOX +wx:CommandButton:Box04 +ISEXEC:FALSE +-85.584870:31.037853:-900.000000 +-42.809870:21.037853:-900.000000 +PORT +Label:"Refresh" +FIN_BOX +BOX +vtk:SphereSource:Box05 +ISEXEC:FALSE +26.306848:5.863047:-900.000000 +66.131848:-4.136953:-900.000000 +PORT +CenterX:"50" +PORT +CenterY:"50" +PORT +CenterZ:"50" +PORT +Radius:"20" +FIN_BOX +BOX +creaVtk:ClipPolyData:Box06 +ISEXEC:FALSE +-49.518922:-34.972985:-900.000000 +-10.693922:-44.972985:-900.000000 +FIN_BOX +BOX +vtk:PolyDataToActor:Box07 +ISEXEC:FALSE +-52.136645:-67.077861:-900.000000 +-9.736645:-77.077861:-900.000000 +FIN_BOX +CONNECTIONS:10 +CONNECTION +Box00:Out:Box01:In +NumberOfControlPoints:0 +CONNECTION +Box01:Renderer1:Box02:Renderer +NumberOfControlPoints:0 +CONNECTION +Box01:Widget:Box03:Widget2 +NumberOfControlPoints:0 +CONNECTION +Box04:Widget:Box03:Widget1 +NumberOfControlPoints:0 +CONNECTION +Box04:BoxChange:Box02:BoxExecute +NumberOfControlPoints:0 +CONNECTION +Box05:Out:Box06:In +NumberOfControlPoints:0 +CONNECTION +Box02:ImplicitFunction:Box06:ImplicitFunction +NumberOfControlPoints:0 +CONNECTION +Box06:Out:Box07:In +NumberOfControlPoints:0 +CONNECTION +Box01:Renderer1:Box07:Renderer +NumberOfControlPoints:0 +CONNECTION +Box06:BoxChange:Box07:BoxExecute +NumberOfControlPoints:0 +APP_END diff --git a/bbtk_creaVtk_PKG/bbs/appli/example_BoxWidget_ClipPolydata.bbs b/bbtk_creaVtk_PKG/bbs/appli/example_BoxWidget_ClipPolydata.bbs new file mode 100644 index 0000000..f57eb60 --- /dev/null +++ b/bbtk_creaVtk_PKG/bbs/appli/example_BoxWidget_ClipPolydata.bbs @@ -0,0 +1,66 @@ +# ---------------------------------- +# - BBTKGEditor v 1.4 BBS BlackBox Script +# - /home/davila/Creatis/C8/creatools_source/creaVtk/bbtk_creaVtk_PKG/bbs/appli/example_BoxWidget_ClipPolydata.bbs +# ---------------------------------- + +# BBTK GEditor Script +# ---------------------- + +include std +include itkvtk +include vtk +include creaMaracasVisu +include creaVtk +include wx + +author "Author ??" +description "Description ??" +category "" + +new vtk:LoadHola Box00 + +new creaMaracasVisu:ViewerNV Box01 + +new creaVtk:BoxWidget Box02 + +new wx:LayoutSplit Box03 + set Box03.Orientation "H" + +new wx:CommandButton Box04 + set Box04.Label "Refresh" + +new vtk:SphereSource Box05 + set Box05.CenterX "50" + set Box05.CenterY "50" + set Box05.CenterZ "50" + set Box05.Radius "20" + +new creaVtk:ClipPolyData Box06 + +new vtk:PolyDataToActor Box07 + + +connect Box00.Out Box01.In + +connect Box01.Renderer1 Box02.Renderer + +connect Box01.Widget Box03.Widget2 + +connect Box04.Widget Box03.Widget1 + +connect Box04.BoxChange Box02.BoxExecute + +connect Box05.Out Box06.In + +connect Box02.ImplicitFunction Box06.ImplicitFunction + +connect Box06.Out Box07.In + +connect Box01.Renderer1 Box07.Renderer + +connect Box06.BoxChange Box07.BoxExecute + + + +# Complex input ports +exec Box03 diff --git a/bbtk_creaVtk_PKG/bbs/appli/save_YZ_XZ_volume.bbg b/bbtk_creaVtk_PKG/bbs/appli/save_YZ_XZ_volume.bbg new file mode 100644 index 0000000..3ef22ce --- /dev/null +++ b/bbtk_creaVtk_PKG/bbs/appli/save_YZ_XZ_volume.bbg @@ -0,0 +1,34 @@ +# ---------------------------------- +# - BBTKGEditor v 1.4 BBG BlackBox Diagram file +# - /home/davila/Creatis/C10/creatools_source/creaVtk/bbtk_creaVtk_PKG/bbs/appli/save_YZ_XZ_volume.bbg +# ---------------------------------- + +APP_START +CATEGORY: +DESCRIPTION:Description ?? +AUTHOR:Author ?? +COMPLEXBOX:FALSE +COMPLEXINPUTS:2 +COMPLEX_PORT +filename +10.332827:23.665507:-900.000000 +FIN_COMPLEX_PORT +COMPLEX_PORT +compression +-17.999118:23.665507:-900.000000 +FIN_COMPLEX_PORT +BOXES:1 +BOX +creaVtk:save_YZ_XZ_volume:Box00 +ISEXEC:TRUE +-15.332582:-5.666389:-900.000000 +30.417418:-15.666389:-900.000000 +FIN_BOX +CONNECTIONS:2 +CONNECTION +compression:compression:Box00:Compression +NumberOfControlPoints:0 +CONNECTION +filename:filename:Box00:FileName +NumberOfControlPoints:0 +APP_END diff --git a/bbtk_creaVtk_PKG/bbs/appli/save_YZ_XZ_volume.bbs b/bbtk_creaVtk_PKG/bbs/appli/save_YZ_XZ_volume.bbs new file mode 100644 index 0000000..3562cb2 --- /dev/null +++ b/bbtk_creaVtk_PKG/bbs/appli/save_YZ_XZ_volume.bbs @@ -0,0 +1,27 @@ +# ---------------------------------- +# - BBTKGEditor v 1.4 BBS BlackBox Script +# - /home/davila/Creatis/C10/creatools_source/creaVtk/bbtk_creaVtk_PKG/bbs/appli/save_YZ_XZ_volume.bbs +# ---------------------------------- + +# BBTK GEditor Script +# ---------------------- + +include std +include itkvtk +include creaVtk + +author "Author ??" +description "Description ??" +category "" + +new creaVtk:save_YZ_XZ_volume Box00 + + + + + + +# Complex input ports +input compression Box00.Compression " " +input filename Box00.FileName " " +exec Box00 diff --git a/bbtk_creaVtk_PKG/bbs/boxes/CompareImagesByRGB-Widget.bbg b/bbtk_creaVtk_PKG/bbs/boxes/CompareImagesByRGB-Widget.bbg new file mode 100644 index 0000000..01e4a79 --- /dev/null +++ b/bbtk_creaVtk_PKG/bbs/boxes/CompareImagesByRGB-Widget.bbg @@ -0,0 +1,297 @@ +# ---------------------------------- +# - BBTKGEditor v 1.4 BBG BlackBox Diagram file +# - /home/davila/Creatis/C11/creatools_source/creaVtk/bbtk_creaVtk_PKG/bbs/boxes/CompareImagesByRGB-Widget.bbg +# ---------------------------------- + +APP_START +CATEGORY: +DESCRIPTION:Description ?? +AUTHOR:Author ?? +COMPLEXBOX:TRUE +COMPLEXBOXNAME:CompareImagesByRGB-Widget +PACKAGENAME:creaVtk +COMPLEXOUTPUTS:1 +COMPLEX_PORT +OutWidget +-141.188304:-163.078587:-900.000000 +FIN_COMPLEX_PORT +COMPLEXINPUTS:2 +COMPLEX_PORT +Image1 +-40.537616:163.388080:-900.000000 +FIN_COMPLEX_PORT +COMPLEX_PORT +Image2 +30.013598:159.944870:-900.000000 +FIN_COMPLEX_PORT +BOXES:20 +BOX +creaMaracasVisu:ViewerNV:Box00 +ISEXEC:FALSE +-43.426794:-66.268413:-900.000000 +20.293206:-76.268413:-900.000000 +PORT +nTypeView:"1 2 0" +FIN_BOX +BOX +creaVtk:ImageAppendComponents:Box02 +ISEXEC:FALSE +-203.582916:-29.421199:-900.000000 +-150.532916:-39.421199:-900.000000 +FIN_BOX +BOX +vtk:RescaleSlopeIntercept:Box05 +ISEXEC:FALSE +-43.951428:89.905525:-900.000000 +4.173572:79.905525:-900.000000 +PORT +A:"0" +PORT +B:"255" +PORT +OutputFormat:"VTK_UNSIGNED_CHAR" +PORT +Type:"2" +FIN_BOX +BOX +creaMaracasVisu:SetwxVtkBaseViewLookupTable:Box06 +ISEXEC:FALSE +-12.855698:-115.985952:-900.000000 +43.994302:-125.985952:-900.000000 +FIN_BOX +BOX +wx:LayoutSplit:Box07 +ISEXEC:FALSE +-141.202294:-144.516735:-900.000000 +-102.122294:-154.516735:-900.000000 +PORT +Proportion:"50" +FIN_BOX +BOX +creaVtk:ScalarsToColors:Box10 +ISEXEC:FALSE +55.522942:-52.647302:-900.000000 +97.047942:-62.647302:-900.000000 +PORT +Type:"3" +FIN_BOX +BOX +vtk:RescaleSlopeIntercept:Box13 +ISEXEC:FALSE +23.644953:90.680497:-900.000000 +71.769953:80.680497:-900.000000 +PORT +A:"0" +PORT +B:"255" +PORT +OutputFormat:"VTK_UNSIGNED_CHAR" +PORT +Type:"2" +FIN_BOX +BOX +std:StringSelect:Box18 +ISEXEC:FALSE +-202.842874:73.343866:-900.000000 +-160.682874:63.343866:-900.000000 +PORT +In0:"1 1 1" +PORT +In1:"0 0 0" +PORT +In2:"1 0 0" +PORT +In3:"0 1 0" +PORT +In4:"0 0 1" +PORT +In5:"1 1 0" +PORT +In6:"1 0 1" +PORT +In7:"0 1 1" +FIN_BOX +BOX +PackRecalage:AddImageToVector:Box19 +ISEXEC:FALSE +-13.743788:38.895326:-900.000000 +31.656212:28.895326:-900.000000 +FIN_BOX +BOX +std:GetVectorStringElement:Box20 +ISEXEC:FALSE +-271.077722:53.758698:-900.000000 +-221.677722:43.758698:-900.000000 +PORT +I:"0" +FIN_BOX +BOX +std:GetVectorStringElement:Box21 +ISEXEC:FALSE +-205.073499:53.172640:-900.000000 +-155.673499:43.172640:-900.000000 +PORT +I:"1" +FIN_BOX +BOX +std:GetVectorStringElement:Box22 +ISEXEC:FALSE +-138.754214:52.260973:-900.000000 +-89.354214:42.260973:-900.000000 +PORT +I:"2" +FIN_BOX +BOX +vtk:GetVectorVtkImageDataElement:Box23 +ISEXEC:FALSE +-270.964594:-0.569468:-900.000000 +-212.714594:-10.569468:-900.000000 +FIN_BOX +BOX +vtk:GetVectorVtkImageDataElement:Box24 +ISEXEC:FALSE +-185.710508:-1.005972:-900.000000 +-127.460508:-11.005972:-900.000000 +FIN_BOX +BOX +vtk:GetVectorVtkImageDataElement:Box25 +ISEXEC:FALSE +-98.887475:-1.939186:-900.000000 +-40.637475:-11.939186:-900.000000 +FIN_BOX +BOX +wx:Slider:Box26 +ISEXEC:FALSE +-306.701264:117.651337:-900.000000 +-255.301264:107.651337:-900.000000 +PORT +Max:"7" +PORT +Min:"0" +FIN_BOX +BOX +vtk:vtkImageDataPointerRelay:Box29 +ISEXEC:FALSE +-48.945155:121.673754:-900.000000 +3.229845:111.673754:-900.000000 +FIN_BOX +BOX +vtk:vtkImageDataPointerRelay:Box30 +ISEXEC:FALSE +24.733746:117.421238:-900.000000 +76.908746:107.421238:-900.000000 +FIN_BOX +BOX +wx:LayoutLine:Box31 +ISEXEC:FALSE +-308.385679:-23.643024:-900.000000 +-250.825679:-33.643024:-900.000000 +PORT +Orientation:"H" +FIN_BOX +BOX +wx:CheckBox:Box32 +ISEXEC:FALSE +-323.671153:15.952937:-900.000000 +-287.346153:5.952937:-900.000000 +PORT +Title:"Interpolation" +FIN_BOX +CONNECTIONS:32 +CONNECTION +Box02:Out:Box00:In +NumberOfControlPoints:0 +CONNECTION +Box10:LookupTable:Box06:ScalarToColors +NumberOfControlPoints:0 +CONNECTION +Box05:Out:Box19:In0 +NumberOfControlPoints:0 +CONNECTION +Box13:Out:Box19:In1 +NumberOfControlPoints:0 +CONNECTION +Box18:Out:Box20:In +NumberOfControlPoints:0 +CONNECTION +Box18:Out:Box21:In +NumberOfControlPoints:0 +CONNECTION +Box18:Out:Box22:In +NumberOfControlPoints:0 +CONNECTION +Box19:Out:Box23:In +NumberOfControlPoints:0 +CONNECTION +Box20:Out:Box23:I +NumberOfControlPoints:0 +CONNECTION +Box19:Out:Box24:In +NumberOfControlPoints:0 +CONNECTION +Box19:Out:Box25:In +NumberOfControlPoints:0 +CONNECTION +Box21:Out:Box24:I +NumberOfControlPoints:0 +CONNECTION +Box22:Out:Box25:I +NumberOfControlPoints:0 +CONNECTION +Box23:Out:Box02:In0 +NumberOfControlPoints:0 +CONNECTION +Box24:Out:Box02:In1 +NumberOfControlPoints:0 +CONNECTION +Box25:Out:Box02:In2 +NumberOfControlPoints:0 +CONNECTION +Box26:Out:Box18:In +NumberOfControlPoints:0 +CONNECTION +Box00:wxVtkBaseView1:Box06:BaseView1 +NumberOfControlPoints:0 +CONNECTION +Box00:wxVtkBaseView2:Box06:BaseView2 +NumberOfControlPoints:0 +CONNECTION +Box00:wxVtkBaseView3:Box06:BaseView3 +NumberOfControlPoints:0 +CONNECTION +Box29:Out:Box05:In +NumberOfControlPoints:0 +CONNECTION +Box30:Out:Box13:In +NumberOfControlPoints:0 +CONNECTION +Image1:Image1:Box29:In +NumberOfControlPoints:0 +CONNECTION +Image2:Image2:Box30:In +NumberOfControlPoints:0 +CONNECTION +Box07:Widget:OutWidget:OutWidget +NumberOfControlPoints:0 +CONNECTION +Box26:BoxChange:Box06:BoxExecute +NumberOfControlPoints:0 +CONNECTION +Box26:Widget:Box31:Widget1 +NumberOfControlPoints:0 +CONNECTION +Box32:Widget:Box31:Widget2 +NumberOfControlPoints:0 +CONNECTION +Box32:Out:Box00:Interpolate +NumberOfControlPoints:0 +CONNECTION +Box32:BoxChange:Box00:BoxExecute +NumberOfControlPoints:0 +CONNECTION +Box00:Widget:Box07:Widget1 +NumberOfControlPoints:0 +CONNECTION +Box31:Widget:Box07:Widget2 +NumberOfControlPoints:0 +APP_END diff --git a/bbtk_creaVtk_PKG/bbs/boxes/CompareImagesByRGB-Widget.bbs b/bbtk_creaVtk_PKG/bbs/boxes/CompareImagesByRGB-Widget.bbs new file mode 100644 index 0000000..47680a9 --- /dev/null +++ b/bbtk_creaVtk_PKG/bbs/boxes/CompareImagesByRGB-Widget.bbs @@ -0,0 +1,127 @@ +# ---------------------------------- +# - BBTKGEditor v 1.4 BBS BlackBox Script (Complex Box) +# - /home/davila/Creatis/C11/creatools_source/creaVtk/bbtk_creaVtk_PKG/bbs/boxes/CompareImagesByRGB-Widget.bbs +# ---------------------------------- + +include std +include itkvtk +include creaMaracasVisu +include creaVtk +include vtk +include wx +include std +include PackRecalage + +define CompareImagesByRGB-Widget creaVtk + +author "Author ??" +description "Description ??" + +category "" + +new creaMaracasVisu:ViewerNV Box00 + set Box00.nTypeView "1 2 0" + +new creaVtk:ImageAppendComponents Box02 + +new vtk:RescaleSlopeIntercept Box05 + set Box05.A "0" + set Box05.B "255" + set Box05.OutputFormat "VTK_UNSIGNED_CHAR" + set Box05.Type "2" + +new creaMaracasVisu:SetwxVtkBaseViewLookupTable Box06 + +new wx:LayoutSplit Box07 + set Box07.Proportion "50" + +new creaVtk:ScalarsToColors Box10 + set Box10.Type "3" + +new vtk:RescaleSlopeIntercept Box13 + set Box13.A "0" + set Box13.B "255" + set Box13.OutputFormat "VTK_UNSIGNED_CHAR" + set Box13.Type "2" + +new std:StringSelect Box18 + set Box18.In0 "1 1 1" + set Box18.In1 "0 0 0" + set Box18.In2 "1 0 0" + set Box18.In3 "0 1 0" + set Box18.In4 "0 0 1" + set Box18.In5 "1 1 0" + set Box18.In6 "1 0 1" + set Box18.In7 "0 1 1" + +new PackRecalage:AddImageToVector Box19 + +new std:GetVectorStringElement Box20 + set Box20.I "0" + +new std:GetVectorStringElement Box21 + set Box21.I "1" + +new std:GetVectorStringElement Box22 + set Box22.I "2" + +new vtk:GetVectorVtkImageDataElement Box23 + +new vtk:GetVectorVtkImageDataElement Box24 + +new vtk:GetVectorVtkImageDataElement Box25 + +new wx:Slider Box26 + set Box26.Max "7" + set Box26.Min "0" + +new vtk:vtkImageDataPointerRelay Box29 + +new vtk:vtkImageDataPointerRelay Box30 + +new wx:LayoutLine Box31 + set Box31.Orientation "H" + +new wx:CheckBox Box32 + set Box32.Title "Interpolation" + + +connect Box02.Out Box00.In +connect Box10.LookupTable Box06.ScalarToColors +connect Box05.Out Box19.In0 +connect Box13.Out Box19.In1 +connect Box18.Out Box20.In +connect Box18.Out Box21.In +connect Box18.Out Box22.In +connect Box19.Out Box23.In +connect Box20.Out Box23.I +connect Box19.Out Box24.In +connect Box19.Out Box25.In +connect Box21.Out Box24.I +connect Box22.Out Box25.I +connect Box23.Out Box02.In0 +connect Box24.Out Box02.In1 +connect Box25.Out Box02.In2 +connect Box26.Out Box18.In +connect Box00.wxVtkBaseView1 Box06.BaseView1 +connect Box00.wxVtkBaseView2 Box06.BaseView2 +connect Box00.wxVtkBaseView3 Box06.BaseView3 +connect Box29.Out Box05.In +connect Box30.Out Box13.In +connect Box26.BoxChange Box06.BoxExecute +connect Box26.Widget Box31.Widget1 +connect Box32.Widget Box31.Widget2 +connect Box32.Out Box00.Interpolate +connect Box32.BoxChange Box00.BoxExecute +connect Box00.Widget Box07.Widget1 +connect Box31.Widget Box07.Widget2 + +# Complex input ports +input Image1 Box29.In " " +input Image2 Box30.In " " + +# Complex output ports +output OutWidget Box07.Widget " " + + +endefine diff --git a/bbtk_creaVtk_PKG/bbs/boxes/FindAxisEED.bbg b/bbtk_creaVtk_PKG/bbs/boxes/FindAxisEED.bbg new file mode 100644 index 0000000..943080a --- /dev/null +++ b/bbtk_creaVtk_PKG/bbs/boxes/FindAxisEED.bbg @@ -0,0 +1,203 @@ +# ---------------------------------- +# - BBTKGEditor v 1.4 BBG BlackBox Diagram file +# - /home/davila/Creatis/C8/creatools_source/creaVtk/bbtk_creaVtk_PKG/bbs/boxes/FindAxisEED.bbg +# ---------------------------------- + +APP_START +CATEGORY: +DESCRIPTION:Description ?? +AUTHOR:Author ?? +COMPLEXBOX:TRUE +COMPLEXBOXNAME:FindAxisEED +PACKAGENAME:creaVtk +COMPLEXOUTPUTS:7 +COMPLEX_PORT +imageOutTmp +-86.519730:-205.275397:-900.000000 +FIN_COMPLEX_PORT +COMPLEX_PORT +imageOutDistanceMap +67.799086:-204.784844:-900.000000 +FIN_COMPLEX_PORT +COMPLEX_PORT +axisLstX +-12.475387:-203.066620:-900.000000 +FIN_COMPLEX_PORT +COMPLEX_PORT +axisLstY +22.071112:-204.330508:-900.000000 +FIN_COMPLEX_PORT +COMPLEX_PORT +axisLstZ +39.089406:-202.265702:-900.000000 +FIN_COMPLEX_PORT +COMPLEX_PORT +finalPointDistanceMap +-49.262810:-205.322083:-900.000000 +FIN_COMPLEX_PORT +COMPLEX_PORT +outLengthPixelsDistanceMap +-28.377706:-204.106778:-900.000000 +FIN_COMPLEX_PORT +COMPLEXINPUTS:6 +COMPLEX_PORT +stdDev +-28.447633:50.012145:-900.000000 +FIN_COMPLEX_PORT +COMPLEX_PORT +averageRadius +-159.307290:53.037280:-900.000000 +FIN_COMPLEX_PORT +COMPLEX_PORT +imageMask +-106.635422:53.024269:-900.000000 +FIN_COMPLEX_PORT +COMPLEX_PORT +slopeDistanceMap +175.140002:49.789248:-900.000000 +FIN_COMPLEX_PORT +COMPLEX_PORT +Point2DistanceMap +124.204556:49.878387:-900.000000 +FIN_COMPLEX_PORT +COMPLEX_PORT +Point1DistanceMap +77.729781:51.447056:-900.000000 +FIN_COMPLEX_PORT +BOXES:7 +BOX +vtk:ImageGaussianSmooth:Box15 +ISEXEC:FALSE +-86.019292:-54.567937:-900.000000 +-37.119292:-64.567937:-900.000000 +FIN_BOX +BOX +itk:BinaryThresholdImageFilter:Box16 +ISEXEC:FALSE +-69.915319:-77.677020:-900.000000 +-17.740319:-87.677020:-900.000000 +PORT +InsideValue:"255" +PORT +LowerThreshold:"250" +PORT +OutsideValue:"0" +PORT +UpperThreshold:"1000" +FIN_BOX +BOX +vtk:ImageGaussianSmooth:Box17 +ISEXEC:FALSE +-152.015620:-95.824068:-900.000000 +-103.115620:-105.824068:-900.000000 +PORT +StdDevX:"10" +PORT +StdDevY:"10" +PORT +StdDevZ:"3" +FIN_BOX +BOX +creaVtk:ApplyMask:Box20 +ISEXEC:FALSE +-32.976315:-121.753349:-900.000000 +4.248685:-131.753349:-900.000000 +FIN_BOX +BOX +creaVtk:DistanceMap:Box21 +ISEXEC:FALSE +-13.775824:-151.205153:-900.000000 +25.424176:-161.205153:-900.000000 +PORT +Point1:"107 103 382" +FIN_BOX +BOX +std:ConcatStrings:Box30 +ISEXEC:FALSE +-172.788476:-49.034634:-900.000000 +-133.063476:-59.034634:-900.000000 +PORT +In1:"10" +FIN_BOX +BOX +std:ConcatStrings:Box31 +ISEXEC:FALSE +-61.001950:-12.733523:-900.000000 +-21.276950:-22.733523:-900.000000 +PORT +In1:"10" +FIN_BOX +CONNECTIONS:24 +CONNECTION +Box15:Out:Box16:In +NumberOfControlPoints:0 +CONNECTION +Box16:Out:Box17:In +NumberOfControlPoints:0 +CONNECTION +Box17:Out:Box20:Image +NumberOfControlPoints:0 +CONNECTION +Box16:Out:Box20:Mask +NumberOfControlPoints:0 +CONNECTION +Box20:Out:Box21:In +NumberOfControlPoints:0 +CONNECTION +Box30:Out:Box17:StdDevX +NumberOfControlPoints:0 +CONNECTION +Box30:Out:Box17:StdDevY +NumberOfControlPoints:0 +CONNECTION +Box30:Out:Box21:AverageRadius +NumberOfControlPoints:0 +CONNECTION +Box31:Out:Box15:StdDevX +NumberOfControlPoints:0 +CONNECTION +Box31:Out:Box15:StdDevY +NumberOfControlPoints:0 +CONNECTION +Box31:Out:Box15:StdDevZ +NumberOfControlPoints:0 +CONNECTION +stdDev:stdDev:Box31:In1 +NumberOfControlPoints:0 +CONNECTION +averageRadius:averageRadius:Box30:In1 +NumberOfControlPoints:0 +CONNECTION +imageMask:imageMask:Box15:In +NumberOfControlPoints:0 +CONNECTION +slopeDistanceMap:slopeDistanceMap:Box21:Slope +NumberOfControlPoints:0 +CONNECTION +Box16:Out:imageOutTmp:imageOutTmp +NumberOfControlPoints:0 +CONNECTION +Box21:Out:imageOutDistanceMap:imageOutDistanceMap +NumberOfControlPoints:0 +CONNECTION +Box21:LstPathXOut:axisLstX:axisLstX +NumberOfControlPoints:0 +CONNECTION +Box21:LstPathYOut:axisLstY:axisLstY +NumberOfControlPoints:0 +CONNECTION +Box21:LstPathZOut:axisLstZ:axisLstZ +NumberOfControlPoints:0 +CONNECTION +Box21:FinalPoint:finalPointDistanceMap:finalPointDistanceMap +NumberOfControlPoints:0 +CONNECTION +Point2DistanceMap:Point2DistanceMap:Box21:Point2 +NumberOfControlPoints:0 +CONNECTION +Point1DistanceMap:Point1DistanceMap:Box21:Point1 +NumberOfControlPoints:0 +CONNECTION +Box21:LengthPixels:outLengthPixelsDistanceMap:outLengthPixelsDistanceMap +NumberOfControlPoints:0 +APP_END diff --git a/bbtk_creaVtk_PKG/bbs/boxes/FindAxisEED.bbs b/bbtk_creaVtk_PKG/bbs/boxes/FindAxisEED.bbs new file mode 100644 index 0000000..84424b2 --- /dev/null +++ b/bbtk_creaVtk_PKG/bbs/boxes/FindAxisEED.bbs @@ -0,0 +1,75 @@ +# ---------------------------------- +# - BBTKGEditor v 1.4 BBS BlackBox Script (Complex Box) +# - /home/davila/Creatis/C8/creatools_source/creaVtk/bbtk_creaVtk_PKG/bbs/boxes/FindAxisEED.bbs +# ---------------------------------- + +include std +include itkvtk +include vtk +include itk +include creaVtk +include std + +define FindAxisEED creaVtk + +author "Author ??" +description "Description ??" + +category "" + +new vtk:ImageGaussianSmooth Box15 + +new itk:BinaryThresholdImageFilter Box16 + set Box16.InsideValue "255" + set Box16.LowerThreshold "250" + set Box16.OutsideValue "0" + set Box16.UpperThreshold "1000" + +new vtk:ImageGaussianSmooth Box17 + set Box17.StdDevX "10" + set Box17.StdDevY "10" + set Box17.StdDevZ "3" + +new creaVtk:ApplyMask Box20 + +new creaVtk:DistanceMap Box21 + set Box21.Point1 "107 103 382" + +new std:ConcatStrings Box30 + set Box30.In1 "10" + +new std:ConcatStrings Box31 + set Box31.In1 "10" + + +connect Box15.Out Box16.In +connect Box16.Out Box17.In +connect Box17.Out Box20.Image +connect Box16.Out Box20.Mask +connect Box20.Out Box21.In +connect Box30.Out Box17.StdDevX +connect Box30.Out Box17.StdDevY +connect Box30.Out Box21.AverageRadius +connect Box31.Out Box15.StdDevX +connect Box31.Out Box15.StdDevY +connect Box31.Out Box15.StdDevZ + +# Complex input ports +input stdDev Box31.In1 " " +input averageRadius Box30.In1 " " +input imageMask Box15.In " " +input slopeDistanceMap Box21.Slope " " +input Point2DistanceMap Box21.Point2 " " +input Point1DistanceMap Box21.Point1 " " + +# Complex output ports +output imageOutTmp Box16.Out " " +output imageOutDistanceMap Box21.Out " " +output axisLstX Box21.LstPathXOut " " +output axisLstY Box21.LstPathYOut " " +output axisLstZ Box21.LstPathZOut " " +output finalPointDistanceMap Box21.FinalPoint " " +output outLengthPixelsDistanceMap Box21.LengthPixels " " + + +endefine diff --git a/bbtk_creaVtk_PKG/bbs/boxes/VectorVisuPlane.bbg b/bbtk_creaVtk_PKG/bbs/boxes/VectorVisuPlane.bbg new file mode 100644 index 0000000..9f24b07 --- /dev/null +++ b/bbtk_creaVtk_PKG/bbs/boxes/VectorVisuPlane.bbg @@ -0,0 +1,345 @@ +# ---------------------------------- +# - BBTKGEditor v 1.4 BBG BlackBox Diagram file +# - /home/davila/Creatis/C8/creatools_source/creaVtk/bbtk_creaVtk_PKG/bbs/boxes/VectorVisuPlane.bbg +# ---------------------------------- + +APP_START +CATEGORY: +DESCRIPTION:Description ?? +AUTHOR:Author ?? +COMPLEXBOX:TRUE +COMPLEXBOXNAME:VectorVisuPlane +PACKAGENAME:creaVtk +COMPLEXOUTPUTS:1 +COMPLEX_PORT +outvtkdataset +166.704997:-189.595641:-900.000000 +FIN_COMPLEX_PORT +COMPLEXINPUTS:5 +COMPLEX_PORT +structuredpoints +168.091564:208.867022:-900.000000 +FIN_COMPLEX_PORT +COMPLEX_PORT +point +116.120397:207.428577:-900.000000 +FIN_COMPLEX_PORT +COMPLEX_PORT +boxexecute +39.849629:211.168926:-900.000000 +FIN_COMPLEX_PORT +COMPLEX_PORT +orientation +81.925146:210.995455:-900.000000 +FIN_COMPLEX_PORT +COMPLEX_PORT +ResolutionPlane +220.331663:206.252378:-900.000000 +FIN_COMPLEX_PORT +BOXES:23 +BOX +vtk:ProbeFilter:Box05 +ISEXEC:FALSE +163.478369:-153.585467:-900.000000 +199.878369:-163.585467:-900.000000 +FIN_BOX +BOX +creaVtk:PlaneSource:Box06 +ISEXEC:FALSE +94.101891:-106.947829:-900.000000 +132.551891:-116.947829:-900.000000 +PORT +Center:"10 10 10" +PORT +Normal:"0 0 1" +PORT +XResolution:"100" +PORT +YResolution:"100" +FIN_BOX +BOX +vtk:ImageVtkProperties:Box15 +ISEXEC:FALSE +-83.675523:128.799375:-900.000000 +-38.325523:118.799375:-900.000000 +FIN_BOX +BOX +std:GetVectorIntElement:Box16 +ISEXEC:FALSE +-150.960816:98.785690:-900.000000 +-104.510816:88.785690:-900.000000 +PORT +I:"0" +FIN_BOX +BOX +std:Div:Box17 +ISEXEC:FALSE +-154.010066:77.460700:-900.000000 +-124.685066:67.460700:-900.000000 +PORT +In2:"2" +FIN_BOX +BOX +std:GetVectorIntElement:Box18 +ISEXEC:FALSE +-85.650958:97.856583:-900.000000 +-39.200958:87.856583:-900.000000 +PORT +I:"1" +FIN_BOX +BOX +std:Div:Box19 +ISEXEC:FALSE +-105.283745:77.582504:-900.000000 +-75.958745:67.582504:-900.000000 +PORT +In2:"2" +FIN_BOX +BOX +std:GetVectorIntElement:Box20 +ISEXEC:FALSE +-6.414177:45.511247:-900.000000 +40.035823:35.511247:-900.000000 +PORT +I:"2" +FIN_BOX +BOX +std:ConcatStrings:Box21 +ISEXEC:FALSE +-83.537606:12.320630:-900.000000 +-43.812606:2.320630:-900.000000 +PORT +In2:" " +PORT +In4:" " +FIN_BOX +BOX +std:MathOperationVector:Box22 +ISEXEC:FALSE +-89.409251:-75.781700:-900.000000 +-41.884251:-85.781700:-900.000000 +PORT +Type:"2" +FIN_BOX +BOX +std:GetVectorIntElement:Box23 +ISEXEC:FALSE +-25.954150:102.423268:-900.000000 +20.495850:92.423268:-900.000000 +PORT +I:"2" +FIN_BOX +BOX +std:Div:Box24 +ISEXEC:FALSE +-34.789630:81.174151:-900.000000 +-5.464630:71.174151:-900.000000 +PORT +In2:"2" +FIN_BOX +BOX +std:MagicBox:Box41 +ISEXEC:FALSE +156.767214:162.166259:-900.000000 +192.842214:152.166259:-900.000000 +FIN_BOX +BOX +std:MagicBox:Box43 +ISEXEC:FALSE +35.415784:161.354987:-900.000000 +71.490784:151.354987:-900.000000 +FIN_BOX +BOX +std:StringSelect:Box45 +ISEXEC:FALSE +-128.065356:-53.449117:-900.000000 +-85.905356:-63.449117:-900.000000 +FIN_BOX +BOX +std:ConcatStrings:Box46 +ISEXEC:FALSE +-202.286031:9.447795:-900.000000 +-162.561031:-0.552205:-900.000000 +PORT +In2:" " +PORT +In4:" " +FIN_BOX +BOX +std:GetVectorIntElement:Box47 +ISEXEC:FALSE +-250.207922:63.996866:-900.000000 +-203.757922:53.996866:-900.000000 +PORT +I:"0" +FIN_BOX +BOX +std:MagicBox:Box48 +ISEXEC:FALSE +104.676855:160.496060:-900.000000 +140.751855:150.496060:-900.000000 +FIN_BOX +BOX +std:GetVectorIntElement:Box49 +ISEXEC:FALSE +-75.803994:40.827484:-900.000000 +-29.353994:30.827484:-900.000000 +PORT +I:"1" +FIN_BOX +BOX +std:ConcatStrings:Box50 +ISEXEC:FALSE +-145.515014:11.542261:-900.000000 +-105.790014:1.542261:-900.000000 +PORT +In2:" " +PORT +In4:" " +FIN_BOX +BOX +std:StringSelect:Box33 +ISEXEC:FALSE +180.417564:-35.556804:-900.000000 +222.577564:-45.556804:-900.000000 +PORT +In0:"1 0 0" +PORT +In1:"0 1 0" +PORT +In2:"0 0 1" +FIN_BOX +BOX +std:MagicBox:Box34 +ISEXEC:FALSE +92.061688:100.413387:-900.000000 +128.136688:90.413387:-900.000000 +FIN_BOX +BOX +std:MagicBox:Box35 +ISEXEC:FALSE +208.217045:162.784387:-900.000000 +244.292045:152.784387:-900.000000 +FIN_BOX +CONNECTIONS:40 +CONNECTION +Box06:PolyData:Box05:Input +NumberOfControlPoints:0 +CONNECTION +Box15:Size:Box16:In +NumberOfControlPoints:0 +CONNECTION +Box16:Out:Box17:In1 +NumberOfControlPoints:0 +CONNECTION +Box18:Out:Box19:In1 +NumberOfControlPoints:0 +CONNECTION +Box15:Size:Box18:In +NumberOfControlPoints:0 +CONNECTION +Box20:Out:Box21:In5 +NumberOfControlPoints:0 +CONNECTION +Box17:Out:Box21:In1 +NumberOfControlPoints:0 +CONNECTION +Box19:Out:Box21:In3 +NumberOfControlPoints:0 +CONNECTION +Box15:Spacing:Box22:In1 +NumberOfControlPoints:0 +CONNECTION +Box22:Out:Box06:Center +NumberOfControlPoints:0 +CONNECTION +Box23:Out:Box24:In1 +NumberOfControlPoints:0 +CONNECTION +Box15:Size:Box23:In +NumberOfControlPoints:0 +CONNECTION +Box41:Out:Box15:In +NumberOfControlPoints:0 +CONNECTION +Box41:Out:Box05:Source +NumberOfControlPoints:0 +CONNECTION +structuredpoints:structuredpoints:Box41:In +NumberOfControlPoints:0 +CONNECTION +boxexecute:boxexecute:Box43:BoxExecute +NumberOfControlPoints:0 +CONNECTION +Box43:BoxChange:Box06:BoxExecute +NumberOfControlPoints:0 +CONNECTION +Box43:BoxChange:Box05:BoxExecute +NumberOfControlPoints:0 +CONNECTION +Box45:Out:Box22:In0 +NumberOfControlPoints:0 +CONNECTION +point:point:Box48:In +NumberOfControlPoints:0 +CONNECTION +Box48:Out:Box20:In +NumberOfControlPoints:0 +CONNECTION +Box48:Out:Box47:In +NumberOfControlPoints:0 +CONNECTION +Box47:Out:Box46:In1 +NumberOfControlPoints:0 +CONNECTION +Box19:Out:Box46:In3 +NumberOfControlPoints:0 +CONNECTION +Box24:Out:Box46:In5 +NumberOfControlPoints:0 +CONNECTION +Box48:Out:Box49:In +NumberOfControlPoints:0 +CONNECTION +Box49:Out:Box50:In3 +NumberOfControlPoints:0 +CONNECTION +Box17:Out:Box50:In1 +NumberOfControlPoints:0 +CONNECTION +Box24:Out:Box50:In5 +NumberOfControlPoints:0 +CONNECTION +Box05:Out:outvtkdataset:outvtkdataset +NumberOfControlPoints:0 +CONNECTION +Box33:Out:Box06:Normal +NumberOfControlPoints:0 +CONNECTION +orientation:orientation:Box34:In +NumberOfControlPoints:0 +CONNECTION +Box34:Out:Box45:In +NumberOfControlPoints:0 +CONNECTION +Box34:Out:Box33:In +NumberOfControlPoints:0 +CONNECTION +ResolutionPlane:ResolutionPlane:Box35:In +NumberOfControlPoints:0 +CONNECTION +Box35:Out:Box06:XResolution +NumberOfControlPoints:0 +CONNECTION +Box35:Out:Box06:YResolution +NumberOfControlPoints:0 +CONNECTION +Box46:Out:Box45:In0 +NumberOfControlPoints:0 +CONNECTION +Box50:Out:Box45:In1 +NumberOfControlPoints:0 +CONNECTION +Box21:Out:Box45:In2 +NumberOfControlPoints:0 +APP_END diff --git a/bbtk_creaVtk_PKG/bbs/boxes/VectorVisuPlane.bbs b/bbtk_creaVtk_PKG/bbs/boxes/VectorVisuPlane.bbs new file mode 100644 index 0000000..1fc0def --- /dev/null +++ b/bbtk_creaVtk_PKG/bbs/boxes/VectorVisuPlane.bbs @@ -0,0 +1,135 @@ +# ---------------------------------- +# - BBTKGEditor v 1.4 BBS BlackBox Script (Complex Box) +# - /home/davila/Creatis/C8/creatools_source/creaVtk/bbtk_creaVtk_PKG/bbs/boxes/VectorVisuPlane.bbs +# ---------------------------------- + +include std +include itkvtk +include vtk +include creaVtk +include std + +define VectorVisuPlane creaVtk + +author "Author ??" +description "Description ??" + +category "" + +new vtk:ProbeFilter Box05 + +new creaVtk:PlaneSource Box06 + set Box06.Center "10 10 10" + set Box06.Normal "0 0 1" + set Box06.XResolution "100" + set Box06.YResolution "100" + +new vtk:ImageVtkProperties Box15 + +new std:GetVectorIntElement Box16 + set Box16.I "0" + +new std:Div Box17 + set Box17.In2 "2" + +new std:GetVectorIntElement Box18 + set Box18.I "1" + +new std:Div Box19 + set Box19.In2 "2" + +new std:GetVectorIntElement Box20 + set Box20.I "2" + +new std:ConcatStrings Box21 + set Box21.In2 " " + set Box21.In4 " " + +new std:MathOperationVector Box22 + set Box22.Type "2" + +new std:GetVectorIntElement Box23 + set Box23.I "2" + +new std:Div Box24 + set Box24.In2 "2" + +new std:MagicBox Box41 + +new std:MagicBox Box43 + +new std:StringSelect Box45 + +new std:ConcatStrings Box46 + set Box46.In2 " " + set Box46.In4 " " + +new std:GetVectorIntElement Box47 + set Box47.I "0" + +new std:MagicBox Box48 + +new std:GetVectorIntElement Box49 + set Box49.I "1" + +new std:ConcatStrings Box50 + set Box50.In2 " " + set Box50.In4 " " + +new std:StringSelect Box33 + set Box33.In0 "1 0 0" + set Box33.In1 "0 1 0" + set Box33.In2 "0 0 1" + +new std:MagicBox Box34 + +new std:MagicBox Box35 + + +connect Box06.PolyData Box05.Input +connect Box15.Size Box16.In +connect Box16.Out Box17.In1 +connect Box18.Out Box19.In1 +connect Box15.Size Box18.In +connect Box20.Out Box21.In5 +connect Box17.Out Box21.In1 +connect Box19.Out Box21.In3 +connect Box15.Spacing Box22.In1 +connect Box22.Out Box06.Center +connect Box23.Out Box24.In1 +connect Box15.Size Box23.In +connect Box41.Out Box15.In +connect Box41.Out Box05.Source +connect Box43.BoxChange Box06.BoxExecute +connect Box43.BoxChange Box05.BoxExecute +connect Box45.Out Box22.In0 +connect Box48.Out Box20.In +connect Box48.Out Box47.In +connect Box47.Out Box46.In1 +connect Box19.Out Box46.In3 +connect Box24.Out Box46.In5 +connect Box48.Out Box49.In +connect Box49.Out Box50.In3 +connect Box17.Out Box50.In1 +connect Box24.Out Box50.In5 +connect Box33.Out Box06.Normal +connect Box34.Out Box45.In +connect Box34.Out Box33.In +connect Box35.Out Box06.XResolution +connect Box35.Out Box06.YResolution +connect Box46.Out Box45.In0 +connect Box50.Out Box45.In1 +connect Box21.Out Box45.In2 + +# Complex input ports +input structuredpoints Box41.In " " +input boxexecute Box43.BoxExecute " " +input point Box48.In " " +input orientation Box34.In " " +input ResolutionPlane Box35.In " " + +# Complex output ports +output outvtkdataset Box05.Out " " + + +endefine diff --git a/bbtk_creaVtk_PKG/bbs/boxes/VectorVisuPlane_Widget.bbg b/bbtk_creaVtk_PKG/bbs/boxes/VectorVisuPlane_Widget.bbg new file mode 100644 index 0000000..1ae192a --- /dev/null +++ b/bbtk_creaVtk_PKG/bbs/boxes/VectorVisuPlane_Widget.bbg @@ -0,0 +1,466 @@ +# ---------------------------------- +# - BBTKGEditor v 1.4 BBG BlackBox Diagram file +# - /home/davila/Creatis/C8/creatools_source/creaVtk/bbtk_creaVtk_PKG/bbs/boxes/VectorVisuPlane_Widget.bbg +# ---------------------------------- + +APP_START +CATEGORY: +DESCRIPTION:Description ?? +AUTHOR:Author ?? +COMPLEXBOX:TRUE +COMPLEXBOXNAME:VectorVisuPlane_Widget +PACKAGENAME:creaVtk +COMPLEXOUTPUTS:1 +COMPLEX_PORT +outwidget +10.147096:-179.347579:-900.000000 +FIN_COMPLEX_PORT +COMPLEXINPUTS:8 +COMPLEX_PORT +structuredpoints +118.034259:165.342792:-900.000000 +FIN_COMPLEX_PORT +COMPLEX_PORT +Point +95.483236:163.994363:-900.000000 +FIN_COMPLEX_PORT +COMPLEX_PORT +wxvtkbaseview1_2D +-109.523616:163.189273:-900.000000 +FIN_COMPLEX_PORT +COMPLEX_PORT +wxvtkbaseview2_2D +-79.035052:161.715922:-900.000000 +FIN_COMPLEX_PORT +COMPLEX_PORT +wxvtkbaseview3_2D +-54.929596:161.100482:-900.000000 +FIN_COMPLEX_PORT +COMPLEX_PORT +vtkbaseview_3D +304.933942:145.606474:-900.000000 +FIN_COMPLEX_PORT +COMPLEX_PORT +boxExecute +136.897755:166.588357:-900.000000 +FIN_COMPLEX_PORT +COMPLEX_PORT +lookuptable +-168.767355:163.699267:-900.000000 +FIN_COMPLEX_PORT +BOXES:23 +BOX +creaVtk:VectorsVisu_Interface:Box01 +ISEXEC:FALSE +-3.043156:153.547981:-900.000000 +44.281844:143.547981:-900.000000 +FIN_BOX +BOX +creaVtk:VectorsVisu:Box03 +ISEXEC:FALSE +-179.879248:-71.409870:-900.000000 +-142.254248:-81.409870:-900.000000 +FIN_BOX +BOX +creaVtk:VectorsVisu:Box04 +ISEXEC:FALSE +-53.890021:-71.117417:-900.000000 +-16.265021:-81.117417:-900.000000 +FIN_BOX +BOX +creaVtk:VectorsVisu:Box05 +ISEXEC:FALSE +25.906741:-74.169050:-900.000000 +63.531741:-84.169050:-900.000000 +FIN_BOX +BOX +creaMaracasVisu:wxVtkBaseView_Info:Box06 +ISEXEC:FALSE +-150.446091:63.276704:-900.000000 +-104.296091:53.276704:-900.000000 +FIN_BOX +BOX +std:MagicBox:Box09 +ISEXEC:FALSE +46.032337:67.058709:-900.000000 +82.107337:57.058709:-900.000000 +FIN_BOX +BOX +std:MagicBox:Box10 +ISEXEC:FALSE +109.452352:67.977758:-900.000000 +145.527352:57.977758:-900.000000 +FIN_BOX +BOX +creaMaracasVisu:wxVtkBaseView_Info:Box11 +ISEXEC:FALSE +-79.070331:59.180158:-900.000000 +-32.920331:49.180158:-900.000000 +FIN_BOX +BOX +creaMaracasVisu:wxVtkBaseView_Info:Box12 +ISEXEC:FALSE +-6.652287:59.730859:-900.000000 +39.497713:49.730859:-900.000000 +FIN_BOX +BOX +creaVtk:VectorVisuPlane:Box13 +ISEXEC:FALSE +213.070490:-10.033221:-900.000000 +255.220490:-20.033221:-900.000000 +PORT +orientation:"0" +FIN_BOX +BOX +creaVtk:VectorsVisu:Box14 +ISEXEC:FALSE +138.245167:-121.547117:-900.000000 +175.870167:-131.547117:-900.000000 +PORT +Orientation:"0" +FIN_BOX +BOX +creaVtk:VectorsVisu:Box15 +ISEXEC:FALSE +283.742959:-94.464991:-900.000000 +321.367959:-104.464991:-900.000000 +PORT +Orientation:"1" +FIN_BOX +BOX +creaVtk:VectorsVisu:Box16 +ISEXEC:FALSE +371.638964:-91.949872:-900.000000 +409.263964:-101.949872:-900.000000 +PORT +Orientation:"2" +FIN_BOX +BOX +creaVtk:VectorVisuPlane:Box17 +ISEXEC:FALSE +288.334393:-11.949302:-900.000000 +330.484393:-21.949302:-900.000000 +PORT +orientation:"1" +FIN_BOX +BOX +creaVtk:VectorVisuPlane:Box18 +ISEXEC:FALSE +367.652496:-12.437082:-900.000000 +409.802496:-22.437082:-900.000000 +PORT +orientation:"2" +FIN_BOX +BOX +creaMaracasVisu:wxVtkBaseView_Info:Box20 +ISEXEC:FALSE +288.011426:71.644160:-900.000000 +334.161426:61.644160:-900.000000 +FIN_BOX +BOX +std:MagicBox:Box21 +ISEXEC:FALSE +183.524331:65.763428:-900.000000 +219.599331:55.763428:-900.000000 +FIN_BOX +BOX +std:MultipleInputs:Box24 +ISEXEC:FALSE +127.554980:-6.909168:-900.000000 +167.254980:-16.909168:-900.000000 +FIN_BOX +BOX +vtk:UpdateRender:Box23 +ISEXEC:FALSE +-146.616129:-113.623551:-900.000000 +-106.291129:-123.623551:-900.000000 +PORT +Active:"true" +FIN_BOX +BOX +vtk:UpdateRender:Box25 +ISEXEC:FALSE +-78.298829:-113.608194:-900.000000 +-37.973829:-123.608194:-900.000000 +PORT +Active:"true" +FIN_BOX +BOX +vtk:UpdateRender:Box26 +ISEXEC:FALSE +7.473410:-115.110656:-900.000000 +47.798410:-125.110656:-900.000000 +PORT +Active:"true" +FIN_BOX +BOX +vtk:UpdateRender:Box27 +ISEXEC:FALSE +256.664371:-161.894777:-900.000000 +296.989371:-171.894777:-900.000000 +PORT +Active:"true" +FIN_BOX +BOX +std:MagicBox:Box28 +ISEXEC:FALSE +-200.365716:-1.413275:-900.000000 +-164.290716:-11.413275:-900.000000 +FIN_BOX +CONNECTIONS:85 +CONNECTION +Box01:widget:outwidget:outwidget +NumberOfControlPoints:0 +CONNECTION +Box06:vtkRenderer:Box03:Renderer +NumberOfControlPoints:0 +CONNECTION +Box01:Opacity:Box03:Opacity +NumberOfControlPoints:0 +CONNECTION +Box01:ScaleFactor:Box03:ScaleFactor +NumberOfControlPoints:0 +CONNECTION +Box01:Type:Box03:TypeForm +NumberOfControlPoints:0 +CONNECTION +Box01:Opacity:Box04:Opacity +NumberOfControlPoints:0 +CONNECTION +Box01:ScaleFactor:Box04:ScaleFactor +NumberOfControlPoints:0 +CONNECTION +Box01:Type:Box04:TypeForm +NumberOfControlPoints:0 +CONNECTION +Box06:Direction:Box03:Orientation +NumberOfControlPoints:0 +CONNECTION +Point:Point:Box09:In +NumberOfControlPoints:0 +CONNECTION +structuredpoints:structuredpoints:Box10:In +NumberOfControlPoints:0 +CONNECTION +Box11:vtkRenderer:Box04:Renderer +NumberOfControlPoints:0 +CONNECTION +Box11:Direction:Box04:Orientation +NumberOfControlPoints:0 +CONNECTION +Box12:vtkRenderer:Box05:Renderer +NumberOfControlPoints:0 +CONNECTION +Box12:Direction:Box05:Orientation +NumberOfControlPoints:0 +CONNECTION +wxvtkbaseview3_2D:wxvtkbaseview3_2D:Box12:wxVtkBaseView +NumberOfControlPoints:0 +CONNECTION +Box01:Opacity:Box05:Opacity +NumberOfControlPoints:0 +CONNECTION +Box01:ScaleFactor:Box05:ScaleFactor +NumberOfControlPoints:0 +CONNECTION +Box01:Type:Box05:TypeForm +NumberOfControlPoints:0 +CONNECTION +Box13:outvtkdataset:Box14:In +NumberOfControlPoints:0 +CONNECTION +Box17:outvtkdataset:Box15:In +NumberOfControlPoints:0 +CONNECTION +Box18:outvtkdataset:Box16:In +NumberOfControlPoints:0 +CONNECTION +vtkbaseview_3D:vtkbaseview_3D:Box20:wxVtkBaseView +NumberOfControlPoints:0 +CONNECTION +Box20:vtkRenderer:Box14:Renderer +NumberOfControlPoints:0 +CONNECTION +Box20:vtkRenderer:Box15:Renderer +NumberOfControlPoints:0 +CONNECTION +Box20:vtkRenderer:Box16:Renderer +NumberOfControlPoints:0 +CONNECTION +Box10:Out:Box13:structuredpoints +NumberOfControlPoints:0 +CONNECTION +Box10:Out:Box17:structuredpoints +NumberOfControlPoints:0 +CONNECTION +Box10:Out:Box18:structuredpoints +NumberOfControlPoints:0 +CONNECTION +Box09:Out:Box13:point +NumberOfControlPoints:0 +CONNECTION +Box09:Out:Box17:point +NumberOfControlPoints:0 +CONNECTION +Box09:Out:Box18:point +NumberOfControlPoints:0 +CONNECTION +Box20:Direction:Box14:Orientation +NumberOfControlPoints:0 +CONNECTION +Box20:Direction:Box15:Orientation +NumberOfControlPoints:0 +CONNECTION +Box20:Direction:Box16:Orientation +NumberOfControlPoints:0 +CONNECTION +boxExecute:boxExecute:Box21:In +NumberOfControlPoints:0 +CONNECTION +Box21:Out:Box13:boxexecute +NumberOfControlPoints:0 +CONNECTION +Box21:Out:Box17:boxexecute +NumberOfControlPoints:0 +CONNECTION +Box21:Out:Box18:boxexecute +NumberOfControlPoints:0 +CONNECTION +Box01:Type:Box14:TypeForm +NumberOfControlPoints:0 +CONNECTION +Box01:Type:Box15:TypeForm +NumberOfControlPoints:0 +CONNECTION +Box01:Type:Box16:TypeForm +NumberOfControlPoints:0 +CONNECTION +Box01:Opacity:Box14:Opacity +NumberOfControlPoints:0 +CONNECTION +Box01:Opacity:Box15:Opacity +NumberOfControlPoints:0 +CONNECTION +Box01:Opacity:Box16:Opacity +NumberOfControlPoints:0 +CONNECTION +Box01:ScaleFactor:Box14:ScaleFactor +NumberOfControlPoints:0 +CONNECTION +Box01:ScaleFactor:Box15:ScaleFactor +NumberOfControlPoints:0 +CONNECTION +Box01:ScaleFactor:Box16:ScaleFactor +NumberOfControlPoints:0 +CONNECTION +Box21:Out:Box24:In1 +NumberOfControlPoints:0 +CONNECTION +Box01:boxChange:Box24:In2 +NumberOfControlPoints:0 +CONNECTION +Box24:BoxChange:Box03:BoxExecute +NumberOfControlPoints:0 +CONNECTION +Box24:BoxChange:Box14:BoxExecute +NumberOfControlPoints:0 +CONNECTION +Box24:BoxChange:Box04:BoxExecute +NumberOfControlPoints:0 +CONNECTION +Box24:BoxChange:Box05:BoxExecute +NumberOfControlPoints:0 +CONNECTION +Box24:BoxChange:Box15:BoxExecute +NumberOfControlPoints:0 +CONNECTION +Box24:BoxChange:Box16:BoxExecute +NumberOfControlPoints:0 +CONNECTION +Box01:Resolution:Box13:ResolutionPlane +NumberOfControlPoints:0 +CONNECTION +Box01:Resolution:Box17:ResolutionPlane +NumberOfControlPoints:0 +CONNECTION +Box01:Resolution:Box18:ResolutionPlane +NumberOfControlPoints:0 +CONNECTION +Box06:vtkRenderer:Box23:Renderer +NumberOfControlPoints:0 +CONNECTION +Box01:boxChange:Box23:BoxExecute +NumberOfControlPoints:0 +CONNECTION +Box11:vtkRenderer:Box25:Renderer +NumberOfControlPoints:0 +CONNECTION +Box12:vtkRenderer:Box26:Renderer +NumberOfControlPoints:0 +CONNECTION +Box20:vtkRenderer:Box27:Renderer +NumberOfControlPoints:0 +CONNECTION +Box01:boxChange:Box25:BoxExecute +NumberOfControlPoints:0 +CONNECTION +Box01:boxChange:Box26:BoxExecute +NumberOfControlPoints:0 +CONNECTION +Box01:boxChange:Box27:BoxExecute +NumberOfControlPoints:0 +CONNECTION +Box01:activeXZ:Box03:Active +NumberOfControlPoints:0 +CONNECTION +Box01:activeYZ:Box04:Active +NumberOfControlPoints:0 +CONNECTION +Box01:activeXY:Box05:Active +NumberOfControlPoints:0 +CONNECTION +wxvtkbaseview2_2D:wxvtkbaseview2_2D:Box06:wxVtkBaseView +NumberOfControlPoints:0 +CONNECTION +wxvtkbaseview1_2D:wxvtkbaseview1_2D:Box11:wxVtkBaseView +NumberOfControlPoints:0 +CONNECTION +Box17:outvtkdataset:Box03:In +NumberOfControlPoints:0 +CONNECTION +Box13:outvtkdataset:Box04:In +NumberOfControlPoints:0 +CONNECTION +Box18:outvtkdataset:Box05:In +NumberOfControlPoints:0 +CONNECTION +Box01:active3DYZ:Box14:Active +NumberOfControlPoints:0 +CONNECTION +Box01:active3DXZ:Box15:Active +NumberOfControlPoints:0 +CONNECTION +Box01:active3DXY:Box16:Active +NumberOfControlPoints:0 +CONNECTION +lookuptable:lookuptable:Box28:In +NumberOfControlPoints:0 +CONNECTION +Box28:Out:Box03:ExternalLut +NumberOfControlPoints:0 +CONNECTION +Box28:Out:Box04:ExternalLut +NumberOfControlPoints:0 +CONNECTION +Box28:Out:Box05:ExternalLut +NumberOfControlPoints:0 +CONNECTION +Box28:Out:Box14:ExternalLut +NumberOfControlPoints:0 +CONNECTION +Box28:Out:Box15:ExternalLut +NumberOfControlPoints:0 +CONNECTION +Box28:Out:Box16:ExternalLut +NumberOfControlPoints:0 +APP_END diff --git a/bbtk_creaVtk_PKG/bbs/boxes/VectorVisuPlane_Widget.bbs b/bbtk_creaVtk_PKG/bbs/boxes/VectorVisuPlane_Widget.bbs new file mode 100644 index 0000000..ff6e413 --- /dev/null +++ b/bbtk_creaVtk_PKG/bbs/boxes/VectorVisuPlane_Widget.bbs @@ -0,0 +1,168 @@ +# ---------------------------------- +# - BBTKGEditor v 1.4 BBS BlackBox Script (Complex Box) +# - /home/davila/Creatis/C8/creatools_source/creaVtk/bbtk_creaVtk_PKG/bbs/boxes/VectorVisuPlane_Widget.bbs +# ---------------------------------- + +include std +include itkvtk +include creaVtk +include creaMaracasVisu +include std +include vtk + +define VectorVisuPlane_Widget creaVtk + +author "Author ??" +description "Description ??" + +category "" + +new creaVtk:VectorsVisu_Interface Box01 + +new creaVtk:VectorsVisu Box03 + +new creaVtk:VectorsVisu Box04 + +new creaVtk:VectorsVisu Box05 + +new creaMaracasVisu:wxVtkBaseView_Info Box06 + +new std:MagicBox Box09 + +new std:MagicBox Box10 + +new creaMaracasVisu:wxVtkBaseView_Info Box11 + +new creaMaracasVisu:wxVtkBaseView_Info Box12 + +new creaVtk:VectorVisuPlane Box13 + set Box13.orientation "0" + +new creaVtk:VectorsVisu Box14 + set Box14.Orientation "0" + +new creaVtk:VectorsVisu Box15 + set Box15.Orientation "1" + +new creaVtk:VectorsVisu Box16 + set Box16.Orientation "2" + +new creaVtk:VectorVisuPlane Box17 + set Box17.orientation "1" + +new creaVtk:VectorVisuPlane Box18 + set Box18.orientation "2" + +new creaMaracasVisu:wxVtkBaseView_Info Box20 + +new std:MagicBox Box21 + +new std:MultipleInputs Box24 + +new vtk:UpdateRender Box23 + set Box23.Active "true" + +new vtk:UpdateRender Box25 + set Box25.Active "true" + +new vtk:UpdateRender Box26 + set Box26.Active "true" + +new vtk:UpdateRender Box27 + set Box27.Active "true" + +new std:MagicBox Box28 + + +connect Box06.vtkRenderer Box03.Renderer +connect Box01.Opacity Box03.Opacity +connect Box01.ScaleFactor Box03.ScaleFactor +connect Box01.Type Box03.TypeForm +connect Box01.Opacity Box04.Opacity +connect Box01.ScaleFactor Box04.ScaleFactor +connect Box01.Type Box04.TypeForm +connect Box06.Direction Box03.Orientation +connect Box11.vtkRenderer Box04.Renderer +connect Box11.Direction Box04.Orientation +connect Box12.vtkRenderer Box05.Renderer +connect Box12.Direction Box05.Orientation +connect Box01.Opacity Box05.Opacity +connect Box01.ScaleFactor Box05.ScaleFactor +connect Box01.Type Box05.TypeForm +connect Box13.outvtkdataset Box14.In +connect Box17.outvtkdataset Box15.In +connect Box18.outvtkdataset Box16.In +connect Box20.vtkRenderer Box14.Renderer +connect Box20.vtkRenderer Box15.Renderer +connect Box20.vtkRenderer Box16.Renderer +connect Box10.Out Box13.structuredpoints +connect Box10.Out Box17.structuredpoints +connect Box10.Out Box18.structuredpoints +connect Box09.Out Box13.point +connect Box09.Out Box17.point +connect Box09.Out Box18.point +connect Box20.Direction Box14.Orientation +connect Box20.Direction Box15.Orientation +connect Box20.Direction Box16.Orientation +connect Box21.Out Box13.boxexecute +connect Box21.Out Box17.boxexecute +connect Box21.Out Box18.boxexecute +connect Box01.Type Box14.TypeForm +connect Box01.Type Box15.TypeForm +connect Box01.Type Box16.TypeForm +connect Box01.Opacity Box14.Opacity +connect Box01.Opacity Box15.Opacity +connect Box01.Opacity Box16.Opacity +connect Box01.ScaleFactor Box14.ScaleFactor +connect Box01.ScaleFactor Box15.ScaleFactor +connect Box01.ScaleFactor Box16.ScaleFactor +connect Box21.Out Box24.In1 +connect Box01.boxChange Box24.In2 +connect Box24.BoxChange Box03.BoxExecute +connect Box24.BoxChange Box14.BoxExecute +connect Box24.BoxChange Box04.BoxExecute +connect Box24.BoxChange Box05.BoxExecute +connect Box24.BoxChange Box15.BoxExecute +connect Box24.BoxChange Box16.BoxExecute +connect Box01.Resolution Box13.ResolutionPlane +connect Box01.Resolution Box17.ResolutionPlane +connect Box01.Resolution Box18.ResolutionPlane +connect Box06.vtkRenderer Box23.Renderer +connect Box01.boxChange Box23.BoxExecute +connect Box11.vtkRenderer Box25.Renderer +connect Box12.vtkRenderer Box26.Renderer +connect Box20.vtkRenderer Box27.Renderer +connect Box01.boxChange Box25.BoxExecute +connect Box01.boxChange Box26.BoxExecute +connect Box01.boxChange Box27.BoxExecute +connect Box01.activeXZ Box03.Active +connect Box01.activeYZ Box04.Active +connect Box01.activeXY Box05.Active +connect Box17.outvtkdataset Box03.In +connect Box13.outvtkdataset Box04.In +connect Box18.outvtkdataset Box05.In +connect Box01.active3DYZ Box14.Active +connect Box01.active3DXZ Box15.Active +connect Box01.active3DXY Box16.Active +connect Box28.Out Box03.ExternalLut +connect Box28.Out Box04.ExternalLut +connect Box28.Out Box05.ExternalLut +connect Box28.Out Box14.ExternalLut +connect Box28.Out Box15.ExternalLut +connect Box28.Out Box16.ExternalLut + +# Complex input ports +input Point Box09.In " " +input structuredpoints Box10.In " " +input wxvtkbaseview3_2D Box12.wxVtkBaseView " " +input vtkbaseview_3D Box20.wxVtkBaseView " " +input boxExecute Box21.In " " +input wxvtkbaseview2_2D Box06.wxVtkBaseView " " +input wxvtkbaseview1_2D Box11.wxVtkBaseView " " +input lookuptable Box28.In " " + +# Complex output ports +output outwidget Box01.widget " " + + +endefine diff --git a/bbtk_creaVtk_PKG/bbs/boxes/VoiMPR-Interface.bbg b/bbtk_creaVtk_PKG/bbs/boxes/VoiMPR-Interface.bbg new file mode 100644 index 0000000..26b85e7 --- /dev/null +++ b/bbtk_creaVtk_PKG/bbs/boxes/VoiMPR-Interface.bbg @@ -0,0 +1,503 @@ +# ---------------------------------- +# - BBTKGEditor v 1.4 BBG BlackBox Diagram file +# - /home/davila/Creatis/C8/creatools_source/creaVtk/bbtk_creaVtk_PKG/bbs/boxes/VoiMPR-Interface.bbg +# ---------------------------------- + +APP_START +CATEGORY: +DESCRIPTION:Description ?? +AUTHOR:InfoDev +COMPLEXBOX:TRUE +COMPLEXBOXNAME:VoiMPR-Interface +PACKAGENAME:creaVtk +COMPLEXOUTPUTS:5 +COMPLEX_PORT +widget +-326.521643:-101.189678:-900.000000 +FIN_COMPLEX_PORT +COMPLEX_PORT +voi +-52.226473:-123.165415:-900.000000 +FIN_COMPLEX_PORT +COMPLEX_PORT +boxchange +215.834887:-129.487204:-900.000000 +FIN_COMPLEX_PORT +COMPLEX_PORT +active +-400.889574:-104.288004:-900.000000 +FIN_COMPLEX_PORT +COMPLEX_PORT +boxchangeRender +2.545632:-132.673333:-900.000000 +FIN_COMPLEX_PORT +COMPLEXINPUTS:4 +COMPLEX_PORT +Image +-168.187558:310.360283:-900.000000 +FIN_COMPLEX_PORT +COMPLEX_PORT +Execute +228.203173:299.936940:-900.000000 +FIN_COMPLEX_PORT +COMPLEX_PORT +voi_index +-66.733674:307.314091:-900.000000 +FIN_COMPLEX_PORT +COMPLEX_PORT +voi_size +55.531289:304.814600:-900.000000 +FIN_COMPLEX_PORT +BOXES:32 +BOX +creaMaracasVisu:SliderMinMax:Box03 +ISEXEC:FALSE +-183.678150:126.815992:-900.000000 +-129.198150:116.815992:-900.000000 +PORT +InMax:"500" +PORT +InMin:"0" +PORT +ShowActual:"false" +PORT +WinClose:"false" +FIN_BOX +BOX +creaMaracasVisu:SliderMinMax:Box04 +ISEXEC:FALSE +-109.661484:126.399574:-900.000000 +-55.181484:116.399574:-900.000000 +PORT +InMax:"500" +PORT +InMin:"0" +PORT +ShowActual:"false" +FIN_BOX +BOX +creaMaracasVisu:SliderMinMax:Box05 +ISEXEC:FALSE +-27.997021:123.372567:-900.000000 +26.482979:113.372567:-900.000000 +PORT +InMax:"500" +PORT +InMin:"0" +PORT +ShowActual:"false" +FIN_BOX +BOX +std:MultipleInputs:Box06 +ISEXEC:FALSE +11.096726:60.042693:-900.000000 +50.796726:50.042693:-900.000000 +FIN_BOX +BOX +std:ConcatStrings:Box07 +ISEXEC:FALSE +-119.450413:58.469239:-900.000000 +-79.725413:48.469239:-900.000000 +PORT +In2:" " +PORT +In4:" " +PORT +In6:" " +PORT +In8:" " +FIN_BOX +BOX +std:ConcatStrings:Box08 +ISEXEC:FALSE +-50.852772:55.779193:-900.000000 +-11.127772:45.779193:-900.000000 +PORT +In2:" " +PORT +In4:" " +PORT +In6:" " +FIN_BOX +BOX +std:ConcatStrings:Box09 +ISEXEC:FALSE +-64.118040:14.195593:-900.000000 +-24.393040:4.195593:-900.000000 +FIN_BOX +BOX +wx:LayoutLine:Box11 +ISEXEC:FALSE +-324.390545:-36.367861:-900.000000 +-266.830545:-46.367861:-900.000000 +FIN_BOX +BOX +vtk:ImageVtkProperties:Box30 +ISEXEC:FALSE +-180.072980:255.020330:-900.000000 +-134.722980:245.020330:-900.000000 +FIN_BOX +BOX +vtk:vtkImageDataPointerRelay:Box31 +ISEXEC:FALSE +-176.426596:278.323054:-900.000000 +-124.251596:268.323054:-900.000000 +FIN_BOX +BOX +std:GetVectorIntElement:Box32 +ISEXEC:FALSE +-195.304681:222.622717:-900.000000 +-148.854681:212.622717:-900.000000 +PORT +I:"0" +FIN_BOX +BOX +std:GetVectorIntElement:Box33 +ISEXEC:FALSE +-179.801153:204.532571:-900.000000 +-133.351153:194.532571:-900.000000 +PORT +I:"1" +FIN_BOX +BOX +std:GetVectorIntElement:Box34 +ISEXEC:FALSE +-157.681683:187.336418:-900.000000 +-111.231683:177.336418:-900.000000 +PORT +I:"2" +FIN_BOX +BOX +std:MultipleInputs:Box40 +ISEXEC:FALSE +219.080593:-45.709082:-900.000000 +258.780593:-55.709082:-900.000000 +FIN_BOX +BOX +wx:CheckBox:Box42 +ISEXEC:FALSE +-401.467596:135.181986:-900.000000 +-365.142596:125.181986:-900.000000 +PORT +In:"true" +PORT +ReactiveOnKeystroke:"true" +PORT +Title:"VOI" +FIN_BOX +BOX +wx:LayoutTab:Box21 +ISEXEC:FALSE +-339.526908:50.695036:-900.000000 +-281.966908:40.695036:-900.000000 +FIN_BOX +BOX +wx:LayoutLine:Box22 +ISEXEC:FALSE +-337.903619:76.667657:-900.000000 +-280.343619:66.667657:-900.000000 +PORT +WinTitle:"X" +FIN_BOX +BOX +wx:LayoutTab:Box23 +ISEXEC:FALSE +-270.828244:52.396144:-900.000000 +-213.268244:42.396144:-900.000000 +FIN_BOX +BOX +wx:LayoutLine:Box24 +ISEXEC:FALSE +-269.204955:78.368765:-900.000000 +-211.644955:68.368765:-900.000000 +PORT +WinTitle:"Y" +FIN_BOX +BOX +wx:LayoutTab:Box25 +ISEXEC:FALSE +-210.393596:53.802109:-900.000000 +-152.833596:43.802109:-900.000000 +FIN_BOX +BOX +wx:LayoutLine:Box26 +ISEXEC:FALSE +-208.770307:79.774730:-900.000000 +-151.210307:69.774730:-900.000000 +PORT +WinTitle:"Z" +FIN_BOX +BOX +std:MagicBox:Box28 +ISEXEC:FALSE +-77.651260:276.041682:-900.000000 +-41.576260:266.041682:-900.000000 +FIN_BOX +BOX +std:GetVectorIntElement:Box29 +ISEXEC:FALSE +-104.988021:245.650707:-900.000000 +-58.538021:235.650707:-900.000000 +PORT +ErrorValue:"0" +PORT +I:"0" +FIN_BOX +BOX +std:GetVectorIntElement:Box35 +ISEXEC:FALSE +-93.858256:230.924994:-900.000000 +-47.408256:220.924994:-900.000000 +PORT +ErrorValue:"0" +PORT +I:"1" +FIN_BOX +BOX +std:GetVectorIntElement:Box36 +ISEXEC:FALSE +-76.112550:216.420388:-900.000000 +-29.662550:206.420388:-900.000000 +PORT +ErrorValue:"0" +PORT +I:"2" +FIN_BOX +BOX +std:MagicBox:Box38 +ISEXEC:FALSE +46.647627:278.729926:-900.000000 +82.722627:268.729926:-900.000000 +FIN_BOX +BOX +std:GetVectorIntElement:Box39 +ISEXEC:FALSE +6.630210:191.808399:-900.000000 +53.080210:181.808399:-900.000000 +PORT +ErrorValue:"0" +PORT +I:"0" +FIN_BOX +BOX +std:GetVectorIntElement:Box41 +ISEXEC:FALSE +16.775677:172.478119:-900.000000 +63.225677:162.478119:-900.000000 +PORT +ErrorValue:"0" +PORT +I:"1" +FIN_BOX +BOX +std:GetVectorIntElement:Box43 +ISEXEC:FALSE +29.780635:150.315924:-900.000000 +76.230635:140.315924:-900.000000 +PORT +ErrorValue:"0" +PORT +I:"2" +FIN_BOX +BOX +std:MathOperationVector:Box44 +ISEXEC:FALSE +43.734256:246.293026:-900.000000 +91.259256:236.293026:-900.000000 +PORT +Type:"0" +FIN_BOX +BOX +wx:OutputText:Box45 +ISEXEC:FALSE +-293.423390:154.955039:-900.000000 +-256.648390:144.955039:-900.000000 +FIN_BOX +BOX +wx:OutputText:Box46 +ISEXEC:FALSE +-251.928697:138.682746:-900.000000 +-215.153697:128.682746:-900.000000 +FIN_BOX +CONNECTIONS:60 +CONNECTION +Box03:BoxChange:Box06:In1 +NumberOfControlPoints:0 +CONNECTION +Box04:BoxChange:Box06:In2 +NumberOfControlPoints:0 +CONNECTION +Box05:BoxChange:Box06:In3 +NumberOfControlPoints:0 +CONNECTION +Box07:Out:Box09:In1 +NumberOfControlPoints:0 +CONNECTION +Box08:Out:Box09:In10 +NumberOfControlPoints:0 +CONNECTION +Box03:OutStart:Box07:In1 +NumberOfControlPoints:0 +CONNECTION +Box03:OutEnd:Box07:In3 +NumberOfControlPoints:0 +CONNECTION +Box04:OutStart:Box07:In5 +NumberOfControlPoints:0 +CONNECTION +Box04:OutEnd:Box07:In7 +NumberOfControlPoints:0 +CONNECTION +Box05:OutStart:Box08:In1 +NumberOfControlPoints:0 +CONNECTION +Box05:OutEnd:Box08:In3 +NumberOfControlPoints:0 +CONNECTION +Box31:Out:Box30:In +NumberOfControlPoints:0 +CONNECTION +Box30:Size:Box32:In +NumberOfControlPoints:0 +CONNECTION +Box30:Size:Box33:In +NumberOfControlPoints:0 +CONNECTION +Box30:Size:Box34:In +NumberOfControlPoints:0 +CONNECTION +Box06:BoxChange:Box40:In1 +NumberOfControlPoints:0 +CONNECTION +Box42:Widget:Box11:Widget1 +NumberOfControlPoints:0 +CONNECTION +Box42:BoxChange:Box06:In4 +NumberOfControlPoints:0 +CONNECTION +Image:Image:Box31:In +NumberOfControlPoints:0 +CONNECTION +Box11:Widget:widget:widget +NumberOfControlPoints:0 +CONNECTION +Execute:Execute:Box40:In2 +NumberOfControlPoints:0 +CONNECTION +Box40:BoxChange:boxchange:boxchange +NumberOfControlPoints:0 +CONNECTION +Box42:Out:active:active +NumberOfControlPoints:0 +CONNECTION +Box06:BoxChange:boxchangeRender:boxchangeRender +NumberOfControlPoints:0 +CONNECTION +Box09:Out:voi:voi +NumberOfControlPoints:0 +CONNECTION +Box22:Widget:Box21:Widget1 +NumberOfControlPoints:0 +CONNECTION +Box03:Widget:Box22:Widget1 +NumberOfControlPoints:0 +CONNECTION +Box21:Widget:Box11:Widget3 +NumberOfControlPoints:0 +CONNECTION +Box24:Widget:Box23:Widget1 +NumberOfControlPoints:0 +CONNECTION +Box04:Widget:Box24:Widget1 +NumberOfControlPoints:0 +CONNECTION +Box23:Widget:Box11:Widget5 +NumberOfControlPoints:0 +CONNECTION +Box26:Widget:Box25:Widget1 +NumberOfControlPoints:0 +CONNECTION +Box25:Widget:Box11:Widget8 +NumberOfControlPoints:0 +CONNECTION +Box05:Widget:Box26:Widget1 +NumberOfControlPoints:0 +CONNECTION +voi_index:voi_index:Box28:In +NumberOfControlPoints:0 +CONNECTION +Box28:Out:Box29:In +NumberOfControlPoints:0 +CONNECTION +Box28:Out:Box35:In +NumberOfControlPoints:0 +CONNECTION +Box28:Out:Box36:In +NumberOfControlPoints:0 +CONNECTION +voi_size:voi_size:Box38:In +NumberOfControlPoints:0 +CONNECTION +Box32:Out:Box39:ErrorValue +NumberOfControlPoints:0 +CONNECTION +Box33:Out:Box41:ErrorValue +NumberOfControlPoints:0 +CONNECTION +Box34:Out:Box43:ErrorValue +NumberOfControlPoints:0 +CONNECTION +Box38:Out:Box44:In0 +NumberOfControlPoints:0 +CONNECTION +Box28:Out:Box44:In1 +NumberOfControlPoints:0 +CONNECTION +Box44:Out:Box39:In +NumberOfControlPoints:0 +CONNECTION +Box44:Out:Box41:In +NumberOfControlPoints:0 +CONNECTION +Box44:Out:Box43:In +NumberOfControlPoints:0 +CONNECTION +Box29:Out:Box03:InMinShow +NumberOfControlPoints:0 +CONNECTION +Box35:Out:Box04:InMinShow +NumberOfControlPoints:0 +CONNECTION +Box36:Out:Box05:InMinShow +NumberOfControlPoints:0 +CONNECTION +Box39:Out:Box03:InMaxShow +NumberOfControlPoints:0 +CONNECTION +Box41:Out:Box04:InMaxShow +NumberOfControlPoints:0 +CONNECTION +Box43:Out:Box05:InMaxShow +NumberOfControlPoints:0 +CONNECTION +Box32:Out:Box03:InMax +NumberOfControlPoints:0 +CONNECTION +Box33:Out:Box04:InMax +NumberOfControlPoints:0 +CONNECTION +Box34:Out:Box05:InMax +NumberOfControlPoints:0 +CONNECTION +Box45:Widget:Box22:Widget3 +NumberOfControlPoints:0 +CONNECTION +Box28:Out:Box45:In +NumberOfControlPoints:0 +CONNECTION +Box38:Out:Box46:In +NumberOfControlPoints:0 +CONNECTION +Box46:Widget:Box24:Widget3 +NumberOfControlPoints:0 +APP_END diff --git a/bbtk_creaVtk_PKG/bbs/boxes/VoiMPR-Interface.bbs b/bbtk_creaVtk_PKG/bbs/boxes/VoiMPR-Interface.bbs new file mode 100644 index 0000000..252e661 --- /dev/null +++ b/bbtk_creaVtk_PKG/bbs/boxes/VoiMPR-Interface.bbs @@ -0,0 +1,190 @@ +# ---------------------------------- +# - BBTKGEditor v 1.4 BBS BlackBox Script (Complex Box) +# - /home/davila/Creatis/C8/creatools_source/creaVtk/bbtk_creaVtk_PKG/bbs/boxes/VoiMPR-Interface.bbs +# ---------------------------------- + +include std +include itkvtk +include creaMaracasVisu +include std +include wx +include vtk + +define VoiMPR-Interface creaVtk + +author "InfoDev" +description "Description ??" + +category "" + +new creaMaracasVisu:SliderMinMax Box03 + set Box03.InMax "500" + set Box03.InMin "0" + set Box03.ShowActual "false" + set Box03.WinClose "false" + +new creaMaracasVisu:SliderMinMax Box04 + set Box04.InMax "500" + set Box04.InMin "0" + set Box04.ShowActual "false" + +new creaMaracasVisu:SliderMinMax Box05 + set Box05.InMax "500" + set Box05.InMin "0" + set Box05.ShowActual "false" + +new std:MultipleInputs Box06 + +new std:ConcatStrings Box07 + set Box07.In2 " " + set Box07.In4 " " + set Box07.In6 " " + set Box07.In8 " " + +new std:ConcatStrings Box08 + set Box08.In2 " " + set Box08.In4 " " + set Box08.In6 " " + +new std:ConcatStrings Box09 + +new wx:LayoutLine Box11 + +new vtk:ImageVtkProperties Box30 + +new vtk:vtkImageDataPointerRelay Box31 + +new std:GetVectorIntElement Box32 + set Box32.I "0" + +new std:GetVectorIntElement Box33 + set Box33.I "1" + +new std:GetVectorIntElement Box34 + set Box34.I "2" + +new std:MultipleInputs Box40 + +new wx:CheckBox Box42 + set Box42.In "true" + set Box42.ReactiveOnKeystroke "true" + set Box42.Title "VOI" + +new wx:LayoutTab Box21 + +new wx:LayoutLine Box22 + set Box22.WinTitle "X" + +new wx:LayoutTab Box23 + +new wx:LayoutLine Box24 + set Box24.WinTitle "Y" + +new wx:LayoutTab Box25 + +new wx:LayoutLine Box26 + set Box26.WinTitle "Z" + +new std:MagicBox Box28 + +new std:GetVectorIntElement Box29 + set Box29.ErrorValue "0" + set Box29.I "0" + +new std:GetVectorIntElement Box35 + set Box35.ErrorValue "0" + set Box35.I "1" + +new std:GetVectorIntElement Box36 + set Box36.ErrorValue "0" + set Box36.I "2" + +new std:MagicBox Box38 + +new std:GetVectorIntElement Box39 + set Box39.ErrorValue "0" + set Box39.I "0" + +new std:GetVectorIntElement Box41 + set Box41.ErrorValue "0" + set Box41.I "1" + +new std:GetVectorIntElement Box43 + set Box43.ErrorValue "0" + set Box43.I "2" + +new std:MathOperationVector Box44 + set Box44.Type "0" + +new wx:OutputText Box45 + +new wx:OutputText Box46 + + +connect Box03.BoxChange Box06.In1 +connect Box04.BoxChange Box06.In2 +connect Box05.BoxChange Box06.In3 +connect Box07.Out Box09.In1 +connect Box08.Out Box09.In10 +connect Box03.OutStart Box07.In1 +connect Box03.OutEnd Box07.In3 +connect Box04.OutStart Box07.In5 +connect Box04.OutEnd Box07.In7 +connect Box05.OutStart Box08.In1 +connect Box05.OutEnd Box08.In3 +connect Box31.Out Box30.In +connect Box30.Size Box32.In +connect Box30.Size Box33.In +connect Box30.Size Box34.In +connect Box06.BoxChange Box40.In1 +connect Box42.Widget Box11.Widget1 +connect Box42.BoxChange Box06.In4 +connect Box22.Widget Box21.Widget1 +connect Box03.Widget Box22.Widget1 +connect Box21.Widget Box11.Widget3 +connect Box24.Widget Box23.Widget1 +connect Box04.Widget Box24.Widget1 +connect Box23.Widget Box11.Widget5 +connect Box26.Widget Box25.Widget1 +connect Box25.Widget Box11.Widget8 +connect Box05.Widget Box26.Widget1 +connect Box28.Out Box29.In +connect Box28.Out Box35.In +connect Box28.Out Box36.In +connect Box32.Out Box39.ErrorValue +connect Box33.Out Box41.ErrorValue +connect Box34.Out Box43.ErrorValue +connect Box38.Out Box44.In0 +connect Box28.Out Box44.In1 +connect Box44.Out Box39.In +connect Box44.Out Box41.In +connect Box44.Out Box43.In +connect Box29.Out Box03.InMinShow +connect Box35.Out Box04.InMinShow +connect Box36.Out Box05.InMinShow +connect Box39.Out Box03.InMaxShow +connect Box41.Out Box04.InMaxShow +connect Box43.Out Box05.InMaxShow +connect Box32.Out Box03.InMax +connect Box33.Out Box04.InMax +connect Box34.Out Box05.InMax +connect Box45.Widget Box22.Widget3 +connect Box28.Out Box45.In +connect Box38.Out Box46.In +connect Box46.Widget Box24.Widget3 + +# Complex input ports +input Image Box31.In " " +input Execute Box40.In2 " " +input voi_index Box28.In " " +input voi_size Box38.In " " + +# Complex output ports +output widget Box11.Widget " " +output boxchange Box40.BoxChange " " +output active Box42.Out " " +output boxchangeRender Box06.BoxChange " " +output voi Box09.Out " " + + +endefine diff --git a/bbtk_creaVtk_PKG/bbs/boxes/VoiMPR-Widget.bbg b/bbtk_creaVtk_PKG/bbs/boxes/VoiMPR-Widget.bbg new file mode 100644 index 0000000..27023b6 --- /dev/null +++ b/bbtk_creaVtk_PKG/bbs/boxes/VoiMPR-Widget.bbg @@ -0,0 +1,365 @@ +# ---------------------------------- +# - BBTKGEditor v 1.4 BBG BlackBox Diagram file +# - /home/davila/Creatis/C8/creatools_source/creaVtk/bbtk_creaVtk_PKG/bbs/boxes/VoiMPR-Widget.bbg +# ---------------------------------- + +APP_START +CATEGORY: +DESCRIPTION:Description ?? +AUTHOR:InfoDev +COMPLEXBOX:TRUE +COMPLEXBOXNAME:VoiMPR-Widget +PACKAGENAME:creaVtk +COMPLEXOUTPUTS:5 +COMPLEX_PORT +Widget +353.092211:-318.865448:-900.000000 +FIN_COMPLEX_PORT +COMPLEX_PORT +Voi +301.480796:-312.026931:-900.000000 +FIN_COMPLEX_PORT +COMPLEX_PORT +boxchangeInterface +271.395421:-312.977644:-900.000000 +FIN_COMPLEX_PORT +COMPLEX_PORT +index +-110.981909:-314.679525:-900.000000 +FIN_COMPLEX_PORT +COMPLEX_PORT +size +182.155431:-324.218825:-900.000000 +FIN_COMPLEX_PORT +COMPLEXINPUTS:8 +COMPLEX_PORT +execute +202.846948:77.379235:-900.000000 +FIN_COMPLEX_PORT +COMPLEX_PORT +image +-67.836074:80.479216:-900.000000 +FIN_COMPLEX_PORT +COMPLEX_PORT +Point +-10.598806:80.481110:-900.000000 +FIN_COMPLEX_PORT +COMPLEX_PORT +RenderXY +14.170076:78.107701:-900.000000 +FIN_COMPLEX_PORT +COMPLEX_PORT +RenderYZ +100.261163:77.448973:-900.000000 +FIN_COMPLEX_PORT +COMPLEX_PORT +RenderXZ +66.284345:75.805900:-900.000000 +FIN_COMPLEX_PORT +COMPLEX_PORT +VoiIndex +244.843857:77.603342:-900.000000 +FIN_COMPLEX_PORT +COMPLEX_PORT +VoiSize +262.608573:76.578085:-900.000000 +FIN_COMPLEX_PORT +BOXES:21 +BOX +creaVtk:VoiMPR-Interface:Box01 +ISEXEC:FALSE +212.804711:4.373404:-900.000000 +255.904711:-5.626596:-900.000000 +FIN_BOX +BOX +creaVtk:VoiMPR:Box02 +ISEXEC:FALSE +-18.111927:-109.039110:-900.000000 +15.438073:-119.039110:-900.000000 +FIN_BOX +BOX +vtk:UpdateRender:Box03 +ISEXEC:FALSE +351.163040:-97.770139:-900.000000 +391.488040:-107.770139:-900.000000 +PORT +Active:"true" +FIN_BOX +BOX +std:MagicBox:Box04 +ISEXEC:FALSE +9.484851:49.900219:-900.000000 +45.559851:39.900219:-900.000000 +FIN_BOX +BOX +std:MagicBox:Box05 +ISEXEC:FALSE +48.870651:49.674678:-900.000000 +84.945651:39.674678:-900.000000 +FIN_BOX +BOX +std:MagicBox:Box06 +ISEXEC:FALSE +90.898503:48.874788:-900.000000 +126.973503:38.874788:-900.000000 +FIN_BOX +BOX +vtk:UpdateRender:Box07 +ISEXEC:FALSE +406.438779:-97.452724:-900.000000 +446.763779:-107.452724:-900.000000 +PORT +Active:"true" +FIN_BOX +BOX +vtk:UpdateRender:Box08 +ISEXEC:FALSE +450.234362:-96.323828:-900.000000 +490.559362:-106.323828:-900.000000 +PORT +Active:"true" +FIN_BOX +BOX +std:ConcatStrings:Box09 +ISEXEC:FALSE +-116.019206:-196.232084:-900.000000 +-76.294206:-206.232084:-900.000000 +PORT +In2:" " +PORT +In4:" " +FIN_BOX +BOX +std:GetVectorIntElement:Box10 +ISEXEC:FALSE +-6.890515:-136.473014:-900.000000 +39.559485:-146.473014:-900.000000 +PORT +I:"0" +FIN_BOX +BOX +std:ConcatStrings:Box14 +ISEXEC:FALSE +157.607448:-247.695413:-900.000000 +197.332448:-257.695413:-900.000000 +PORT +In2:" " +PORT +In4:" " +FIN_BOX +BOX +std:MathOperation:Box15 +ISEXEC:FALSE +3.807182:-195.312415:-900.000000 +44.857182:-205.312415:-900.000000 +PORT +Type:"1" +FIN_BOX +BOX +std:GetVectorIntElement:Box16 +ISEXEC:FALSE +47.213814:-137.759972:-900.000000 +93.663814:-147.759972:-900.000000 +PORT +I:"1" +FIN_BOX +BOX +std:GetVectorIntElement:Box17 +ISEXEC:FALSE +128.705901:-136.782115:-900.000000 +175.155901:-146.782115:-900.000000 +PORT +I:"2" +FIN_BOX +BOX +std:MathOperation:Box18 +ISEXEC:FALSE +162.348219:-197.941357:-900.000000 +203.398219:-207.941357:-900.000000 +PORT +Type:"1" +FIN_BOX +BOX +std:GetVectorIntElement:Box19 +ISEXEC:FALSE +180.079360:-136.525745:-900.000000 +226.529360:-146.525745:-900.000000 +PORT +I:"3" +FIN_BOX +BOX +std:GetVectorIntElement:Box20 +ISEXEC:FALSE +297.542452:-134.964985:-900.000000 +343.992452:-144.964985:-900.000000 +PORT +I:"4" +FIN_BOX +BOX +std:MathOperation:Box21 +ISEXEC:FALSE +307.499788:-193.961686:-900.000000 +348.549788:-203.961686:-900.000000 +PORT +Type:"1" +FIN_BOX +BOX +std:GetVectorIntElement:Box22 +ISEXEC:FALSE +358.601996:-135.005921:-900.000000 +405.051996:-145.005921:-900.000000 +PORT +I:"5" +FIN_BOX +BOX +vtk:vtkImageDataPointerRelay:Box23 +ISEXEC:FALSE +-80.401182:48.734170:-900.000000 +-28.226182:38.734170:-900.000000 +FIN_BOX +BOX +vtk:ImageVtkProperties:Box24 +ISEXEC:FALSE +-87.393532:-45.289394:-900.000000 +-42.043532:-55.289394:-900.000000 +FIN_BOX +CONNECTIONS:46 +CONNECTION +execute:execute:Box01:Execute +NumberOfControlPoints:0 +CONNECTION +Box01:active:Box02:Active +NumberOfControlPoints:0 +CONNECTION +Box01:boxchange:Box02:BoxExecute +NumberOfControlPoints:0 +CONNECTION +Box01:voi:Box02:In +NumberOfControlPoints:0 +CONNECTION +Box01:widget:Widget:Widget +NumberOfControlPoints:0 +CONNECTION +Box01:voi:Voi:Voi +NumberOfControlPoints:0 +CONNECTION +RenderXY:RenderXY:Box04:In +NumberOfControlPoints:0 +CONNECTION +Box04:Out:Box02:XYrender +NumberOfControlPoints:0 +CONNECTION +RenderXZ:RenderXZ:Box05:In +NumberOfControlPoints:0 +CONNECTION +Box05:Out:Box02:XZrender +NumberOfControlPoints:0 +CONNECTION +Box04:Out:Box03:Renderer +NumberOfControlPoints:0 +CONNECTION +RenderYZ:RenderYZ:Box06:In +NumberOfControlPoints:0 +CONNECTION +Box06:Out:Box02:YZrender +NumberOfControlPoints:0 +CONNECTION +Box05:Out:Box07:Renderer +NumberOfControlPoints:0 +CONNECTION +Box06:Out:Box08:Renderer +NumberOfControlPoints:0 +CONNECTION +Box01:boxchangeRender:Box03:BoxExecute +NumberOfControlPoints:0 +CONNECTION +Box01:boxchangeRender:Box07:BoxExecute +NumberOfControlPoints:0 +CONNECTION +Box01:boxchangeRender:Box08:BoxExecute +NumberOfControlPoints:0 +CONNECTION +Box01:boxchangeRender:boxchangeInterface:boxchangeInterface +NumberOfControlPoints:0 +CONNECTION +Box01:voi:Box10:In +NumberOfControlPoints:0 +CONNECTION +Box10:Out:Box09:In1 +NumberOfControlPoints:0 +CONNECTION +Box09:Out:index:index +NumberOfControlPoints:0 +CONNECTION +Box01:voi:Box16:In +NumberOfControlPoints:0 +CONNECTION +Box16:Out:Box15:In1 +NumberOfControlPoints:0 +CONNECTION +Box10:Out:Box15:In2 +NumberOfControlPoints:0 +CONNECTION +Box19:Out:Box18:In1 +NumberOfControlPoints:0 +CONNECTION +Box17:Out:Box18:In2 +NumberOfControlPoints:0 +CONNECTION +Box22:Out:Box21:In1 +NumberOfControlPoints:0 +CONNECTION +Box20:Out:Box21:In2 +NumberOfControlPoints:0 +CONNECTION +Box17:Out:Box09:In3 +NumberOfControlPoints:0 +CONNECTION +Box20:Out:Box09:In5 +NumberOfControlPoints:0 +CONNECTION +Box15:Out:Box14:In1 +NumberOfControlPoints:0 +CONNECTION +Box18:Out:Box14:In3 +NumberOfControlPoints:0 +CONNECTION +Box21:Out:Box14:In5 +NumberOfControlPoints:0 +CONNECTION +Box01:voi:Box17:In +NumberOfControlPoints:0 +CONNECTION +Box01:voi:Box19:In +NumberOfControlPoints:0 +CONNECTION +Box01:voi:Box20:In +NumberOfControlPoints:0 +CONNECTION +Box01:voi:Box22:In +NumberOfControlPoints:0 +CONNECTION +Box14:Out:size:size +NumberOfControlPoints:0 +CONNECTION +Point:Point:Box02:ActualPoint +NumberOfControlPoints:0 +CONNECTION +image:image:Box23:In +NumberOfControlPoints:0 +CONNECTION +Box23:Out:Box01:Image +NumberOfControlPoints:0 +CONNECTION +Box23:Out:Box24:In +NumberOfControlPoints:0 +CONNECTION +Box24:Spacing:Box02:Spacing +NumberOfControlPoints:0 +CONNECTION +VoiIndex:VoiIndex:Box01:voi_index +NumberOfControlPoints:0 +CONNECTION +VoiSize:VoiSize:Box01:voi_size +NumberOfControlPoints:0 +APP_END diff --git a/bbtk_creaVtk_PKG/bbs/boxes/VoiMPR-Widget.bbs b/bbtk_creaVtk_PKG/bbs/boxes/VoiMPR-Widget.bbs new file mode 100644 index 0000000..0de727b --- /dev/null +++ b/bbtk_creaVtk_PKG/bbs/boxes/VoiMPR-Widget.bbs @@ -0,0 +1,130 @@ +# ---------------------------------- +# - BBTKGEditor v 1.4 BBS BlackBox Script (Complex Box) +# - /home/davila/Creatis/C8/creatools_source/creaVtk/bbtk_creaVtk_PKG/bbs/boxes/VoiMPR-Widget.bbs +# ---------------------------------- + +include std +include itkvtk +include creaVtk +include vtk +include std + +define VoiMPR-Widget creaVtk + +author "InfoDev" +description "Description ??" + +category "" + +new creaVtk:VoiMPR-Interface Box01 + +new creaVtk:VoiMPR Box02 + +new vtk:UpdateRender Box03 + set Box03.Active "true" + +new std:MagicBox Box04 + +new std:MagicBox Box05 + +new std:MagicBox Box06 + +new vtk:UpdateRender Box07 + set Box07.Active "true" + +new vtk:UpdateRender Box08 + set Box08.Active "true" + +new std:ConcatStrings Box09 + set Box09.In2 " " + set Box09.In4 " " + +new std:GetVectorIntElement Box10 + set Box10.I "0" + +new std:ConcatStrings Box14 + set Box14.In2 " " + set Box14.In4 " " + +new std:MathOperation Box15 + set Box15.Type "1" + +new std:GetVectorIntElement Box16 + set Box16.I "1" + +new std:GetVectorIntElement Box17 + set Box17.I "2" + +new std:MathOperation Box18 + set Box18.Type "1" + +new std:GetVectorIntElement Box19 + set Box19.I "3" + +new std:GetVectorIntElement Box20 + set Box20.I "4" + +new std:MathOperation Box21 + set Box21.Type "1" + +new std:GetVectorIntElement Box22 + set Box22.I "5" + +new vtk:vtkImageDataPointerRelay Box23 + +new vtk:ImageVtkProperties Box24 + + +connect Box01.active Box02.Active +connect Box01.boxchange Box02.BoxExecute +connect Box01.voi Box02.In +connect Box04.Out Box02.XYrender +connect Box05.Out Box02.XZrender +connect Box04.Out Box03.Renderer +connect Box06.Out Box02.YZrender +connect Box05.Out Box07.Renderer +connect Box06.Out Box08.Renderer +connect Box01.boxchangeRender Box03.BoxExecute +connect Box01.boxchangeRender Box07.BoxExecute +connect Box01.boxchangeRender Box08.BoxExecute +connect Box01.voi Box10.In +connect Box10.Out Box09.In1 +connect Box01.voi Box16.In +connect Box16.Out Box15.In1 +connect Box10.Out Box15.In2 +connect Box19.Out Box18.In1 +connect Box17.Out Box18.In2 +connect Box22.Out Box21.In1 +connect Box20.Out Box21.In2 +connect Box17.Out Box09.In3 +connect Box20.Out Box09.In5 +connect Box15.Out Box14.In1 +connect Box18.Out Box14.In3 +connect Box21.Out Box14.In5 +connect Box01.voi Box17.In +connect Box01.voi Box19.In +connect Box01.voi Box20.In +connect Box01.voi Box22.In +connect Box23.Out Box01.Image +connect Box23.Out Box24.In +connect Box24.Spacing Box02.Spacing + +# Complex input ports +input execute Box01.Execute " " +input RenderXY Box04.In " " +input RenderXZ Box05.In " " +input RenderYZ Box06.In " " +input Point Box02.ActualPoint " " +input image Box23.In " " +input VoiIndex Box01.voi_index " " +input VoiSize Box01.voi_size " " + +# Complex output ports +output Widget Box01.widget " " +output Voi Box01.voi " " +output boxchangeInterface Box01.boxchangeRender " " +output index Box09.Out " " +output size Box14.Out " " + + +endefine diff --git a/bbtk_creaVtk_PKG/src/bbcreaVtkActor.cxx b/bbtk_creaVtk_PKG/src/bbcreaVtkActor.cxx index 6b00248..2d52f39 100644 --- a/bbtk_creaVtk_PKG/src/bbcreaVtkActor.cxx +++ b/bbtk_creaVtk_PKG/src/bbcreaVtkActor.cxx @@ -33,36 +33,43 @@ void Actor::Process() // std::cout << "Output value = " <GetClassName(); - std::string wantedClass = "vtkOpenGLActor"; - if(className == wantedClass) - { - ((vtkActor*)vtkprop3D)->GetProperty()->SetOpacity( bbGetInputOpacity() ); - } - - if ( bbGetInputTransform()!=NULL ) - { - vtkprop3D->SetUserTransform( bbGetInputTransform() ); - } - -// bbSetOutputOut( vtkactor ); - - // Interface Update - - if ((bbGetInputRenderer()!=NULL) && ( backActive!=bbGetInputActive() )) + if (bbGetInputIn()!=NULL) { - - if (bbGetInputActive()==true ) - { - bbGetInputRenderer()->AddActor( vtkprop3D ); - } else { - bbGetInputRenderer()->RemoveActor( vtkprop3D ); - } //if Active - backActive=bbGetInputActive(); - } // if Renderer + vtkProp3D* vtkprop3D=bbGetInputIn(); + std::string className = vtkprop3D->GetClassName(); + std::string wantedClass = "vtkOpenGLActor"; + if(className == wantedClass) + { + vtkActor *vtkactor=((vtkActor*)vtkprop3D); + vtkactor->GetProperty()->SetOpacity( bbGetInputOpacity() ); + vtkactor->GetProperty()->SetLineWidth( bbGetInputLineWidth() ); + double r = bbGetInputColor()[0]; + double g = bbGetInputColor()[1]; + double b = bbGetInputColor()[2]; + vtkactor->GetProperty()->SetColor( r,g,b ); + } + + if ( bbGetInputTransform()!=NULL ) + { + vtkprop3D->SetUserTransform( bbGetInputTransform() ); + } + + // bbSetOutputOut( vtkactor ); + + // Interface Update + + if ((bbGetInputRenderer()!=NULL) && ( backActive!=bbGetInputActive() )) + { + + if (bbGetInputActive()==true ) + { + bbGetInputRenderer()->AddActor( vtkprop3D ); + } else { + bbGetInputRenderer()->RemoveActor( vtkprop3D ); + } //if Active + backActive=bbGetInputActive(); + } // if Renderer + }// bbGetInputIn } //===== @@ -73,11 +80,18 @@ void Actor::bbUserSetDefaultValues() // SET HERE THE DEFAULT INPUT/OUTPUT VALUES OF YOUR BOX // Here we initialize the input 'In' to 0 - bbSetInputActive(false); - backActive=bbGetInputActive(); - bbSetInputIn(NULL); - bbSetInputOpacity(1); - bbSetInputRenderer(NULL); + + std::vector color; + color.push_back(1); + color.push_back(0); + color.push_back(0); + bbSetInputActive( false ); + backActive=bbGetInputActive(); + bbSetInputIn( NULL ); + bbSetInputOpacity( 1 ); + bbSetInputLineWidth( 0.5 ); + bbSetInputRenderer( NULL ); + bbSetInputColor( color ); } //===== diff --git a/bbtk_creaVtk_PKG/src/bbcreaVtkActor.h b/bbtk_creaVtk_PKG/src/bbcreaVtkActor.h index 405369f..101b2ab 100644 --- a/bbtk_creaVtk_PKG/src/bbcreaVtkActor.h +++ b/bbtk_creaVtk_PKG/src/bbcreaVtkActor.h @@ -25,6 +25,8 @@ class bbcreaVtk_EXPORT Actor BBTK_DECLARE_INPUT(Active,bool); BBTK_DECLARE_INPUT(In,vtkProp3D*); BBTK_DECLARE_INPUT(Opacity,double); + BBTK_DECLARE_INPUT(Color,std::vector); + BBTK_DECLARE_INPUT(LineWidth,double); BBTK_DECLARE_INPUT(Transform,vtkTransform*); BBTK_DECLARE_INPUT(Renderer,vtkRenderer*); // BBTK_DECLARE_OUTPUT(Out,double); @@ -46,6 +48,8 @@ BBTK_BEGIN_DESCRIBE_BLACK_BOX(Actor,bbtk::AtomicBlackBox); BBTK_INPUT(Actor,Active,"Active true/false (default false)",bool,""); BBTK_INPUT(Actor,In,"First input",vtkProp3D*,""); BBTK_INPUT(Actor,Opacity,"Opacity 0..1 (default 1)",double,""); + BBTK_INPUT(Actor,Color,"(default [1 0 0]red ) RGB color vector [0..1, 0..1, 0..1] )", std::vector,""); + BBTK_INPUT(Actor,LineWidth,"(default 0.5 ) With ligne )",double,""); BBTK_INPUT(Actor,Renderer,"Renderer",vtkRenderer*,""); // BBTK_OUTPUT(Actor,Out,"First output",double,""); diff --git a/bbtk_creaVtk_PKG/src/bbcreaVtkApplyMask.cxx b/bbtk_creaVtk_PKG/src/bbcreaVtkApplyMask.cxx new file mode 100644 index 0000000..8d34691 --- /dev/null +++ b/bbtk_creaVtk_PKG/src/bbcreaVtkApplyMask.cxx @@ -0,0 +1,183 @@ +//===== +// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost) +//===== +#include "bbcreaVtkApplyMask.h" +#include "bbcreaVtkPackage.h" + +#include "creaVtk_MACROS.h" + +namespace bbcreaVtk +{ + +BBTK_ADD_BLACK_BOX_TO_PACKAGE(creaVtk,ApplyMask) +BBTK_BLACK_BOX_IMPLEMENTATION(ApplyMask,bbtk::AtomicBlackBox); +//===== +// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost) +//===== +void ApplyMask::Process() +{ + +// THE MAIN PROCESSING METHOD BODY +// Here we simply set the input 'In' value to the output 'Out' +// And print out the output value +// INPUT/OUTPUT ACCESSORS ARE OF THE FORM : +// void bbSet{Input|Output}NAME(const TYPE&) +// const TYPE& bbGet{Input|Output}NAME() const +// Where : +// * NAME is the name of the input/output +// (the one provided in the attribute 'name' of the tag 'input') +// * TYPE is the C++ type of the input/output +// (the one provided in the attribute 'type' of the tag 'input') + +// bbSetOutputOut( bbGetInputIn() ); +// std::cout << "Output value = " <GetExtent( extImage ); + bbGetInputImage()->GetExtent( extMask ); + int dimXImage = extImage[1]-extImage[0]+1; + int dimYImage = extImage[3]-extImage[2]+1; + int dimZImage = extImage[5]-extImage[4]+1; + int dimXMask = extMask[1]-extMask[0]+1; + int dimYMask = extMask[3]-extMask[2]+1; + int dimZMask = extMask[5]-extMask[4]+1; + double background = bbGetInputBackground(); + double bgToAnalice = bbGetInputBackgroundToAnalice(); + + if (bbGetInputType()==0) + { + if (bbGetOutputOut()!=NULL) + { + bbGetOutputOut()->Delete(); + } + + resultImage = vtkImageData::New(); + resultImage->Initialize(); + resultImage->SetSpacing( bbGetInputImage()->GetSpacing() ); + resultImage->SetDimensions( dimXImage, dimYImage, dimZImage ); + resultImage->AllocateScalars( bbGetInputImage()->GetScalarType(),1 ); + } // if Type==0 + + if (bbGetInputType()==1) + { + resultImage=bbGetInputImage(); + } // if Type==1 + + if (bbGetInputType()==2) + { + resultImage=bbGetInputImage(); + } // if Type==2 + + if (bbGetInputType()==3) + { + resultImage=bbGetInputImage(); + } // if Type==3 + + + if ((dimXImage==dimXMask) && + (dimYImage==dimYMask) && + (dimZImage==dimZMask)) + { + long int i, size = dimXImage * dimYImage * dimZImage; + DEF_POINTER_IMAGE_VTK_CREA(vI,ssI,pI,stI, bbGetInputImage() ); + DEF_POINTER_IMAGE_VTK_CREA(vM,ssM,pM,stM, bbGetInputMask() ); + DEF_POINTER_IMAGE_VTK_CREA(vO,ssO,pO,stO, resultImage ); +long int k1omp=(double)(size-1)*0.0; +long int k2omp=(double)(size-1)*0.2; +long int k3omp=(double)(size-1)*0.4; +long int k4omp=(double)(size-1)*0.6; +long int k5omp=(double)(size-1)*0.8; +long int k6omp=(double)(size-1)*1.0; +printf("EED ApplyMask::Process (with openmp)\n"); + #pragma omp parallel for + for (i=0; iModified(); + bbSetOutputOut( resultImage ); + } // if Image && Mask +} +//===== +// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost) +//===== +void ApplyMask::bbUserSetDefaultValues() +{ + +// SET HERE THE DEFAULT INPUT/OUTPUT VALUES OF YOUR BOX +// Here we initialize the input 'In' to 0 + bbSetInputImage(NULL); + bbSetInputMask(NULL); + bbSetInputBackground(0); // output image Type 0 + bbSetInputBackgroundToAnalice(0); + bbSetInputLabel(255); + bbSetInputType(0); + bbSetOutputOut(NULL); + +} +//===== +// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost) +//===== +void ApplyMask::bbUserInitializeProcessing() +{ + +// THE INITIALIZATION METHOD BODY : +// Here does nothing +// but this is where you should allocate the internal/output pointers +// if any + + +} +//===== +// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost) +//===== +void ApplyMask::bbUserFinalizeProcessing() +{ + +// THE FINALIZATION METHOD BODY : +// Here does nothing +// but this is where you should desallocate the internal/output pointers +// if any + +} +} +// EO namespace bbcreaVtk + + diff --git a/bbtk_creaVtk_PKG/src/bbcreaVtkApplyMask.h b/bbtk_creaVtk_PKG/src/bbcreaVtkApplyMask.h new file mode 100644 index 0000000..ead804f --- /dev/null +++ b/bbtk_creaVtk_PKG/src/bbcreaVtkApplyMask.h @@ -0,0 +1,57 @@ +//===== +// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost) +//===== +#ifndef __bbcreaVtkApplyMask_h_INCLUDED__ +#define __bbcreaVtkApplyMask_h_INCLUDED__ + +#include "bbcreaVtk_EXPORT.h" +#include "bbtkAtomicBlackBox.h" +#include "iostream" + +#include "vtkImageData.h" +namespace bbcreaVtk +{ + +class bbcreaVtk_EXPORT ApplyMask + : + public bbtk::AtomicBlackBox +{ + BBTK_BLACK_BOX_INTERFACE(ApplyMask,bbtk::AtomicBlackBox); +//===== +// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost) +//===== + BBTK_DECLARE_INPUT(Background,double); + BBTK_DECLARE_INPUT(BackgroundToAnalice,double); + BBTK_DECLARE_INPUT(Label,double); + BBTK_DECLARE_INPUT(Image,vtkImageData*); + BBTK_DECLARE_INPUT(Mask,vtkImageData*); + BBTK_DECLARE_INPUT(Type,int); + BBTK_DECLARE_OUTPUT(Out,vtkImageData*); + BBTK_PROCESS(Process); + void Process(); +//===== +// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost) +//===== +}; + +BBTK_BEGIN_DESCRIBE_BLACK_BOX(ApplyMask,bbtk::AtomicBlackBox); + BBTK_NAME("ApplyMask"); + BBTK_AUTHOR("InfoDev"); + BBTK_DESCRIPTION("No Description."); + BBTK_CATEGORY("empty"); + BBTK_INPUT(ApplyMask,Background,"(default 0) type 0: Background value in output image type 1: Nothing type 2: Nothing",double,""); + BBTK_INPUT(ApplyMask,BackgroundToAnalice,"(default 0) Background to check in the mask ",double,""); + BBTK_INPUT(ApplyMask,Label,"(double 255) type 0: Nothing type 1: valueOut in the mask type 2: Nothing ",double,""); + BBTK_INPUT(ApplyMask,Image,"Input image",vtkImageData*,""); + BBTK_INPUT(ApplyMask,Mask,"Input mask",vtkImageData*,""); + BBTK_INPUT(ApplyMask,Type,"(default 0) 0:Create new image 1:Modify the Image input with Label value at the mask place 2: Modify the Image input with the value of the mask",int,""); + BBTK_OUTPUT(ApplyMask,Out,"Output image",vtkImageData*,""); +BBTK_END_DESCRIBE_BLACK_BOX(ApplyMask); +//===== +// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost) +//===== +} +// EO namespace bbcreaVtk + +#endif // __bbcreaVtkApplyMask_h_INCLUDED__ + diff --git a/bbtk_creaVtk_PKG/src/bbcreaVtkApplyTransformToPoint3D.cxx b/bbtk_creaVtk_PKG/src/bbcreaVtkApplyTransformToPoint3D.cxx new file mode 100644 index 0000000..6b66267 --- /dev/null +++ b/bbtk_creaVtk_PKG/src/bbcreaVtkApplyTransformToPoint3D.cxx @@ -0,0 +1,107 @@ +//===== +// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost) +//===== +#include "bbcreaVtkApplyTransformToPoint3D.h" +#include "bbcreaVtkPackage.h" +#include "vtkTransform.h" + +namespace bbcreaVtk +{ + +BBTK_ADD_BLACK_BOX_TO_PACKAGE(creaVtk,ApplyTransformToPoint3D) +BBTK_BLACK_BOX_IMPLEMENTATION(ApplyTransformToPoint3D,bbtk::AtomicBlackBox); +//===== +// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost) +//===== +void ApplyTransformToPoint3D::Process() +{ + +// THE MAIN PROCESSING METHOD BODY +// Here we simply set the input 'In' value to the output 'Out' +// And print out the output value +// INPUT/OUTPUT ACCESSORS ARE OF THE FORM : +// void bbSet{Input|Output}NAME(const TYPE&) +// const TYPE& bbGet{Input|Output}NAME() const +// Where : +// * NAME is the name of the input/output +// (the one provided in the attribute 'name' of the tag 'input') +// * TYPE is the C++ type of the input/output +// (the one provided in the attribute 'type' of the tag 'input') +// bbSetOutputOut( bbGetInputIn() ); +// std::cout << "Output value = " <TransformPoint( point,newPoint ); + std::vector out; + out.push_back( newPoint[0] ); + out.push_back( newPoint[1] ); + out.push_back( newPoint[2] ); + bbSetOutputOut( out ); + + double pointDir[3] , newPointDir[3]; + pointDir[0] = bbGetInputPoint()[0]+bbGetInputDirectionInPoint()[0]; + pointDir[1] = bbGetInputPoint()[1]+bbGetInputDirectionInPoint()[1]; + pointDir[2] = bbGetInputPoint()[2]+bbGetInputDirectionInPoint()[2]; + bbGetInputTransform()->TransformPoint( pointDir,newPointDir ); + std::vector outDir; + outDir.push_back( newPointDir[0]-newPoint[0] ); + outDir.push_back( newPointDir[1]-newPoint[1] ); + outDir.push_back( newPointDir[2]-newPoint[2] ); + bbSetOutputOutDirection( outDir ); + } else { + printf("EED Warning! ApplyTransformToPoint3D::Process Incoherent sizes Point(3)=%d DirectionInPoint(3)=%d\n", bbGetInputPoint().size(),bbGetInputDirectionInPoint().size() ); + }// if Point size +} + +//===== +// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost) +//===== +void ApplyTransformToPoint3D::bbUserSetDefaultValues() +{ +// SET HERE THE DEFAULT INPUT/OUTPUT VALUES OF YOUR BOX +// Here we initialize the input 'In' to 0 + + std::vector point; + point.push_back(0); + point.push_back(0); + point.push_back(0); + bbSetInputPoint( point ); + std::vector dir; + dir.push_back(0); + dir.push_back(0); + dir.push_back(1); + bbSetInputDirectionInPoint( dir ); + bbSetInputTransform(NULL); +} + +//===== +// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost) +//===== +void ApplyTransformToPoint3D::bbUserInitializeProcessing() +{ +// THE INITIALIZATION METHOD BODY : +// Here does nothing +// but this is where you should allocate the internal/output pointers +// if any +} + +//===== +// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost) +//===== +void ApplyTransformToPoint3D::bbUserFinalizeProcessing() +{ +// THE FINALIZATION METHOD BODY : +// Here does nothing +// but this is where you should desallocate the internal/output pointers +// if any +} + +} // EO namespace bbcreaVtk + + diff --git a/bbtk_creaVtk_PKG/src/bbcreaVtkApplyTransformToPoint3D.h b/bbtk_creaVtk_PKG/src/bbcreaVtkApplyTransformToPoint3D.h new file mode 100644 index 0000000..fb5b70b --- /dev/null +++ b/bbtk_creaVtk_PKG/src/bbcreaVtkApplyTransformToPoint3D.h @@ -0,0 +1,56 @@ +//===== +// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost) +//===== +#ifndef __bbcreaVtkApplyTransformToPoint3D_h_INCLUDED__ +#define __bbcreaVtkApplyTransformToPoint3D_h_INCLUDED__ + +#include "bbcreaVtk_EXPORT.h" +#include "bbtkAtomicBlackBox.h" +#include "iostream" +#include "vtkLinearTransform.h" + +namespace bbcreaVtk +{ + +class bbcreaVtk_EXPORT ApplyTransformToPoint3D + : + public bbtk::AtomicBlackBox +{ + BBTK_BLACK_BOX_INTERFACE(ApplyTransformToPoint3D,bbtk::AtomicBlackBox); +//===== +// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost) +//===== + BBTK_DECLARE_INPUT(Point,std::vector); + BBTK_DECLARE_INPUT(DirectionInPoint,std::vector); + BBTK_DECLARE_INPUT(Transform,vtkLinearTransform*); + BBTK_DECLARE_OUTPUT(Out,std::vector); + BBTK_DECLARE_OUTPUT(OutDirection,std::vector); + BBTK_PROCESS(Process); + void Process(); +//===== +// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost) +//===== +}; + +BBTK_BEGIN_DESCRIBE_BLACK_BOX(ApplyTransformToPoint3D,bbtk::AtomicBlackBox); + BBTK_NAME("ApplyTransformToPoint3D"); + BBTK_AUTHOR("InfoDev"); + BBTK_DESCRIPTION("No Description."); + BBTK_CATEGORY("empty"); + + BBTK_INPUT(ApplyTransformToPoint3D,Point,"(default [0,0,0]) Point 3D [x,y,z]",std::vector,""); + BBTK_INPUT(ApplyTransformToPoint3D,DirectionInPoint,"(default [0,0,1]) Direction from point [x,y,z]",std::vector,""); + BBTK_INPUT(ApplyTransformToPoint3D,Transform,"vtkLinearTransform",vtkLinearTransform*,""); + + BBTK_OUTPUT(ApplyTransformToPoint3D,Out,"Point 3D [x,y,z] after Transform ",std::vector,""); + BBTK_OUTPUT(ApplyTransformToPoint3D,OutDirection,"Direction 3D [x,y,z] after Transform",std::vector,""); + +BBTK_END_DESCRIBE_BLACK_BOX(ApplyTransformToPoint3D); +//===== +// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost) +//===== +} +// EO namespace bbcreaVtk + +#endif // __bbcreaVtkApplyTransformToPoint3D_h_INCLUDED__ + diff --git a/bbtk_creaVtk_PKG/src/bbcreaVtkBooleanOperationPolyDataFilter.cxx b/bbtk_creaVtk_PKG/src/bbcreaVtkBooleanOperationPolyDataFilter.cxx new file mode 100644 index 0000000..9017e5b --- /dev/null +++ b/bbtk_creaVtk_PKG/src/bbcreaVtkBooleanOperationPolyDataFilter.cxx @@ -0,0 +1,123 @@ +//===== +// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost) +//===== +#include "bbcreaVtkBooleanOperationPolyDataFilter.h" +#include "bbcreaVtkPackage.h" + +#include "vtkBooleanOperationPolyDataFilter.h" +#include "vtkCleanPolyData.h" +#include "vtkTriangleFilter.h" + +namespace bbcreaVtk +{ + +BBTK_ADD_BLACK_BOX_TO_PACKAGE(creaVtk,BooleanOperationPolyDataFilter) +BBTK_BLACK_BOX_IMPLEMENTATION(BooleanOperationPolyDataFilter,bbtk::AtomicBlackBox); +//===== +// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost) +//===== +void BooleanOperationPolyDataFilter::Process() +{ + +// THE MAIN PROCESSING METHOD BODY +// Here we simply set the input 'In' value to the output 'Out' +// And print out the output value +// INPUT/OUTPUT ACCESSORS ARE OF THE FORM : +// void bbSet{Input|Output}NAME(const TYPE&) +// const TYPE& bbGet{Input|Output}NAME() const +// Where : +// * NAME is the name of the input/output +// (the one provided in the attribute 'name' of the tag 'input') +// * TYPE is the C++ type of the input/output +// (the one provided in the attribute 'type' of the tag 'input') +// bbSetOutputOut( bbGetInputIn() ); +// std::cout << "Output value = " <SetInputData( bbGetInputIn1() ); + clean2->SetInputData( bbGetInputIn2() ); + clean1->Update(); + clean2->Update(); + vtkTriangleFilter *triangle1 = vtkTriangleFilter::New(); + vtkTriangleFilter *triangle2 = vtkTriangleFilter::New(); + triangle1->SetInputData( clean1->GetOutput() ); + triangle2->SetInputData( clean2->GetOutput() ); + triangle1->Update(); + triangle2->Update(); + + vtkBooleanOperationPolyDataFilter *booleanOperation = vtkBooleanOperationPolyDataFilter::New(); + booleanOperation->SetInputData(0, triangle1->GetOutput() ); + booleanOperation->SetInputData(1, triangle2->GetOutput() ); + + if (bbGetInputOperation()==0 ) + { + booleanOperation->SetOperationToUnion(); + } + if (bbGetInputOperation()==1 ) + { + booleanOperation->SetOperationToIntersection(); + } + if (bbGetInputOperation()==2 ) + { + booleanOperation->SetOperationToDifference(); + } + booleanOperation->Update(); + bbSetOutputOut( booleanOperation->GetOutput() ); + } else { + printf("EED Warnning! BooleanOperationPolyDataFilter::Process vtkPolyData In1 or In2 is EMPTY\n"); + } // if In1 In2 != NULL +} +//===== +// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost) +//===== +void BooleanOperationPolyDataFilter::bbUserSetDefaultValues() +{ + +// SET HERE THE DEFAULT INPUT/OUTPUT VALUES OF YOUR BOX +// Here we initialize the input 'In' to 0 + bbSetInputIn1(NULL); + bbSetInputIn2(NULL); + bbSetInputOperation(0); + +} +//===== +// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost) +//===== +void BooleanOperationPolyDataFilter::bbUserInitializeProcessing() +{ + +// THE INITIALIZATION METHOD BODY : +// Here does nothing +// but this is where you should allocate the internal/output pointers +// if any + + +} +//===== +// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost) +//===== +void BooleanOperationPolyDataFilter::bbUserFinalizeProcessing() +{ + +// THE FINALIZATION METHOD BODY : +// Here does nothing +// but this is where you should desallocate the internal/output pointers +// if any + +} +} +// EO namespace bbcreaVtk + + diff --git a/bbtk_creaVtk_PKG/src/bbcreaVtkBooleanOperationPolyDataFilter.h b/bbtk_creaVtk_PKG/src/bbcreaVtkBooleanOperationPolyDataFilter.h new file mode 100644 index 0000000..f604191 --- /dev/null +++ b/bbtk_creaVtk_PKG/src/bbcreaVtkBooleanOperationPolyDataFilter.h @@ -0,0 +1,55 @@ +//===== +// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost) +//===== +#ifndef __bbcreaVtkBooleanOperationPolyDataFilter_h_INCLUDED__ +#define __bbcreaVtkBooleanOperationPolyDataFilter_h_INCLUDED__ + +#include "bbcreaVtk_EXPORT.h" +#include "bbtkAtomicBlackBox.h" +#include "iostream" + +#include "vtkPolyData.h" + +namespace bbcreaVtk +{ + +class bbcreaVtk_EXPORT BooleanOperationPolyDataFilter + : + public bbtk::AtomicBlackBox +{ + BBTK_BLACK_BOX_INTERFACE(BooleanOperationPolyDataFilter,bbtk::AtomicBlackBox); +//===== +// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost) +//===== + BBTK_DECLARE_INPUT(In1,vtkPolyData*); + BBTK_DECLARE_INPUT(In2,vtkPolyData*); + BBTK_DECLARE_INPUT(Operation,int); + BBTK_DECLARE_OUTPUT(Out,vtkPolyData*); + BBTK_PROCESS(Process); + void Process(); +//===== +// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost) +//===== +}; + +BBTK_BEGIN_DESCRIBE_BLACK_BOX(BooleanOperationPolyDataFilter,bbtk::AtomicBlackBox); + BBTK_NAME("BooleanOperationPolyDataFilter"); + BBTK_AUTHOR("InfoDev"); + BBTK_DESCRIPTION("No Description."); + BBTK_CATEGORY("empty"); + + BBTK_INPUT(BooleanOperationPolyDataFilter,In1,"vtkPolyData",vtkPolyData*,""); + BBTK_INPUT(BooleanOperationPolyDataFilter,In2,"vtkPolyData",vtkPolyData*,""); + BBTK_INPUT(BooleanOperationPolyDataFilter,Operation,"(defalut 0) 0:Union 1:Intersection 2:Difference",int,""); + + BBTK_OUTPUT(BooleanOperationPolyDataFilter,Out,"vtkPolyData",vtkPolyData*,""); + +BBTK_END_DESCRIBE_BLACK_BOX(BooleanOperationPolyDataFilter); +//===== +// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost) +//===== +} +// EO namespace bbcreaVtk + +#endif // __bbcreaVtkBooleanOperationPolyDataFilter_h_INCLUDED__ + diff --git a/bbtk_creaVtk_PKG/src/bbcreaVtkBoxWidget.cxx b/bbtk_creaVtk_PKG/src/bbcreaVtkBoxWidget.cxx new file mode 100644 index 0000000..a973e3b --- /dev/null +++ b/bbtk_creaVtk_PKG/src/bbcreaVtkBoxWidget.cxx @@ -0,0 +1,141 @@ +//===== +// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost) +//===== +#include "bbcreaVtkBoxWidget.h" +#include "bbcreaVtkPackage.h" + +#include "vtkRenderWindow.h" +#include "vtkCommand.h" + + +namespace bbcreaVtk +{ + +BBTK_ADD_BLACK_BOX_TO_PACKAGE(creaVtk,BoxWidget) +BBTK_BLACK_BOX_IMPLEMENTATION(BoxWidget,bbtk::AtomicBlackBox); +//===== +// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost) +//===== + +class bbBoxWidgetCallback : public vtkCommand + { + public: + BoxWidget *_box; + static bbBoxWidgetCallback *New() + { + return new bbBoxWidgetCallback; + } + void SetBox( BoxWidget* box ) + { + _box=box; + } + + void Execute(vtkObject *caller, unsigned long, void*) override + { + vtkBoxWidget *vtkwidget = reinterpret_cast(caller); + vtkwidget->GetPlanes( _box->planes ); + _box->bbSignalOutputModification(std::string("ImplicitFunction")); + } + }; + + + +void BoxWidget::Process() +{ + +// THE MAIN PROCESSING METHOD BODY +// Here we simply set the input 'In' value to the output 'Out' +// And print out the output value +// INPUT/OUTPUT ACCESSORS ARE OF THE FORM : +// void bbSet{Input|Output}NAME(const TYPE&) +// const TYPE& bbGet{Input|Output}NAME() const +// Where : +// * NAME is the name of the input/output +// (the one provided in the attribute 'name' of the tag 'input') +// * TYPE is the C++ type of the input/output +// (the one provided in the attribute 'type' of the tag 'input') +// bbSetOutputOut( bbGetInputIn() ); +// std::cout << "Output value = " <SetInteractor( bbGetInputRenderer()->GetRenderWindow()->GetInteractor() ); + boxWidget->SetPlaceFactor(1.25); + if (bbGetInputImageInitSize()!=NULL) + { + int ext[6]; + bbGetInputImageInitSize()->GetExtent( ext ); + double spc[3]; + bbGetInputImageInitSize()->GetSpacing( spc ); + boxWidget->PlaceWidget( ext[0]*spc[0] , ext[1]*spc[0] , ext[2]*spc[1] , ext[3]*spc[1] , ext[4]*spc[2] , ext[5]*spc[2] ); + } else { + boxWidget->PlaceWidget(0,500,0,500,0,500); + }// if ImageInitSize + boxWidget->GetPlanes( planes ); + } // if firsttime + + // boxWidget->SetProp3D(coneActor); + bbBoxWidgetCallback *callback = bbBoxWidgetCallback::New(); + callback->SetBox( this ); + boxWidget->AddObserver(vtkCommand::InteractionEvent, callback); + + if (bbGetInputActive()==true) + { + boxWidget->On(); + } else { + boxWidget->Off(); + } // if Active + bbSetOutputImplicitFunction( planes ); + } else { + printf("EED Warnning! BoxWidget::Process vtkRenderer not set.\n"); + }// vtkRenderer != NULL + +} +//===== +// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost) +//===== +void BoxWidget::bbUserSetDefaultValues() +{ + +// SET HERE THE DEFAULT INPUT/OUTPUT VALUES OF YOUR BOX +// Here we initialize the input 'In' to 0 + firsttime=true; + bbSetInputRenderer(NULL); + bbSetInputActive( false ); + bbSetInputImageInitSize(NULL); +} +//===== +// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost) +//===== +void BoxWidget::bbUserInitializeProcessing() +{ + +// THE INITIALIZATION METHOD BODY : +// Here does nothing +// but this is where you should allocate the internal/output pointers +// if any + + +} +//===== +// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost) +//===== +void BoxWidget::bbUserFinalizeProcessing() +{ + +// THE FINALIZATION METHOD BODY : +// Here does nothing +// but this is where you should desallocate the internal/output pointers +// if any + +} +} +// EO namespace bbcreaVtk + + diff --git a/bbtk_creaVtk_PKG/src/bbcreaVtkBoxWidget.h b/bbtk_creaVtk_PKG/src/bbcreaVtkBoxWidget.h new file mode 100644 index 0000000..cfa8bc6 --- /dev/null +++ b/bbtk_creaVtk_PKG/src/bbcreaVtkBoxWidget.h @@ -0,0 +1,63 @@ +//===== +// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost) +//===== +#ifndef __bbcreaVtkBoxWidget_h_INCLUDED__ +#define __bbcreaVtkBoxWidget_h_INCLUDED__ + +#include "bbcreaVtk_EXPORT.h" +#include "bbtkAtomicBlackBox.h" +#include "iostream" + +#include "vtkBoxWidget.h" +#include "vtkRenderer.h" +#include "vtkImplicitFunction.h" +#include "vtkPlanes.h" +#include "vtkImageData.h" + +namespace bbcreaVtk +{ + +class bbcreaVtk_EXPORT BoxWidget + : + public bbtk::AtomicBlackBox +{ + BBTK_BLACK_BOX_INTERFACE(BoxWidget,bbtk::AtomicBlackBox); +//===== +// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost) +//===== + BBTK_DECLARE_INPUT( Active , bool ); + BBTK_DECLARE_INPUT( Renderer , vtkRenderer* ); + BBTK_DECLARE_INPUT( ImageInitSize , vtkImageData* ); + BBTK_DECLARE_OUTPUT( ImplicitFunction , vtkImplicitFunction* ); + BBTK_PROCESS(Process); + void Process(); + + bool firsttime; + vtkBoxWidget *boxWidget; + vtkPlanes *planes; +//===== +// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost) +//===== +}; + +BBTK_BEGIN_DESCRIBE_BLACK_BOX(BoxWidget,bbtk::AtomicBlackBox); + BBTK_NAME("BoxWidget"); + BBTK_AUTHOR("InfoDev"); + BBTK_DESCRIPTION("No Description."); + BBTK_CATEGORY("empty"); + + BBTK_INPUT(BoxWidget,Active,"(default false) true/false",bool,""); + BBTK_INPUT(BoxWidget,ImageInitSize,"(default NULL=> 0,500,0,500,0,500) Boudaring image size ",vtkImageData*,""); + BBTK_INPUT(BoxWidget,Renderer,"vtkRenderer",vtkRenderer*,""); + + BBTK_OUTPUT(BoxWidget,ImplicitFunction,"vtkImplicitFunction",vtkImplicitFunction*,""); + +BBTK_END_DESCRIBE_BLACK_BOX(BoxWidget); +//===== +// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost) +//===== +} +// EO namespace bbcreaVtk + +#endif // __bbcreaVtkBoxWidget_h_INCLUDED__ + diff --git a/bbtk_creaVtk_PKG/src/bbcreaVtkClipPolyData.cxx b/bbtk_creaVtk_PKG/src/bbcreaVtkClipPolyData.cxx new file mode 100644 index 0000000..428518e --- /dev/null +++ b/bbtk_creaVtk_PKG/src/bbcreaVtkClipPolyData.cxx @@ -0,0 +1,115 @@ +//===== +// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost) +//===== +#include "bbcreaVtkClipPolyData.h" +#include "bbcreaVtkPackage.h" + +#include "vtkExtractPoints.h" +#include "vtkClipPolyData.h" + +namespace bbcreaVtk +{ + +BBTK_ADD_BLACK_BOX_TO_PACKAGE(creaVtk,ClipPolyData) +BBTK_BLACK_BOX_IMPLEMENTATION(ClipPolyData,bbtk::AtomicBlackBox); +//===== +// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost) +//===== +void ClipPolyData::Process() +{ + +// THE MAIN PROCESSING METHOD BODY +// Here we simply set the input 'In' value to the output 'Out' +// And print out the output value +// INPUT/OUTPUT ACCESSORS ARE OF THE FORM : +// void bbSet{Input|Output}NAME(const TYPE&) +// const TYPE& bbGet{Input|Output}NAME() const +// Where : +// * NAME is the name of the input/output +// (the one provided in the attribute 'name' of the tag 'input') +// * TYPE is the C++ type of the input/output +// (the one provided in the attribute 'type' of the tag 'input') + +// bbSetOutputOut( bbGetInputIn() ); +// std::cout << "Output value = " <SetInputData( bbGetInputIn() ); + clip->SetClipFunction( bbGetInputImplicitFunction() ); + clip->GenerateClipScalarsOn(); + clip->GenerateClippedOutputOff(); + if (bbGetInputInside()==true) + { + clip->InsideOutOn(); + } else { + clip->InsideOutOff(); + } + clip->Update(); + bbSetOutputOut( clip->GetOutput() ); + } // Type 0 + if (bbGetInputType()==1) + { + vtkExtractPoints *clip = vtkExtractPoints::New(); + clip->SetInputData( bbGetInputIn() ); + clip->SetImplicitFunction( bbGetInputImplicitFunction() ); + if (bbGetInputInside()==true) + { + clip->ExtractInsideOn(); + } else { + clip->ExtractInsideOff(); + } + clip->Update(); + bbSetOutputOut( clip->GetOutput() ); + } // type 1 + } else { + printf("EED Warnning! ClipPolyData::Process In or ImplicitFunction is EMPTY\n"); + } // if In ImplicitFunction != NULL + +} +//===== +// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost) +//===== +void ClipPolyData::bbUserSetDefaultValues() +{ + +// SET HERE THE DEFAULT INPUT/OUTPUT VALUES OF YOUR BOX +// Here we initialize the input 'In' to 0 + bbSetInputIn( NULL ); + bbSetInputType( 0 ); + bbSetInputInside( true ); + bbSetInputImplicitFunction( NULL ); + +} +//===== +// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost) +//===== +void ClipPolyData::bbUserInitializeProcessing() +{ + +// THE INITIALIZATION METHOD BODY : +// Here does nothing +// but this is where you should allocate the internal/output pointers +// if any + + +} +//===== +// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost) +//===== +void ClipPolyData::bbUserFinalizeProcessing() +{ + +// THE FINALIZATION METHOD BODY : +// Here does nothing +// but this is where you should desallocate the internal/output pointers +// if any + +} +} +// EO namespace bbcreaVtk + + diff --git a/bbtk_creaVtk_PKG/src/bbcreaVtkClipPolyData.h b/bbtk_creaVtk_PKG/src/bbcreaVtkClipPolyData.h new file mode 100644 index 0000000..156b84f --- /dev/null +++ b/bbtk_creaVtk_PKG/src/bbcreaVtkClipPolyData.h @@ -0,0 +1,58 @@ +//===== +// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost) +//===== +#ifndef __bbcreaVtkClipPolyData_h_INCLUDED__ +#define __bbcreaVtkClipPolyData_h_INCLUDED__ + +#include "bbcreaVtk_EXPORT.h" +#include "bbtkAtomicBlackBox.h" +#include "iostream" + +#include "vtkPolyData.h" +#include "vtkImplicitFunction.h" + +namespace bbcreaVtk +{ + +class bbcreaVtk_EXPORT ClipPolyData + : + public bbtk::AtomicBlackBox +{ + BBTK_BLACK_BOX_INTERFACE(ClipPolyData,bbtk::AtomicBlackBox); +//===== +// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost) +//===== + BBTK_DECLARE_INPUT(Type,int); + BBTK_DECLARE_INPUT(In,vtkPolyData*); + BBTK_DECLARE_INPUT(Inside,bool); + BBTK_DECLARE_INPUT(ImplicitFunction,vtkImplicitFunction*); + BBTK_DECLARE_OUTPUT(Out,vtkPolyData*); + BBTK_PROCESS(Process); + void Process(); +//===== +// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost) +//===== +}; + +BBTK_BEGIN_DESCRIBE_BLACK_BOX(ClipPolyData,bbtk::AtomicBlackBox); + BBTK_NAME("ClipPolyData"); + BBTK_AUTHOR("InfoDev"); + BBTK_DESCRIPTION("No Description."); + BBTK_CATEGORY("empty"); + + BBTK_INPUT(ClipPolyData,Type,"(default 0) 0:surface vtkClipPolydata 1:points vtkExtractPoints",int,""); + BBTK_INPUT(ClipPolyData,In,"vtkPolyData",vtkPolyData*,""); + BBTK_INPUT(ClipPolyData,Inside,"(defalut true) Inside true, Outside false",bool,""); + BBTK_INPUT(ClipPolyData,ImplicitFunction,"vtkImplicitFunction",vtkImplicitFunction*,""); + + BBTK_OUTPUT(ClipPolyData,Out,"vtkPolyData",vtkPolyData*,""); + +BBTK_END_DESCRIBE_BLACK_BOX(ClipPolyData); +//===== +// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost) +//===== +} +// EO namespace bbcreaVtk + +#endif // __bbcreaVtkClipPolyData_h_INCLUDED__ + diff --git a/bbtk_creaVtk_PKG/src/bbcreaVtkCreateMeshFromPoints.cxx b/bbtk_creaVtk_PKG/src/bbcreaVtkCreateMeshFromPoints.cxx new file mode 100644 index 0000000..3d6227f --- /dev/null +++ b/bbtk_creaVtk_PKG/src/bbcreaVtkCreateMeshFromPoints.cxx @@ -0,0 +1,146 @@ +//===== +// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost) +//===== +#include "bbcreaVtkCreateMeshFromPoints.h" +#include "bbcreaVtkPackage.h" + +#include "vtkTriangleStrip.h" + +namespace bbcreaVtk +{ + +BBTK_ADD_BLACK_BOX_TO_PACKAGE(creaVtk,CreateMeshFromPoints) +BBTK_BLACK_BOX_IMPLEMENTATION(CreateMeshFromPoints,bbtk::AtomicBlackBox); +//===== +// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost) +//===== +void CreateMeshFromPoints::Process() +{ + +// THE MAIN PROCESSING METHOD BODY +// Here we simply set the input 'In' value to the output 'Out' +// And print out the output value +// INPUT/OUTPUT ACCESSORS ARE OF THE FORM : +// void bbSet{Input|Output}NAME(const TYPE&) +// const TYPE& bbGet{Input|Output}NAME() const +// Where : +// * NAME is the name of the input/output +// (the one provided in the attribute 'name' of the tag 'input') +// * TYPE is the C++ type of the input/output +// (the one provided in the attribute 'type' of the tag 'input') + +// bbSetOutputOut( bbGetInputIn() ); +// std::cout << "Output value = " < lstX = bbGetInputLstX(); + std::vector lstY = bbGetInputLstY(); + std::vector lstZ = bbGetInputLstZ(); + std::vector lstIndexs = bbGetInputLstIndexs(); + if ( (lstIndexs.size()<=1) || (lstX.size()==0) || (lstX.size()!=lstY.size()) || (lstY.size()!=lstZ.size()) ) + { + printf("Warnning! CreateMeshFromPoints::Process: List of points X Y Z and LstIndexes is not correct\n"); + bbSetOutputOut(NULL); + } else { + int ii,sizeSegment1,sizeSegment2; + int endSegment; +// vtkSmartPointer points = vtkSmartPointer::New(); + if (points!=NULL) points->Delete(); + points = vtkPoints::New(); + int i,sizeLstX = lstX.size(); + for (i=0;iInsertNextPoint(lstX[i],lstY[i],lstZ[i]); + } // for i +// vtkSmartPointer cells = vtkSmartPointer::New(); + if (cells!=NULL) cells->Delete(); + cells = vtkCellArray::New(); + int maxElements; + int maxSegment1,maxSegment2; + int iSeg1,iSeg2; + int iGeneral = 0; + int sizeLstIdexes=lstIndexs.size(); + for (i=0; i triangleStrip = vtkSmartPointer::New(); + triangleStrip->GetPointIds()->SetNumberOfIds(sizeSegment1+sizeSegment2); + maxElements=sizeSegment1; + if (maxElementsGetPointIds()->SetId(ii*2 ,iSeg1); + triangleStrip->GetPointIds()->SetId(ii*2+1,iSeg2); + iSeg1++; + iSeg2++; + if (iSeg1>=maxSegment1) iSeg1=maxSegment1-1; + if (iSeg2>=maxSegment2) iSeg2=maxSegment2-1; + } // for ii + iGeneral=iGeneral+sizeSegment1; + cells->InsertNextCell(triangleStrip); + } //for LstIndexs +// vtkPolyData *polydata = vtkPolyData::New(); + if (polydata!=NULL) polydata->Delete(); + polydata = vtkPolyData::New(); + polydata->SetPoints(points); + polydata->SetStrips(cells); +// vtkCleanPolyData *clean=vtkCleanPolyData::New(); + if (clean!=NULL) clean->Delete(); + clean = vtkCleanPolyData::New(); + clean->SetInputData(polydata); + clean->Update(); +// vtkTriangleFilter *triangle = vtkTriangleFilter::New(); + if (triangle!=NULL) triangle->Delete(); + triangle = vtkTriangleFilter::New(); + triangle->SetInputData( clean->GetOutput() ); + triangle->Update(); + bbSetOutputOut( clean->GetOutput() ); + }// if listXYZ size +} +//===== +// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost) +//===== +void CreateMeshFromPoints::bbUserSetDefaultValues() +{ + +// SET HERE THE DEFAULT INPUT/OUTPUT VALUES OF YOUR BOX +// Here we initialize the input 'In' to 0 +// bbSetInputIn(0); + points = NULL; + cells = NULL; + polydata = NULL; + clean = NULL; + triangle = NULL; +} +//===== +// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost) +//===== +void CreateMeshFromPoints::bbUserInitializeProcessing() +{ + +// THE INITIALIZATION METHOD BODY : +// Here does nothing +// but this is where you should allocate the internal/output pointers +// if any + + +} +//===== +// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost) +//===== +void CreateMeshFromPoints::bbUserFinalizeProcessing() +{ + +// THE FINALIZATION METHOD BODY : +// Here does nothing +// but this is where you should desallocate the internal/output pointers +// if any + +} +} +// EO namespace bbcreaVtk + + diff --git a/bbtk_creaVtk_PKG/src/bbcreaVtkCreateMeshFromPoints.h b/bbtk_creaVtk_PKG/src/bbcreaVtkCreateMeshFromPoints.h new file mode 100644 index 0000000..94eda53 --- /dev/null +++ b/bbtk_creaVtk_PKG/src/bbcreaVtkCreateMeshFromPoints.h @@ -0,0 +1,69 @@ +//===== +// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost) +//===== +#ifndef __bbcreaVtkCreateMeshFromPoints_h_INCLUDED__ +#define __bbcreaVtkCreateMeshFromPoints_h_INCLUDED__ + +#include "bbcreaVtk_EXPORT.h" +#include "bbtkAtomicBlackBox.h" +#include "iostream" + +#include "vtkPoints.h" +#include "vtkCellArray.h" +#include "vtkPolyData.h" +#include "vtkCleanPolyData.h" +#include "vtkTriangleFilter.h" + + +namespace bbcreaVtk +{ + +class bbcreaVtk_EXPORT CreateMeshFromPoints + : + public bbtk::AtomicBlackBox +{ + BBTK_BLACK_BOX_INTERFACE(CreateMeshFromPoints,bbtk::AtomicBlackBox); +//===== +// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost) +//===== + BBTK_DECLARE_INPUT(LstX,std::vector); + BBTK_DECLARE_INPUT(LstY,std::vector); + BBTK_DECLARE_INPUT(LstZ,std::vector); + BBTK_DECLARE_INPUT(LstIndexs,std::vector); + BBTK_DECLARE_OUTPUT(Out,vtkPolyData*); + BBTK_PROCESS(Process); + void Process(); + + vtkPoints *points; + vtkCellArray *cells; + vtkPolyData *polydata; + vtkCleanPolyData *clean; + vtkTriangleFilter *triangle; + +//===== +// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost) +//===== +}; + +BBTK_BEGIN_DESCRIBE_BLACK_BOX(CreateMeshFromPoints,bbtk::AtomicBlackBox); + BBTK_NAME("CreateMeshFromPoints"); + BBTK_AUTHOR("InfoDev"); + BBTK_DESCRIPTION("No Description."); + BBTK_CATEGORY("empty"); + + BBTK_INPUT(CreateMeshFromPoints,LstX,"List X point",std::vector,""); + BBTK_INPUT(CreateMeshFromPoints,LstY,"List Y point",std::vector,""); + BBTK_INPUT(CreateMeshFromPoints,LstZ,"List Z point",std::vector,""); + BBTK_INPUT(CreateMeshFromPoints,LstIndexs,"Number of points by segment",std::vector,""); + + BBTK_OUTPUT(CreateMeshFromPoints,Out,"vtkPolyData",vtkPolyData*,""); + +BBTK_END_DESCRIBE_BLACK_BOX(CreateMeshFromPoints); +//===== +// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost) +//===== +} +// EO namespace bbcreaVtk + +#endif // __bbcreaVtkCreateMeshFromPoints_h_INCLUDED__ + diff --git a/bbtk_creaVtk_PKG/src/bbcreaVtkCutter.cxx b/bbtk_creaVtk_PKG/src/bbcreaVtkCutter.cxx new file mode 100644 index 0000000..5f0aaa1 --- /dev/null +++ b/bbtk_creaVtk_PKG/src/bbcreaVtkCutter.cxx @@ -0,0 +1,85 @@ +//===== +// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost) +//===== +#include "bbcreaVtkCutter.h" +#include "bbcreaVtkPackage.h" +#include "vtkCutter.h" + +namespace bbcreaVtk +{ + +BBTK_ADD_BLACK_BOX_TO_PACKAGE(creaVtk,Cutter) +BBTK_BLACK_BOX_IMPLEMENTATION(Cutter,bbtk::AtomicBlackBox); +//===== +// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost) +//===== +void Cutter::Process() +{ + +// THE MAIN PROCESSING METHOD BODY +// Here we simply set the input 'In' value to the output 'Out' +// And print out the output value +// INPUT/OUTPUT ACCESSORS ARE OF THE FORM : +// void bbSet{Input|Output}NAME(const TYPE&) +// const TYPE& bbGet{Input|Output}NAME() const +// Where : +// * NAME is the name of the input/output +// (the one provided in the attribute 'name' of the tag 'input') +// * TYPE is the C++ type of the input/output +// (the one provided in the attribute 'type' of the tag 'input') +// bbSetOutputOut( bbGetInputIn() ); +// std::cout << "Output value = " <SetInputData( bbGetInputIn() ); + cutter->SetCutFunction( bbGetInputImplicitFunction() ); + cutter->Update(); + bbSetOutputOut( cutter->GetOutput() ); + + +} +//===== +// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost) +//===== +void Cutter::bbUserSetDefaultValues() +{ + +// SET HERE THE DEFAULT INPUT/OUTPUT VALUES OF YOUR BOX +// Here we initialize the input 'In' to 0 +// bbSetInputIn(NULL); + +} +//===== +// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost) +//===== +void Cutter::bbUserInitializeProcessing() +{ + +// THE INITIALIZATION METHOD BODY : +// Here does nothing +// but this is where you should allocate the internal/output pointers +// if any + + +} +//===== +// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost) +//===== +void Cutter::bbUserFinalizeProcessing() +{ + +// THE FINALIZATION METHOD BODY : +// Here does nothing +// but this is where you should desallocate the internal/output pointers +// if any + +} +} +// EO namespace bbcreaVtk + + diff --git a/bbtk_creaVtk_PKG/src/bbcreaVtkCutter.h b/bbtk_creaVtk_PKG/src/bbcreaVtkCutter.h new file mode 100644 index 0000000..35614e0 --- /dev/null +++ b/bbtk_creaVtk_PKG/src/bbcreaVtkCutter.h @@ -0,0 +1,52 @@ +//===== +// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost) +//===== +#ifndef __bbcreaVtkCutter_h_INCLUDED__ +#define __bbcreaVtkCutter_h_INCLUDED__ + +#include "bbcreaVtk_EXPORT.h" +#include "bbtkAtomicBlackBox.h" +#include "iostream" +#include "vtkPolyData.h" +#include "vtkImplicitFunction.h" + +namespace bbcreaVtk +{ + +class bbcreaVtk_EXPORT Cutter + : + public bbtk::AtomicBlackBox +{ + BBTK_BLACK_BOX_INTERFACE(Cutter,bbtk::AtomicBlackBox); +//===== +// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost) +//===== + BBTK_DECLARE_INPUT(In,vtkPolyData*); + BBTK_DECLARE_INPUT(ImplicitFunction,vtkImplicitFunction*); + BBTK_DECLARE_OUTPUT(Out,vtkPolyData*); + BBTK_PROCESS(Process); + void Process(); +//===== +// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost) +//===== +}; + +BBTK_BEGIN_DESCRIBE_BLACK_BOX(Cutter,bbtk::AtomicBlackBox); + BBTK_NAME("Cutter"); + BBTK_AUTHOR("InfoDev"); + BBTK_DESCRIPTION("vtkCutter"); + BBTK_CATEGORY("empty"); + + BBTK_INPUT(Cutter,In,"vtkPolyData input",vtkPolyData*,""); + BBTK_INPUT(Cutter,ImplicitFunction,"vtkImpliciteFunction ex.: vtkBox, vtkCone, vtkCylender, vtkPlane, vtkSphere(s), vtkQuadric, ETC.",vtkImplicitFunction*,""); + + BBTK_OUTPUT(Cutter,Out,"vtkPolyData output",vtkPolyData*,""); + +BBTK_END_DESCRIBE_BLACK_BOX(Cutter); +//===== +// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost) +//===== +} // EO namespace bbcreaVtk + +#endif // __bbcreaVtkCutter_h_INCLUDED__ + diff --git a/bbtk_creaVtk_PKG/src/bbcreaVtkDelaunay3D.cxx b/bbtk_creaVtk_PKG/src/bbcreaVtkDelaunay3D.cxx new file mode 100644 index 0000000..baeb1f1 --- /dev/null +++ b/bbtk_creaVtk_PKG/src/bbcreaVtkDelaunay3D.cxx @@ -0,0 +1,121 @@ +//===== +// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost) +//===== +#include "bbcreaVtkDelaunay3D.h" +#include "bbcreaVtkPackage.h" + +#include "vtkPoints.h" +#include "vtkDelaunay2D.h" +#include "vtkDelaunay3D.h" +#include "vtkShrinkFilter.h" +#include "vtkGeometryFilter.h" +#include +#include + +#include +#include +#include +#include + +#include +#include +#include + + + +namespace bbcreaVtk +{ + +BBTK_ADD_BLACK_BOX_TO_PACKAGE(creaVtk,Delaunay3D) +BBTK_BLACK_BOX_IMPLEMENTATION(Delaunay3D,bbtk::AtomicBlackBox); +//===== +// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost) +//===== +void Delaunay3D::Process() +{ + +// THE MAIN PROCESSING METHOD BODY +// Here we simply set the input 'In' value to the output 'Out' +// And print out the output value +// INPUT/OUTPUT ACCESSORS ARE OF THE FORM : +// void bbSet{Input|Output}NAME(const TYPE&) +// const TYPE& bbGet{Input|Output}NAME() const +// Where : +// * NAME is the name of the input/output +// (the one provided in the attribute 'name' of the tag 'input') +// * TYPE is the C++ type of the input/output +// (the one provided in the attribute 'type' of the tag 'input') +// bbSetOutputOut( bbGetInputIn() ); +// std::cout << "Output value = " < lstX=bbGetInputLstPointsX(); + std::vector lstY=bbGetInputLstPointsY(); + std::vector lstZ=bbGetInputLstPointsZ(); + if (lstX.size()!=0) + { + vtkPoints *points = vtkPoints::New(); + int i,size=lstX.size(); + for (i=0;iInsertNextPoint( lstX[i], lstY[i], lstZ[i] ); + } // for i + + vtkPolyData *inputpolydata = vtkPolyData::New(); + inputpolydata->SetPoints( points ); + +/* Delaunay */ + vtkDelaunay3D* delaunay = vtkDelaunay3D::New(); + delaunay->SetInputData( inputpolydata ); + delaunay->SetTolerance( bbGetInputTolerance() ); //0.01 + delaunay->SetAlpha( bbGetInputAlpha() ); //0.2 + delaunay->BoundingTriangulationOff(); + delaunay->Update(); + vtkGeometryFilter *geometry = vtkGeometryFilter::New(); + geometry->SetInputData( delaunay->GetOutput() ); + geometry->Update(); + bbSetOutputOut( geometry->GetOutput() ); + } else { + printf("Warnning! Delaunay3D::Process: list of points empty. \n"); + } // if lstX.size +} + +//===== +// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost) +//===== +void Delaunay3D::bbUserSetDefaultValues() +{ + +// SET HERE THE DEFAULT INPUT/OUTPUT VALUES OF YOUR BOX +// Here we initialize the input 'In' to 0 + bbSetInputTolerance( 0 ); + bbSetInputAlpha( 0 ); +} +//===== +// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost) +//===== +void Delaunay3D::bbUserInitializeProcessing() +{ + +// THE INITIALIZATION METHOD BODY : +// Here does nothing +// but this is where you should allocate the internal/output pointers +// if any + + +} +//===== +// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost) +//===== +void Delaunay3D::bbUserFinalizeProcessing() +{ + +// THE FINALIZATION METHOD BODY : +// Here does nothing +// but this is where you should desallocate the internal/output pointers +// if any + +} +} +// EO namespace bbcreaVtk + + diff --git a/bbtk_creaVtk_PKG/src/bbcreaVtkDelaunay3D.h b/bbtk_creaVtk_PKG/src/bbcreaVtkDelaunay3D.h new file mode 100644 index 0000000..9761ddb --- /dev/null +++ b/bbtk_creaVtk_PKG/src/bbcreaVtkDelaunay3D.h @@ -0,0 +1,60 @@ +//===== +// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost) +//===== +#ifndef __bbcreaVtkDelaunay3D_h_INCLUDED__ +#define __bbcreaVtkDelaunay3D_h_INCLUDED__ + +#include "bbcreaVtk_EXPORT.h" +#include "bbtkAtomicBlackBox.h" +#include "iostream" + +#include "vtkPolyData.h" + +namespace bbcreaVtk +{ + +class bbcreaVtk_EXPORT Delaunay3D + : + public bbtk::AtomicBlackBox +{ + BBTK_BLACK_BOX_INTERFACE(Delaunay3D,bbtk::AtomicBlackBox); +//===== +// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost) +//===== + + BBTK_DECLARE_INPUT(Tolerance,double); + BBTK_DECLARE_INPUT(Alpha,double); + BBTK_DECLARE_INPUT(LstPointsX,std::vector); + BBTK_DECLARE_INPUT(LstPointsY,std::vector); + BBTK_DECLARE_INPUT(LstPointsZ,std::vector); + BBTK_DECLARE_OUTPUT(Out,vtkPolyData *); + BBTK_PROCESS(Process); + void Process(); +//===== +// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost) +//===== +}; + +BBTK_BEGIN_DESCRIBE_BLACK_BOX(Delaunay3D,bbtk::AtomicBlackBox); + BBTK_NAME("Delaunay3D"); + BBTK_AUTHOR("InfoDev"); + BBTK_DESCRIPTION("No Description."); + BBTK_CATEGORY("empty"); + + BBTK_INPUT(Delaunay3D,Tolerance,"(default 0) Delaunay Tolerance",double,""); + BBTK_INPUT(Delaunay3D,Alpha,"(default 0) Delaunay Alpha",double,""); + BBTK_INPUT(Delaunay3D,LstPointsX,"Vector of points X",std::vector,""); + BBTK_INPUT(Delaunay3D,LstPointsY,"Vector of points Y",std::vector,""); + BBTK_INPUT(Delaunay3D,LstPointsZ,"Vector of points Z",std::vector,""); + + BBTK_OUTPUT(Delaunay3D,Out,"vtkPolyData",vtkPolyData*,""); + +BBTK_END_DESCRIBE_BLACK_BOX(Delaunay3D); +//===== +// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost) +//===== +} +// EO namespace bbcreaVtk + +#endif // __bbcreaVtkDelaunay3D_h_INCLUDED__ + diff --git a/bbtk_creaVtk_PKG/src/bbcreaVtkDistanceMap.cxx b/bbtk_creaVtk_PKG/src/bbcreaVtkDistanceMap.cxx new file mode 100644 index 0000000..fae5840 --- /dev/null +++ b/bbtk_creaVtk_PKG/src/bbcreaVtkDistanceMap.cxx @@ -0,0 +1,291 @@ +//===== +// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost) +//===== +#include "bbcreaVtkDistanceMap.h" +#include "bbcreaVtkPackage.h" + +#include "creaVtk_MACROS.h" + +namespace bbcreaVtk +{ + +BBTK_ADD_BLACK_BOX_TO_PACKAGE(creaVtk,DistanceMap) +BBTK_BLACK_BOX_IMPLEMENTATION(DistanceMap,bbtk::AtomicBlackBox); +//===== +// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost) +//===== +void DistanceMap::Process() +{ + +// THE MAIN PROCESSING METHOD BODY +// Here we simply set the input 'In' value to the output 'Out' +// And print out the output value +// INPUT/OUTPUT ACCESSORS ARE OF THE FORM : +// void bbSet{Input|Output}NAME(const TYPE&) +// const TYPE& bbGet{Input|Output}NAME() const +// Where : +// * NAME is the name of the input/output +// (the one provided in the attribute 'name' of the tag 'input') +// * TYPE is the C++ type of the input/output +// (the one provided in the attribute 'type' of the tag 'input') + + if ( (bbGetInputIn()!=NULL) && (bbGetInputPoint1().size()==3) ) + { + + int ext[6]; + int dim[3]; + long int dimX,dimXY; + double spc[3]; + bbGetInputIn()->GetSpacing(spc); + bbGetInputIn()->GetExtent(ext); + dim[0] = ext[1]-ext[0]+1; + dim[1] = ext[3]-ext[2]+1; + dim[2] = ext[5]-ext[4]+1; + dimX = dim[0]; + dimXY = dim[0]*dim[1]; + if (imageoutput!=NULL) + { + imageoutput->Delete(); + } + imageoutput = vtkImageData::New(); + imageoutput->Initialize(); + imageoutput->SetSpacing( spc ); + imageoutput->SetDimensions( dim[0], dim[1], dim[2] ); + + //EED 2017-01-01 Migration VTK7 + #if (VTK_MAJOR_VERSION <= 5) + imageoutput->SetScalarType( VTK_DOUBLE ); + imageoutput->AllocateScalars(); + #endif + #if (VTK_MAJOR_VERSION >= 6) + imageoutput->AllocateScalars( VTK_DOUBLE,1 ); + #endif + imageoutput->Modified(); + + memset( imageoutput->GetScalarPointer() ,0, sizeof(double)*dim[0]*dim[1]*dim[2] ); + std::vector lst1X; + std::vector lst1Y; + std::vector lst1Z; + + std::vector lst2X; + std::vector lst2Y; + std::vector lst2Z; + + lst1X.push_back( bbGetInputPoint1()[0] ); + lst1Y.push_back( bbGetInputPoint1()[1]); + lst1Z.push_back( bbGetInputPoint1()[2]); + + long int i,size; + double glIn,glOut; + double depth=0; + int px,py,pz; + int pxOut,pyOut,pzOut; + double tmpValue; + + + DEF_POINTER_IMAGE_VTK_CREA(vIn,ssIn,pIn,stIn,bbGetInputIn()) + DEF_POINTER_IMAGE_VTK_CREA(vOut,ssOut,pOut,stOut,imageoutput) + + while (lst1X.size()>0) + { + depth=depth+bbGetInputSlope(); + size=lst1X.size(); + for (i=0;iGetScalarComponentAsDouble( lst1X[i], lst1Y[i], lst1Z[i], 0); + if (glIn!=0) + { + GETVALUE2_VTK_CREA(glOut,pOut,stOut, lst1X[i] + lst1Y[i]*dimX + lst1Z[i]*dimXY ) +// glOut=imageoutput->GetScalarComponentAsDouble( lst1X[i], lst1Y[i], lst1Z[i], 0); + if (glOut==0) + { + tmpValue = depth + (255-glIn)*bbGetInputAverageRadius()*2; + SETVALUE2_VTK_CREA(tmpValue,pOut,stOut, lst1X[i] + lst1Y[i]*dimX + lst1Z[i]*dimXY ) +// imageoutput->SetScalarComponentFromDouble( lst1X[i], lst1Y[i], lst1Z[i], 0, depth+(255-glIn)*bbGetInputAverageRadius()*2); + pxOut=lst1X[i]; pyOut=lst1Y[i]; pzOut=lst1Z[i]; + + + for (px=lst1X[i]-1;px<=lst1X[i]+1;px++) + { + for (py=lst1Y[i]-1;py<=lst1Y[i]+1;py++) + { + for (pz=lst1Z[i]-1;pz<=lst1Z[i]+1;pz++) + { + if (!( (px==lst1X[i]) && (py==lst1Y[i]) && (pz==lst1Z[i]) )) + { + if ((px>=0) && (px=0) && (py=0) && (pzGetScalarComponentAsDouble( px,py,pz , 0); + } else { + glOut=-1; + } // if px py pz inside the image + if (glOut==0) { lst2X.push_back(px); lst2Y.push_back( py ); lst2Z.push_back( pz ); } + } // if + } // for kk + } // fo jj + } // for ii + + if ( bbGetInputPoint2().size()==3) + { + if ( (bbGetInputPoint2()[0]==lst1X[i]) && (bbGetInputPoint2()[1]==lst1Y[i]) && (bbGetInputPoint2()[2]==lst1Z[i]) ) + { + i=size; // out of for lst1 + lst2X.clear(); + lst2Y.clear(); + lst2Z.clear(); + } // if Arrive to Point2 + } // Point size 3 + + } + + }// If glIn + + } // for lst1 + + lst1X.clear(); + lst1Y.clear(); + lst1Z.clear(); + + size=lst2X.size(); + for (i=0;i lstPointOut; + lstPointOut.push_back( pxOut ); + lstPointOut.push_back( pyOut ); + lstPointOut.push_back( pzOut ); + + std::vector lstPathXOut; + std::vector lstPathYOut; + std::vector lstPathZOut; + + lstPathXOut.push_back( pxOut ); + lstPathYOut.push_back( pyOut ); + lstPathZOut.push_back( pzOut ); + + // find Path + bool ok2; + bool ok = true; + double min = imageoutput->GetScalarComponentAsDouble( pxOut,pyOut,pzOut , 0); + int pxOutBack; + int pyOutBack; + int pzOutBack; + while (ok==true) + { + ok2=false; + for (px=pxOut-1;px<=pxOut+1;px++) + { + for (py=pyOut-1;py<=pyOut+1;py++) + { + for (pz=pzOut-1;pz<=pzOut+1;pz++) + { + if ((px>=0) && (px=0) && (py=0) && (pzGetScalarComponentAsDouble( px,py,pz , 0); + if ( (glOut); + BBTK_DECLARE_INPUT(Point2, std::vector); + + BBTK_DECLARE_OUTPUT(Out,vtkImageData*); + BBTK_DECLARE_OUTPUT(LengthPixels, int ); + BBTK_DECLARE_OUTPUT(FinalPoint,std::vector); + BBTK_DECLARE_OUTPUT(LstPathXOut,std::vector); + BBTK_DECLARE_OUTPUT(LstPathYOut,std::vector); + BBTK_DECLARE_OUTPUT(LstPathZOut,std::vector); + + BBTK_PROCESS(Process); + void Process(); + + vtkImageData* imageoutput; + +//===== +// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost) +//===== +}; + +BBTK_BEGIN_DESCRIBE_BLACK_BOX(DistanceMap,bbtk::AtomicBlackBox); + BBTK_NAME("DistanceMap"); + BBTK_AUTHOR("InfoDev"); + BBTK_DESCRIPTION("Normaly mask or mask[0 255] + gaussian[5]"); + BBTK_CATEGORY("empty"); + + BBTK_INPUT(DistanceMap,In,"Input image",vtkImageData*,""); + BBTK_INPUT(DistanceMap,Slope,"(default 10) Slope",double,""); + BBTK_INPUT(DistanceMap,AverageRadius,"(default 10) Average Radius of the tube",double,""); + BBTK_INPUT(DistanceMap,Point1,"Start point",std::vector,""); + BBTK_INPUT(DistanceMap,Point2,"End point (There is no guarantee of reaching this point.)",std::vector,""); + + BBTK_OUTPUT(DistanceMap,Out,"Output image",vtkImageData*,""); + BBTK_OUTPUT(DistanceMap,LengthPixels,"Path Length",int,""); + BBTK_OUTPUT(DistanceMap,FinalPoint,"Final Point",std::vector,""); + BBTK_OUTPUT(DistanceMap,LstPathXOut,"Vector path X",std::vector,""); + BBTK_OUTPUT(DistanceMap,LstPathYOut,"Vector path Y",std::vector,""); + BBTK_OUTPUT(DistanceMap,LstPathZOut,"Vector path Z",std::vector,""); + +BBTK_END_DESCRIBE_BLACK_BOX(DistanceMap); +//===== +// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost) +//===== +} +// EO namespace bbcreaVtk + +#endif // __bbcreaVtkDistanceMap_h_INCLUDED__ + diff --git a/bbtk_creaVtk_PKG/src/bbcreaVtkFillHolesFilter.cxx b/bbtk_creaVtk_PKG/src/bbcreaVtkFillHolesFilter.cxx new file mode 100644 index 0000000..4fc6141 --- /dev/null +++ b/bbtk_creaVtk_PKG/src/bbcreaVtkFillHolesFilter.cxx @@ -0,0 +1,83 @@ +//===== +// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost) +//===== +#include "bbcreaVtkFillHolesFilter.h" +#include "bbcreaVtkPackage.h" + +#include "vtkFillHolesFilter.h" + +namespace bbcreaVtk +{ + +BBTK_ADD_BLACK_BOX_TO_PACKAGE(creaVtk,FillHolesFilter) +BBTK_BLACK_BOX_IMPLEMENTATION(FillHolesFilter,bbtk::AtomicBlackBox); +//===== +// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost) +//===== +void FillHolesFilter::Process() +{ + +// THE MAIN PROCESSING METHOD BODY +// Here we simply set the input 'In' value to the output 'Out' +// And print out the output value +// INPUT/OUTPUT ACCESSORS ARE OF THE FORM : +// void bbSet{Input|Output}NAME(const TYPE&) +// const TYPE& bbGet{Input|Output}NAME() const +// Where : +// * NAME is the name of the input/output +// (the one provided in the attribute 'name' of the tag 'input') +// * TYPE is the C++ type of the input/output +// (the one provided in the attribute 'type' of the tag 'input') +// bbSetOutputOut( bbGetInputIn() ); +// std::cout << "Output value = " <SetInputData( bbGetInputIn() ); + filler->SetHoleSize( bbGetInputHoleSize() ); + filler->Update(); + bbSetOutputOut( filler->GetOutput() ); + } // if + +} +//===== +// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost) +//===== +void FillHolesFilter::bbUserSetDefaultValues() +{ + +// SET HERE THE DEFAULT INPUT/OUTPUT VALUES OF YOUR BOX +// Here we initialize the input 'In' to 0 + bbSetInputIn(NULL); + bbSetInputHoleSize(500); +} +//===== +// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost) +//===== +void FillHolesFilter::bbUserInitializeProcessing() +{ + +// THE INITIALIZATION METHOD BODY : +// Here does nothing +// but this is where you should allocate the internal/output pointers +// if any + + +} +//===== +// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost) +//===== +void FillHolesFilter::bbUserFinalizeProcessing() +{ + +// THE FINALIZATION METHOD BODY : +// Here does nothing +// but this is where you should desallocate the internal/output pointers +// if any + +} +} +// EO namespace bbcreaVtk + + diff --git a/bbtk_creaVtk_PKG/src/bbcreaVtkFillHolesFilter.h b/bbtk_creaVtk_PKG/src/bbcreaVtkFillHolesFilter.h new file mode 100644 index 0000000..f2ab5b4 --- /dev/null +++ b/bbtk_creaVtk_PKG/src/bbcreaVtkFillHolesFilter.h @@ -0,0 +1,50 @@ +//===== +// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost) +//===== +#ifndef __bbcreaVtkFillHolesFilter_h_INCLUDED__ +#define __bbcreaVtkFillHolesFilter_h_INCLUDED__ + +#include "bbcreaVtk_EXPORT.h" +#include "bbtkAtomicBlackBox.h" +#include "iostream" + +#include "vtkPolyData.h" + +namespace bbcreaVtk +{ + +class bbcreaVtk_EXPORT FillHolesFilter + : + public bbtk::AtomicBlackBox +{ + BBTK_BLACK_BOX_INTERFACE(FillHolesFilter,bbtk::AtomicBlackBox); +//===== +// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost) +//===== + BBTK_DECLARE_INPUT(In,vtkPolyData*); + BBTK_DECLARE_INPUT(HoleSize,double); + BBTK_DECLARE_OUTPUT(Out,vtkPolyData*); + BBTK_PROCESS(Process); + void Process(); +//===== +// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost) +//===== +}; + +BBTK_BEGIN_DESCRIBE_BLACK_BOX(FillHolesFilter,bbtk::AtomicBlackBox); + BBTK_NAME("FillHolesFilter"); + BBTK_AUTHOR("InfoDev"); + BBTK_DESCRIPTION("vtk - Mesh fill holes"); + BBTK_CATEGORY("empty"); + BBTK_INPUT(FillHolesFilter,In,"Input mesh polydata",vtkPolyData*,""); + BBTK_INPUT(FillHolesFilter,HoleSize,"(default 500) Hole size",double,""); + BBTK_OUTPUT(FillHolesFilter,Out,"Output mesh",vtkPolyData*,""); +BBTK_END_DESCRIBE_BLACK_BOX(FillHolesFilter); +//===== +// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost) +//===== +} +// EO namespace bbcreaVtk + +#endif // __bbcreaVtkFillHolesFilter_h_INCLUDED__ + diff --git a/bbtk_creaVtk_PKG/src/bbcreaVtkGetCameraInfo.cxx b/bbtk_creaVtk_PKG/src/bbcreaVtkGetCameraInfo.cxx new file mode 100644 index 0000000..38a982e --- /dev/null +++ b/bbtk_creaVtk_PKG/src/bbcreaVtkGetCameraInfo.cxx @@ -0,0 +1,98 @@ +//===== +// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost) +//===== +#include "bbcreaVtkGetCameraInfo.h" +#include "bbcreaVtkPackage.h" + +#include "vtkCamera.h" + +namespace bbcreaVtk +{ + +BBTK_ADD_BLACK_BOX_TO_PACKAGE(creaVtk,GetCameraInfo) +BBTK_BLACK_BOX_IMPLEMENTATION(GetCameraInfo,bbtk::AtomicBlackBox); +//===== +// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost) +//===== +void GetCameraInfo::Process() +{ + +// THE MAIN PROCESSING METHOD BODY +// Here we simply set the input 'In' value to the output 'Out' +// And print out the output value +// INPUT/OUTPUT ACCESSORS ARE OF THE FORM : +// void bbSet{Input|Output}NAME(const TYPE&) +// const TYPE& bbGet{Input|Output}NAME() const +// Where : +// * NAME is the name of the input/output +// (the one provided in the attribute 'name' of the tag 'input') +// * TYPE is the C++ type of the input/output +// (the one provided in the attribute 'type' of the tag 'input') + + if (bbGetInputvtkRenderer()!=NULL) + { + double px,py,pz; + bbGetInputvtkRenderer()->GetActiveCamera()->GetPosition(px,py,pz); + std::vector position; + position.push_back(px); + position.push_back(py); + position.push_back(pz); + bbSetOutputPosition(position); + + double vx,vy,vz; + bbGetInputvtkRenderer()->GetActiveCamera()->GetViewUp(vx,vy,vz); + std::vector viewup; + viewup.push_back(vx); + viewup.push_back(vy); + viewup.push_back(vz); + bbSetOutputViewUp(viewup); + + double fx,fy,fz; + bbGetInputvtkRenderer()->GetActiveCamera()->GetFocalPoint(fx,fy,fz); + std::vector focalpoint; + focalpoint.push_back(fx); + focalpoint.push_back(fy); + focalpoint.push_back(fz); + bbSetOutputFocalPoint(focalpoint); + } +} +//===== +// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost) +//===== +void GetCameraInfo::bbUserSetDefaultValues() +{ + +// SET HERE THE DEFAULT INPUT/OUTPUT VALUES OF YOUR BOX +// Here we initialize the input 'In' to 0 + bbSetInputvtkRenderer(NULL); + +} +//===== +// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost) +//===== +void GetCameraInfo::bbUserInitializeProcessing() +{ + +// THE INITIALIZATION METHOD BODY : +// Here does nothing +// but this is where you should allocate the internal/output pointers +// if any + + +} +//===== +// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost) +//===== +void GetCameraInfo::bbUserFinalizeProcessing() +{ + +// THE FINALIZATION METHOD BODY : +// Here does nothing +// but this is where you should desallocate the internal/output pointers +// if any + +} +} +// EO namespace bbcreaVtk + + diff --git a/bbtk_creaVtk_PKG/src/bbcreaVtkGetCameraInfo.h b/bbtk_creaVtk_PKG/src/bbcreaVtkGetCameraInfo.h new file mode 100644 index 0000000..6a8b865 --- /dev/null +++ b/bbtk_creaVtk_PKG/src/bbcreaVtkGetCameraInfo.h @@ -0,0 +1,51 @@ +//===== +// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost) +//===== +#ifndef __bbcreaVtkGetCameraInfo_h_INCLUDED__ +#define __bbcreaVtkGetCameraInfo_h_INCLUDED__ +#include "bbcreaVtk_EXPORT.h" +#include "bbtkAtomicBlackBox.h" +#include "iostream" + +#include "vtkRenderer.h" + +namespace bbcreaVtk +{ + +class bbcreaVtk_EXPORT GetCameraInfo + : + public bbtk::AtomicBlackBox +{ + BBTK_BLACK_BOX_INTERFACE(GetCameraInfo,bbtk::AtomicBlackBox); +//===== +// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost) +//===== + BBTK_DECLARE_INPUT(vtkRenderer,vtkRenderer*); + BBTK_DECLARE_OUTPUT( ViewUp, std::vector ); + BBTK_DECLARE_OUTPUT( FocalPoint, std::vector ); + BBTK_DECLARE_OUTPUT( Position, std::vector ); + BBTK_PROCESS(Process); + void Process(); +//===== +// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost) +//===== +}; + +BBTK_BEGIN_DESCRIBE_BLACK_BOX(GetCameraInfo,bbtk::AtomicBlackBox); + BBTK_NAME("GetCameraInfo"); + BBTK_AUTHOR("InfoDev"); + BBTK_DESCRIPTION("No Description."); + BBTK_CATEGORY("empty"); + BBTK_INPUT(GetCameraInfo,vtkRenderer,"vtkRenderer default NULL", vtkRenderer* ,""); + BBTK_OUTPUT(GetCameraInfo,ViewUp,"ViewUp[x,y,z]",std::vector,""); + BBTK_OUTPUT(GetCameraInfo,FocalPoint,"FocalPoint[x,y,z]",std::vector,""); + BBTK_OUTPUT(GetCameraInfo,Position,"Position[x,y,z]",std::vector,""); +BBTK_END_DESCRIBE_BLACK_BOX(GetCameraInfo); +//===== +// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost) +//===== +} +// EO namespace bbcreaVtk + +#endif // __bbcreaVtkGetCameraInfo_h_INCLUDED__ + diff --git a/bbtk_creaVtk_PKG/src/bbcreaVtkGrayLevel.cxx b/bbtk_creaVtk_PKG/src/bbcreaVtkGrayLevel.cxx index 959c59c..75ae894 100644 --- a/bbtk_creaVtk_PKG/src/bbcreaVtkGrayLevel.cxx +++ b/bbtk_creaVtk_PKG/src/bbcreaVtkGrayLevel.cxx @@ -13,7 +13,6 @@ BBTK_BLACK_BOX_IMPLEMENTATION(GrayLevel,bbtk::AtomicBlackBox); //===== void GrayLevel::Process() { - // THE MAIN PROCESSING METHOD BODY // Here we simply set the input 'In' value to the output 'Out' // And print out the output value @@ -25,27 +24,89 @@ void GrayLevel::Process() // (the one provided in the attribute 'name' of the tag 'input') // * TYPE is the C++ type of the input/output // (the one provided in the attribute 'type' of the tag 'input') - vtkImageData *m_image = vtkImageData::New(); - m_image = bbGetInputImage(); - - int grayLevel = 0; - std::vector coord = bbGetInputCoordinate(); - grayLevel = m_image->GetScalarComponentAsDouble(coord[0],coord[1],coord[2],0); +// vtkImageData *m_image = vtkImageData::New(); +// m_image = bbGetInputImage(); + double grayLevel = -9999; + std::vector coord = bbGetInputCoordinate(); + int ext[6]; + int maxX,maxY,maxZ; + double px,py,pz; + if (bbGetInputImage()!=NULL) + { + double spc[3]; + bbGetInputImage()->GetSpacing(spc); + bbGetInputImage()->GetExtent(ext); + maxX = ext[1]-ext[0]+1; + maxY = ext[3]-ext[2]+1; + maxZ = ext[5]-ext[4]+1; + if (coord.size()==3) + { + if (bbGetInputWithSpacing()==true) + { + px = coord[0]/spc[0]; + py = coord[1]/spc[1]; + pz = coord[2]/spc[2]; + } else { + px = coord[0]; + py = coord[1]; + pz = coord[2]; + }// if + px=round(px); + py=round(py); + pz=round(pz); + if ( (px>=0) && (px=0) && (py=0) && (pzGetScalarComponentAsDouble( px,py,pz,0); + } else { + grayLevel = -9991; + } // if px py pz + } // coord + std::vector lstGL; + std::vector lstX = bbGetInputLstPointsX(); + std::vector lstY = bbGetInputLstPointsY(); + std::vector lstZ = bbGetInputLstPointsZ(); + if ( (lstX.size()==lstY.size()) && (lstY.size()==lstZ.size()) ) + { + long int i,size=lstX.size(); + for (i=0;i=0) && (px=0) && (py=0) && (pzGetScalarComponentAsDouble( px, py,pz,0) ); + } else { + lstGL.push_back( -9991 ); + } + }// for + bbSetOutputLstGrayLevel(lstGL); + } // if size of Lst + } // InputImage bbSetOutputGrayLevel(grayLevel); - } + //===== // Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost) //===== void GrayLevel::bbUserSetDefaultValues() { - // SET HERE THE DEFAULT INPUT/OUTPUT VALUES OF YOUR BOX // Here we initialize the input 'In' to 0 bbSetInputImage(NULL); - + bbSetInputWithSpacing(false); } //===== // Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost) diff --git a/bbtk_creaVtk_PKG/src/bbcreaVtkGrayLevel.h b/bbtk_creaVtk_PKG/src/bbcreaVtkGrayLevel.h index 20e06f8..1023f8d 100644 --- a/bbtk_creaVtk_PKG/src/bbcreaVtkGrayLevel.h +++ b/bbtk_creaVtk_PKG/src/bbcreaVtkGrayLevel.h @@ -21,8 +21,13 @@ class bbcreaVtk_EXPORT GrayLevel // Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost) //===== BBTK_DECLARE_INPUT(Image,vtkImageData*); + BBTK_DECLARE_INPUT(WithSpacing,bool); BBTK_DECLARE_INPUT(Coordinate,std::vector); + BBTK_DECLARE_INPUT(LstPointsX,std::vector); + BBTK_DECLARE_INPUT(LstPointsY,std::vector); + BBTK_DECLARE_INPUT(LstPointsZ,std::vector); BBTK_DECLARE_OUTPUT(GrayLevel,double); + BBTK_DECLARE_OUTPUT(LstGrayLevel,std::vector); BBTK_PROCESS(Process); void Process(); //===== @@ -31,13 +36,21 @@ class bbcreaVtk_EXPORT GrayLevel }; BBTK_BEGIN_DESCRIBE_BLACK_BOX(GrayLevel,bbtk::AtomicBlackBox); -BBTK_NAME("GrayLevel"); -BBTK_AUTHOR("Monica ESPINOSA"); -BBTK_DESCRIPTION("No Description."); -BBTK_CATEGORY("empty"); -BBTK_INPUT(GrayLevel,Image,"Image",vtkImageData*,""); -BBTK_INPUT(GrayLevel,Coordinate,"Coordinate Of Point ",std::vector,""); -BBTK_OUTPUT(GrayLevel,GrayLevel,"GrayLevel",double,""); + BBTK_NAME("GrayLevel"); + BBTK_AUTHOR("Monica ESPINOSA"); + BBTK_DESCRIPTION("No Description."); + BBTK_CATEGORY("empty"); + + BBTK_INPUT(GrayLevel,Image,"Image",vtkImageData*,""); + BBTK_INPUT(GrayLevel,WithSpacing,"default (false) With spacing of the image",bool,""); + BBTK_INPUT(GrayLevel,Coordinate,"Coordinate Of Point ",std::vector,""); + BBTK_INPUT(GrayLevel,LstPointsX," List of points in X",std::vector,""); + BBTK_INPUT(GrayLevel,LstPointsY," List of points in X",std::vector,""); + BBTK_INPUT(GrayLevel,LstPointsZ," List of points in X",std::vector,""); + + BBTK_OUTPUT(GrayLevel,GrayLevel,"GrayLevel",double,""); + BBTK_OUTPUT(GrayLevel,LstGrayLevel,"List of GrayLevels for the list of points",std::vector,""); + BBTK_END_DESCRIBE_BLACK_BOX(GrayLevel); //===== // Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost) diff --git a/bbtk_creaVtk_PKG/src/bbcreaVtkHausdorffDistancePointSetFilter.cxx b/bbtk_creaVtk_PKG/src/bbcreaVtkHausdorffDistancePointSetFilter.cxx new file mode 100644 index 0000000..16b8bfd --- /dev/null +++ b/bbtk_creaVtk_PKG/src/bbcreaVtkHausdorffDistancePointSetFilter.cxx @@ -0,0 +1,95 @@ +//===== +// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost) +//===== +#include "bbcreaVtkHausdorffDistancePointSetFilter.h" +#include "bbcreaVtkPackage.h" + +#include + +namespace bbcreaVtk +{ + +BBTK_ADD_BLACK_BOX_TO_PACKAGE(creaVtk,HausdorffDistancePointSetFilter) +BBTK_BLACK_BOX_IMPLEMENTATION(HausdorffDistancePointSetFilter,bbtk::AtomicBlackBox); +//===== +// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost) +//===== +void HausdorffDistancePointSetFilter::Process() +{ + +// THE MAIN PROCESSING METHOD BODY +// Here we simply set the input 'In' value to the output 'Out' +// And print out the output value +// INPUT/OUTPUT ACCESSORS ARE OF THE FORM : +// void bbSet{Input|Output}NAME(const TYPE&) +// const TYPE& bbGet{Input|Output}NAME() const +// Where : +// * NAME is the name of the input/output +// (the one provided in the attribute 'name' of the tag 'input') +// * TYPE is the C++ type of the input/output +// (the one provided in the attribute 'type' of the tag 'input') + +// bbSetOutputOut( bbGetInputIn() ); +// std::cout << "Output value = " <SetInputData(0, bbGetInputInA() ); + hausdorff->SetInputData(1, bbGetInputInB() ); + +// hausdorff->SetTargetDistanceMethodToPointToCell(); + hausdorff->SetTargetDistanceMethodToPointToPoint(); + + hausdorff->Update(); + double rdAB,rdBA,hd; + hausdorff->GetRelativeDistance(rdAB,rdBA); + hd=hausdorff->GetHausdorffDistance(); + bbSetOutputRelativeDistanceAtoB( rdAB ); + bbSetOutputRelativeDistanceBtoA( rdBA ); + bbSetOutputHausdorffDistance( hd ); + bbSetOutputOutA( (vtkPolyData*) (hausdorff->GetOutput(0)) ); + bbSetOutputOutB( (vtkPolyData*) (hausdorff->GetOutput(1)) ); + } // if +} +//===== +// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost) +//===== +void HausdorffDistancePointSetFilter::bbUserSetDefaultValues() +{ + +// SET HERE THE DEFAULT INPUT/OUTPUT VALUES OF YOUR BOX +// Here we initialize the input 'In' to 0 + bbSetInputInA(NULL); + bbSetInputInB(NULL); + +} +//===== +// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost) +//===== +void HausdorffDistancePointSetFilter::bbUserInitializeProcessing() +{ + +// THE INITIALIZATION METHOD BODY : +// Here does nothing +// but this is where you should allocate the internal/output pointers +// if any + + +} +//===== +// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost) +//===== +void HausdorffDistancePointSetFilter::bbUserFinalizeProcessing() +{ + +// THE FINALIZATION METHOD BODY : +// Here does nothing +// but this is where you should desallocate the internal/output pointers +// if any + +} +} +// EO namespace bbcreaVtk + + diff --git a/bbtk_creaVtk_PKG/src/bbcreaVtkHausdorffDistancePointSetFilter.h b/bbtk_creaVtk_PKG/src/bbcreaVtkHausdorffDistancePointSetFilter.h new file mode 100644 index 0000000..4828067 --- /dev/null +++ b/bbtk_creaVtk_PKG/src/bbcreaVtkHausdorffDistancePointSetFilter.h @@ -0,0 +1,63 @@ +//===== +// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost) +//===== +#ifndef __bbcreaVtkHausdorffDistancePointSetFilter_h_INCLUDED__ +#define __bbcreaVtkHausdorffDistancePointSetFilter_h_INCLUDED__ + +#include "bbcreaVtk_EXPORT.h" +#include "bbtkAtomicBlackBox.h" +#include "iostream" + +#include + +namespace bbcreaVtk +{ + +class bbcreaVtk_EXPORT HausdorffDistancePointSetFilter + : + public bbtk::AtomicBlackBox +{ + BBTK_BLACK_BOX_INTERFACE(HausdorffDistancePointSetFilter,bbtk::AtomicBlackBox); +//===== +// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost) +//===== + BBTK_DECLARE_INPUT(InA,vtkPolyData*); + BBTK_DECLARE_INPUT(InB,vtkPolyData*); + + BBTK_DECLARE_OUTPUT(RelativeDistanceAtoB,double); + BBTK_DECLARE_OUTPUT(RelativeDistanceBtoA,double); + BBTK_DECLARE_OUTPUT(HausdorffDistance,double); + BBTK_DECLARE_OUTPUT(OutA,vtkPolyData*); + BBTK_DECLARE_OUTPUT(OutB,vtkPolyData*); + + BBTK_PROCESS(Process); + void Process(); +//===== +// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost) +//===== +}; + +BBTK_BEGIN_DESCRIBE_BLACK_BOX(HausdorffDistancePointSetFilter,bbtk::AtomicBlackBox); + BBTK_NAME("HausdorffDistancePointSetFilter"); + BBTK_AUTHOR("InfoDev"); + BBTK_DESCRIPTION("Output Mesh with HausdorffDistance and RelativeDistance vector information "); + BBTK_CATEGORY("empty"); + + BBTK_INPUT(HausdorffDistancePointSetFilter,InA,"Mesh A",vtkPolyData*,""); + BBTK_INPUT(HausdorffDistancePointSetFilter,InB,"Mesh B",vtkPolyData*,""); + + BBTK_OUTPUT(HausdorffDistancePointSetFilter,RelativeDistanceAtoB,"Relative distance A to B",double,""); + BBTK_OUTPUT(HausdorffDistancePointSetFilter,RelativeDistanceBtoA,"Relative distance B to A",double,""); + BBTK_OUTPUT(HausdorffDistancePointSetFilter,HausdorffDistance,"Hausdorff distance",double,""); + + BBTK_OUTPUT(HausdorffDistancePointSetFilter,OutA,"Output Mesh with 'Distance' vector information",vtkPolyData*,""); + BBTK_OUTPUT(HausdorffDistancePointSetFilter,OutB,"Output Mesh with 'Distance' vector information",vtkPolyData*,""); +BBTK_END_DESCRIBE_BLACK_BOX(HausdorffDistancePointSetFilter); +//===== +// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost) +//===== +} +// EO namespace bbcreaVtk + +#endif // __bbcreaVtkHausdorffDistancePointSetFilter_h_INCLUDED__ + diff --git a/bbtk_creaVtk_PKG/src/bbcreaVtkImageAppendComponents.cxx b/bbtk_creaVtk_PKG/src/bbcreaVtkImageAppendComponents.cxx new file mode 100644 index 0000000..bcdc510 --- /dev/null +++ b/bbtk_creaVtk_PKG/src/bbcreaVtkImageAppendComponents.cxx @@ -0,0 +1,80 @@ +//===== +// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost) +//===== +#include "bbcreaVtkImageAppendComponents.h" +#include "bbcreaVtkPackage.h" +namespace bbcreaVtk +{ + +BBTK_ADD_BLACK_BOX_TO_PACKAGE(creaVtk,ImageAppendComponents) +BBTK_BLACK_BOX_IMPLEMENTATION(ImageAppendComponents,bbtk::AtomicBlackBox); +//===== +// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost) +//===== +void ImageAppendComponents::Process() +{ + +// THE MAIN PROCESSING METHOD BODY +// Here we simply set the input 'In' value to the output 'Out' +// And print out the output value +// INPUT/OUTPUT ACCESSORS ARE OF THE FORM : +// void bbSet{Input|Output}NAME(const TYPE&) +// const TYPE& bbGet{Input|Output}NAME() const +// Where : +// * NAME is the name of the input/output +// (the one provided in the attribute 'name' of the tag 'input') +// * TYPE is the C++ type of the input/output +// (the one provided in the attribute 'type' of the tag 'input') + +// bbSetOutputOut( bbGetInputIn() ); +// std::cout << "Output value = " <Delete(); + } // + _appendFilter = vtkImageAppendComponents::New(); + _appendFilter->SetInputData( bbGetInputIn0() ); + _appendFilter->AddInputData( bbGetInputIn1() ); + _appendFilter->AddInputData( bbGetInputIn2() ); + _appendFilter->AddInputData( bbGetInputIn3() ); + _appendFilter->Update(); + bbSetOutputOut( _appendFilter->GetOutput() ); +} +//===== +// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost) +//===== +void ImageAppendComponents::bbUserSetDefaultValues() +{ +// SET HERE THE DEFAULT INPUT/OUTPUT VALUES OF YOUR BOX +// Here we initialize the input 'In' to 0 + _appendFilter=NULL; + bbSetInputIn0(NULL); + bbSetInputIn1(NULL); + bbSetInputIn2(NULL); + bbSetInputIn3(NULL); +} +//===== +// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost) +//===== +void ImageAppendComponents::bbUserInitializeProcessing() +{ +// THE INITIALIZATION METHOD BODY : +// Here does nothing +// but this is where you should allocate the internal/output pointers +// if any +} +//===== +// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost) +//===== +void ImageAppendComponents::bbUserFinalizeProcessing() +{ +// THE FINALIZATION METHOD BODY : +// Here does nothing +// but this is where you should desallocate the internal/output pointers +// if any +} + +}// EO namespace bbcreaVtk + + diff --git a/bbtk_creaVtk_PKG/src/bbcreaVtkImageAppendComponents.h b/bbtk_creaVtk_PKG/src/bbcreaVtkImageAppendComponents.h new file mode 100644 index 0000000..9ff171f --- /dev/null +++ b/bbtk_creaVtk_PKG/src/bbcreaVtkImageAppendComponents.h @@ -0,0 +1,61 @@ +//===== +// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost) +//===== +#ifndef __bbcreaVtkImageAppendComponents_h_INCLUDED__ +#define __bbcreaVtkImageAppendComponents_h_INCLUDED__ + +#include "bbcreaVtk_EXPORT.h" +#include "bbtkAtomicBlackBox.h" +#include "iostream" + +#include "vtkImageData.h" +#include "vtkImageAppendComponents.h" + +namespace bbcreaVtk +{ + +class bbcreaVtk_EXPORT ImageAppendComponents + : + public bbtk::AtomicBlackBox +{ + BBTK_BLACK_BOX_INTERFACE(ImageAppendComponents,bbtk::AtomicBlackBox); +//===== +// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost) +//===== + BBTK_DECLARE_INPUT(In0,vtkImageData*); + BBTK_DECLARE_INPUT(In1,vtkImageData*); + BBTK_DECLARE_INPUT(In2,vtkImageData*); + BBTK_DECLARE_INPUT(In3,vtkImageData*); + BBTK_DECLARE_OUTPUT(Out,vtkImageData*); + BBTK_PROCESS(Process); + void Process(); + + vtkImageAppendComponents *_appendFilter; + +//===== +// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost) +//===== +}; + +BBTK_BEGIN_DESCRIBE_BLACK_BOX(ImageAppendComponents,bbtk::AtomicBlackBox); + BBTK_NAME("ImageAppendComponents"); + BBTK_AUTHOR("InfoDev"); + BBTK_DESCRIPTION("No Description."); + BBTK_CATEGORY("empty"); + + BBTK_INPUT(ImageAppendComponents,In0,"Image Component",vtkImageData*,""); + BBTK_INPUT(ImageAppendComponents,In1,"Image Component",vtkImageData*,""); + BBTK_INPUT(ImageAppendComponents,In2,"Image Component",vtkImageData*,""); + BBTK_INPUT(ImageAppendComponents,In3,"Image Component",vtkImageData*,""); + + BBTK_OUTPUT(ImageAppendComponents,Out,"Output image with some components",vtkImageData*,""); + +BBTK_END_DESCRIBE_BLACK_BOX(ImageAppendComponents); +//===== +// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost) +//===== +} +// EO namespace bbcreaVtk + +#endif // __bbcreaVtkImageAppendComponents_h_INCLUDED__ + diff --git a/bbtk_creaVtk_PKG/src/bbcreaVtkImageConnectivityFilter.cxx b/bbtk_creaVtk_PKG/src/bbcreaVtkImageConnectivityFilter.cxx new file mode 100644 index 0000000..2f5c9e9 --- /dev/null +++ b/bbtk_creaVtk_PKG/src/bbcreaVtkImageConnectivityFilter.cxx @@ -0,0 +1,102 @@ +//===== +// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost) +//===== +#include "bbcreaVtkImageConnectivityFilter.h" +#include "bbcreaVtkPackage.h" + +namespace bbcreaVtk +{ + +BBTK_ADD_BLACK_BOX_TO_PACKAGE(creaVtk,ImageConnectivityFilter) +BBTK_BLACK_BOX_IMPLEMENTATION(ImageConnectivityFilter,bbtk::AtomicBlackBox); +//===== +// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost) +//===== +void ImageConnectivityFilter::Process() +{ + +// THE MAIN PROCESSING METHOD BODY +// Here we simply set the input 'In' value to the output 'Out' +// And print out the output value +// INPUT/OUTPUT ACCESSORS ARE OF THE FORM : +// void bbSet{Input|Output}NAME(const TYPE&) +// const TYPE& bbGet{Input|Output}NAME() const +// Where : +// * NAME is the name of the input/output +// (the one provided in the attribute 'name' of the tag 'input') +// * TYPE is the C++ type of the input/output +// (the one provided in the attribute 'type' of the tag 'input') + + + if (bbGetInputIn()!=NULL){ + if (imgConnfilter) {imgConnfilter->Delete();} + imgConnfilter=vtkImageConnectivityFilter::New(); + imgConnfilter->SetInputData( bbGetInputIn() ); + if (bbGetInputExtractionMode()==0) // LargestRegion + { + imgConnfilter->SetExtractionModeToLargestRegion(); + } // ExtractionMode + + if (bbGetInputExtractionMode()==1) // AllRegions + { + printf("EED Warning!!!! ImageConnectivityFilter - AllRegions Not Implemented\n "); + } // ExtractionMode + if (bbGetInputExtractionMode()==2) // SeededRegions + { + printf("EED Warning!!!! ImageConnectivityFilter - SeededRegions Not Implemented\n "); + } // ExtractionMode + + if (bbGetInputScalarRange().size()==2) + { + imgConnfilter->SetScalarRange( bbGetInputScalarRange()[0], bbGetInputScalarRange()[1] ); + } // Range + imgConnfilter->Update(); + bbSetOutputOut( imgConnfilter->GetOutput() ); + } else { + printf("EED Warning!!!! ImageConnectivityFilter - Input image not defined.\n "); + }// In + +} +//===== +// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost) +//===== +void ImageConnectivityFilter::bbUserSetDefaultValues() +{ + +// SET HERE THE DEFAULT INPUT/OUTPUT VALUES OF YOUR BOX +// Here we initialize the input 'In' to 0 + bbSetInputIn(NULL); +// bbSetInputScalarRange(); + imgConnfilter=NULL; + bbSetInputExtractionMode(0); + +} +//===== +// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost) +//===== +void ImageConnectivityFilter::bbUserInitializeProcessing() +{ + +// THE INITIALIZATION METHOD BODY : +// Here does nothing +// but this is where you should allocate the internal/output pointers +// if any + + +} +//===== +// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost) +//===== +void ImageConnectivityFilter::bbUserFinalizeProcessing() +{ + +// THE FINALIZATION METHOD BODY : +// Here does nothing +// but this is where you should desallocate the internal/output pointers +// if any + +} +} +// EO namespace bbcreaVtk + + diff --git a/bbtk_creaVtk_PKG/src/bbcreaVtkImageConnectivityFilter.h b/bbtk_creaVtk_PKG/src/bbcreaVtkImageConnectivityFilter.h new file mode 100644 index 0000000..bec7295 --- /dev/null +++ b/bbtk_creaVtk_PKG/src/bbcreaVtkImageConnectivityFilter.h @@ -0,0 +1,59 @@ +//===== +// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost) +//===== +#ifndef __bbcreaVtkImageConnectivityFilter_h_INCLUDED__ +#define __bbcreaVtkImageConnectivityFilter_h_INCLUDED__ + +#include "bbcreaVtk_EXPORT.h" +#include "bbtkAtomicBlackBox.h" +#include "iostream" + +#include +#include + +namespace bbcreaVtk +{ + +class bbcreaVtk_EXPORT ImageConnectivityFilter + : + public bbtk::AtomicBlackBox +{ + BBTK_BLACK_BOX_INTERFACE(ImageConnectivityFilter,bbtk::AtomicBlackBox); +//===== +// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost) +//===== + BBTK_DECLARE_INPUT(In,vtkImageData*); + BBTK_DECLARE_INPUT(ExtractionMode,int); + BBTK_DECLARE_INPUT(ScalarRange,std::vector< double >); + + BBTK_DECLARE_OUTPUT(Out,vtkImageData*); + BBTK_PROCESS(Process); + void Process(); + + vtkImageConnectivityFilter* imgConnfilter; +//===== +// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost) +//===== +}; + +BBTK_BEGIN_DESCRIBE_BLACK_BOX(ImageConnectivityFilter,bbtk::AtomicBlackBox); + BBTK_NAME("ImageConnectivityFilter"); + BBTK_AUTHOR("InfoDev"); + BBTK_DESCRIPTION("No Description."); + BBTK_CATEGORY("empty"); + + BBTK_INPUT(ImageConnectivityFilter,In,"Input image",vtkImageData*,""); + BBTK_INPUT(ImageConnectivityFilter,ExtractionMode,"(default 0) 0=LargestRegion 1=AllRegions 2=SeededRegions",int,""); + BBTK_INPUT(ImageConnectivityFilter,ScalarRange,"threshold [Min Max]",std::vector< double >,""); + + BBTK_OUTPUT(ImageConnectivityFilter,Out,"Output image",vtkImageData*,""); + +BBTK_END_DESCRIBE_BLACK_BOX(ImageConnectivityFilter); +//===== +// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost) +//===== +} +// EO namespace bbcreaVtk + +#endif // __bbcreaVtkImageConnectivityFilter_h_INCLUDED__ + diff --git a/bbtk_creaVtk_PKG/src/bbcreaVtkImageContinuousDilate3D.cxx b/bbtk_creaVtk_PKG/src/bbcreaVtkImageContinuousDilate3D.cxx index f7ab426..f616d22 100644 --- a/bbtk_creaVtk_PKG/src/bbcreaVtkImageContinuousDilate3D.cxx +++ b/bbtk_creaVtk_PKG/src/bbcreaVtkImageContinuousDilate3D.cxx @@ -15,7 +15,7 @@ void ImageContinuousDilate3D::Process() vtkImageData* ImageContinuousDilate3D::dilateFilterRecursive(vtkImageData* image, int repetitions, double x, double y, double z) { - vtkImageContinuousDilate3D *dilateFilter = vtkImageContinuousDilate3D ::New(); + vtkImageContinuousDilate3D *dilateFilter = vtkImageContinuousDilate3D::New(); //EED 2017-01-01 Migration VTK7 #if VTK_MAJOR_VERSION <= 5 dilateFilter->SetInput (image); @@ -45,20 +45,16 @@ void ImageContinuousDilate3D::bbUserSetDefaultValues() void ImageContinuousDilate3D::bbUserInitializeProcessing() { - - } void ImageContinuousDilate3D::bbUserFinalizeProcessing() { - // THE FINALIZATION METHOD BODY : // Here does nothing // but this is where you should desallocate the internal/output pointers // if any - } -} -// EO namespace bbcreaVtk + +} // EO namespace bbcreaVtk diff --git a/bbtk_creaVtk_PKG/src/bbcreaVtkImageContinuousDilate3D.h b/bbtk_creaVtk_PKG/src/bbcreaVtkImageContinuousDilate3D.h index 738e9f3..687e01e 100644 --- a/bbtk_creaVtk_PKG/src/bbcreaVtkImageContinuousDilate3D.h +++ b/bbtk_creaVtk_PKG/src/bbcreaVtkImageContinuousDilate3D.h @@ -36,16 +36,19 @@ class bbcreaVtk_EXPORT ImageContinuousDilate3D }; BBTK_BEGIN_DESCRIBE_BLACK_BOX(ImageContinuousDilate3D,bbtk::AtomicBlackBox); -BBTK_NAME("ImageContinuousDilate3D"); -BBTK_AUTHOR("Carlos Torres"); -BBTK_DESCRIPTION("No Description."); -BBTK_CATEGORY("empty"); -BBTK_INPUT(ImageContinuousDilate3D,X,"X (default 3)",double,""); -BBTK_INPUT(ImageContinuousDilate3D,Y,"Y (default 3)",double,""); -BBTK_INPUT(ImageContinuousDilate3D,Z,"Z (default 3)",double,""); -BBTK_INPUT(ImageContinuousDilate3D,Repetitions,"Repetitions (default 0, it works minimum ones) ",int,""); -BBTK_INPUT(ImageContinuousDilate3D,Image,"Image input",vtkImageData*,""); -BBTK_OUTPUT(ImageContinuousDilate3D,Out,"Image output",vtkImageData*,""); + BBTK_NAME("ImageContinuousDilate3D"); + BBTK_AUTHOR("Carlos Torres"); + BBTK_DESCRIPTION("No Description."); + BBTK_CATEGORY("empty"); + + BBTK_INPUT(ImageContinuousDilate3D,X,"X (default 3)",double,""); + BBTK_INPUT(ImageContinuousDilate3D,Y,"Y (default 3)",double,""); + BBTK_INPUT(ImageContinuousDilate3D,Z,"Z (default 3)",double,""); + BBTK_INPUT(ImageContinuousDilate3D,Repetitions,"Repetitions (default 0, it works minimum ones) ",int,""); + BBTK_INPUT(ImageContinuousDilate3D,Image,"Image input",vtkImageData*,""); + + BBTK_OUTPUT(ImageContinuousDilate3D,Out,"Image output",vtkImageData*,""); + BBTK_END_DESCRIBE_BLACK_BOX(ImageContinuousDilate3D); //===== // Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost) diff --git a/bbtk_creaVtk_PKG/src/bbcreaVtkImageContinuousErode3D.cxx b/bbtk_creaVtk_PKG/src/bbcreaVtkImageContinuousErode3D.cxx index 4784991..debccc0 100644 --- a/bbtk_creaVtk_PKG/src/bbcreaVtkImageContinuousErode3D.cxx +++ b/bbtk_creaVtk_PKG/src/bbcreaVtkImageContinuousErode3D.cxx @@ -1,6 +1,10 @@ #include "bbcreaVtkImageContinuousErode3D.h" #include "bbcreaVtkPackage.h" + +#include "vtkImageContinuousErode3D.h" + + namespace bbcreaVtk { @@ -37,17 +41,16 @@ vtkImageData* ImageContinuousErode3D::erodeFilterRecursive(vtkImageData* image, void ImageContinuousErode3D::bbUserSetDefaultValues() { - + bbSetInputX(3); + bbSetInputY(3); + bbSetInputY(3); + bbSetInputRepetitions(0); } //===== // Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost) //===== void ImageContinuousErode3D::bbUserInitializeProcessing() { - bbSetInputX(3); - bbSetInputY(3); - bbSetInputY(3); - bbSetInputRepetitions(0); } //===== // Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost) diff --git a/bbtk_creaVtk_PKG/src/bbcreaVtkImageContinuousErode3D.h b/bbtk_creaVtk_PKG/src/bbcreaVtkImageContinuousErode3D.h index efe2127..c87a328 100644 --- a/bbtk_creaVtk_PKG/src/bbcreaVtkImageContinuousErode3D.h +++ b/bbtk_creaVtk_PKG/src/bbcreaVtkImageContinuousErode3D.h @@ -6,8 +6,8 @@ #include "bbcreaVtk_EXPORT.h" #include "bbtkAtomicBlackBox.h" #include "iostream" + #include "vtkImageData.h" -#include "vtkImageContinuousErode3D.h" namespace bbcreaVtk { @@ -20,10 +20,10 @@ class bbcreaVtk_EXPORT ImageContinuousErode3D //===== // Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost) //===== + BBTK_DECLARE_INPUT(Repetitions,int); BBTK_DECLARE_INPUT(X,double); BBTK_DECLARE_INPUT(Y,double); BBTK_DECLARE_INPUT(Z,double); - BBTK_DECLARE_INPUT(Repetitions,int); BBTK_DECLARE_INPUT(Image,vtkImageData*); BBTK_DECLARE_OUTPUT(Out,vtkImageData*); BBTK_PROCESS(Process); @@ -35,16 +35,19 @@ class bbcreaVtk_EXPORT ImageContinuousErode3D }; BBTK_BEGIN_DESCRIBE_BLACK_BOX(ImageContinuousErode3D,bbtk::AtomicBlackBox); -BBTK_NAME("ImageContinuousErode3D"); -BBTK_AUTHOR("Carlos Torres"); -BBTK_DESCRIPTION("No Description."); -BBTK_CATEGORY("empty"); -BBTK_INPUT(ImageContinuousErode3D,X,"X (default 3)",double,""); -BBTK_INPUT(ImageContinuousErode3D,Y,"Y (default 3)",double,""); -BBTK_INPUT(ImageContinuousErode3D,Z,"Z (default 3)",double,""); -BBTK_INPUT(ImageContinuousErode3D,Repetitions,"Repetitions (default 0, it works minimum ones)",int,""); -BBTK_INPUT(ImageContinuousErode3D,Image,"Image input",vtkImageData*,""); -BBTK_OUTPUT(ImageContinuousErode3D,Out,"Image output",vtkImageData*,""); + BBTK_NAME("ImageContinuousErode3D"); + BBTK_AUTHOR("Carlos Torres"); + BBTK_DESCRIPTION("No Description."); + BBTK_CATEGORY("empty"); + + BBTK_INPUT(ImageContinuousErode3D,X,"X (default 3)",double,""); + BBTK_INPUT(ImageContinuousErode3D,Y,"Y (default 3)",double,""); + BBTK_INPUT(ImageContinuousErode3D,Z,"Z (default 3)",double,""); + BBTK_INPUT(ImageContinuousErode3D,Repetitions,"Repetitions (default 0, it works minimum ones)",int,""); + BBTK_INPUT(ImageContinuousErode3D,Image,"Image input",vtkImageData*,""); + + BBTK_OUTPUT(ImageContinuousErode3D,Out,"Image output",vtkImageData*,""); + BBTK_END_DESCRIBE_BLACK_BOX(ImageContinuousErode3D); //===== // Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost) diff --git a/bbtk_creaVtk_PKG/src/bbcreaVtkImageCutByAxis.cxx b/bbtk_creaVtk_PKG/src/bbcreaVtkImageCutByAxis.cxx index 7644642..687ee73 100644 --- a/bbtk_creaVtk_PKG/src/bbcreaVtkImageCutByAxis.cxx +++ b/bbtk_creaVtk_PKG/src/bbcreaVtkImageCutByAxis.cxx @@ -118,7 +118,7 @@ void ImageCutByAxis::Process() } // for j } //c4 - + newData->Modified(); bbSetOutputOut( newData ); } @@ -131,7 +131,7 @@ void ImageCutByAxis::bbUserSetDefaultValues() // SET HERE THE DEFAULT INPUT/OUTPUT VALUES OF YOUR BOX // Here we initialize the input 'In' to 0 bbSetInputIn(NULL); - bbSetInputType("x+y+z+"); + bbSetInputType("x-y-z+"); bbSetInputInsideVol(true); std::vector point; point.push_back(0); diff --git a/bbtk_creaVtk_PKG/src/bbcreaVtkImageCutByAxis.h b/bbtk_creaVtk_PKG/src/bbcreaVtkImageCutByAxis.h index 1cf7640..33d9c3c 100644 --- a/bbtk_creaVtk_PKG/src/bbcreaVtkImageCutByAxis.h +++ b/bbtk_creaVtk_PKG/src/bbcreaVtkImageCutByAxis.h @@ -38,7 +38,7 @@ BBTK_BEGIN_DESCRIBE_BLACK_BOX(ImageCutByAxis,bbtk::AtomicBlackBox); BBTK_DESCRIPTION("No Description."); BBTK_CATEGORY("empty"); BBTK_INPUT(ImageCutByAxis,In,"Input image",vtkImageData*,""); - BBTK_INPUT(ImageCutByAxis,Type,"x y z x+y+ x-y+ x+y- x-y- y+z+ y+z- y-z+ y-z- x+z+ x+z- x-z+ x-z- x+y+z+ x-y+z+ x+y-z+ x+y+z- x-y-z+ x-y+z- x+y-z- x-y-z-",std::string,""); + BBTK_INPUT(ImageCutByAxis,Type,"(default x-y-z+) missing all options:x y z x+y+ x-y+ x+y- x-y- y+z+ y+z- y-z+ y-z- x+z+ x+z- x-z+ x-z- x+y+z+ x-y+z+ x+y-z+ x+y+z- x-y-z+ x-y+z- x+y-z- x-y-z-",std::string,""); BBTK_INPUT(ImageCutByAxis,InsideVol,"Inside volume",bool,""); BBTK_INPUT(ImageCutByAxis,Point,"First input",std::vector,""); BBTK_INPUT(ImageCutByAxis,TypeOrientation,"TypeOrientation (default 0) 0=XY 1=XZ 2=YZ",int,""); diff --git a/bbtk_creaVtk_PKG/src/bbcreaVtkImageDataStructuredPoints.cxx b/bbtk_creaVtk_PKG/src/bbcreaVtkImageDataStructuredPoints.cxx index 20c25c7..9f0ccec 100644 --- a/bbtk_creaVtk_PKG/src/bbcreaVtkImageDataStructuredPoints.cxx +++ b/bbtk_creaVtk_PKG/src/bbcreaVtkImageDataStructuredPoints.cxx @@ -13,22 +13,26 @@ BBTK_BLACK_BOX_IMPLEMENTATION(ImageDataStructuredPoints,bbtk::AtomicBlackBox); //===== void ImageDataStructuredPoints::Process() { - vtkImageData* imageX = bbGetInputX(); - vtkImageData* imageY = bbGetInputY(); - vtkImageData* imageZ = bbGetInputZ(); - - vtkImageDataStrucPoints idsp; - - idsp.joinComponents(imageX, imageY, imageZ); - bbSetOutputImageEnsemble( idsp.getStructuredPoints() ); - + vtkImageDataStrucPoints idsp; + idsp.joinComponents(bbGetInputX(), bbGetInputY(), bbGetInputZ(), + bbGetInputData1(), bbGetInputData2(), bbGetInputData3(), + bbGetInputData4(), bbGetInputData5(), bbGetInputData6() ); + bbSetOutputImageEnsemble( idsp.getStructuredPoints() ); } //===== // Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost) //===== void ImageDataStructuredPoints::bbUserSetDefaultValues() { - + bbSetInputX(NULL); + bbSetInputY(NULL); + bbSetInputZ(NULL); + bbSetInputData1(NULL); + bbSetInputData2(NULL); + bbSetInputData3(NULL); + bbSetInputData4(NULL); + bbSetInputData5(NULL); + bbSetInputData6(NULL); } //===== // Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost) diff --git a/bbtk_creaVtk_PKG/src/bbcreaVtkImageDataStructuredPoints.h b/bbtk_creaVtk_PKG/src/bbcreaVtkImageDataStructuredPoints.h index c679b52..4e30e62 100644 --- a/bbtk_creaVtk_PKG/src/bbcreaVtkImageDataStructuredPoints.h +++ b/bbtk_creaVtk_PKG/src/bbcreaVtkImageDataStructuredPoints.h @@ -24,6 +24,12 @@ class bbcreaVtk_EXPORT ImageDataStructuredPoints BBTK_DECLARE_INPUT(X, vtkImageData*); BBTK_DECLARE_INPUT(Y, vtkImageData*); BBTK_DECLARE_INPUT(Z, vtkImageData*); + BBTK_DECLARE_INPUT(Data1, vtkImageData*); + BBTK_DECLARE_INPUT(Data2, vtkImageData*); + BBTK_DECLARE_INPUT(Data3, vtkImageData*); + BBTK_DECLARE_INPUT(Data4, vtkImageData*); + BBTK_DECLARE_INPUT(Data5, vtkImageData*); + BBTK_DECLARE_INPUT(Data6, vtkImageData*); BBTK_DECLARE_OUTPUT(ImageEnsemble, vtkImageData*); BBTK_PROCESS(Process); void Process(); @@ -33,14 +39,20 @@ class bbcreaVtk_EXPORT ImageDataStructuredPoints }; BBTK_BEGIN_DESCRIBE_BLACK_BOX(ImageDataStructuredPoints,bbtk::AtomicBlackBox); -BBTK_NAME("ImageDataStructuredPoints"); -BBTK_AUTHOR("Carlos Torres"); -BBTK_DESCRIPTION("No Description."); -BBTK_CATEGORY("empty"); -BBTK_INPUT(ImageDataStructuredPoints,X,"Image X",vtkImageData*,""); -BBTK_INPUT(ImageDataStructuredPoints,Y,"Image Y",vtkImageData*,""); -BBTK_INPUT(ImageDataStructuredPoints,Z,"Image Z",vtkImageData*,""); -BBTK_OUTPUT(ImageDataStructuredPoints,ImageEnsemble,"Image Ensemble",vtkImageData*,""); + BBTK_NAME("ImageDataStructuredPoints"); + BBTK_AUTHOR("Carlos Torres"); + BBTK_DESCRIPTION("No Description."); + BBTK_CATEGORY("empty"); + BBTK_INPUT(ImageDataStructuredPoints,X,"Image X",vtkImageData*,""); + BBTK_INPUT(ImageDataStructuredPoints,Y,"Image Y",vtkImageData*,""); + BBTK_INPUT(ImageDataStructuredPoints,Z,"Image Z",vtkImageData*,""); + BBTK_INPUT(ImageDataStructuredPoints,Data1,"You need: No Data or Data1 or Data1..3 or Data1..6",vtkImageData*,""); + BBTK_INPUT(ImageDataStructuredPoints,Data2,"You need: No Data or Data1 or Data1..3 or Data1..6",vtkImageData*,""); + BBTK_INPUT(ImageDataStructuredPoints,Data3,"You need: No Data or Data1 or Data1..3 or Data1..6",vtkImageData*,""); + BBTK_INPUT(ImageDataStructuredPoints,Data4,"You need: No Data or Data1 or Data1..3 or Data1..6",vtkImageData*,""); + BBTK_INPUT(ImageDataStructuredPoints,Data5,"You need: No Data or Data1 or Data1..3 or Data1..6",vtkImageData*,""); + BBTK_INPUT(ImageDataStructuredPoints,Data6,"You need: No Data or Data1 or Data1..3 or Data1..6",vtkImageData*,""); + BBTK_OUTPUT(ImageDataStructuredPoints,ImageEnsemble,"Image Ensemble",vtkImageData*,""); BBTK_END_DESCRIBE_BLACK_BOX(ImageDataStructuredPoints); //===== // Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost) diff --git a/bbtk_creaVtk_PKG/src/bbcreaVtkImageExtractComponents.cxx b/bbtk_creaVtk_PKG/src/bbcreaVtkImageExtractComponents.cxx index 2769f79..e4bd318 100644 --- a/bbtk_creaVtk_PKG/src/bbcreaVtkImageExtractComponents.cxx +++ b/bbtk_creaVtk_PKG/src/bbcreaVtkImageExtractComponents.cxx @@ -34,67 +34,93 @@ void ImageExtractComponents::Process() bbSetOutputOut2( NULL ); bbSetOutputOut3( NULL ); - if (bbGetInputComponent0()!=-1) - { -//EED 2017-01-01 Migration VTK7 -#if VTK_MAJOR_VERSION <= 5 - IEC0->SetInput( bbGetInputIn() ); -#else - IEC0->SetInputData( bbGetInputIn() ); -#endif - IEC0->SetComponents( bbGetInputComponent0() ); - IEC0->Update(); - bbSetOutputOut0( IEC0->GetOutput() ); - } - - if (bbGetInputComponent1()!=-1) - { -//EED 2017-01-01 Migration VTK7 -#if VTK_MAJOR_VERSION <= 5 - IEC1->SetInput( bbGetInputIn() ); -#else - IEC1->SetInputData( bbGetInputIn() ); -#endif - IEC1->SetComponents( bbGetInputComponent1() ); - IEC1->Update(); - bbSetOutputOut1( IEC1->GetOutput() ); - } - - if (bbGetInputComponent2()!=-1) - { -//EED 2017-01-01 Migration VTK7 -#if VTK_MAJOR_VERSION <= 5 - IEC2->SetInput( bbGetInputIn() ); -#else - IEC2->SetInputData( bbGetInputIn() ); -#endif - IEC2->SetComponents( bbGetInputComponent2() ); - IEC2->Update(); - bbSetOutputOut2( IEC2->GetOutput() ); - } - - if (bbGetInputComponent3()!=-1) - { - -//EED 2017-01-01 Migration VTK7 -#if VTK_MAJOR_VERSION <= 5 - IEC3->SetInput( bbGetInputIn() ); -#else - IEC3->SetInputData( bbGetInputIn() ); -#endif - IEC3->SetComponents( bbGetInputComponent2() ); - IEC3->Update(); - bbSetOutputOut3( IEC3->GetOutput() ); - } - - +// InputComponent 0..3 + if (bbGetInputType()==0) + { + + if (bbGetInputComponent0()!=-1) + { + //EED 2017-01-01 Migration VTK7 + #if VTK_MAJOR_VERSION <= 5 + IEC0->SetInput( bbGetInputIn() ); + #else + IEC0->SetInputData( bbGetInputIn() ); + #endif + IEC0->SetComponents( bbGetInputComponent0() ); + IEC0->Update(); + bbSetOutputOut0( IEC0->GetOutput() ); + } + + if (bbGetInputComponent1()!=-1) + { + //EED 2017-01-01 Migration VTK7 + #if VTK_MAJOR_VERSION <= 5 + IEC1->SetInput( bbGetInputIn() ); + #else + IEC1->SetInputData( bbGetInputIn() ); + #endif + IEC1->SetComponents( bbGetInputComponent1() ); + IEC1->Update(); + bbSetOutputOut1( IEC1->GetOutput() ); + } + + if (bbGetInputComponent2()!=-1) + { + //EED 2017-01-01 Migration VTK7 + #if VTK_MAJOR_VERSION <= 5 + IEC2->SetInput( bbGetInputIn() ); + #else + IEC2->SetInputData( bbGetInputIn() ); + #endif + IEC2->SetComponents( bbGetInputComponent2() ); + IEC2->Update(); + bbSetOutputOut2( IEC2->GetOutput() ); + } + + if (bbGetInputComponent3()!=-1) + { + //EED 2017-01-01 Migration VTK7 + #if VTK_MAJOR_VERSION <= 5 + IEC3->SetInput( bbGetInputIn() ); + #else + IEC3->SetInputData( bbGetInputIn() ); + #endif + IEC3->SetComponents( bbGetInputComponent2() ); + IEC3->Update(); + bbSetOutputOut3( IEC3->GetOutput() ); + } + } // Type 0 + +// List of components + if (bbGetInputType()==1) + { + int i,size=lstIEC.size(); + for (i=0; iDelete(); + } // for i + lstIEC.clear(); + lstOut.clear(); + int nrCmp = bbGetInputIn()->GetNumberOfScalarComponents(); + for (i=0; iSetInputData( bbGetInputIn() ); + IEC->SetComponents( i ); + IEC->Update(); + lstIEC.push_back( IEC); + lstOut.push_back( IEC->GetOutput() ); + } // for i + bbSetOutputLstOut( lstOut ); + } // Type 1 } + //===== // Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost) //===== void ImageExtractComponents::bbUserSetDefaultValues() { - // SET HERE THE DEFAULT INPUT/OUTPUT VALUES OF YOUR BOX // Here we initialize the input 'In' to 0 bbSetInputIn(NULL); @@ -102,8 +128,9 @@ void ImageExtractComponents::bbUserSetDefaultValues() bbSetInputComponent1(-1); bbSetInputComponent2(-1); bbSetInputComponent3(-1); - + bbSetInputType(0); } + //===== // Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost) //===== @@ -125,20 +152,22 @@ void ImageExtractComponents::bbUserInitializeProcessing() //===== void ImageExtractComponents::bbUserFinalizeProcessing() { - // THE FINALIZATION METHOD BODY : // Here does nothing // but this is where you should desallocate the internal/output pointers // if any - IEC0->Delete(); IEC1->Delete(); IEC2->Delete(); IEC3->Delete(); - + int i,size=lstIEC.size(); + for (i=0; iDelete(); + } // for i + lstIEC.clear(); } - } // EO namespace bbcreaVtk diff --git a/bbtk_creaVtk_PKG/src/bbcreaVtkImageExtractComponents.h b/bbtk_creaVtk_PKG/src/bbcreaVtkImageExtractComponents.h index 674e114..d8d0aa9 100644 --- a/bbtk_creaVtk_PKG/src/bbcreaVtkImageExtractComponents.h +++ b/bbtk_creaVtk_PKG/src/bbcreaVtkImageExtractComponents.h @@ -3,9 +3,11 @@ //===== #ifndef __bbcreaVtkImageExtractComponents_h_INCLUDED__ #define __bbcreaVtkImageExtractComponents_h_INCLUDED__ + #include "bbcreaVtk_EXPORT.h" #include "bbtkAtomicBlackBox.h" #include "iostream" +#include #include #include @@ -26,10 +28,13 @@ class bbcreaVtk_EXPORT ImageExtractComponents BBTK_DECLARE_INPUT(Component1,int); BBTK_DECLARE_INPUT(Component2,int); BBTK_DECLARE_INPUT(Component3,int); - BBTK_DECLARE_OUTPUT(Out0,vtkImageData *); - BBTK_DECLARE_OUTPUT(Out1,vtkImageData *); - BBTK_DECLARE_OUTPUT(Out2,vtkImageData *); - BBTK_DECLARE_OUTPUT(Out3,vtkImageData *); + BBTK_DECLARE_INPUT(Type,int); + BBTK_DECLARE_OUTPUT(Out0,vtkImageData*); + BBTK_DECLARE_OUTPUT(Out1,vtkImageData*); + BBTK_DECLARE_OUTPUT(Out2,vtkImageData*); + BBTK_DECLARE_OUTPUT(Out3,vtkImageData*); + BBTK_DECLARE_OUTPUT(LstOut,std::vector< vtkImageData* >); + BBTK_PROCESS(Process); void Process(); @@ -38,6 +43,9 @@ class bbcreaVtk_EXPORT ImageExtractComponents vtkImageExtractComponents* IEC1; vtkImageExtractComponents* IEC2; vtkImageExtractComponents* IEC3; + std::vector lstIEC; + std::vector lstOut; + //===== // Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost) //===== @@ -48,21 +56,27 @@ BBTK_BEGIN_DESCRIBE_BLACK_BOX(ImageExtractComponents,bbtk::AtomicBlackBox); BBTK_AUTHOR("InfoDev"); BBTK_DESCRIPTION("No Description."); BBTK_CATEGORY("empty"); + BBTK_INPUT(ImageExtractComponents,In,"Input image",vtkImageData*,""); BBTK_INPUT(ImageExtractComponents,Component0,"Component 0 (default -1)",int,""); BBTK_INPUT(ImageExtractComponents,Component1,"Component 1 (default -1)",int,""); BBTK_INPUT(ImageExtractComponents,Component2,"Component 2 (default -1)",int,""); BBTK_INPUT(ImageExtractComponents,Component3,"Component 3 (default -1)",int,""); + BBTK_INPUT(ImageExtractComponents,Type,"(default 0) 0=Out comp.0..3 , 1=Out List of all components",int,""); + BBTK_OUTPUT(ImageExtractComponents,Out0,"Output image 0",vtkImageData*,""); BBTK_OUTPUT(ImageExtractComponents,Out1,"Output image 1",vtkImageData*,""); BBTK_OUTPUT(ImageExtractComponents,Out2,"Output image 2",vtkImageData*,""); BBTK_OUTPUT(ImageExtractComponents,Out3,"Output image 3",vtkImageData*,""); -BBTK_END_DESCRIBE_BLACK_BOX(ImageExtractComponents); + BBTK_OUTPUT(ImageExtractComponents,LstOut,"List of all components by single images",std::vector< vtkImageData* >,""); + + BBTK_END_DESCRIBE_BLACK_BOX(ImageExtractComponents); //===== // Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost) //===== -} -// EO namespace bbcreaVtk + + +} // EO namespace bbcreaVtk #endif // __bbcreaVtkImageExtractComponents_h_INCLUDED__ diff --git a/bbtk_creaVtk_PKG/src/bbcreaVtkImageThreshold.cxx b/bbtk_creaVtk_PKG/src/bbcreaVtkImageThreshold.cxx new file mode 100644 index 0000000..a6c35f6 --- /dev/null +++ b/bbtk_creaVtk_PKG/src/bbcreaVtkImageThreshold.cxx @@ -0,0 +1,93 @@ +//===== +// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost) +//===== +#include "bbcreaVtkImageThreshold.h" +#include "bbcreaVtkPackage.h" +namespace bbcreaVtk +{ + +BBTK_ADD_BLACK_BOX_TO_PACKAGE(creaVtk,ImageThreshold) +BBTK_BLACK_BOX_IMPLEMENTATION(ImageThreshold,bbtk::AtomicBlackBox); +//===== +// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost) +//===== +void ImageThreshold::Process() +{ + +// THE MAIN PROCESSING METHOD BODY +// Here we simply set the input 'In' value to the output 'Out' +// And print out the output value +// INPUT/OUTPUT ACCESSORS ARE OF THE FORM : +// void bbSet{Input|Output}NAME(const TYPE&) +// const TYPE& bbGet{Input|Output}NAME() const +// Where : +// * NAME is the name of the input/output +// (the one provided in the attribute 'name' of the tag 'input') +// * TYPE is the C++ type of the input/output +// (the one provided in the attribute 'type' of the tag 'input') +// bbSetOutputOut( bbGetInputIn() ); +// std::cout << "Output value = " <Delete(); + filter=NULL; + } // if + filter = vtkImageThreshold::New(); + + if (bbGetInputIn()!=NULL) + { + filter->SetInValue( bbGetInputInValue() ); + filter->SetOutValue( bbGetInputOutValue() ); + filter->SetInputData( bbGetInputIn() ); + filter->ThresholdBetween( bbGetInputLower(),bbGetInputUpper() ); + filter->Update(); + bbSetOutputOut( filter->GetOutput() ); + } else { + bbSetOutputOut( NULL ); + }// In +} +//===== +// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost) +//===== +void ImageThreshold::bbUserSetDefaultValues() +{ + +// SET HERE THE DEFAULT INPUT/OUTPUT VALUES OF YOUR BOX +// Here we initialize the input 'In' to 0 + filter=NULL; + bbSetInputIn(NULL); + bbSetInputLower(0); + bbSetInputUpper(10000); + bbSetInputInValue(255); + bbSetInputOutValue(0); +} +//===== +// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost) +//===== +void ImageThreshold::bbUserInitializeProcessing() +{ + +// THE INITIALIZATION METHOD BODY : +// Here does nothing +// but this is where you should allocate the internal/output pointers +// if any + + +} +//===== +// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost) +//===== +void ImageThreshold::bbUserFinalizeProcessing() +{ + +// THE FINALIZATION METHOD BODY : +// Here does nothing +// but this is where you should desallocate the internal/output pointers +// if any + +} +} +// EO namespace bbcreaVtk + + diff --git a/bbtk_creaVtk_PKG/src/bbcreaVtkImageThreshold.h b/bbtk_creaVtk_PKG/src/bbcreaVtkImageThreshold.h new file mode 100644 index 0000000..7a5f2f2 --- /dev/null +++ b/bbtk_creaVtk_PKG/src/bbcreaVtkImageThreshold.h @@ -0,0 +1,60 @@ +//===== +// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost) +//===== +#ifndef __bbcreaVtkImageThreshold_h_INCLUDED__ +#define __bbcreaVtkImageThreshold_h_INCLUDED__ + +#include "bbcreaVtk_EXPORT.h" +#include "bbtkAtomicBlackBox.h" +#include "iostream" + +#include "vtkImageData.h" +#include + +namespace bbcreaVtk +{ + +class bbcreaVtk_EXPORT ImageThreshold + : + public bbtk::AtomicBlackBox +{ + BBTK_BLACK_BOX_INTERFACE(ImageThreshold,bbtk::AtomicBlackBox); +//===== +// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost) +//===== + BBTK_DECLARE_INPUT(In,vtkImageData*); + BBTK_DECLARE_INPUT(Lower,double); + BBTK_DECLARE_INPUT(Upper,double); + BBTK_DECLARE_INPUT(InValue,double); + BBTK_DECLARE_INPUT(OutValue,double); + BBTK_DECLARE_OUTPUT(Out,vtkImageData*); + BBTK_PROCESS(Process); + void Process(); + + vtkImageThreshold *filter; + +//===== +// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost) +//===== +}; + +BBTK_BEGIN_DESCRIBE_BLACK_BOX(ImageThreshold,bbtk::AtomicBlackBox); + BBTK_NAME("ImageThreshold"); + BBTK_AUTHOR("InfoDev"); + BBTK_DESCRIPTION("No Description."); + BBTK_CATEGORY("empty"); + BBTK_INPUT(ImageThreshold,In,"Input image",vtkImageData*,""); + BBTK_INPUT(ImageThreshold,Lower,"(default 0) Lower threshold",double,""); + BBTK_INPUT(ImageThreshold,Upper,"(default 10000) Upper threshold",double,""); + BBTK_INPUT(ImageThreshold,InValue,"(default 255) In value",double,""); + BBTK_INPUT(ImageThreshold,OutValue,"(default 0) Out Value",double,""); + BBTK_OUTPUT(ImageThreshold,Out,"Output image",vtkImageData*,""); +BBTK_END_DESCRIBE_BLACK_BOX(ImageThreshold); +//===== +// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost) +//===== +} +// EO namespace bbcreaVtk + +#endif // __bbcreaVtkImageThreshold_h_INCLUDED__ + diff --git a/bbtk_creaVtk_PKG/src/bbcreaVtkImageThresholdConnectivity.cxx b/bbtk_creaVtk_PKG/src/bbcreaVtkImageThresholdConnectivity.cxx new file mode 100644 index 0000000..7136643 --- /dev/null +++ b/bbtk_creaVtk_PKG/src/bbcreaVtkImageThresholdConnectivity.cxx @@ -0,0 +1,74 @@ +//===== +// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost) +//===== +#include "bbcreaVtkImageThresholdConnectivity.h" +#include "bbcreaVtkPackage.h" +namespace bbcreaVtk +{ + +BBTK_ADD_BLACK_BOX_TO_PACKAGE(creaVtk,ImageThresholdConnectivity) +BBTK_BLACK_BOX_IMPLEMENTATION(ImageThresholdConnectivity,bbtk::AtomicBlackBox); +//===== +// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost) +//===== +void ImageThresholdConnectivity::Process() +{ + +// THE MAIN PROCESSING METHOD BODY +// Here we simply set the input 'In' value to the output 'Out' +// And print out the output value +// INPUT/OUTPUT ACCESSORS ARE OF THE FORM : +// void bbSet{Input|Output}NAME(const TYPE&) +// const TYPE& bbGet{Input|Output}NAME() const +// Where : +// * NAME is the name of the input/output +// (the one provided in the attribute 'name' of the tag 'input') +// * TYPE is the C++ type of the input/output +// (the one provided in the attribute 'type' of the tag 'input') + + + printf("EED ImageThresholdConnectivity::Process Error this box is not implemented .... \n"); + printf("EED ImageThresholdConnectivity::Process Error this box is not implemented .... \n"); + printf("EED ImageThresholdConnectivity::Process Error this box is not implemented .... \n"); + printf("EED ImageThresholdConnectivity::Process Error this box is not implemented .... \n"); +} +//===== +// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost) +//===== +void ImageThresholdConnectivity::bbUserSetDefaultValues() +{ + +// SET HERE THE DEFAULT INPUT/OUTPUT VALUES OF YOUR BOX +// Here we initialize the input 'In' to 0 + bbSetInputIn(NULL); + +} +//===== +// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost) +//===== +void ImageThresholdConnectivity::bbUserInitializeProcessing() +{ + +// THE INITIALIZATION METHOD BODY : +// Here does nothing +// but this is where you should allocate the internal/output pointers +// if any + + +} +//===== +// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost) +//===== +void ImageThresholdConnectivity::bbUserFinalizeProcessing() +{ + +// THE FINALIZATION METHOD BODY : +// Here does nothing +// but this is where you should desallocate the internal/output pointers +// if any + +} +} +// EO namespace bbcreaVtk + + diff --git a/bbtk_creaVtk_PKG/src/bbcreaVtkImageThresholdConnectivity.h b/bbtk_creaVtk_PKG/src/bbcreaVtkImageThresholdConnectivity.h new file mode 100644 index 0000000..a629e1c --- /dev/null +++ b/bbtk_creaVtk_PKG/src/bbcreaVtkImageThresholdConnectivity.h @@ -0,0 +1,52 @@ +//===== +// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost) +//===== +#ifndef __bbcreaVtkImageThresholdConnectivity_h_INCLUDED__ +#define __bbcreaVtkImageThresholdConnectivity_h_INCLUDED__ + +#include "bbcreaVtk_EXPORT.h" +#include "bbtkAtomicBlackBox.h" +#include "iostream" + +#include +#include + +namespace bbcreaVtk +{ + +class bbcreaVtk_EXPORT ImageThresholdConnectivity + : + public bbtk::AtomicBlackBox +{ + BBTK_BLACK_BOX_INTERFACE(ImageThresholdConnectivity,bbtk::AtomicBlackBox); +//===== +// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost) +//===== + BBTK_DECLARE_INPUT(In,vtkImageData*); + BBTK_DECLARE_OUTPUT(Out,vtkImageData*); + BBTK_PROCESS(Process); + void Process(); +//===== +// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost) +//===== +}; + +BBTK_BEGIN_DESCRIBE_BLACK_BOX(ImageThresholdConnectivity,bbtk::AtomicBlackBox); + BBTK_NAME("ImageThresholdConnectivity"); + BBTK_AUTHOR("InfoDev"); + BBTK_DESCRIPTION("vtkImageThresholdConnectivity"); + BBTK_CATEGORY("empty"); + + BBTK_INPUT(ImageThresholdConnectivity,In,"Input image",vtkImageData*,""); + + BBTK_OUTPUT(ImageThresholdConnectivity,Out,"Output image",vtkImageData*,""); + +BBTK_END_DESCRIBE_BLACK_BOX(ImageThresholdConnectivity); +//===== +// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost) +//===== +} +// EO namespace bbcreaVtk + +#endif // __bbcreaVtkImageThresholdConnectivity_h_INCLUDED__ + diff --git a/bbtk_creaVtk_PKG/src/bbcreaVtkKMeansStatistics.cxx b/bbtk_creaVtk_PKG/src/bbcreaVtkKMeansStatistics.cxx new file mode 100644 index 0000000..45370ac --- /dev/null +++ b/bbtk_creaVtk_PKG/src/bbcreaVtkKMeansStatistics.cxx @@ -0,0 +1,214 @@ +//===== +// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost) +//===== + + + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include + + + +#include "bbcreaVtkKMeansStatistics.h" +#include "bbcreaVtkPackage.h" +namespace bbcreaVtk +{ + +BBTK_ADD_BLACK_BOX_TO_PACKAGE(creaVtk,KMeansStatistics) +BBTK_BLACK_BOX_IMPLEMENTATION(KMeansStatistics,bbtk::AtomicBlackBox); +//===== +// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost) +//===== +void KMeansStatistics::Process() +{ + +// THE MAIN PROCESSING METHOD BODY +// Here we simply set the input 'In' value to the output 'Out' +// And print out the output value +// INPUT/OUTPUT ACCESSORS ARE OF THE FORM : +// void bbSet{Input|Output}NAME(const TYPE&) +// const TYPE& bbGet{Input|Output}NAME() const +// Where : +// * NAME is the name of the input/output +// (the one provided in the attribute 'name' of the tag 'input') +// * TYPE is the C++ type of the input/output +// (the one provided in the attribute 'type' of the tag 'input') + +// bbSetOutputOut( bbGetInputIn() ); +// std::cout << "Output value = " < inputData; + int ext[6]; + int dimX,dimY,dimZ; + bbGetInputIn()->GetExtent(ext); + dimX = ext[1]-ext[0]+1; + dimY = ext[3]-ext[2]+1; + dimZ = ext[5]-ext[4]+1; + + vtkImageData *resultImage = vtkImageData::New(); + resultImage->Initialize(); + resultImage->SetSpacing( bbGetInputIn()->GetSpacing() ); + resultImage->SetDimensions( dimX, dimY, dimZ ); + resultImage->AllocateScalars( VTK_SHORT ,1 ); + + long int size= dimX*dimY*dimZ; + vtkDoubleArray *doubleArrayX = vtkDoubleArray::New(); + vtkDoubleArray *doubleArrayY = vtkDoubleArray::New(); + vtkDoubleArray *doubleArrayZ = vtkDoubleArray::New(); + vtkDoubleArray *doubleArrayValue1 = vtkDoubleArray::New(); + vtkDoubleArray *doubleArrayValue2 = vtkDoubleArray::New(); + vtkDoubleArray *doubleArrayValue3 = vtkDoubleArray::New(); + doubleArrayX->SetNumberOfComponents(1); + doubleArrayY->SetNumberOfComponents(1); + doubleArrayZ->SetNumberOfComponents(1); + doubleArrayValue1->SetNumberOfComponents(1); + doubleArrayValue2->SetNumberOfComponents(1); + doubleArrayValue3->SetNumberOfComponents(1); + doubleArrayX->SetName("X"); + doubleArrayY->SetName("Y"); + doubleArrayZ->SetName("Z"); + doubleArrayValue1->SetName("Value1"); + doubleArrayValue2->SetName("Value2"); + doubleArrayValue3->SetName("Value3"); + doubleArrayX->SetNumberOfTuples( size ); + doubleArrayY->SetNumberOfTuples( size ); + doubleArrayZ->SetNumberOfTuples( size ); + if (bbGetInputIn()->GetNumberOfScalarComponents()>=1) { doubleArrayValue1->SetNumberOfTuples( size ); } + if (bbGetInputIn()->GetNumberOfScalarComponents()>=2) { doubleArrayValue2->SetNumberOfTuples( size ); } + if (bbGetInputIn()->GetNumberOfScalarComponents()>=3) { doubleArrayValue3->SetNumberOfTuples( size ); } + + double value; + int x,y,z; + for ( z=0 ; zSetValue(x + y*dimX + z*dimX*dimY, x ); + doubleArrayY->SetValue(x + y*dimX + z*dimX*dimY, y ); + doubleArrayZ->SetValue(x + y*dimX + z*dimX*dimY, z ); + if (bbGetInputIn()->GetNumberOfScalarComponents()>=1) + { + value = bbGetInputIn()->GetScalarComponentAsDouble(x,y,z,0); + doubleArrayValue1->SetValue( x + y*dimX + z*dimX*dimY , value ); + } + if (bbGetInputIn()->GetNumberOfScalarComponents()>=2) + { + value = bbGetInputIn()->GetScalarComponentAsDouble(x,y,z,1); + doubleArrayValue2->SetValue( x + y*dimX + z*dimX*dimY , value ); + } + if (bbGetInputIn()->GetNumberOfScalarComponents()>=3) + { + value = bbGetInputIn()->GetScalarComponentAsDouble(x,y,z,2); + doubleArrayValue3->SetValue( x + y*dimX + z*dimX*dimY , value ); + } + } // for x + } // for y + }// for z + + inputData->AddColumn(doubleArrayX); + inputData->AddColumn(doubleArrayY); + inputData->AddColumn(doubleArrayZ); + if (bbGetInputIn()->GetNumberOfScalarComponents()>=1) { inputData->AddColumn(doubleArrayValue1); } + if (bbGetInputIn()->GetNumberOfScalarComponents()>=2) { inputData->AddColumn(doubleArrayValue2); } + if (bbGetInputIn()->GetNumberOfScalarComponents()>=3) { inputData->AddColumn(doubleArrayValue3); } + + + printf("EED KMeansStatistics::Process 1\n"); + + vtkNew kMeansStatistics; + kMeansStatistics->SetInputData(vtkStatisticsAlgorithm::INPUT_DATA, inputData); + kMeansStatistics->SetColumnStatus(inputData->GetColumnName(0), 1); + kMeansStatistics->SetColumnStatus(inputData->GetColumnName(1), 1); + kMeansStatistics->SetColumnStatus(inputData->GetColumnName(2), 1); + if (bbGetInputIn()->GetNumberOfScalarComponents()>=1) { kMeansStatistics->SetColumnStatus(inputData->GetColumnName(3), 1); } + if (bbGetInputIn()->GetNumberOfScalarComponents()>=2) { kMeansStatistics->SetColumnStatus(inputData->GetColumnName(4), 1); } + if (bbGetInputIn()->GetNumberOfScalarComponents()>=3) { kMeansStatistics->SetColumnStatus(inputData->GetColumnName(5), 1); } + + kMeansStatistics->RequestSelectedColumns(); + kMeansStatistics->SetAssessOption(true); + kMeansStatistics->SetDefaultNumberOfClusters( bbGetInputNumberOfClusters() ); + kMeansStatistics->Update(); + +// Display the results +// kMeansStatistics->GetOutput()->Dump(); + for ( z=0 ; zGetOutput()->GetValue( r, kMeansStatistics->GetOutput()->GetNumberOfColumns() - 1); + resultImage->SetScalarComponentFromDouble(x,y,z,0,(double) (v.ToInt()) ); + } // for x + } // for y + }// for z + bbSetOutputOut( resultImage ); + printf("EED KMeansStatistics::Process Start\n"); +} +//===== +// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost) +//===== +void KMeansStatistics::bbUserSetDefaultValues() +{ + +// SET HERE THE DEFAULT INPUT/OUTPUT VALUES OF YOUR BOX +// Here we initialize the input 'In' to 0 + bbSetInputIn(NULL); + bbSetInputNumberOfClusters(3); + +} +//===== +// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost) +//===== +void KMeansStatistics::bbUserInitializeProcessing() +{ + +// THE INITIALIZATION METHOD BODY : +// Here does nothing +// but this is where you should allocate the internal/output pointers +// if any + + +} +//===== +// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost) +//===== +void KMeansStatistics::bbUserFinalizeProcessing() +{ + +// THE FINALIZATION METHOD BODY : +// Here does nothing +// but this is where you should desallocate the internal/output pointers +// if any + +} +} +// EO namespace bbcreaVtk + + diff --git a/bbtk_creaVtk_PKG/src/bbcreaVtkKMeansStatistics.h b/bbtk_creaVtk_PKG/src/bbcreaVtkKMeansStatistics.h new file mode 100644 index 0000000..de19521 --- /dev/null +++ b/bbtk_creaVtk_PKG/src/bbcreaVtkKMeansStatistics.h @@ -0,0 +1,52 @@ +//===== +// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost) +//===== +#ifndef __bbcreaVtkKMeansStatistics_h_INCLUDED__ +#define __bbcreaVtkKMeansStatistics_h_INCLUDED__ + +#include "bbcreaVtk_EXPORT.h" +#include "bbtkAtomicBlackBox.h" +#include "iostream" + +#include + +namespace bbcreaVtk +{ + +class bbcreaVtk_EXPORT KMeansStatistics + : + public bbtk::AtomicBlackBox +{ + BBTK_BLACK_BOX_INTERFACE(KMeansStatistics,bbtk::AtomicBlackBox); +//===== +// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost) +//===== + BBTK_DECLARE_INPUT(In,vtkImageData*); + BBTK_DECLARE_INPUT(NumberOfClusters,int); + + BBTK_DECLARE_OUTPUT(Out,vtkImageData*); + BBTK_PROCESS(Process); + void Process(); +//===== +// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost) +//===== +}; + +BBTK_BEGIN_DESCRIBE_BLACK_BOX(KMeansStatistics,bbtk::AtomicBlackBox); + BBTK_NAME("KMeansStatistics"); + BBTK_AUTHOR("InfoDev"); + BBTK_DESCRIPTION("No Description."); + BBTK_CATEGORY("empty"); + BBTK_INPUT(KMeansStatistics,In,"Input image",vtkImageData*,""); + BBTK_INPUT(KMeansStatistics,NumberOfClusters,"(default 3) Number of Clusters", int ,""); + + BBTK_OUTPUT(KMeansStatistics,Out,"Output image with labels",vtkImageData*,""); +BBTK_END_DESCRIBE_BLACK_BOX(KMeansStatistics); +//===== +// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost) +//===== +} +// EO namespace bbcreaVtk + +#endif // __bbcreaVtkKMeansStatistics_h_INCLUDED__ + diff --git a/bbtk_creaVtk_PKG/src/bbcreaVtkLstOfVoxels.cxx b/bbtk_creaVtk_PKG/src/bbcreaVtkLstOfVoxels.cxx new file mode 100644 index 0000000..b3f257e --- /dev/null +++ b/bbtk_creaVtk_PKG/src/bbcreaVtkLstOfVoxels.cxx @@ -0,0 +1,139 @@ +//===== +// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost) +//===== +#include "bbcreaVtkLstOfVoxels.h" +#include "bbcreaVtkPackage.h" + +#include "creaVtk_MACROS.h" + +namespace bbcreaVtk +{ + +BBTK_ADD_BLACK_BOX_TO_PACKAGE(creaVtk,LstOfVoxels) +BBTK_BLACK_BOX_IMPLEMENTATION(LstOfVoxels,bbtk::AtomicBlackBox); +//===== +// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost) +//===== +void LstOfVoxels::Process() +{ + +// THE MAIN PROCESSING METHOD BODY +// Here we simply set the input 'In' value to the output 'Out' +// And print out the output value +// INPUT/OUTPUT ACCESSORS ARE OF THE FORM : +// void bbSet{Input|Output}NAME(const TYPE&) +// const TYPE& bbGet{Input|Output}NAME() const +// Where : +// * NAME is the name of the input/output +// (the one provided in the attribute 'name' of the tag 'input') +// * TYPE is the C++ type of the input/output +// (the one provided in the attribute 'type' of the tag 'input') + + if (bbGetInputIn()!=NULL) + { + DEF_POINTER_IMAGE_VTK_CREA(vIn,ssIn,pIn,stIn,bbGetInputIn()) \ + std::vector lstX; + std::vector lstY; + std::vector lstZ; + std::vector lstValues; + int ext[6]; + bbGetInputIn()->GetExtent(ext); + int dim[3]; + dim[0]=ext[1]-ext[0]+1; + dim[1]=ext[3]-ext[2]+1; + dim[2]=ext[5]-ext[4]+1; + int i,j,k; + long int index=0; + + + int rangeType=0; + if (bbGetInputRange().size()==2) + { + rangeType=1; + } + bool addPoint; + + + for (k=0 ; k=bbGetInputRange()[0]) && (vIn<=bbGetInputRange()[1]) ) + { + addPoint=true; + } // if vIn ==0 + } // if rangeType + + + if (addPoint==true) + { + lstX.push_back(i); + lstY.push_back(j); + lstZ.push_back(k); + lstValues.push_back(vIn); + } // if vIn ==0 + + index++; + } // for i + } // for j + } // for k + bbSetOutputLstX( lstX ); + bbSetOutputLstY( lstY ); + bbSetOutputLstZ( lstZ ); + bbSetOutputLstValues( lstValues ); + } else { + printf("EED Warning!! LstOfVoxels image not set.\n"); + }// In + +} +//===== +// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost) +//===== +void LstOfVoxels::bbUserSetDefaultValues() +{ + +// SET HERE THE DEFAULT INPUT/OUTPUT VALUES OF YOUR BOX +// Here we initialize the input 'In' to 0 + bbSetInputIn(NULL); + +} +//===== +// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost) +//===== +void LstOfVoxels::bbUserInitializeProcessing() +{ + +// THE INITIALIZATION METHOD BODY : +// Here does nothing +// but this is where you should allocate the internal/output pointers +// if any + + +} +//===== +// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost) +//===== +void LstOfVoxels::bbUserFinalizeProcessing() +{ + +// THE FINALIZATION METHOD BODY : +// Here does nothing +// but this is where you should desallocate the internal/output pointers +// if any + +} +} +// EO namespace bbcreaVtk + + diff --git a/bbtk_creaVtk_PKG/src/bbcreaVtkLstOfVoxels.h b/bbtk_creaVtk_PKG/src/bbcreaVtkLstOfVoxels.h new file mode 100644 index 0000000..f534caa --- /dev/null +++ b/bbtk_creaVtk_PKG/src/bbcreaVtkLstOfVoxels.h @@ -0,0 +1,57 @@ +//===== +// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost) +//===== +#ifndef __bbcreaVtkLstOfVoxels_h_INCLUDED__ +#define __bbcreaVtkLstOfVoxels_h_INCLUDED__ + +#include "bbcreaVtk_EXPORT.h" +#include "bbtkAtomicBlackBox.h" +#include "iostream" + +#include "vector" +#include "vtkImageData.h" + +namespace bbcreaVtk +{ + +class bbcreaVtk_EXPORT LstOfVoxels + : + public bbtk::AtomicBlackBox +{ + BBTK_BLACK_BOX_INTERFACE(LstOfVoxels,bbtk::AtomicBlackBox); +//===== +// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost) +//===== + BBTK_DECLARE_INPUT(In,vtkImageData*); + BBTK_DECLARE_INPUT(Range,std::vector); + BBTK_DECLARE_OUTPUT(LstX,std::vector); + BBTK_DECLARE_OUTPUT(LstY,std::vector); + BBTK_DECLARE_OUTPUT(LstZ,std::vector); + BBTK_DECLARE_OUTPUT(LstValues,std::vector); + BBTK_PROCESS(Process); + void Process(); +//===== +// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost) +//===== +}; + +BBTK_BEGIN_DESCRIBE_BLACK_BOX(LstOfVoxels,bbtk::AtomicBlackBox); + BBTK_NAME("LstOfVoxels"); + BBTK_AUTHOR("InfoDev"); + BBTK_DESCRIPTION("No Description."); + BBTK_CATEGORY("empty"); + BBTK_INPUT(LstOfVoxels,In,"Input image",vtkImageData*,""); + BBTK_INPUT(LstOfVoxels,Range,"Threshold [Min Max]",std::vector,""); + BBTK_OUTPUT(LstOfVoxels,LstX,"List of x points",std::vector,""); + BBTK_OUTPUT(LstOfVoxels,LstY,"List of y points",std::vector,""); + BBTK_OUTPUT(LstOfVoxels,LstZ,"List of z points",std::vector,""); + BBTK_OUTPUT(LstOfVoxels,LstValues,"List of z points",std::vector,""); +BBTK_END_DESCRIBE_BLACK_BOX(LstOfVoxels); +//===== +// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost) +//===== +} +// EO namespace bbcreaVtk + +#endif // __bbcreaVtkLstOfVoxels_h_INCLUDED__ + diff --git a/bbtk_creaVtk_PKG/src/bbcreaVtkMHDFileInfo.cxx b/bbtk_creaVtk_PKG/src/bbcreaVtkMHDFileInfo.cxx index 4154990..9280727 100644 --- a/bbtk_creaVtk_PKG/src/bbcreaVtkMHDFileInfo.cxx +++ b/bbtk_creaVtk_PKG/src/bbcreaVtkMHDFileInfo.cxx @@ -29,6 +29,7 @@ void MHDFileInfo::Process() // bbSetOutputOut( bbGetInputIn() ); // std::cout << "Output value = " < #include #include - +#include namespace bbcreaVtk { @@ -39,14 +39,18 @@ void MeshCutByAxis::Process() vtkPlane *clipPlane = vtkPlane::New(); vtkBox *clipBox = vtkBox::New(); vtkClipPolyData *clipper = vtkClipPolyData::New(); +// clipper->GenerateClipScalarsOn(); +// clipper->GenerateClippedOutputOff(); //EED 2017-01-01 Migration VTK7 #if VTK_MAJOR_VERSION <= 5 clipper -> SetInput( bbGetInputIn() ); #else +// vtkPolyDataNormals *nn = vtkPolyDataNormals::New(); +// nn->SetInputData( bbGetInputIn() ); +// clipper -> SetInputData( nn->GetOutput() ); clipper -> SetInputData( bbGetInputIn() ); #endif clipper->SetInsideOut( bbGetInputInsideVol() ); - int a; // correction border if (bbGetInputInsideVol()==false) { @@ -54,15 +58,12 @@ void MeshCutByAxis::Process() } else { a=0; } - int px=bbGetInputPoint()[0]; int py=bbGetInputPoint()[1]; int pz=bbGetInputPoint()[2]; - if ( bbGetInputType()=="x" ) { clipPlane->SetNormal(1, 0, 0); ok=1; } else if ( bbGetInputType()=="y" ) { clipPlane->SetNormal(0, 1, 0); ok=1; } else if ( bbGetInputType()=="z" ) { clipPlane->SetNormal(0, 0, 1); ok=1; } else - if ( bbGetInputType()=="x+y+" ) { clipBox->SetBounds(px ,px+sb ,py ,py+sb ,pz-sb ,pz+sb ); ok=2; } else if ( bbGetInputType()=="x-y+" ) { clipBox->SetBounds(px-sb,px+a ,py ,py+sb ,pz-sb ,pz+sb ); ok=2; } else if ( bbGetInputType()=="x+y-" ) { clipBox->SetBounds(px ,px+sb ,py-sb ,py+a ,pz-sb ,pz+sb ); ok=2; } else @@ -78,7 +79,6 @@ void MeshCutByAxis::Process() if ( bbGetInputType()=="x+z-" ) { clipBox->SetBounds(px ,px+sb ,py-sb ,py+sb ,pz-sb ,pz+a ); ok=2; } else if ( bbGetInputType()=="x-z-" ) { clipBox->SetBounds(px-sb,px+a ,py-sb ,py+sb ,pz-sb ,pz+a ); ok=2; } else - if ( bbGetInputType()=="x+y+z+" ) { clipBox->SetBounds(px ,px+sb ,py ,py+sb ,pz ,pz+sb ); ok=2; } else if ( bbGetInputType()=="x-y+z+" ) { clipBox->SetBounds(px-sb,px+a ,py ,py+sb ,pz ,pz+sb ); ok=2; } else if ( bbGetInputType()=="x+y-z+" ) { clipBox->SetBounds(px ,px+sb ,py-sb ,py+a ,pz ,pz+sb ); ok=2; } else @@ -90,11 +90,14 @@ void MeshCutByAxis::Process() if (ok==1) { clipPlane -> SetOrigin(px,py,pz); + clipPlane -> Modified(); clipper -> SetClipFunction(clipPlane); + clipper -> Update(); bbSetOutputOut( clipper->GetOutput() ); - } else if (ok==2) { - - clipper -> SetClipFunction(clipBox); + } else if (ok==2) { + clipBox -> Modified(); + clipper -> SetClipFunction(clipBox); + clipper -> Update(); bbSetOutputOut( clipper->GetOutput() ); } else { bbSetOutputOut( bbGetInputIn() ); diff --git a/bbtk_creaVtk_PKG/src/bbcreaVtkMeshCutByAxis.h b/bbtk_creaVtk_PKG/src/bbcreaVtkMeshCutByAxis.h index 23cf4cb..d043878 100644 --- a/bbtk_creaVtk_PKG/src/bbcreaVtkMeshCutByAxis.h +++ b/bbtk_creaVtk_PKG/src/bbcreaVtkMeshCutByAxis.h @@ -37,7 +37,7 @@ BBTK_BEGIN_DESCRIBE_BLACK_BOX(MeshCutByAxis,bbtk::AtomicBlackBox); BBTK_DESCRIPTION("MeshCutByAxis"); BBTK_CATEGORY("empty"); BBTK_INPUT(MeshCutByAxis,In,"Mesh to be cut",vtkPolyData*,""); - BBTK_INPUT(MeshCutByAxis,Type,"x y z x+y+ x-y+ x+y- x-y- y+z+ y+z- y-z+ y-z- x+z+ x+z- x-z+ x-z- x+y+z+ x-y+z+ x+y-z+ x+y+z- x-y-z+ x-y+z- x+y-z- x-y-z-",std::string,""); + BBTK_INPUT(MeshCutByAxis,Type,"(defalut x+y+z+) x y z x+y+ x-y+ x+y- x-y- y+z+ y+z- y-z+ y-z- x+z+ x+z- x-z+ x-z- x+y+z+ x-y+z+ x+y-z+ x+y+z- x-y-z+ x-y+z- x+y-z- x-y-z-",std::string,""); BBTK_INPUT(MeshCutByAxis,InsideVol,"Inside volume",bool,""); BBTK_INPUT(MeshCutByAxis,Point,"First input",std::vector,""); BBTK_OUTPUT(MeshCutByAxis,Out,"First output",vtkPolyData*,""); diff --git a/bbtk_creaVtk_PKG/src/bbcreaVtkMeshReduction_DecimatePro.cxx b/bbtk_creaVtk_PKG/src/bbcreaVtkMeshReduction_DecimatePro.cxx new file mode 100644 index 0000000..6848c8a --- /dev/null +++ b/bbtk_creaVtk_PKG/src/bbcreaVtkMeshReduction_DecimatePro.cxx @@ -0,0 +1,89 @@ +//===== +// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost) +//===== +#include "bbcreaVtkMeshReduction_DecimatePro.h" +#include "bbcreaVtkPackage.h" + + +namespace bbcreaVtk +{ + +BBTK_ADD_BLACK_BOX_TO_PACKAGE(creaVtk,MeshReduction_DecimatePro) +BBTK_BLACK_BOX_IMPLEMENTATION(MeshReduction_DecimatePro,bbtk::AtomicBlackBox); +//===== +// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost) +//===== +void MeshReduction_DecimatePro::Process() +{ + +// THE MAIN PROCESSING METHOD BODY +// Here we simply set the input 'In' value to the output 'Out' +// And print out the output value +// INPUT/OUTPUT ACCESSORS ARE OF THE FORM : +// void bbSet{Input|Output}NAME(const TYPE&) +// const TYPE& bbGet{Input|Output}NAME() const +// Where : +// * NAME is the name of the input/output +// (the one provided in the attribute 'name' of the tag 'input') +// * TYPE is the C++ type of the input/output +// (the one provided in the attribute 'type' of the tag 'input') + + + if (firsttime==true) + { + firsttime = false; + decimatepro = vtkDecimatePro::New(); + } + decimatepro->SetInputData( bbGetInputIn() ); + decimatepro->SetTargetReduction( bbGetInputTargetReduction() ); + decimatepro->PreserveTopologyOn(); + decimatepro->Update(); + bbSetOutputOut(decimatepro->GetOutput() ); +} +//===== +// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost) +//===== +void MeshReduction_DecimatePro::bbUserSetDefaultValues() +{ + +// SET HERE THE DEFAULT INPUT/OUTPUT VALUES OF YOUR BOX +// Here we initialize the input 'In' to 0 + firsttime = true; + decimatepro = NULL; + bbSetInputIn(NULL); + bbSetInputTargetReduction(0.5); +} +//===== +// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost) +//===== +void MeshReduction_DecimatePro::bbUserInitializeProcessing() +{ + +// THE INITIALIZATION METHOD BODY : +// Here does nothing +// but this is where you should allocate the internal/output pointers +// if any + + +} +//===== +// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost) +//===== +void MeshReduction_DecimatePro::bbUserFinalizeProcessing() +{ + +// THE FINALIZATION METHOD BODY : +// Here does nothing +// but this is where you should desallocate the internal/output pointers +// if any + + if (decimatepro!=NULL) + { + decimatepro->Delete(); + } + +} +} +// EO namespace bbcreaVtk + + diff --git a/bbtk_creaVtk_PKG/src/bbcreaVtkMeshReduction_DecimatePro.h b/bbtk_creaVtk_PKG/src/bbcreaVtkMeshReduction_DecimatePro.h new file mode 100644 index 0000000..099bef4 --- /dev/null +++ b/bbtk_creaVtk_PKG/src/bbcreaVtkMeshReduction_DecimatePro.h @@ -0,0 +1,55 @@ +//===== +// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost) +//===== +#ifndef __bbcreaVtkMeshReduction_DecimatePro_h_INCLUDED__ +#define __bbcreaVtkMeshReduction_DecimatePro_h_INCLUDED__ + +#include "bbcreaVtk_EXPORT.h" +#include "bbtkAtomicBlackBox.h" +#include "iostream" + +#include "vtkPolyData.h" +#include "vtkDecimatePro.h" + +namespace bbcreaVtk +{ + +class bbcreaVtk_EXPORT MeshReduction_DecimatePro + : + public bbtk::AtomicBlackBox +{ + BBTK_BLACK_BOX_INTERFACE(MeshReduction_DecimatePro,bbtk::AtomicBlackBox); +//===== +// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost) +//===== + BBTK_DECLARE_INPUT(In,vtkPolyData*); + BBTK_DECLARE_INPUT(TargetReduction,double); + BBTK_DECLARE_OUTPUT(Out,vtkPolyData*); + BBTK_PROCESS(Process); + void Process(); + + bool firsttime; + vtkDecimatePro *decimatepro; + +//===== +// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost) +//===== +}; + +BBTK_BEGIN_DESCRIBE_BLACK_BOX(MeshReduction_DecimatePro,bbtk::AtomicBlackBox); + BBTK_NAME("MeshReduction_DecimatePro"); + BBTK_AUTHOR("InfoDev"); + BBTK_DESCRIPTION("No Description."); + BBTK_CATEGORY("empty"); + BBTK_INPUT(MeshReduction_DecimatePro,In,"vtkPolyData*",vtkPolyData*,""); + BBTK_INPUT(MeshReduction_DecimatePro,TargetReduction,"[0-1] (default 0.5)",double,""); + BBTK_OUTPUT(MeshReduction_DecimatePro,Out,"vtkPolyData*",vtkPolyData*,""); +BBTK_END_DESCRIBE_BLACK_BOX(MeshReduction_DecimatePro); +//===== +// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost) +//===== +} +// EO namespace bbcreaVtk + +#endif // __bbcreaVtkMeshReduction_DecimatePro_h_INCLUDED__ + diff --git a/bbtk_creaVtk_PKG/src/bbcreaVtkMeshReduction_QuadricDecimation.cxx b/bbtk_creaVtk_PKG/src/bbcreaVtkMeshReduction_QuadricDecimation.cxx new file mode 100644 index 0000000..38fd833 --- /dev/null +++ b/bbtk_creaVtk_PKG/src/bbcreaVtkMeshReduction_QuadricDecimation.cxx @@ -0,0 +1,87 @@ +//===== +// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost) +//===== +#include "bbcreaVtkMeshReduction_QuadricDecimation.h" +#include "bbcreaVtkPackage.h" +namespace bbcreaVtk +{ + +BBTK_ADD_BLACK_BOX_TO_PACKAGE(creaVtk,MeshReduction_QuadricDecimation) +BBTK_BLACK_BOX_IMPLEMENTATION(MeshReduction_QuadricDecimation,bbtk::AtomicBlackBox); +//===== +// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost) +//===== +void MeshReduction_QuadricDecimation::Process() +{ + +// THE MAIN PROCESSING METHOD BODY +// Here we simply set the input 'In' value to the output 'Out' +// And print out the output value +// INPUT/OUTPUT ACCESSORS ARE OF THE FORM : +// void bbSet{Input|Output}NAME(const TYPE&) +// const TYPE& bbGet{Input|Output}NAME() const +// Where : +// * NAME is the name of the input/output +// (the one provided in the attribute 'name' of the tag 'input') +// * TYPE is the C++ type of the input/output +// (the one provided in the attribute 'type' of the tag 'input') + + + if (firsttime==true) + { + firsttime =false; + quadricdecimation = vtkQuadricDecimation::New(); + } + quadricdecimation->SetInputData( bbGetInputIn() ); + + quadricdecimation->SetTargetReduction( bbGetInputTargetReduction() ); + + quadricdecimation->Update(); + bbSetOutputOut(quadricdecimation->GetOutput() ); +} +//===== +// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost) +//===== +void MeshReduction_QuadricDecimation::bbUserSetDefaultValues() +{ + +// SET HERE THE DEFAULT INPUT/OUTPUT VALUES OF YOUR BOX +// Here we initialize the input 'In' to 0 + firsttime = true; + quadricdecimation = NULL; + bbSetInputIn(NULL); + bbSetInputTargetReduction(0.5); +} +//===== +// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost) +//===== +void MeshReduction_QuadricDecimation::bbUserInitializeProcessing() +{ + +// THE INITIALIZATION METHOD BODY : +// Here does nothing +// but this is where you should allocate the internal/output pointers +// if any + + +} +//===== +// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost) +//===== +void MeshReduction_QuadricDecimation::bbUserFinalizeProcessing() +{ + +// THE FINALIZATION METHOD BODY : +// Here does nothing +// but this is where you should desallocate the internal/output pointers +// if any + + if (quadricdecimation!=NULL) + { + quadricdecimation->Delete(); + } +} +} +// EO namespace bbcreaVtk + + diff --git a/bbtk_creaVtk_PKG/src/bbcreaVtkMeshReduction_QuadricDecimation.h b/bbtk_creaVtk_PKG/src/bbcreaVtkMeshReduction_QuadricDecimation.h new file mode 100644 index 0000000..7d0185a --- /dev/null +++ b/bbtk_creaVtk_PKG/src/bbcreaVtkMeshReduction_QuadricDecimation.h @@ -0,0 +1,55 @@ +//===== +// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost) +//===== +#ifndef __bbcreaVtkMeshReduction_QuadricDecimation_h_INCLUDED__ +#define __bbcreaVtkMeshReduction_QuadricDecimation_h_INCLUDED__ + +#include "bbcreaVtk_EXPORT.h" +#include "bbtkAtomicBlackBox.h" +#include "iostream" + +#include + +namespace bbcreaVtk +{ + +class bbcreaVtk_EXPORT MeshReduction_QuadricDecimation + : + public bbtk::AtomicBlackBox +{ + BBTK_BLACK_BOX_INTERFACE(MeshReduction_QuadricDecimation,bbtk::AtomicBlackBox); +//===== +// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost) +//===== + BBTK_DECLARE_INPUT(In,vtkPolyData*); + BBTK_DECLARE_INPUT(TargetReduction,double); + BBTK_DECLARE_OUTPUT(Out,vtkPolyData*); + BBTK_PROCESS(Process); + void Process(); + + bool firsttime; + vtkQuadricDecimation *quadricdecimation; + +//===== +// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost) +//===== +}; + +BBTK_BEGIN_DESCRIBE_BLACK_BOX(MeshReduction_QuadricDecimation,bbtk::AtomicBlackBox); + BBTK_NAME("MeshReduction_QuadricDecimation"); + BBTK_AUTHOR("InfoDev"); + BBTK_DESCRIPTION("No Description."); + BBTK_CATEGORY("empty"); + + BBTK_INPUT(MeshReduction_QuadricDecimation,In,"vtkPolyData*",vtkPolyData*,""); + BBTK_INPUT(MeshReduction_QuadricDecimation,TargetReduction,"[0-1] (default 0.5)",double,""); + BBTK_OUTPUT(MeshReduction_QuadricDecimation,Out,"vtkPolyData*",vtkPolyData*,""); +BBTK_END_DESCRIBE_BLACK_BOX(MeshReduction_QuadricDecimation); +//===== +// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost) +//===== +} +// EO namespace bbcreaVtk + +#endif // __bbcreaVtkMeshReduction_QuadricDecimation_h_INCLUDED__ + diff --git a/bbtk_creaVtk_PKG/src/bbcreaVtkMultipleOperations.cxx b/bbtk_creaVtk_PKG/src/bbcreaVtkMultipleOperations.cxx new file mode 100644 index 0000000..fe7b4fa --- /dev/null +++ b/bbtk_creaVtk_PKG/src/bbcreaVtkMultipleOperations.cxx @@ -0,0 +1,129 @@ +//===== +// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost) +//===== +#include "bbcreaVtkMultipleOperations.h" +#include "bbcreaVtkPackage.h" + +#include "creaVtk_MACROS.h" + +namespace bbcreaVtk +{ + +BBTK_ADD_BLACK_BOX_TO_PACKAGE(creaVtk,MultipleOperations) +BBTK_BLACK_BOX_IMPLEMENTATION(MultipleOperations,bbtk::AtomicBlackBox); +//===== +// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost) +//===== +void MultipleOperations::Process() +{ +// THE MAIN PROCESSING METHOD BODY +// Here we simply set the input 'In' value to the output 'Out' +// And print out the output value +// INPUT/OUTPUT ACCESSORS ARE OF THE FORM : +// void bbSet{Input|Output}NAME(const TYPE&) +// const TYPE& bbGet{Input|Output}NAME() const +// Where : +// * NAME is the name of the input/output +// (the one provided in the attribute 'name' of the tag 'input') +// * TYPE is the C++ type of the input/output +// (the one provided in the attribute 'type' of the tag 'input') + + if ( bbGetInputInLst().size()>0 ) + { + int extImage[6]; + vtkImageData *resultImage=NULL; + bbGetInputInLst()[0]->GetExtent( extImage ); + int dimXImage = extImage[1]-extImage[0]+1; + int dimYImage = extImage[3]-extImage[2]+1; + int dimZImage = extImage[5]-extImage[4]+1; + if (bbGetOutputOut()!=NULL) + { + bbGetOutputOut()->Delete(); + } + resultImage = vtkImageData::New(); + resultImage->Initialize(); + resultImage->SetSpacing( bbGetInputInLst()[0]->GetSpacing() ); + resultImage->SetDimensions( dimXImage, dimYImage, dimZImage ); + resultImage->AllocateScalars( bbGetInputInLst()[0]->GetScalarType(),1 ); + long int index,size=dimXImage*dimYImage*dimZImage; + DEF_POINTER_IMAGE_VTK_CREA(vOut,ssOut,pOut,stOut,resultImage ) + if (bbGetInputType()==20) + { + +long int k1omp=(double)(size-1)*0.0; +long int k2omp=(double)(size-1)*0.2; +long int k3omp=(double)(size-1)*0.4; +long int k4omp=(double)(size-1)*0.6; +long int k5omp=(double)(size-1)*0.8; +long int k6omp=(double)(size-1)*1.0; + +printf("EED MultipleOperations::Process (with openmp)\n"); +#pragma omp parallel for + for (index=0;indexGetScalarPointer() ); + GETVALUE2_VTK_CREA(vIn,pIn,stIn,index) + if (iLst!=0) + { + acumDiff = acumDiff+abs(vIn-vInBack); + } + vInBack=vIn; + } // for iLst + acumDiff = acumDiff/sizeLst; + SETVALUE2_VTK_CREA(acumDiff,pOut,stOut,index) + } // for index + } // if Type==20 + bbSetOutputOut( resultImage ); + } // if InLst size +} +//===== +// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost) +//===== +void MultipleOperations::bbUserSetDefaultValues() +{ + +// SET HERE THE DEFAULT INPUT/OUTPUT VALUES OF YOUR BOX +// Here we initialize the input 'In' to 0 + + bbSetInputType(0); + bbSetOutputOut(NULL); + +} +//===== +// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost) +//===== +void MultipleOperations::bbUserInitializeProcessing() +{ + +// THE INITIALIZATION METHOD BODY : +// Here does nothing +// but this is where you should allocate the internal/output pointers +// if any + + +} +//===== +// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost) +//===== +void MultipleOperations::bbUserFinalizeProcessing() +{ + +// THE FINALIZATION METHOD BODY : +// Here does nothing +// but this is where you should desallocate the internal/output pointers +// if any + +} +} +// EO namespace bbcreaVtk + + diff --git a/bbtk_creaVtk_PKG/src/bbcreaVtkMultipleOperations.h b/bbtk_creaVtk_PKG/src/bbcreaVtkMultipleOperations.h new file mode 100644 index 0000000..7eccc8c --- /dev/null +++ b/bbtk_creaVtk_PKG/src/bbcreaVtkMultipleOperations.h @@ -0,0 +1,50 @@ +//===== +// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost) +//===== +#ifndef __bbcreaVtkMultipleOperations_h_INCLUDED__ +#define __bbcreaVtkMultipleOperations_h_INCLUDED__ + +#include "bbcreaVtk_EXPORT.h" +#include "bbtkAtomicBlackBox.h" +#include "iostream" + +#include + +namespace bbcreaVtk +{ + +class bbcreaVtk_EXPORT MultipleOperations + : + public bbtk::AtomicBlackBox +{ + BBTK_BLACK_BOX_INTERFACE(MultipleOperations,bbtk::AtomicBlackBox); +//===== +// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost) +//===== + BBTK_DECLARE_INPUT(InLst,std::vector); + BBTK_DECLARE_INPUT(Type,int); + BBTK_DECLARE_OUTPUT(Out,vtkImageData*); + BBTK_PROCESS(Process); + void Process(); +//===== +// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost) +//===== +}; + +BBTK_BEGIN_DESCRIBE_BLACK_BOX(MultipleOperations,bbtk::AtomicBlackBox); + BBTK_NAME("MultipleOperations"); + BBTK_AUTHOR("InfoDev"); + BBTK_DESCRIPTION("No Description."); + BBTK_CATEGORY("empty"); + BBTK_INPUT(MultipleOperations,InLst,"List input images ",std::vector,""); + BBTK_INPUT(MultipleOperations,Type,"(default 0) 0, 20 average-difference ",int,""); + BBTK_OUTPUT(MultipleOperations,Out,"Output image",vtkImageData*,""); +BBTK_END_DESCRIBE_BLACK_BOX(MultipleOperations); +//===== +// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost) +//===== +} +// EO namespace bbcreaVtk + +#endif // __bbcreaVtkMultipleOperations_h_INCLUDED__ + diff --git a/bbtk_creaVtk_PKG/src/bbcreaVtkNIFTIImageReader.cxx b/bbtk_creaVtk_PKG/src/bbcreaVtkNIFTIImageReader.cxx new file mode 100644 index 0000000..fbb3ebb --- /dev/null +++ b/bbtk_creaVtk_PKG/src/bbcreaVtkNIFTIImageReader.cxx @@ -0,0 +1,114 @@ +//===== +// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost) +//===== +#include "bbcreaVtkNIFTIImageReader.h" +#include "bbcreaVtkPackage.h" + +#include +#include + +namespace bbcreaVtk +{ + +BBTK_ADD_BLACK_BOX_TO_PACKAGE(creaVtk,NIFTIImageReader) +BBTK_BLACK_BOX_IMPLEMENTATION(NIFTIImageReader,bbtk::AtomicBlackBox); +//===== +// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost) +//===== +void NIFTIImageReader::Process() +{ + +// THE MAIN PROCESSING METHOD BODY +// Here we simply set the input 'In' value to the output 'Out' +// And print out the output value +// INPUT/OUTPUT ACCESSORS ARE OF THE FORM : +// void bbSet{Input|Output}NAME(const TYPE&) +// const TYPE& bbGet{Input|Output}NAME() const +// Where : +// * NAME is the name of the input/output +// (the one provided in the attribute 'name' of the tag 'input') +// * TYPE is the C++ type of the input/output +// (the one provided in the attribute 'type' of the tag 'input') +// bbSetOutputOut( bbGetInputIn() ); +// std::cout << "Output value = " < lstImages; + + if (bbGetInputType()==0) + { + vtkNIFTIImageReader* reader=vtkNIFTIImageReader::New(); + if ( bbGetInputFileNames().size()==1) + { + reader->SetFileName( bbGetInputFileNames()[0].c_str() ); + reader->Update(); + } else { + vtkStringArray *lstFileNames=vtkStringArray::New(); + int i,size=bbGetInputFileNames().size(); + for (i=0;iInsertNextValue( bbGetInputFileNames()[i].c_str() ); + } // for i + reader->SetFileNames( lstFileNames ); + reader->Update(); + } // FileNames + lstImages.push_back( reader->GetOutput() ); + } // Type 0 + + if (bbGetInputType()==1) + { + int i,size=bbGetInputFileNames().size(); + for (i=0;iSetFileName( bbGetInputFileNames()[i].c_str() ); + reader->Update(); + lstImages.push_back( reader->GetOutput() ); + } // for i + } // Type 1 + + + if (lstImages.size()>=1) { bbSetOutputOut( lstImages[0] ); } else {bbSetOutputOut( NULL ); } + bbSetOutputOutVector( lstImages ); +} +//===== +// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost) +//===== +void NIFTIImageReader::bbUserSetDefaultValues() +{ + +// SET HERE THE DEFAULT INPUT/OUTPUT VALUES OF YOUR BOX +// Here we initialize the input 'In' to 0 + bbSetInputType(0); + +} +//===== +// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost) +//===== +void NIFTIImageReader::bbUserInitializeProcessing() +{ + +// THE INITIALIZATION METHOD BODY : +// Here does nothing +// but this is where you should allocate the internal/output pointers +// if any + + +} +//===== +// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost) +//===== +void NIFTIImageReader::bbUserFinalizeProcessing() +{ + +// THE FINALIZATION METHOD BODY : +// Here does nothing +// but this is where you should desallocate the internal/output pointers +// if any + +} +} +// EO namespace bbcreaVtk + + diff --git a/bbtk_creaVtk_PKG/src/bbcreaVtkNIFTIImageReader.h b/bbtk_creaVtk_PKG/src/bbcreaVtkNIFTIImageReader.h new file mode 100644 index 0000000..f32a71d --- /dev/null +++ b/bbtk_creaVtk_PKG/src/bbcreaVtkNIFTIImageReader.h @@ -0,0 +1,52 @@ +//===== +// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost) +//===== +#ifndef __bbcreaVtkNIFTIImageReader_h_INCLUDED__ +#define __bbcreaVtkNIFTIImageReader_h_INCLUDED__ + +#include "bbcreaVtk_EXPORT.h" +#include "bbtkAtomicBlackBox.h" +#include "iostream" + +#include "vtkImageData.h" + +namespace bbcreaVtk +{ + +class bbcreaVtk_EXPORT NIFTIImageReader + : + public bbtk::AtomicBlackBox +{ + BBTK_BLACK_BOX_INTERFACE(NIFTIImageReader,bbtk::AtomicBlackBox); +//===== +// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost) +//===== + BBTK_DECLARE_INPUT(Type,int); + BBTK_DECLARE_INPUT(FileNames,std::vector < std::string >); + BBTK_DECLARE_OUTPUT(Out, vtkImageData*); + BBTK_DECLARE_OUTPUT(OutVector, std::vector< vtkImageData* >); + BBTK_PROCESS(Process); + void Process(); +//===== +// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost) +//===== +}; + +BBTK_BEGIN_DESCRIBE_BLACK_BOX(NIFTIImageReader,bbtk::AtomicBlackBox); + BBTK_NAME("NIFTIImageReader"); + BBTK_AUTHOR("Info-Dev"); + BBTK_DESCRIPTION("No Description."); + BBTK_CATEGORY("empty"); + BBTK_INPUT(NIFTIImageReader,Type,"(default 0) 0:Use FileNames by slice 1:Use FileNames by volumes",int,""); + BBTK_INPUT(NIFTIImageReader,FileNames,"List of file names",std::vector,""); + BBTK_OUTPUT(NIFTIImageReader,Out,"Output image",vtkImageData*,""); + BBTK_OUTPUT(NIFTIImageReader,OutVector,"Vector of image",std::vector,""); +BBTK_END_DESCRIBE_BLACK_BOX(NIFTIImageReader); +//===== +// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost) +//===== +} +// EO namespace bbcreaVtk + +#endif // __bbcreaVtkNIFTIImageReader_h_INCLUDED__ + diff --git a/bbtk_creaVtk_PKG/src/bbcreaVtkPlane.cxx b/bbtk_creaVtk_PKG/src/bbcreaVtkPlane.cxx new file mode 100644 index 0000000..61b28e9 --- /dev/null +++ b/bbtk_creaVtk_PKG/src/bbcreaVtkPlane.cxx @@ -0,0 +1,87 @@ +//===== +// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost) +//===== +#include "bbcreaVtkPlane.h" +#include "bbcreaVtkPackage.h" + +#include "vtkPlane.h" + +namespace bbcreaVtk +{ + +BBTK_ADD_BLACK_BOX_TO_PACKAGE(creaVtk,Plane) +BBTK_BLACK_BOX_IMPLEMENTATION(Plane,bbtk::AtomicBlackBox); +//===== +// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost) +//===== +void Plane::Process() +{ + +// THE MAIN PROCESSING METHOD BODY +// Here we simply set the input 'In' value to the output 'Out' +// And print out the output value +// INPUT/OUTPUT ACCESSORS ARE OF THE FORM : +// void bbSet{Input|Output}NAME(const TYPE&) +// const TYPE& bbGet{Input|Output}NAME() const +// Where : +// * NAME is the name of the input/output +// (the one provided in the attribute 'name' of the tag 'input') +// * TYPE is the C++ type of the input/output +// (the one provided in the attribute 'type' of the tag 'input') +// bbSetOutputOut( bbGetInputIn() ); +// std::cout << "Output value = " <SetOrigin( bbGetInputOrigin()[0],bbGetInputOrigin()[1],bbGetInputOrigin()[2] ); + plane->SetNormal( bbGetInputNormal()[0], bbGetInputNormal()[1], bbGetInputNormal()[2] ); + } + bbSetOutputOut( plane ); +} + +//===== +// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost) +//===== +void Plane::bbUserSetDefaultValues() +{ +// SET HERE THE DEFAULT INPUT/OUTPUT VALUES OF YOUR BOX +// Here we initialize the input 'In' to 0 + std::vector origin; + std::vector normal; + origin.push_back(0); + origin.push_back(0); + origin.push_back(0); + normal.push_back(0); + normal.push_back(0); + normal.push_back(1); + bbSetInputOrigin( origin ); + bbSetInputNormal( normal ); +} + +//===== +// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost) +//===== +void Plane::bbUserInitializeProcessing() +{ +// THE INITIALIZATION METHOD BODY : +// Here does nothing +// but this is where you should allocate the internal/output pointers +// if any +} + +//===== +// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost) +//===== +void Plane::bbUserFinalizeProcessing() +{ +// THE FINALIZATION METHOD BODY : +// Here does nothing +// but this is where you should desallocate the internal/output pointers +// if any +} + +} // EO namespace bbcreaVtk + + diff --git a/bbtk_creaVtk_PKG/src/bbcreaVtkPlane.h b/bbtk_creaVtk_PKG/src/bbcreaVtkPlane.h new file mode 100644 index 0000000..a6a1e85 --- /dev/null +++ b/bbtk_creaVtk_PKG/src/bbcreaVtkPlane.h @@ -0,0 +1,52 @@ +//===== +// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost) +//===== +#ifndef __bbcreaVtkPlane_h_INCLUDED__ +#define __bbcreaVtkPlane_h_INCLUDED__ + +#include "bbcreaVtk_EXPORT.h" +#include "bbtkAtomicBlackBox.h" +#include "iostream" +#include "vtkImplicitFunction.h" + +namespace bbcreaVtk +{ + +class bbcreaVtk_EXPORT Plane + : + public bbtk::AtomicBlackBox +{ + BBTK_BLACK_BOX_INTERFACE(Plane,bbtk::AtomicBlackBox); +//===== +// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost) +//===== + BBTK_DECLARE_INPUT(Origin,std::vector); + BBTK_DECLARE_INPUT(Normal,std::vector); + BBTK_DECLARE_OUTPUT(Out,vtkImplicitFunction*); + BBTK_PROCESS(Process); + void Process(); +//===== +// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost) +//===== +}; + +BBTK_BEGIN_DESCRIBE_BLACK_BOX(Plane,bbtk::AtomicBlackBox); + BBTK_NAME("Plane"); + BBTK_AUTHOR("InfoDev"); + BBTK_DESCRIPTION("Implicite Function of VTK"); + BBTK_CATEGORY("empty"); + + BBTK_INPUT(Plane,Origin,"(default [0,0,0]) point [x,y,z]",std::vector,""); + BBTK_INPUT(Plane,Normal,"(default [0,0,1]) vector [x,y,z]",std::vector,""); + + BBTK_OUTPUT(Plane,Out,"vtkImplicitFuntion",vtkImplicitFunction*,""); + +BBTK_END_DESCRIBE_BLACK_BOX(Plane); +//===== +// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost) +//===== +} +// EO namespace bbcreaVtk + +#endif // __bbcreaVtkPlane_h_INCLUDED__ + diff --git a/bbtk_creaVtk_PKG/src/bbcreaVtkPlaneSource.cxx b/bbtk_creaVtk_PKG/src/bbcreaVtkPlaneSource.cxx index 2f8b50d..91f5a49 100644 --- a/bbtk_creaVtk_PKG/src/bbcreaVtkPlaneSource.cxx +++ b/bbtk_creaVtk_PKG/src/bbcreaVtkPlaneSource.cxx @@ -16,33 +16,71 @@ BBTK_BLACK_BOX_IMPLEMENTATION(PlaneSource,bbtk::AtomicBlackBox); //===== void PlaneSource::Process() { - vtkPlaneSource *plane; - plane = vtkPlaneSource::New(); - double p0[3]; - p0[0]=0; - p0[1]=0; - p0[2]=0; + double c[3]; + double p0[3]; double p1[3]; - p1[0]=0; - p1[1]=1; - p1[2]=0; - double p2[3]; - p2[0]=0; - p2[1]=0; - p2[2]=1; - double c[3]; - c[0]=bbGetInputCenter()[0]; - c[1]=bbGetInputCenter()[1]; - c[2]=bbGetInputCenter()[2]; + double p2[3]; + vtkPlaneSource *plane; + plane = vtkPlaneSource::New(); + c[0] = bbGetInputCenter()[0]; + c[1] = bbGetInputCenter()[1]; + c[2] = bbGetInputCenter()[2]; + p0[0] = 0; + p0[1] = 0; + p0[2] = 0; + + + bool byNormal=true; + double size=350; + + // xy + if ((bbGetInputNormal()[0]==0) && (bbGetInputNormal()[1]==0) && (bbGetInputNormal()[2]==1) ) + { + byNormal= false; + p1[0] = size; + p1[1] = 0; + p1[2] = 0; + p2[0] = 0; + p2[1] = size; + p2[2] = 0; + } + + // xz + if ((bbGetInputNormal()[0]==0) && (bbGetInputNormal()[1]==1) && (bbGetInputNormal()[2]==0) ) + { + byNormal= false; + p1[0] = size; + p1[1] = 0; + p1[2] = 0; + p2[0] = 0; + p2[1] = 0; + p2[2] = size; + } + + // yz + if ((bbGetInputNormal()[0]==1) && (bbGetInputNormal()[1]==0) && (bbGetInputNormal()[2]==0) ) + { + byNormal= false; + p1[0] = 0; + p1[1] = size; + p1[2] = 0; + p2[0] = 0; + p2[1] = 0; + p2[2] = size; + } plane->SetResolution( bbGetInputXResolution(), bbGetInputYResolution() ); - plane->SetOrigin( p0 ); - plane->SetPoint1( p1 ); - plane->SetPoint2( p2 ); - plane->Update( ); - plane->SetNormal( bbGetInputNormal()[0], bbGetInputNormal()[1], bbGetInputNormal()[2] ); - plane->Update( ); - plane->SetCenter( c ); + if (byNormal==false) + { + plane->SetOrigin( p0 ); + plane->SetPoint1( p1 ); + plane->SetPoint2( p2 ); + } else { + plane->SetNormal( bbGetInputNormal()[0], bbGetInputNormal()[1], bbGetInputNormal()[2] ); + printf("EED PlaneSource. Missing mechanism to define the size of the plane\n"); + } + plane->SetCenter( c ); + plane->Update( ); bbSetOutputPlane( (vtkDataSet*)plane ); bbSetOutputPolyData( plane->GetOutput() ); diff --git a/bbtk_creaVtk_PKG/src/bbcreaVtkPlaneWidget.cxx b/bbtk_creaVtk_PKG/src/bbcreaVtkPlaneWidget.cxx index 59b6821..91de0a6 100644 --- a/bbtk_creaVtk_PKG/src/bbcreaVtkPlaneWidget.cxx +++ b/bbtk_creaVtk_PKG/src/bbcreaVtkPlaneWidget.cxx @@ -44,14 +44,23 @@ void PlaneWidget::Process() // * TYPE is the C++ type of the input/output // (the one provided in the attribute 'type' of the tag 'input') - _boxcreavtkplanewidget.SetActive( bbGetInputActive() ); - _boxcreavtkplanewidget.SetImage( bbGetInputIn() ); - _boxcreavtkplanewidget.SetResolution( bbGetInputResolution() ); - _boxcreavtkplanewidget.SetRenderer( bbGetInputRenderer() ); - _boxcreavtkplanewidget.Process(); - bbSetOutputOut( _boxcreavtkplanewidget.GetPlaneSource()->GetOutput() ); - bbSetOutputCenter( _boxcreavtkplanewidget.GetCenter() ); - bbSetOutputNormal( _boxcreavtkplanewidget.GetNormal() ); + if ((bbGetInputIn()==NULL) || (bbGetInputRenderer()==NULL)) + { + bbSetOutputOut( NULL ); + std::vector center; + std::vector normal; + bbSetOutputCenter( center ); + bbSetOutputNormal( normal ); + } else { + _boxcreavtkplanewidget.SetActive( bbGetInputActive() ); + _boxcreavtkplanewidget.SetImage( bbGetInputIn() ); + _boxcreavtkplanewidget.SetResolution( bbGetInputResolution() ); + _boxcreavtkplanewidget.SetRenderer( bbGetInputRenderer() ); + _boxcreavtkplanewidget.Process(); + bbSetOutputOut( _boxcreavtkplanewidget.GetPlaneSource()->GetOutput() ); + bbSetOutputCenter( _boxcreavtkplanewidget.GetCenter() ); + bbSetOutputNormal( _boxcreavtkplanewidget.GetNormal() ); + } } //===== // Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost) diff --git a/bbtk_creaVtk_PKG/src/bbcreaVtkPointPicker.cxx b/bbtk_creaVtk_PKG/src/bbcreaVtkPointPicker.cxx index 6bc8262..0d75b95 100644 --- a/bbtk_creaVtk_PKG/src/bbcreaVtkPointPicker.cxx +++ b/bbtk_creaVtk_PKG/src/bbcreaVtkPointPicker.cxx @@ -7,31 +7,53 @@ #include #include #include -#include #include namespace bbcreaVtk { +creaVtkCallbackPointPicker::creaVtkCallbackPointPicker(void) +{ + boxPointPicker=NULL; +} +void creaVtkCallbackPointPicker::setBox(PointPicker *box) +{ + boxPointPicker=box; +} void creaVtkCallbackPointPicker::Execute(vtkObject *caller, unsigned long, void*) { - printf("creaVtkCallbackPointPicker EED Picker\n"); - vtkRenderWindowInteractor *iren = static_cast(caller); - - int* pos = iren->GetEventPosition(); - vtkCellPicker *picker = vtkCellPicker::New(); - picker->SetTolerance(0.0005); - picker->Pick(pos[0], pos[1], 0, iren->GetRenderWindow()->GetRenderers()->GetFirstRenderer() ); - - if(picker->GetCellId() != -1) - { - printf("creaVtkCallbackPointPicker EED picker OK\n"); - } else { - printf("creaVtkCallbackPointPicker EED picker --\n"); - } // if - + if (boxPointPicker!=NULL) + { + if (boxPointPicker->bbGetInputActive()==true) + { +// printf("creaVtkCallbackPointPicker EED Picker\n"); + vtkRenderWindowInteractor *iren = static_cast(caller); + int* pos = iren->GetEventPosition(); + vtkCellPicker *picker = vtkCellPicker::New(); + picker->SetTolerance(0.0005); + picker->Pick(pos[0], pos[1], 0, iren->GetRenderWindow()->GetRenderers()->GetFirstRenderer() ); + double point[3]; + + if(picker->GetCellId() != -1) + { +// printf("creaVtkCallbackPointPicker EED picker OK\n"); + picker->GetPickPosition(point); + std::vector vecPoint; + vecPoint.push_back( point[0] ); + vecPoint.push_back( point[1] ); + vecPoint.push_back( point[2] ); + boxPointPicker->bbSetOutputPoint( vecPoint ); + boxPointPicker->bbSetOutputMesh( picker->GetProp3D() ); + boxPointPicker->bbSetOutputPointId( picker->GetPointId() ); + boxPointPicker->bbSetOutputCellId( picker->GetCellId() ); + boxPointPicker->bbSignalOutputModification(); + } else { +// printf("creaVtkCallbackPointPicker EED picker --\n"); + } // if + } + } // if boxPoiintPicker /* { @@ -40,7 +62,7 @@ void creaVtkCallbackPointPicker::Execute(vtkObject *caller, unsigned long, void* << " " << worldPosition[2] << endl; vtkSmartPointer ids = - vtkSmartPointer::New(); + vtkSmartPointer::New()creaVtkCallbackPointPicker *callPicker; ids->SetNumberOfComponents(1); ids->InsertNextValue(picker->GetCellId()); @@ -128,8 +150,6 @@ void PointPicker::Process() if (firsttime==true) { - -printf("EED PointPicker::Process Firsttime \n"); firsttime = false; // vtkCellPicker *picker = vtkCellPicker::New(); // vtkPropPicker *picker = vtkCellPicker::New(); @@ -147,26 +167,56 @@ printf("EED PointPicker::Process Firsttime \n"); bbGetInputRenderer()->GetRenderWindow()->GetInteractor()->SetPicker(picker); */ - creaVtkCallbackPointPicker *callPicker = creaVtkCallbackPointPicker::New(); - vtkRenderWindowInteractor *vrwi = bbGetInputRenderer()->GetRenderWindow()->GetInteractor(); - vrwi->AddObserver( vtkCommand::EndPickEvent , callPicker ); - vrwi->AddObserver( vtkCommand::StartPickEvent , callPicker ); - vrwi->AddObserver( vtkCommand::MouseMoveEvent , callPicker ); + callPicker = creaVtkCallbackPointPicker::New(); + callPicker->setBox( this ); } // if firsttime + + if (bbGetInputRenderer()!=NULL) + { + vtkRenderWindowInteractor *vrwi = bbGetInputRenderer()->GetRenderWindow()->GetInteractor(); + vrwi->RemoveObserver( callPicker ); + + if (bbGetInputTypeEvent()==0) + { + // Nothing + } else if (bbGetInputTypeEvent()==1) + { + vrwi->AddObserver( vtkCommand::MouseMoveEvent , callPicker ); + } else if (bbGetInputTypeEvent()==2) + { + vrwi->AddObserver( vtkCommand::LeftButtonPressEvent , callPicker ); + } else if (bbGetInputTypeEvent()==3) + { +#if VTK_MAJOR_VERSION >= 9 + vrwi->AddObserver( vtkCommand::LeftButtonDoubleClickEvent , callPicker ); +#else + printf("EED Warnning! PointPicker LeftButtonPressEvent since vtk 9 \n"); +#endif + } // if TypeEvent + // ....See vtkCommand EventIds + } // if bbGetInputRenderer() + + + + } //===== // Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost) //===== void PointPicker::bbUserSetDefaultValues() { - // SET HERE THE DEFAULT INPUT/OUTPUT VALUES OF YOUR BOX // Here we initialize the input 'In' to 0 // bbSetInputIn(0); - - firsttime=true; + bbSetInputActive(true); + bbSetInputTypeEvent(0); + bbSetOutputMesh(NULL); + bbSetOutputPointId(-1); + bbSetOutputCellId(-1); + firsttime=true; + callPicker=NULL; } //===== // Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost) diff --git a/bbtk_creaVtk_PKG/src/bbcreaVtkPointPicker.h b/bbtk_creaVtk_PKG/src/bbcreaVtkPointPicker.h index 804309f..94c9d37 100644 --- a/bbtk_creaVtk_PKG/src/bbcreaVtkPointPicker.h +++ b/bbtk_creaVtk_PKG/src/bbcreaVtkPointPicker.h @@ -9,18 +9,28 @@ #include "vtkCommand.h" #include "vtkRenderer.h" +#include "vtkProp3D.h" +#include + namespace bbcreaVtk { +class PointPicker; //--------------------------------------------- class creaVtkCallbackPointPicker : public vtkCommand { + public: + creaVtkCallbackPointPicker(); + static creaVtkCallbackPointPicker *New() { return new creaVtkCallbackPointPicker; } void Delete() { delete this; } virtual void Execute(vtkObject *caller, unsigned long, void*); + void setBox(PointPicker *box); + private: + PointPicker *boxPointPicker; }; @@ -29,6 +39,7 @@ class creaVtkCallbackPointPicker : public vtkCommand //--------------------------------------------- //--------------------------------------------- +typedef long int longInt; class bbcreaVtk_EXPORT PointPicker : @@ -38,24 +49,39 @@ class bbcreaVtk_EXPORT PointPicker //===== // Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost) //===== + BBTK_DECLARE_INPUT(Active,bool); + BBTK_DECLARE_INPUT(TypeEvent,int ); BBTK_DECLARE_INPUT(Renderer,vtkRenderer*); - BBTK_DECLARE_OUTPUT(Out,std::vector); + BBTK_DECLARE_OUTPUT(Point,std::vector); + BBTK_DECLARE_OUTPUT(Mesh,vtkProp3D*); + BBTK_DECLARE_OUTPUT(PointId,longInt); + BBTK_DECLARE_OUTPUT(CellId,longInt); BBTK_PROCESS(Process); void Process(); bool firsttime; + creaVtkCallbackPointPicker *callPicker; + //===== // Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost) //===== }; BBTK_BEGIN_DESCRIBE_BLACK_BOX(PointPicker,bbtk::AtomicBlackBox); -BBTK_NAME("PointPicker"); -BBTK_AUTHOR("InfoDev"); -BBTK_DESCRIPTION("No Description."); -BBTK_CATEGORY("empty"); -BBTK_INPUT(PointPicker,Renderer,"vtk Renderer",vtkRenderer*,""); -BBTK_OUTPUT(PointPicker,Out,"First output",std::vector,""); + BBTK_NAME("PointPicker"); + BBTK_AUTHOR("InfoDev"); + BBTK_DESCRIPTION("No Description."); + BBTK_CATEGORY("empty"); + + BBTK_INPUT(PointPicker,Active,"(true default) true/false",bool,""); + BBTK_INPUT(PointPicker,TypeEvent,"(0 default) 0:NOTHING, 1:MouseMoveEvent 2:LeftButtonPressEvent 3:LeftButtonDoubleClickEvent",int,""); + BBTK_INPUT(PointPicker,Renderer,"vtk Renderer",vtkRenderer*,""); + + BBTK_OUTPUT(PointPicker,Point,"Point (double)",std::vector,""); + BBTK_OUTPUT(PointPicker,Mesh,"Mesh",vtkProp3D*,""); + BBTK_OUTPUT(PointPicker,PointId,"Point Id in Mesh",longInt,""); + BBTK_OUTPUT(PointPicker,CellId,"Cell Id in Mesh",longInt,""); + BBTK_END_DESCRIBE_BLACK_BOX(PointPicker); //===== // Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost) diff --git a/bbtk_creaVtk_PKG/src/bbcreaVtkPolyDataInfo.cxx b/bbtk_creaVtk_PKG/src/bbcreaVtkPolyDataInfo.cxx new file mode 100644 index 0000000..68c02e1 --- /dev/null +++ b/bbtk_creaVtk_PKG/src/bbcreaVtkPolyDataInfo.cxx @@ -0,0 +1,132 @@ +//===== +// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost) +//===== +#include "bbcreaVtkPolyDataInfo.h" +#include "bbcreaVtkPackage.h" +namespace bbcreaVtk +{ + +BBTK_ADD_BLACK_BOX_TO_PACKAGE(creaVtk,PolyDataInfo) +BBTK_BLACK_BOX_IMPLEMENTATION(PolyDataInfo,bbtk::AtomicBlackBox); +//===== +// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost) +//===== +void PolyDataInfo::Process() +{ + +// THE MAIN PROCESSING METHOD BODY +// Here we simply set the input 'In' value to the output 'Out' +// And print out the output value +// INPUT/OUTPUT ACCESSORS ARE OF THE FORM : +// void bbSet{Input|Output}NAME(const TYPE&) +// const TYPE& bbGet{Input|Output}NAME() const +// Where : +// * NAME is the name of the input/output +// (the one provided in the attribute 'name' of the tag 'input') +// * TYPE is the C++ type of the input/output +// (the one provided in the attribute 'type' of the tag 'input') +// bbSetOutputOut( bbGetInputIn() ); +// std::cout << "Output value = " <GetNumberOfCells() ); + bbSetOutputNumberOfLines( bbGetInputIn()->GetNumberOfLines() ); + bbSetOutputNumberOfPieces( bbGetInputIn()->GetNumberOfPieces() ); + bbSetOutputNumberOfPoints( bbGetInputIn()->GetNumberOfPoints() ); + bbSetOutputNumberOfPolys( bbGetInputIn()->GetNumberOfPolys() ); + bbSetOutputNumberOfStrips( bbGetInputIn()->GetNumberOfStrips() ); + bbSetOutputNumberOfVerts( bbGetInputIn()->GetNumberOfVerts() ); + + if (bbGetInputPoints()==true) + { + std::vector lstIds; + std::vector lstPointsX; + std::vector lstPointsY; + std::vector lstPointsZ; + double p1[3]; + double p2[3]; + long int i,size= bbGetInputIn()->GetNumberOfPoints(); + for (i=0;iGetPoint(i,p1); + bbGetInputTransform()->TransformPoint(p1,p2); + } else { + bbGetInputIn()->GetPoint(i,p2); + } + lstPointsX.push_back(p2[0]); + lstPointsY.push_back(p2[1]); + lstPointsZ.push_back(p2[2]); + } // for i + bbSetOutputLstIdsPoints(lstIds); + bbSetOutputLstPointsX(lstPointsX); + bbSetOutputLstPointsY(lstPointsY); + bbSetOutputLstPointsZ(lstPointsZ); + } // Points + } else { + bbSetOutputNumberOfCells(-1); + bbSetOutputNumberOfLines(-1); + bbSetOutputNumberOfPieces(-1); + bbSetOutputNumberOfPoints(-1); + bbSetOutputNumberOfPolys(-1); + bbSetOutputNumberOfStrips(-1); + bbSetOutputNumberOfVerts(-1); + }// if + +} +//===== +// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost) +//===== +void PolyDataInfo::bbUserSetDefaultValues() +{ + +// SET HERE THE DEFAULT INPUT/OUTPUT VALUES OF YOUR BOX +// Here we initialize the input 'In' to 0 + bbSetInputIn(NULL); + bbSetOutputNumberOfCells(-9999); + bbSetOutputNumberOfLines(-9999); + bbSetOutputNumberOfPoints(-9999); + bbSetOutputNumberOfPieces(-9999); + bbSetOutputNumberOfPolys(-9999); + bbSetOutputNumberOfStrips(-9999); + bbSetOutputNumberOfVerts(-9999); + bbSetInputIdsPoints(false); + bbSetInputPoints(false); + bbSetInputTransform(NULL); +} +//===== +// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost) +//===== +void PolyDataInfo::bbUserInitializeProcessing() +{ + +// THE INITIALIZATION METHOD BODY : +// Here does nothing +// but this is where you should allocate the internal/output pointers +// if any + + +} +//===== +// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost) +//===== +void PolyDataInfo::bbUserFinalizeProcessing() +{ + +// THE FINALIZATION METHOD BODY : +// Here does nothing +// but this is where you should desallocate the internal/output pointers +// if any + +} +} +// EO namespace bbcreaVtk + + diff --git a/bbtk_creaVtk_PKG/src/bbcreaVtkPolyDataInfo.h b/bbtk_creaVtk_PKG/src/bbcreaVtkPolyDataInfo.h new file mode 100644 index 0000000..3bafe68 --- /dev/null +++ b/bbtk_creaVtk_PKG/src/bbcreaVtkPolyDataInfo.h @@ -0,0 +1,81 @@ +//===== +// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost) +//===== +#ifndef __bbcreaVtkPolyDataInfo_h_INCLUDED__ +#define __bbcreaVtkPolyDataInfo_h_INCLUDED__ + +#include "bbcreaVtk_EXPORT.h" +#include "bbtkAtomicBlackBox.h" +#include "iostream" + +#include "vtkPolyData.h" +#include "vtkLinearTransform.h" + +namespace bbcreaVtk +{ + +class bbcreaVtk_EXPORT PolyDataInfo + : + public bbtk::AtomicBlackBox +{ + BBTK_BLACK_BOX_INTERFACE(PolyDataInfo,bbtk::AtomicBlackBox); +//===== +// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost) +//===== + BBTK_DECLARE_INPUT( In , vtkPolyData* ); + BBTK_DECLARE_INPUT( Points , bool ); + BBTK_DECLARE_INPUT( IdsPoints , bool ); + BBTK_DECLARE_INPUT( Transform , vtkLinearTransform* ); + + BBTK_DECLARE_OUTPUT( NumberOfCells , double ); + BBTK_DECLARE_OUTPUT( NumberOfLines , double ); + BBTK_DECLARE_OUTPUT( NumberOfPoints , double ); + BBTK_DECLARE_OUTPUT( NumberOfPieces , double ); + BBTK_DECLARE_OUTPUT( NumberOfPolys , double ); + BBTK_DECLARE_OUTPUT( NumberOfStrips , double ); + BBTK_DECLARE_OUTPUT( NumberOfVerts , double ); + BBTK_DECLARE_OUTPUT( LstIdsPoints , std::vector ); + BBTK_DECLARE_OUTPUT( LstPointsX , std::vector ); + BBTK_DECLARE_OUTPUT( LstPointsY , std::vector ); + BBTK_DECLARE_OUTPUT( LstPointsZ , std::vector ); + + BBTK_PROCESS(Process); + void Process(); +//===== +// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost) +//===== +}; + +BBTK_BEGIN_DESCRIBE_BLACK_BOX(PolyDataInfo,bbtk::AtomicBlackBox); + BBTK_NAME("PolyDataInfo"); + BBTK_AUTHOR("InfoDev"); + BBTK_DESCRIPTION("No Description."); + BBTK_CATEGORY("empty"); + + BBTK_INPUT(PolyDataInfo,In,"vtkPolyData", vtkPolyData* ,""); + BBTK_INPUT(PolyDataInfo,IdsPoints,"(default false) Extract ids of the mesh or not.", bool ,""); + BBTK_INPUT(PolyDataInfo,Points,"(default false) Extract points of the mesh or not.", bool ,""); + BBTK_INPUT(PolyDataInfo,Transform,"vtkTransform", vtkLinearTransform* ,""); + + BBTK_OUTPUT(PolyDataInfo,NumberOfCells,"Number of Cells",double,""); + BBTK_OUTPUT(PolyDataInfo,NumberOfLines,"Number of Lines",double,""); + BBTK_OUTPUT(PolyDataInfo,NumberOfPoints,"Number of Points",double,""); + BBTK_OUTPUT(PolyDataInfo,NumberOfPieces,"Number of Pieces",double,""); + BBTK_OUTPUT(PolyDataInfo,NumberOfPolys,"Number of Ploys",double,""); + BBTK_OUTPUT(PolyDataInfo,NumberOfStrips,"Number of Strips",double,""); + BBTK_OUTPUT(PolyDataInfo,NumberOfVerts,"Number of Verts",double,""); + BBTK_OUTPUT(PolyDataInfo,LstIdsPoints,"List of Ids of points (if input Ids=true)",std::vector,""); + BBTK_OUTPUT(PolyDataInfo,LstPointsX,"List of X of points (if input Points=true)",std::vector,""); + BBTK_OUTPUT(PolyDataInfo,LstPointsY,"List of Y of points (if input Points=true)",std::vector,""); + BBTK_OUTPUT(PolyDataInfo,LstPointsZ,"List of Z of points (if input Points=true)",std::vector,""); + + +BBTK_END_DESCRIBE_BLACK_BOX(PolyDataInfo); +//===== +// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost) +//===== +} +// EO namespace bbcreaVtk + +#endif // __bbcreaVtkPolyDataInfo_h_INCLUDED__ + diff --git a/bbtk_creaVtk_PKG/src/bbcreaVtkPolyDataToImageData.cxx b/bbtk_creaVtk_PKG/src/bbcreaVtkPolyDataToImageData.cxx new file mode 100644 index 0000000..7813c42 --- /dev/null +++ b/bbtk_creaVtk_PKG/src/bbcreaVtkPolyDataToImageData.cxx @@ -0,0 +1,116 @@ +//===== +// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost) +//===== +#include "bbcreaVtkPolyDataToImageData.h" +#include "bbcreaVtkPackage.h" + + +namespace bbcreaVtk +{ + +BBTK_ADD_BLACK_BOX_TO_PACKAGE(creaVtk,PolyDataToImageData) +BBTK_BLACK_BOX_IMPLEMENTATION(PolyDataToImageData,bbtk::AtomicBlackBox); +//===== +// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost) +//===== +void PolyDataToImageData::Process() +{ + +// THE MAIN PROCESSING METHOD BODY +// Here we simply set the input 'In' value to the output 'Out' +// And print out the output value +// INPUT/OUTPUT ACCESSORS ARE OF THE FORM : +// void bbSet{Input|Output}NAME(const TYPE&) +// const TYPE& bbGet{Input|Output}NAME() const +// Where : +// * NAME is the name of the input/output +// (the one provided in the attribute 'name' of the tag 'input') +// * TYPE is the C++ type of the input/output +// (the one provided in the attribute 'type' of the tag 'input') + +// bbSetOutputOut( bbGetInputIn() ); +// std::cout << "Output value = " <GetExtent( ext ); +// vtkCleanPolyData *clean1 = vtkCleanPolyData::New(); + if (clean1!=NULL) clean1->Delete(); + clean1 = vtkCleanPolyData::New(); + clean1->SetInputData( bbGetInputInPolyData() ); + clean1->Update(); + vtkTriangleFilter *triangle1 = vtkTriangleFilter::New(); + triangle1->SetInputData( clean1->GetOutput() ); + triangle1->Update(); +// vtkPolyDataToImageStencil *dataToStencil = vtkPolyDataToImageStencil::New(); + if (dataToStencil!=NULL) dataToStencil->Delete(); + dataToStencil = vtkPolyDataToImageStencil::New(); + dataToStencil->SetInputData( triangle1->GetOutput() ); + dataToStencil->SetOutputWholeExtent( ext ); + dataToStencil->Update(); +// vtkExtractVOI *extract = vtkExtractVOI::New(); + if (extract!=NULL) extract->Delete(); + extract = vtkExtractVOI::New(); + extract->SetVOI( ext ); + extract->SetSampleRate(1, 1, 1); + extract->SetInputData( bbGetInputInImage() ); + extract->ReleaseDataFlagOff(); + extract->Update(); +// vtkImageStencil *stencil = vtkImageStencil::New(); + if (stencil!=NULL) stencil->Delete(); + stencil = vtkImageStencil::New(); + stencil->SetInputData( extract->GetOutput() ); + stencil->Update(); + stencil->SetStencilData( dataToStencil->GetOutput() ); + stencil->ReverseStencilOn(); + stencil->SetBackgroundValue( bbGetInputBackgroundValue() ); + stencil->Update(); + bbSetOutputOut( stencil->GetOutput() ); + } else { + printf("EED Warnning! PolyDataToImageData::Process > Missing Image or PolyData inputs\n"); + bbSetOutputOut( NULL); + }// if In NULL +} +//===== +// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost) +//===== +void PolyDataToImageData::bbUserSetDefaultValues() +{ +// SET HERE THE DEFAULT INPUT/OUTPUT VALUES OF YOUR BOX +// Here we initialize the input 'In' to 0 + bbSetInputInPolyData(NULL); + bbSetInputInImage(NULL); + bbSetInputBackgroundValue(255); +} +//===== +// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost) +//===== +void PolyDataToImageData::bbUserInitializeProcessing() +{ +// THE INITIALIZATION METHOD BODY : +// Here does nothing +// but this is where you should allocate the internal/output pointers +// if any + clean1 = NULL; + dataToStencil = NULL; + extract = NULL; + stencil = NULL; +} +//===== +// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost) +//===== +void PolyDataToImageData::bbUserFinalizeProcessing() +{ + +// THE FINALIZATION METHOD BODY : +// Here does nothing +// but this is where you should desallocate the internal/output pointers +// if any + +} +} +// EO namespace bbcreaVtk + + diff --git a/bbtk_creaVtk_PKG/src/bbcreaVtkPolyDataToImageData.h b/bbtk_creaVtk_PKG/src/bbcreaVtkPolyDataToImageData.h new file mode 100644 index 0000000..b5fd4b3 --- /dev/null +++ b/bbtk_creaVtk_PKG/src/bbcreaVtkPolyDataToImageData.h @@ -0,0 +1,69 @@ +//===== +// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost) +//===== +#ifndef __bbcreaVtkPolyDataToImageData_h_INCLUDED__ +#define __bbcreaVtkPolyDataToImageData_h_INCLUDED__ + +#include "bbcreaVtk_EXPORT.h" +#include "bbtkAtomicBlackBox.h" +#include "iostream" + +#include "vtkPolyData.h" +#include "vtkImageData.h" +#include "vtkPolyDataToImageStencil.h" +#include "vtkImageStencil.h" +#include "vtkCleanPolyData.h" +#include "vtkTriangleFilter.h" +#include "vtkExtractVOI.h" +#include "vtkExtractVOI.h" + +namespace bbcreaVtk +{ + +class bbcreaVtk_EXPORT PolyDataToImageData + : + public bbtk::AtomicBlackBox +{ + BBTK_BLACK_BOX_INTERFACE(PolyDataToImageData,bbtk::AtomicBlackBox); +//===== +// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost) +//===== + BBTK_DECLARE_INPUT(InImage,vtkImageData*); + BBTK_DECLARE_INPUT(BackgroundValue,double); + + BBTK_DECLARE_INPUT(InPolyData,vtkPolyData*); + BBTK_DECLARE_OUTPUT(Out,vtkImageData*); + BBTK_PROCESS(Process); + void Process(); + + vtkCleanPolyData *clean1; + vtkPolyDataToImageStencil *dataToStencil; + vtkExtractVOI *extract; + vtkImageStencil *stencil; + +//===== +// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost) +//===== +}; + +BBTK_BEGIN_DESCRIBE_BLACK_BOX(PolyDataToImageData,bbtk::AtomicBlackBox); + BBTK_NAME("PolyDataToImageData"); + BBTK_AUTHOR("InfoDev"); + BBTK_DESCRIPTION("No Description."); + BBTK_CATEGORY("empty"); + + BBTK_INPUT(PolyDataToImageData,InImage,"Image to put Result",vtkImageData*,""); + BBTK_INPUT(PolyDataToImageData,BackgroundValue,"(default 255) Background value",double,""); + BBTK_INPUT(PolyDataToImageData,InPolyData,"Input vtkPolyData",vtkPolyData*,""); + + BBTK_OUTPUT(PolyDataToImageData,Out,"Output vtkImageData",vtkImageData*,""); + +BBTK_END_DESCRIBE_BLACK_BOX(PolyDataToImageData); +//===== +// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost) +//===== +} +// EO namespace bbcreaVtk + +#endif // __bbcreaVtkPolyDataToImageData_h_INCLUDED__ + diff --git a/bbtk_creaVtk_PKG/src/bbcreaVtkReadMHDPlane.cxx b/bbtk_creaVtk_PKG/src/bbcreaVtkReadMHDPlane.cxx index cfa8d83..9ca404f 100644 --- a/bbtk_creaVtk_PKG/src/bbcreaVtkReadMHDPlane.cxx +++ b/bbtk_creaVtk_PKG/src/bbcreaVtkReadMHDPlane.cxx @@ -36,9 +36,12 @@ BBTK_BLACK_BOX_IMPLEMENTATION(ReadMHDPlane,bbtk::AtomicBlackBox); vtkImageData* ReadMHDPlane::CreateDefaultImage() { + vtkImageData *newImage = NULL; +/* + newImage = vtkImageData::New(); int i; int sizeX, sizeY, sizeZ; - sizeX = 200; + sizeX = 1; sizeY = sizeX; sizeZ = 1; vtkImageData *newImage = vtkImageData::New(); @@ -54,133 +57,142 @@ vtkImageData* ReadMHDPlane::CreateDefaultImage() newImage->AllocateScalars(); newImage->Update(); #else - newImage->AllocateScalars(VTK_UNSIGNED_CHAR,1); +// newImage->AllocateScalars(VTK_UNSIGNED_CHAR,1); + newImage->AllocateScalars(VTK_SHORT,1); #endif - memset ( (void*)newImage->GetScalarPointer(), 0, sizeX*sizeY*1 ); - for (i=0; iSetScalarComponentFromDouble(i,i,0, 0, 255 ); - newImage->SetScalarComponentFromDouble(i,sizeY-1-i,0, 0, 255 ); - } // for i +// memset ( (void*)newImage->GetScalarPointer(), 0, sizeX*sizeY*sizeZ*sizeof(unsigned char) ); + memset ( (void*)newImage->GetScalarPointer(), 0, sizeX*sizeY*sizeof(short) ); +// for (i=0; iSetScalarComponentFromDouble(i,i ,0, 0, 255 ); +// newImage->SetScalarComponentFromDouble(i,sizeY-1-i ,0, 0, 255 ); +// } // for i + newImage->Modified(); +*/ return newImage; } vtkImageData* ReadMHDPlane::ChangeOrientation(vtkImageData* imgOrg) { - int width = bbGetInputWidth(); - int ext[6]; - int sizeXOrg, sizeYOrg,sizeZOrg; - int sizeXDst, sizeYDst,sizeZDst; -//EED 2017-01-01 Migration VTK7 -#if VTK_MAJOR_VERSION <= 5 - imgOrg->GetWholeExtent(ext); -#else - imgOrg->GetExtent(ext); -#endif - int sizeLine; - - sizeXOrg = ext[1]-ext[0]+1; - sizeYOrg = ext[3]-ext[2]+1; - sizeZOrg = ext[5]-ext[4]+1; + vtkImageData *imgDst = NULL; - if (bbGetInputDirectionPlane()=="XY") - { - sizeXDst = ext[1]-ext[0]+1; - sizeYDst = ext[3]-ext[2]+1; - sizeZDst = width; - } // XY - if (bbGetInputDirectionPlane()=="YZ") - { - sizeXDst = width; - sizeYDst = ext[1]-ext[0]+1; - sizeZDst = ext[3]-ext[2]+1; - sizeLine = sizeYDst; - } // YZ - if (bbGetInputDirectionPlane()=="ZX") + if (imgOrg!=NULL) { - sizeXDst = ext[1]-ext[0]+1; - sizeYDst = width; - sizeZDst = ext[3]-ext[2]+1; - sizeLine = sizeXDst; - } // ZX - vtkImageData *imgDst = vtkImageData::New(); - imgDst->Initialize(); - imgDst->SetSpacing( imgOrg->GetSpacing() ); - imgDst->SetDimensions( sizeXDst,sizeYDst,sizeZDst ); - imgDst->SetExtent(0,sizeXDst-1,0,sizeYDst-1,0,sizeZDst-1 ); - -//EED 2017-01-01 Migration VTK7 -#if VTK_MAJOR_VERSION <= 5 - imgDst->SetWholeExtent(0,sizeXDst-1,0,sizeYDst-1,0,sizeZDst-1 ); - imgDst->SetScalarType( imgOrg->GetScalarType() ); - imgDst->SetNumberOfScalarComponents(1); - imgDst->AllocateScalars(); - imgDst->Update(); -#else - imgDst->AllocateScalars(imgOrg->GetScalarType(),1); -#endif + int width; + int ext[6]; + int sizeXOrg, sizeYOrg,sizeZOrg; + int sizeXDst, sizeYDst,sizeZDst; + //EED 2017-01-01 Migration VTK7 + #if VTK_MAJOR_VERSION <= 5 + imgOrg->GetWholeExtent(ext); + #else + imgOrg->GetExtent(ext); + #endif + int sizeLine; + + sizeXOrg = ext[1]-ext[0]+1; + sizeYOrg = ext[3]-ext[2]+1; + sizeZOrg = ext[5]-ext[4]+1; + width=sizeZOrg; + + if (bbGetInputDirectionPlane()=="XY") + { + sizeXDst = ext[1]-ext[0]+1; + sizeYDst = ext[3]-ext[2]+1; + sizeZDst = width; + } // XY + if (bbGetInputDirectionPlane()=="YZ") + { + sizeXDst = width; + sizeYDst = ext[1]-ext[0]+1; + sizeZDst = ext[3]-ext[2]+1; + sizeLine = sizeYDst; + } // YZ + if (bbGetInputDirectionPlane()=="ZX") + { + sizeXDst = ext[1]-ext[0]+1; + sizeYDst = width; + sizeZDst = ext[3]-ext[2]+1; + sizeLine = sizeXDst; + } // ZX + imgDst = vtkImageData::New(); + imgDst->Initialize(); + imgDst->SetSpacing( imgOrg->GetSpacing() ); + imgDst->SetDimensions( sizeXDst,sizeYDst,sizeZDst ); + imgDst->SetExtent(0,sizeXDst-1,0,sizeYDst-1,0,sizeZDst-1 ); + + //EED 2017-01-01 Migration VTK7 + #if VTK_MAJOR_VERSION <= 5 + imgDst->SetWholeExtent(0,sizeXDst-1,0,sizeYDst-1,0,sizeZDst-1 ); + imgDst->SetScalarType( imgOrg->GetScalarType() ); + imgDst->SetNumberOfScalarComponents(1); + imgDst->AllocateScalars(); + imgDst->Update(); + #else + imgDst->AllocateScalars(imgOrg->GetScalarType(),1); + #endif - char *ptrDst,*ptrOrg; - int sizeBytes = imgOrg->GetScalarSize(); - int sizeLineBytes = sizeLine*imgOrg->GetScalarSize(); - int xx,yy,zz; + char *ptrDst,*ptrOrg; + int sizeBytes = imgOrg->GetScalarSize(); + int sizeLineBytes = sizeLine*imgOrg->GetScalarSize(); + int xx,yy,zz; - long int sizeXDstBytes = sizeXDst*sizeBytes; - long int sizeXYDstBytes = sizeXDst*sizeYDst*sizeBytes; - long int sizeXYDstBytes2 = sizeXDst*sizeYDst*sizeBytes*2; - long int sizeXYZDstBytes = sizeXDst*sizeYDst*sizeZDst*sizeBytes; - long int sizeXYZDstBytes1 = sizeXDst*sizeYDst*(sizeZDst-1)*sizeBytes; + long int sizeXDstBytes = sizeXDst*sizeBytes; + long int sizeXYDstBytes = sizeXDst*sizeYDst*sizeBytes; + long int sizeXYDstBytes2 = sizeXDst*sizeYDst*sizeBytes*2; + long int sizeXYZDstBytes = sizeXDst*sizeYDst*sizeZDst*sizeBytes; + long int sizeXYZDstBytes1 = sizeXDst*sizeYDst*(sizeZDst-1)*sizeBytes; - ptrOrg = (char*)( imgOrg->GetScalarPointer() ); + ptrOrg = (char*)( imgOrg->GetScalarPointer() ); - if (bbGetInputDirectionPlane()=="XY") - { - memcpy ( imgDst->GetScalarPointer(), ptrOrg , sizeXDst*sizeYDst*sizeZDst*(imgOrg->GetScalarSize()) ); - } // if XY + if (bbGetInputDirectionPlane()=="XY") + { + memcpy ( imgDst->GetScalarPointer(), ptrOrg , sizeXDst*sizeYDst*sizeZDst*(imgOrg->GetScalarSize()) ); + } // if XY - if (bbGetInputDirectionPlane()=="ZX") - { - ptrDst = (char*)( imgDst->GetScalarPointer(0,0,sizeYOrg-00-1) ); - for( zz=0 ; zzGetScalarPointer(0,zz,sizeYOrg-00-1) ); - for( yy=0 ; yyGetScalarPointer(0,0,sizeYOrg-00-1) ); + for( zz=0 ; zzGetScalarPointer(0,yy,zz) ); -// ptrDst=(char*)( imgDst->GetScalarPointer(0,zz,sizeYOrg-yy-1) ); - memcpy ( ptrDst, ptrOrg , sizeLineBytes ); - ptrOrg = ptrOrg + sizeLineBytes; - ptrDst = ptrDst - sizeXYDstBytes; - } // for yy - ptrDst = ptrDst + sizeXDstBytes; - ptrDst = ptrDst + sizeXYZDstBytes; - } // for zz - } // ZX - - if (bbGetInputDirectionPlane()=="YZ") - { - ptrDst = (char*)( imgDst->GetScalarPointer(0,0,sizeYOrg-0-1) ); - for( zz=0 ; zzGetScalarPointer(0,zz,sizeYOrg-00-1) ); + for( yy=0 ; yyGetScalarPointer(0,yy,zz) ); + // ptrDst=(char*)( imgDst->GetScalarPointer(0,zz,sizeYOrg-yy-1) ); + memcpy ( ptrDst, ptrOrg , sizeLineBytes ); + ptrOrg = ptrOrg + sizeLineBytes; + ptrDst = ptrDst - sizeXYDstBytes; + } // for yy + ptrDst = ptrDst + sizeXDstBytes; + ptrDst = ptrDst + sizeXYZDstBytes; + } // for zz + } // ZX + + if (bbGetInputDirectionPlane()=="YZ") { - ptrDst=(char*)( imgDst->GetScalarPointer(zz,0,sizeYOrg-0-1) ); - for( yy=0 ; yyGetScalarPointer(0,0,sizeYOrg-0-1) ); + for( zz=0 ; zzGetScalarPointer(zz,0,sizeYOrg-yy-1) ); - for( xx=0 ; xxGetScalarPointer(zz,0,sizeYOrg-0-1) ); + for( yy=0 ; yyGetScalarPointer(xx,yy,zz) ); -// ptrDst=(char*)( imgDst->GetScalarPointer(zz,xx,sizeYOrg-yy-1) ); - memcpy ( ptrDst, ptrOrg , sizeBytes ); - ptrOrg+= sizeBytes; - ptrDst+= sizeXDstBytes; - } /// for xx - ptrDst = ptrDst - sizeXYDstBytes2; - } // for yy - ptrDst = ptrDst + sizeXYZDstBytes; -// ptrDst++; - } // for zz - } // ZX - + // ptrDst=(char*)( imgDst->GetScalarPointer(zz,0,sizeYOrg-yy-1) ); + for( xx=0 ; xxGetScalarPointer(xx,yy,zz) ); + // ptrDst=(char*)( imgDst->GetScalarPointer(zz,xx,sizeYOrg-yy-1) ); + memcpy ( ptrDst, ptrOrg , sizeBytes ); + ptrOrg+= sizeBytes; + ptrDst+= sizeXDstBytes; + } /// for xx + ptrDst = ptrDst - sizeXYDstBytes2; + } // for yy + ptrDst = ptrDst + sizeXYZDstBytes; + // ptrDst++; + } // for zz + } // ZX + } // if imgOrg return imgDst; } @@ -202,8 +214,8 @@ void ReadMHDPlane::Read64lseek(std::string fileNameIn, std::string plane) long int headersize=0; vtkImageData *newImage=NULL; char mystring[250]; - char strTmp[30]; - char strTmp2[30]; + char strTmp[250]; + char strTmp2[250]; FILE *ffIn = fopen( fileNameIn.c_str() , "r"); long long dataSize; if (ffIn!=NULL) diff --git a/bbtk_creaVtk_PKG/src/bbcreaVtkReadMHDPlane.h b/bbtk_creaVtk_PKG/src/bbcreaVtkReadMHDPlane.h index bd80f4b..4cc2e46 100644 --- a/bbtk_creaVtk_PKG/src/bbcreaVtkReadMHDPlane.h +++ b/bbtk_creaVtk_PKG/src/bbcreaVtkReadMHDPlane.h @@ -57,7 +57,7 @@ BBTK_BEGIN_DESCRIBE_BLACK_BOX(ReadMHDPlane,bbtk::AtomicBlackBox); BBTK_INPUT(ReadMHDPlane,FileName,"Image file name",std::string,""); BBTK_INPUT(ReadMHDPlane,Slice,"Slice number",int,""); BBTK_INPUT(ReadMHDPlane,Width,"(1 default) Number of slices to be read",int,""); - BBTK_INPUT(ReadMHDPlane,DirectionPlane,"Direction plane: XY (default), YZ , XZ",std::string,""); + BBTK_INPUT(ReadMHDPlane,DirectionPlane,"Direction plane: XY (default), YZ , ZX",std::string,""); BBTK_INPUT(ReadMHDPlane,Type,"(1 default) 0 = Normal mhd, 1 = lseek64",int,""); BBTK_OUTPUT(ReadMHDPlane,Out,"Image 2D",vtkImageData*,""); BBTK_OUTPUT(ReadMHDPlane,Out2,"Image 2D in the good orientation",vtkImageData*,""); diff --git a/bbtk_creaVtk_PKG/src/bbcreaVtkScalarBarActor.cxx b/bbtk_creaVtk_PKG/src/bbcreaVtkScalarBarActor.cxx index 9f19bc6..0c4df25 100644 --- a/bbtk_creaVtk_PKG/src/bbcreaVtkScalarBarActor.cxx +++ b/bbtk_creaVtk_PKG/src/bbcreaVtkScalarBarActor.cxx @@ -4,7 +4,6 @@ #include "bbcreaVtkScalarBarActor.h" #include "bbcreaVtkPackage.h" -#include namespace bbcreaVtk { @@ -34,23 +33,29 @@ void ScalarBarActor::Process() // std::cout << "Output value = " <SetLookupTable( bbGetInputLookupTable() ); - scalarbarActor->SetTitle("Value"); - scalarbarActor->SetNumberOfLabels(4); + scalarbarActor->SetTitle( bbGetInputTitle().c_str() ); + scalarbarActor->SetNumberOfLabels(5); + if (bbGetInputDisplayPosition().size()==2) + { + scalarbarActor->SetDisplayPosition( bbGetInputDisplayPosition()[0] , bbGetInputDisplayPosition()[1] ); + } //if int fontsize = scalarbarActor->GetLabelTextProperty()->GetFontSize(); scalarbarActor->GetLabelTextProperty()->SetFontSize(fontsize/2); if (bbGetInputRenderer()!=NULL) { bbGetInputRenderer()->AddActor2D( scalarbarActor ); - } + } // if } // firsttime -printf ("EED ScalarBarActor End\n"); + if (scalarbarActor!=NULL) + { + scalarbarActor->SetVisibility( bbGetInputActive() ); + } // if scalarbarActor NULL } @@ -64,8 +69,11 @@ void ScalarBarActor::bbUserSetDefaultValues() // Here we initialize the input 'In' to 0 bbSetInputLookupTable(NULL); bbSetInputRenderer(NULL); - firsttime=true; - + bbSetInputTitle("Value"); + bbSetInputActive(true); + firsttime = true; + scalarbarActor = NULL; + } //===== // Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost) diff --git a/bbtk_creaVtk_PKG/src/bbcreaVtkScalarBarActor.h b/bbtk_creaVtk_PKG/src/bbcreaVtkScalarBarActor.h index 9dc8403..b72d797 100644 --- a/bbtk_creaVtk_PKG/src/bbcreaVtkScalarBarActor.h +++ b/bbtk_creaVtk_PKG/src/bbcreaVtkScalarBarActor.h @@ -10,6 +10,7 @@ #include #include #include +#include namespace bbcreaVtk { @@ -23,12 +24,16 @@ class bbcreaVtk_EXPORT ScalarBarActor // Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost) //===== BBTK_DECLARE_INPUT(LookupTable,vtkScalarsToColors*); + BBTK_DECLARE_INPUT(DisplayPosition,std::vector); + BBTK_DECLARE_INPUT(Title,std::string); BBTK_DECLARE_INPUT(Renderer,vtkRenderer*); + BBTK_DECLARE_INPUT(Active,bool); // BBTK_DECLARE_OUTPUT(Out,double); BBTK_PROCESS(Process); void Process(); bool firsttime; + vtkScalarBarActor *scalarbarActor; //===== // Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost) @@ -41,7 +46,10 @@ BBTK_BEGIN_DESCRIBE_BLACK_BOX(ScalarBarActor,bbtk::AtomicBlackBox); BBTK_DESCRIPTION("No Description."); BBTK_CATEGORY("empty"); BBTK_INPUT(ScalarBarActor,LookupTable,"LookupTable",vtkScalarsToColors*,""); + BBTK_INPUT(ScalarBarActor,DisplayPosition,"(default EMPTY) [x,y] ",std::vector,""); + BBTK_INPUT(ScalarBarActor,Title,"('Value' default) Title",std::string,""); BBTK_INPUT(ScalarBarActor,Renderer,"Renderer",vtkRenderer*,""); + BBTK_INPUT(ScalarBarActor,Active,"(true default) Active true/false",bool,""); // BBTK_OUTPUT(ScalarBarActor,Out,"First output",double,""); BBTK_END_DESCRIBE_BLACK_BOX(ScalarBarActor); //===== diff --git a/bbtk_creaVtk_PKG/src/bbcreaVtkScalarsToColors.cxx b/bbtk_creaVtk_PKG/src/bbcreaVtkScalarsToColors.cxx index f3c8c99..17780e1 100644 --- a/bbtk_creaVtk_PKG/src/bbcreaVtkScalarsToColors.cxx +++ b/bbtk_creaVtk_PKG/src/bbcreaVtkScalarsToColors.cxx @@ -4,9 +4,205 @@ #include "bbcreaVtkScalarsToColors.h" #include "bbcreaVtkPackage.h" +#include "vtkLookupTable.h" +#include "vtkObjectFactory.h" + namespace bbcreaVtk { +class /*VTK_COMMON_EXPORT*/ vtkLookupTableDirectionVector2 : public vtkScalarsToColors +{ +public: + // Description: + // Construct with range=[0,1]; and hsv ranges set up for rainbow color table + // (from red to blue). + static vtkLookupTableDirectionVector2 *New(); + vtkTypeMacro(vtkLookupTableDirectionVector2,vtkScalarsToColors); + void PrintSelf(ostream& os, vtkIndent indent); + double *GetRange() { return this->GetTableRange(); }; + void SetRange(double min, double max) { this->SetTableRange(min, max); }; + void SetRange(double rng[2]) { this->SetRange(rng[0], rng[1]); }; + void SetTableRange(double r[2]); + virtual void SetTableRange(double min, double max); + vtkGetVectorMacro(TableRange,double,2); + unsigned char *MapValue(double v); + void GetColor(double x, double rgb[3]); + void MapScalarsThroughTable2(void *input, unsigned char *output, + int inputDataType, int numberOfValues, + int inputIncrement, int outputIncrement); + void SetTypeTable( int typetable ); +protected: + double TableRange[2]; + vtkLookupTableDirectionVector2(int sze=256, int ext=256); + ~vtkLookupTableDirectionVector2(); +private: + int TypeTable; //EED + vtkLookupTableDirectionVector2(const vtkLookupTableDirectionVector2&); // Not implemented. + void operator=(const vtkLookupTableDirectionVector2&); // Not implemented. +}; + + + + +vtkStandardNewMacro(vtkLookupTableDirectionVector2); + +// Construct with range=(0,1); and hsv ranges set up for rainbow color table +// (from red to blue). +vtkLookupTableDirectionVector2::vtkLookupTableDirectionVector2(int sze, int ext) +{ + this->TableRange[0] = 0.0; + this->TableRange[1] = 1.0; + TypeTable=0; +} + +//---------------------------------------------------------------------------- +vtkLookupTableDirectionVector2::~vtkLookupTableDirectionVector2() +{ +} + +unsigned char *vtkLookupTableDirectionVector2::MapValue(double v) +{ + + //int idx = this->GetIndex(v); + //return (this->Table->GetPointer(0) + 4*idx); + return 0; +} + +void vtkLookupTableDirectionVector2::GetColor(double v, double rgb[3]) +{ +// unsigned char *rgb8 = this->MapValue(v); +// rgb[0] = rgb8[0]/255.0; +// rgb[1] = rgb8[1]/255.0; +// rgb[2] = rgb8[2]/255.0; + + rgb[0] = 1; + rgb[1] = 1; + rgb[2] = 0; +} + + +void vtkLookupTableDirectionVector2::SetTableRange(double r[2]) +{ + this->SetTableRange(r[0],r[1]); +} + +void vtkLookupTableDirectionVector2::SetTypeTable( int typetable ) +{ + TypeTable=typetable; +} + +//---------------------------------------------------------------------------- +// Set the minimum/maximum scalar values for scalar mapping. Scalar values +// less than minimum range value are clamped to minimum range value. +// Scalar values greater than maximum range value are clamped to maximum +// range value. +void vtkLookupTableDirectionVector2::SetTableRange(double rmin, double rmax) +{ + if (rmax < rmin) + { + vtkErrorMacro("Bad table range: ["<TableRange[0] == rmin && this->TableRange[1] == rmax) + { + return; + } + + this->TableRange[0] = rmin; + this->TableRange[1] = rmax; + + this->Modified(); +} + + + +//---------------------------------------------------------------------------- +// Although this is a relatively expensive calculation, +// it is only done on the first render. Colors are cached +// for subsequent renders. +template +void vtkLookupTableMapDirVectorEED2(vtkLookupTableDirectionVector2 *self, T *input, + unsigned char *output, int length, + int inIncr, int outFormat,int TypeTable) +{ + + if (TypeTable==0) + { + double sum; + int i; + double dirx,diry,dirz; + for (i = 0; i < length; ++i) + { + dirx = static_cast(input[0]); + diry = static_cast(input[1]); + dirz = static_cast(input[2]); + input = input+inIncr; + sum = sqrt( dirx*dirx + diry*diry + dirz*dirz ); + *output++ = (unsigned char) abs( (255*dirx/sum) ); + *output++ = (unsigned char) abs( (255*diry/sum) ); + *output++ = (unsigned char) abs( (255*dirz/sum) ); + *output++ = 255; + // printf("%d %d %d ",(int)(255*dirx/sum),(int)(255*diry/sum),(int)(255*dirz/sum)); + // printf(" C %d %f %f %f \n",inIncr,dirx,diry,dirz); + + } // for + } // typeTable == 0 + + if (TypeTable==1) + { + int i; + for (i = 0; i < length; ++i) + { + *output++ = static_cast(input[0]); // red + *output++ = static_cast(input[1]); // green + *output++ = static_cast(input[2]); // blue +// *output++ = 255; + input = input+inIncr; + } // for + } // typeTable == 1 + + +} + + +//---------------------------------------------------------------------------- +void vtkLookupTableDirectionVector2::MapScalarsThroughTable2(void *input, + unsigned char *output, + int inputDataType, + int numberOfValues, + int inputIncrement, + int outputFormat) +{ +// if (this->UseMagnitude && inputIncrement > 1) +// { + switch (inputDataType) + { + vtkTemplateMacro( vtkLookupTableMapDirVectorEED2(this,static_cast(input),output, + numberOfValues,inputIncrement,outputFormat,TypeTable); + return + ); + case VTK_BIT: + vtkErrorMacro("Cannot comput magnitude of bit array."); + break; + default: + vtkErrorMacro(<< "MapImageThroughTable: Unknown input ScalarType"); + } /// switch +// } //if +} + + +//---------------------------------------------------------------------------- +void vtkLookupTableDirectionVector2::PrintSelf(ostream& os, vtkIndent indent) +{ + this->Superclass::PrintSelf(os,indent); +} + + + + + + BBTK_ADD_BLACK_BOX_TO_PACKAGE(creaVtk,ScalarsToColors) BBTK_BLACK_BOX_IMPLEMENTATION(ScalarsToColors,bbtk::AtomicBlackBox); //===== @@ -30,120 +226,142 @@ void ScalarsToColors::Process() // bbSetOutputOut( bbGetInputIn() ); // std::cout << "Output value = " <SetRange( bbGetInputRange()[0],bbGetInputRange()[1]); -// _colorLookupTable->SetTableRange( bbGetInputRange()[0],bbGetInputRange()[1]); + colorLookupTable->SetRange( bbGetInputRange()[0],bbGetInputRange()[1]); +// colorLookupTable->SetTableRange( bbGetInputRange()[0],bbGetInputRange()[1]); + colorLookupTable->UseBelowRangeColorOn(); + colorLookupTable->UseAboveRangeColorOn(); } else { - _colorLookupTable->SetRange(0,255); + colorLookupTable->SetRange(0,255); } - _colorLookupTable->SetNumberOfTableValues(1000); - _colorLookupTable->Build(); + int NumberOfColors=1000; + int NumberOfColorsHalf=NumberOfColors/2; + colorLookupTable->SetNumberOfTableValues( NumberOfColors ); + colorLookupTable->Build(); double rgba1[4]; double rgba2[4]; int iLookTable; - for (iLookTable = 0; iLookTable<500; iLookTable++) + for (iLookTable = 0; iLookTableGetTableValue( iLookTable, rgba1); - _colorLookupTable->GetTableValue(1000-1-iLookTable, rgba2); - _colorLookupTable->SetTableValue(1000-1-iLookTable , rgba1[0],rgba1[1],rgba1[2],rgba1[3]); - _colorLookupTable->SetTableValue( iLookTable , rgba2[0],rgba2[1],rgba2[2],rgba2[3]); + colorLookupTable->GetTableValue( iLookTable, rgba1 ); + colorLookupTable->GetTableValue(NumberOfColors-1-iLookTable, rgba2 ); + colorLookupTable->SetTableValue(NumberOfColors-1-iLookTable, rgba1[0],rgba1[1],rgba1[2],rgba1[3] ); + colorLookupTable->SetTableValue( iLookTable, rgba2[0],rgba2[1],rgba2[2],rgba2[3] ); } // for iLookTable - double rgba[4]; - _colorLookupTable->GetTableValue(0,rgba); - rgba[3]=0; - _colorLookupTable->SetTableValue(0,rgba); - - int i,iMax; - - iMax=(1000/16)*4; - for (i=0;iGetTableValue(500+i, rgba); - rgba[3]=(double)i/(double)iMax; - _colorLookupTable->SetTableValue(500+i,rgba); - _colorLookupTable->GetTableValue(500-i, rgba); - rgba[3]=(double)i/(double)iMax; - _colorLookupTable->SetTableValue(500-i,rgba); - - } // for - - -/* - iMax=100; - for (i=0;iGetTableValue(500+100+i, rgba); - rgba[3]=(double)i/(double)iMax; - _colorLookupTable->SetTableValue(500+100+i,rgba); - _colorLookupTable->GetTableValue(500-100-i, rgba); - rgba[3]=(double)i/(double)iMax; - _colorLookupTable->SetTableValue(500-100-i,rgba); - - } // for - - iMax=200; - for (i=0;iGetTableValue(500+i, rgba); - rgba[3]=0; - _colorLookupTable->SetTableValue(500+i,rgba); - _colorLookupTable->GetTableValue(500-i, rgba); + // First Element + double rgba[4]; + colorLookupTable->GetTableValue(0,rgba); rgba[3]=0; - _colorLookupTable->SetTableValue(500-i,rgba); - } // for -*/ - + colorLookupTable->SetTableValue(0,rgba); - - } // if Type 0 + colorLookupTable->UseBelowRangeColorOn(); + colorLookupTable->UseAboveRangeColorOn(); + if (bbGetInputBelowAboveRangeTransparence()==true) + { + colorLookupTable->SetBelowRangeColor(1,1,1,0); // White transparent + colorLookupTable->SetAboveRangeColor(1,1,1,0); // White transparent + } else { + colorLookupTable->SetBelowRangeColor(1,1,1,1); // White transparent + colorLookupTable->SetAboveRangeColor(1,1,1,1); // White transparent + } + + // Middle range + int i,iMax=(NumberOfColors/16)*4; + for (i=0;iGetTableValue(NumberOfColorsHalf+i, rgba); + rgba[3]=(double)i/(double)iMax; + colorLookupTable->SetTableValue(NumberOfColorsHalf+i,rgba); + colorLookupTable->GetTableValue(NumberOfColorsHalf-i, rgba); + rgba[3]=(double)i/(double)iMax; + colorLookupTable->SetTableValue(NumberOfColorsHalf-i,rgba); + } // for + } //if Type 0 + + colorLookupTable->Modified(); + _scalarstocolors = colorLookupTable; + } // if Type 0 || 100 //EED 2018-06-8 ***********************ARDS Projet*********************************************** - if (bbGetInputType()==1) + if ((bbGetInputType()==1) || (bbGetInputType()==101) ) { - _colorLookupTable = vtkLookupTable::New(); + vtkLookupTable *colorLookupTable = vtkLookupTable::New(); if (bbGetInputRange().size()==2) { - _colorLookupTable->SetRange( bbGetInputRange()[0],bbGetInputRange()[1]); -// _colorLookupTable->SetTableRange( bbGetInputRange()[0],bbGetInputRange()[1]); + colorLookupTable->SetRange( bbGetInputRange()[0],bbGetInputRange()[1]); +// colorLookupTable->SetTableRange( bbGetInputRange()[0],bbGetInputRange()[1]); ???????? +// colorLookupTable->SetBelowRangeColor(1,1,1,1); // White transparent +// colorLookupTable->SetAboveRangeColor(1,1,1,1); // White transparent + colorLookupTable->UseBelowRangeColorOn(); + colorLookupTable->UseAboveRangeColorOn(); + if (bbGetInputBelowAboveRangeTransparence()==true) + { + colorLookupTable->SetBelowRangeColor(1,1,1,0); // White transparent + colorLookupTable->SetAboveRangeColor(1,1,1,0); // White transparent + } else { + colorLookupTable->SetBelowRangeColor(1,1,1,1); // White transparent + colorLookupTable->SetAboveRangeColor(1,1,1,1); // White transparent + } } else { - _colorLookupTable->SetRange(0,255); + colorLookupTable->SetRange(0,255); } - _colorLookupTable->SetValueRange(0.0, 1.0); // from black to white - _colorLookupTable->SetSaturationRange(0.0, 0.0); // no color saturation - _colorLookupTable->SetRampToLinear(); - _colorLookupTable->Build(); - double rgba[4]; - _colorLookupTable->GetTableValue(0,rgba); - rgba[3]=0; - _colorLookupTable->SetTableValue(0,rgba); - } // IF + colorLookupTable->SetValueRange(0.0, 1.0); // from black to white + colorLookupTable->SetSaturationRange(0.0, 0.0); // no color saturation + colorLookupTable->SetRampToLinear(); + colorLookupTable->Build(); + // Transparency + if (bbGetInputType()==1) + { + // First Element + double rgba[4]; + colorLookupTable->GetTableValue(0,rgba); + rgba[3]=0; + colorLookupTable->SetTableValue(0,rgba); + } // if Type 1 + _scalarstocolors = colorLookupTable; + } // If Type 1 || 101 + if (bbGetInputType()==2) // Direction Color Vector + { + vtkLookupTableDirectionVector2 *_LutEED = vtkLookupTableDirectionVector2::New(); + _LutEED->SetVectorModeToRGBColors(); + _LutEED->SetTypeTable(0); + _scalarstocolors = _LutEED; + } // If Type 2 + if (bbGetInputType()==3) // Componets image rgb [0 255] + { + vtkLookupTableDirectionVector2 *_LutEED = vtkLookupTableDirectionVector2::New(); + _LutEED->SetVectorModeToRGBColors(); + _LutEED->SetTypeTable(1); // for components image + _scalarstocolors = _LutEED; + } // If Type 3 - } // firsttime +// } // firsttime double rgb[3]; std::vectorcolorRGB; - _colorLookupTable->GetColor( bbGetInputScalarValue() , rgb ); + _scalarstocolors->GetColor( bbGetInputScalarValue() , rgb ); colorRGB.push_back( rgb[0] ); colorRGB.push_back( rgb[1] ); colorRGB.push_back( rgb[2] ); bbSetOutputColor( colorRGB ); - bbSetOutputLookupTable(_colorLookupTable); + bbSetOutputLookupTable( _scalarstocolors ); -printf("EED ScalarsToColors::Process End\n"); } //===== @@ -160,9 +378,9 @@ void ScalarsToColors::bbUserSetDefaultValues() range.push_back( 1 ); bbSetInputRange(range); bbSetInputScalarValue(0); - firsttime=true; - - _colorLookupTable=NULL; + bbSetInputBelowAboveRangeTransparence(true); +// firsttime = true; + _scalarstocolors = NULL; } //===== // Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost) diff --git a/bbtk_creaVtk_PKG/src/bbcreaVtkScalarsToColors.h b/bbtk_creaVtk_PKG/src/bbcreaVtkScalarsToColors.h index 340ab86..fc7945d 100644 --- a/bbtk_creaVtk_PKG/src/bbcreaVtkScalarsToColors.h +++ b/bbtk_creaVtk_PKG/src/bbcreaVtkScalarsToColors.h @@ -25,14 +25,15 @@ class bbcreaVtk_EXPORT ScalarsToColors //===== BBTK_DECLARE_INPUT(Type,int); BBTK_DECLARE_INPUT(ScalarValue,double); + BBTK_DECLARE_INPUT(BelowAboveRangeTransparence,bool); BBTK_DECLARE_INPUT(Range,std::vector ); BBTK_DECLARE_OUTPUT(Color, std::vector ); BBTK_DECLARE_OUTPUT(LookupTable,vtkScalarsToColors*); BBTK_PROCESS(Process); void Process(); - bool firsttime; - vtkLookupTable *_colorLookupTable; +// bool firsttime; + vtkScalarsToColors *_scalarstocolors; vtkColorTransferFunction *_volumeColor; @@ -46,8 +47,9 @@ BBTK_BEGIN_DESCRIBE_BLACK_BOX(ScalarsToColors,bbtk::AtomicBlackBox); BBTK_AUTHOR("Info-Dev"); BBTK_DESCRIPTION("No Description."); BBTK_CATEGORY("empty"); - BBTK_INPUT(ScalarsToColors,Type,"0 (default) Type of color table",int,""); + BBTK_INPUT(ScalarsToColors,Type,"(0 default) 0=JET(transparent for first element and middle range); 100=As 0 without transparace; 1=RangeTable (transparent for first element); 101=As 1 without transparace; 2=DirectionColorRGB; 3=ComponentColorRGB[0-255]",int,""); BBTK_INPUT(ScalarsToColors,ScalarValue,"Scalar value -> Color OUT",double,""); + BBTK_INPUT(ScalarsToColors,BelowAboveRangeTransparence,"(default true) Transparence for Before and After range true/false",bool,""); BBTK_INPUT(ScalarsToColors,Range,"Min Max range",std::vector,""); BBTK_OUTPUT(ScalarsToColors,Color,"Color",std::vector,""); BBTK_OUTPUT(ScalarsToColors,LookupTable,"LookupTable",vtkScalarsToColors*,""); diff --git a/bbtk_creaVtk_PKG/src/bbcreaVtkScreenShot.cxx b/bbtk_creaVtk_PKG/src/bbcreaVtkScreenShot.cxx new file mode 100644 index 0000000..08f4089 --- /dev/null +++ b/bbtk_creaVtk_PKG/src/bbcreaVtkScreenShot.cxx @@ -0,0 +1,120 @@ +//===== +// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost) +//===== +#include "bbcreaVtkScreenShot.h" +#include "bbcreaVtkPackage.h" + +#include "vtkWindowToImageFilter.h" +#include "vtkPNGWriter.h" +#include "vtkWindow.h" + +// #include "vtkFFMPEGWriter.h" + + +namespace bbcreaVtk +{ + +BBTK_ADD_BLACK_BOX_TO_PACKAGE(creaVtk,ScreenShot) +BBTK_BLACK_BOX_IMPLEMENTATION(ScreenShot,bbtk::AtomicBlackBox); +//===== +// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost) +//===== +void ScreenShot::Process() +{ + +// THE MAIN PROCESSING METHOD BODY +// Here we simply set the input 'In' value to the output 'Out' +// And print out the output value +// INPUT/OUTPUT ACCESSORS ARE OF THE FORM : +// void bbSet{Input|Output}NAME(const TYPE&) +// const TYPE& bbGet{Input|Output}NAME() const +// Where : +// * NAME is the name of the input/output +// (the one provided in the attribute 'name' of the tag 'input') +// * TYPE is the C++ type of the input/output +// (the one provided in the attribute 'type' of the tag 'input') + +// bbSetOutputOut( bbGetInputIn() ); +// std::cout << "Output value = " <GetVTKWindow()->SetSize( bbGetInputSize()[0], bbGetInputSize()[1] ); + } + wif->SetInput( bbGetInputvtkRenderer()->GetVTKWindow() ); + wif->SetMagnification( bbGetInputScale()[0] ); +// wif->SetScale( bbGetInputScale()[0], bbGetInputScale()[1] ); + wif->SetInputBufferTypeToRGB(); + wif->ReadFrontBufferOff(); + wif->Update(); + vtkPNGWriter *writer = vtkPNGWriter::New(); + writer->SetFileName( bbGetInputFileName().c_str() ); + +//EED 2017-01-01 Migration VTK7 +#if VTK_MAJOR_VERSION <= 5 + writer->SetInput( wif->GetOutput() ); +#else + writer->SetInputData( wif->GetOutput() ); +#endif + + + writer->Write(); + +/* + vtkFFMPEGWriter *writer2 = vtkFFMPEGWriter::New(); + writer2->SetInput(wif->GetOutput()); + for (int i=0; i<10; i++) + { + // update + writer2->Write(); + } // for + writer2->End; +*/ +} +//===== +// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost) +//===== +void ScreenShot::bbUserSetDefaultValues() +{ + +// SET HERE THE DEFAULT INPUT/OUTPUT VALUES OF YOUR BOX +// Here we initialize the input 'In' to 0 + bbSetInputvtkRenderer(NULL); + bbSetInputFileName("ScreenShot-BBTK.png"); + + std::vector scale; + scale.push_back(1); + scale.push_back(1); + bbSetInputScale(scale); + +} +//===== +// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost) +//===== +void ScreenShot::bbUserInitializeProcessing() +{ + +// THE INITIALIZATION METHOD BODY : +// Here does nothing +// but this is where you should allocate the internal/output pointers +// if any + + +} +//===== +// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost) +//===== +void ScreenShot::bbUserFinalizeProcessing() +{ + +// THE FINALIZATION METHOD BODY : +// Here does nothing +// but this is where you should desallocate the internal/output pointers +// if any + +} +} +// EO namespace bbcreaVtk + + diff --git a/bbtk_creaVtk_PKG/src/bbcreaVtkScreenShot.h b/bbtk_creaVtk_PKG/src/bbcreaVtkScreenShot.h new file mode 100644 index 0000000..3f37cfb --- /dev/null +++ b/bbtk_creaVtk_PKG/src/bbcreaVtkScreenShot.h @@ -0,0 +1,53 @@ +//===== +// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost) +//===== +#ifndef __bbcreaVtkScreenShot_h_INCLUDED__ +#define __bbcreaVtkScreenShot_h_INCLUDED__ +#include "bbcreaVtk_EXPORT.h" +#include "bbtkAtomicBlackBox.h" +#include "iostream" + +#include "vtkRenderer.h" + +namespace bbcreaVtk +{ + +class bbcreaVtk_EXPORT ScreenShot + : + public bbtk::AtomicBlackBox +{ + BBTK_BLACK_BOX_INTERFACE(ScreenShot,bbtk::AtomicBlackBox); +//===== +// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost) +//===== + BBTK_DECLARE_INPUT(FileName,std::string); + BBTK_DECLARE_INPUT(Size,std::vector); + BBTK_DECLARE_INPUT(Scale,std::vector); + BBTK_DECLARE_INPUT(vtkRenderer,vtkRenderer*); +// BBTK_DECLARE_OUTPUT(Out,double); + BBTK_PROCESS(Process); + void Process(); +//===== +// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost) +//===== +}; + +BBTK_BEGIN_DESCRIBE_BLACK_BOX(ScreenShot,bbtk::AtomicBlackBox); + BBTK_NAME("ScreenShot"); + BBTK_AUTHOR("InfoDev"); + BBTK_DESCRIPTION("No Description."); + BBTK_CATEGORY("empty"); + BBTK_INPUT(ScreenShot,Size,"[sX,sY] size of the render window. Default [actual window sX, actual window sY]",std::vector,""); + BBTK_INPUT(ScreenShot,Scale,"[scaleX,scaleY] default [1,1]",std::vector,""); + BBTK_INPUT(ScreenShot,FileName,"File Name Default:ScreenShot-BBTK.png",std::string,""); + BBTK_INPUT(ScreenShot,vtkRenderer,"First input",vtkRenderer*,""); +// BBTK_OUTPUT(ScreenShot,Out,"First output",double,""); +BBTK_END_DESCRIBE_BLACK_BOX(ScreenShot); +//===== +// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost) +//===== +} +// EO namespace bbcreaVtk + +#endif // __bbcreaVtkScreenShot_h_INCLUDED__ + diff --git a/bbtk_creaVtk_PKG/src/bbcreaVtkSetCameraInfo.cxx b/bbtk_creaVtk_PKG/src/bbcreaVtkSetCameraInfo.cxx new file mode 100644 index 0000000..f2cb534 --- /dev/null +++ b/bbtk_creaVtk_PKG/src/bbcreaVtkSetCameraInfo.cxx @@ -0,0 +1,91 @@ +//===== +// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost) +//===== +#include "bbcreaVtkSetCameraInfo.h" +#include "bbcreaVtkPackage.h" + +#include "vtkCamera.h" + +namespace bbcreaVtk +{ + +BBTK_ADD_BLACK_BOX_TO_PACKAGE(creaVtk,SetCameraInfo) +BBTK_BLACK_BOX_IMPLEMENTATION(SetCameraInfo,bbtk::AtomicBlackBox); +//===== +// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost) +//===== +void SetCameraInfo::Process() +{ + +// THE MAIN PROCESSING METHOD BODY +// Here we simply set the input 'In' value to the output 'Out' +// And print out the output value +// INPUT/OUTPUT ACCESSORS ARE OF THE FORM : +// void bbSet{Input|Output}NAME(const TYPE&) +// const TYPE& bbGet{Input|Output}NAME() const +// Where : +// * NAME is the name of the input/output +// (the one provided in the attribute 'name' of the tag 'input') +// * TYPE is the C++ type of the input/output +// (the one provided in the attribute 'type' of the tag 'input') + + if (bbGetInputvtkRenderer()!=NULL) + { + double px,py,pz; + px=bbGetInputPosition()[0]; + py=bbGetInputPosition()[1]; + pz=bbGetInputPosition()[2]; + bbGetInputvtkRenderer()->GetActiveCamera()->SetPosition(px,py,pz); + double fx,fy,fz; + fx=bbGetInputFocalPoint()[0]; + fy=bbGetInputFocalPoint()[1]; + fz=bbGetInputFocalPoint()[2]; + bbGetInputvtkRenderer()->GetActiveCamera()->SetFocalPoint(fx,fy,fz); + double vx,vy,vz; + vx=bbGetInputViewUp()[0]; + vy=bbGetInputViewUp()[1]; + vz=bbGetInputViewUp()[2]; + bbGetInputvtkRenderer()->GetActiveCamera()->SetViewUp(vx,vy,vz); + } // if + +} +//===== +// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost) +//===== +void SetCameraInfo::bbUserSetDefaultValues() +{ + +// SET HERE THE DEFAULT INPUT/OUTPUT VALUES OF YOUR BOX +// Here we initialize the input 'In' to 0 + bbSetInputvtkRenderer( NULL ); + +} +//===== +// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost) +//===== +void SetCameraInfo::bbUserInitializeProcessing() +{ + +// THE INITIALIZATION METHOD BODY : +// Here does nothing +// but this is where you should allocate the internal/output pointers +// if any + + +} +//===== +// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost) +//===== +void SetCameraInfo::bbUserFinalizeProcessing() +{ + +// THE FINALIZATION METHOD BODY : +// Here does nothing +// but this is where you should desallocate the internal/output pointers +// if any + +} +} +// EO namespace bbcreaVtk + + diff --git a/bbtk_creaVtk_PKG/src/bbcreaVtkSetCameraInfo.h b/bbtk_creaVtk_PKG/src/bbcreaVtkSetCameraInfo.h new file mode 100644 index 0000000..1f34c57 --- /dev/null +++ b/bbtk_creaVtk_PKG/src/bbcreaVtkSetCameraInfo.h @@ -0,0 +1,52 @@ +//===== +// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost) +//===== +#ifndef __bbcreaVtkSetCameraInfo_h_INCLUDED__ +#define __bbcreaVtkSetCameraInfo_h_INCLUDED__ +#include "bbcreaVtk_EXPORT.h" +#include "bbtkAtomicBlackBox.h" +#include "iostream" + +#include "vtkRenderer.h" + +namespace bbcreaVtk +{ + +class bbcreaVtk_EXPORT SetCameraInfo + : + public bbtk::AtomicBlackBox +{ + BBTK_BLACK_BOX_INTERFACE(SetCameraInfo,bbtk::AtomicBlackBox); +//===== +// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost) +//===== + BBTK_DECLARE_INPUT(vtkRenderer,vtkRenderer*); + BBTK_DECLARE_INPUT(ViewUp,std::vector); + BBTK_DECLARE_INPUT(FocalPoint,std::vector); + BBTK_DECLARE_INPUT(Position,std::vector); +// BBTK_DECLARE_OUTPUT(Out,double); + BBTK_PROCESS(Process); + void Process(); +//===== +// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost) +//===== +}; + +BBTK_BEGIN_DESCRIBE_BLACK_BOX(SetCameraInfo,bbtk::AtomicBlackBox); + BBTK_NAME("SetCameraInfo"); + BBTK_AUTHOR("InfoDev"); + BBTK_DESCRIPTION("No Description."); + BBTK_CATEGORY("empty"); + BBTK_INPUT(SetCameraInfo,vtkRenderer,"vtkRenderer",vtkRenderer*,""); + BBTK_INPUT(SetCameraInfo,ViewUp,"ViewUp[x,y,z]",std::vector,""); + BBTK_INPUT(SetCameraInfo,FocalPoint,"FocalPoint[x,y,z]",std::vector,""); + BBTK_INPUT(SetCameraInfo,Position,"Position[x,y,z]",std::vector,""); +BBTK_END_DESCRIBE_BLACK_BOX(SetCameraInfo); +//===== +// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost) +//===== +} +// EO namespace bbcreaVtk + +#endif // __bbcreaVtkSetCameraInfo_h_INCLUDED__ + diff --git a/bbtk_creaVtk_PKG/src/bbcreaVtkStlReader.cxx b/bbtk_creaVtk_PKG/src/bbcreaVtkStlReader.cxx new file mode 100644 index 0000000..11f4e19 --- /dev/null +++ b/bbtk_creaVtk_PKG/src/bbcreaVtkStlReader.cxx @@ -0,0 +1,77 @@ +//===== +// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost) +//===== +#include "bbcreaVtkStlReader.h" +#include "bbcreaVtkPackage.h" + +#include "vtkSTLReader.h" + +namespace bbcreaVtk +{ + +BBTK_ADD_BLACK_BOX_TO_PACKAGE(creaVtk,StlReader) +BBTK_BLACK_BOX_IMPLEMENTATION(StlReader,bbtk::AtomicBlackBox); +//===== +// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost) +//===== +void StlReader::Process() +{ + +// THE MAIN PROCESSING METHOD BODY +// Here we simply set the input 'In' value to the output 'Out' +// And print out the output value +// INPUT/OUTPUT ACCESSORS ARE OF THE FORM : +// void bbSet{Input|Output}NAME(const TYPE&) +// const TYPE& bbGet{Input|Output}NAME() const +// Where : +// * NAME is the name of the input/output +// (the one provided in the attribute 'name' of the tag 'input') +// * TYPE is the C++ type of the input/output +// (the one provided in the attribute 'type' of the tag 'input') + + vtkSTLReader *reader = vtkSTLReader::New(); + reader->SetFileName( bbGetInputFileName().c_str() ); + reader->Update(); + bbSetOutputOut( reader->GetOutput() ); + +} +//===== +// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost) +//===== +void StlReader::bbUserSetDefaultValues() +{ + +// SET HERE THE DEFAULT INPUT/OUTPUT VALUES OF YOUR BOX +// Here we initialize the input 'In' to 0 + bbSetOutputOut(NULL); + +} +//===== +// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost) +//===== +void StlReader::bbUserInitializeProcessing() +{ + +// THE INITIALIZATION METHOD BODY : +// Here does nothing +// but this is where you should allocate the internal/output pointers +// if any + + +} +//===== +// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost) +//===== +void StlReader::bbUserFinalizeProcessing() +{ + +// THE FINALIZATION METHOD BODY : +// Here does nothing +// but this is where you should desallocate the internal/output pointers +// if any + +} +} +// EO namespace bbcreaVtk + + diff --git a/bbtk_creaVtk_PKG/src/bbcreaVtkStlReader.h b/bbtk_creaVtk_PKG/src/bbcreaVtkStlReader.h new file mode 100644 index 0000000..e1405e1 --- /dev/null +++ b/bbtk_creaVtk_PKG/src/bbcreaVtkStlReader.h @@ -0,0 +1,48 @@ +//===== +// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost) +//===== +#ifndef __bbcreaVtkStlReader_h_INCLUDED__ +#define __bbcreaVtkStlReader_h_INCLUDED__ + +#include "bbcreaVtk_EXPORT.h" +#include "bbtkAtomicBlackBox.h" +#include "iostream" + +#include "vtkPolyData.h" + +namespace bbcreaVtk +{ + +class bbcreaVtk_EXPORT StlReader + : + public bbtk::AtomicBlackBox +{ + BBTK_BLACK_BOX_INTERFACE(StlReader,bbtk::AtomicBlackBox); +//===== +// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost) +//===== + BBTK_DECLARE_INPUT(FileName,std::string); + BBTK_DECLARE_OUTPUT(Out,vtkPolyData*); + BBTK_PROCESS(Process); + void Process(); +//===== +// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost) +//===== +}; + +BBTK_BEGIN_DESCRIBE_BLACK_BOX(StlReader,bbtk::AtomicBlackBox); + BBTK_NAME("StlReader"); + BBTK_AUTHOR("InfoDev"); + BBTK_DESCRIPTION("No Description."); + BBTK_CATEGORY("empty"); + BBTK_INPUT(StlReader,FileName,"File Name",std::string,""); + BBTK_OUTPUT(StlReader,Out,"vtkPolyData",vtkPolyData*,""); +BBTK_END_DESCRIBE_BLACK_BOX(StlReader); +//===== +// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost) +//===== +} +// EO namespace bbcreaVtk + +#endif // __bbcreaVtkStlReader_h_INCLUDED__ + diff --git a/bbtk_creaVtk_PKG/src/bbcreaVtkStlWriter.cxx b/bbtk_creaVtk_PKG/src/bbcreaVtkStlWriter.cxx new file mode 100644 index 0000000..e933ce2 --- /dev/null +++ b/bbtk_creaVtk_PKG/src/bbcreaVtkStlWriter.cxx @@ -0,0 +1,91 @@ +//===== +// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost) +//===== +#include "bbcreaVtkStlWriter.h" +#include "bbcreaVtkPackage.h" + +#include "vtkSTLWriter.h" +namespace bbcreaVtk +{ + +BBTK_ADD_BLACK_BOX_TO_PACKAGE(creaVtk,StlWriter) +BBTK_BLACK_BOX_IMPLEMENTATION(StlWriter,bbtk::AtomicBlackBox); +//===== +// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost) +//===== +void StlWriter::Process() +{ + +// THE MAIN PROCESSING METHOD BODY +// Here we simply set the input 'In' value to the output 'Out' +// And print out the output value +// INPUT/OUTPUT ACCESSORS ARE OF THE FORM : +// void bbSet{Input|Output}NAME(const TYPE&) +// const TYPE& bbGet{Input|Output}NAME() const +// Where : +// * NAME is the name of the input/output +// (the one provided in the attribute 'name' of the tag 'input') +// * TYPE is the C++ type of the input/output +// (the one provided in the attribute 'type' of the tag 'input') + +// bbSetOutputOut( bbGetInputIn() ); +// std::cout << "Output value = " <SetFileTypeToASCII(); + } else { + writer->SetFileTypeToBinary(); + } // if Ascii + writer->SetInputData( bbGetInputIn() ); + writer->SetFileName( bbGetInputFileName().c_str() ); + writer->Write(); + writer->Delete(); + } // if In Filename + +} +//===== +// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost) +//===== +void StlWriter::bbUserSetDefaultValues() +{ + +// SET HERE THE DEFAULT INPUT/OUTPUT VALUES OF YOUR BOX +// Here we initialize the input 'In' to 0 + bbSetInputIn(NULL); + bbSetInputFileName(""); + bbSetInputAscii(true); + +} +//===== +// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost) +//===== +void StlWriter::bbUserInitializeProcessing() +{ + +// THE INITIALIZATION METHOD BODY : +// Here does nothing +// but this is where you should allocate the internal/output pointers +// if any + + +} +//===== +// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost) +//===== +void StlWriter::bbUserFinalizeProcessing() +{ + +// THE FINALIZATION METHOD BODY : +// Here does nothing +// but this is where you should desallocate the internal/output pointers +// if any + +} +} +// EO namespace bbcreaVtk + + diff --git a/bbtk_creaVtk_PKG/src/bbcreaVtkStlWriter.h b/bbtk_creaVtk_PKG/src/bbcreaVtkStlWriter.h new file mode 100644 index 0000000..1203b2a --- /dev/null +++ b/bbtk_creaVtk_PKG/src/bbcreaVtkStlWriter.h @@ -0,0 +1,52 @@ +//===== +// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost) +//===== +#ifndef __bbcreaVtkStlWriter_h_INCLUDED__ +#define __bbcreaVtkStlWriter_h_INCLUDED__ + +#include "bbcreaVtk_EXPORT.h" +#include "bbtkAtomicBlackBox.h" +#include "iostream" + +#include "vtkPolyData.h" + +namespace bbcreaVtk +{ + +class bbcreaVtk_EXPORT StlWriter + : + public bbtk::AtomicBlackBox +{ + BBTK_BLACK_BOX_INTERFACE(StlWriter,bbtk::AtomicBlackBox); +//===== +// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost) +//===== + BBTK_DECLARE_INPUT(FileName,std::string); + BBTK_DECLARE_INPUT(In,vtkPolyData*); + BBTK_DECLARE_INPUT(Ascii,bool); +// BBTK_DECLARE_OUTPUT(Out,double); + BBTK_PROCESS(Process); + void Process(); +//===== +// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost) +//===== +}; + +BBTK_BEGIN_DESCRIBE_BLACK_BOX(StlWriter,bbtk::AtomicBlackBox); + BBTK_NAME("StlWriter"); + BBTK_AUTHOR("InfoDev"); + BBTK_DESCRIPTION("No Description."); + BBTK_CATEGORY("empty"); + BBTK_INPUT(StlWriter,FileName,"File Name",std::string,""); + BBTK_INPUT(StlWriter,In,"vtkPolyData (Mesh)",vtkPolyData*,""); + BBTK_INPUT(StlWriter,Ascii,"(true defaimt) true Ascii / false Binary",bool,""); +// BBTK_OUTPUT(StlWriter,Out,"First output",double,""); +BBTK_END_DESCRIBE_BLACK_BOX(StlWriter); +//===== +// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost) +//===== +} +// EO namespace bbcreaVtk + +#endif // __bbcreaVtkStlWriter_h_INCLUDED__ + diff --git a/bbtk_creaVtk_PKG/src/bbcreaVtkStripper.cxx b/bbtk_creaVtk_PKG/src/bbcreaVtkStripper.cxx new file mode 100644 index 0000000..4f03879 --- /dev/null +++ b/bbtk_creaVtk_PKG/src/bbcreaVtkStripper.cxx @@ -0,0 +1,85 @@ +//===== +// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost) +//===== +#include "bbcreaVtkStripper.h" +#include "bbcreaVtkPackage.h" + +#include "vtkStripper.h" + +namespace bbcreaVtk +{ + +BBTK_ADD_BLACK_BOX_TO_PACKAGE(creaVtk,Stripper) +BBTK_BLACK_BOX_IMPLEMENTATION(Stripper,bbtk::AtomicBlackBox); +//===== +// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost) +//===== +void Stripper::Process() +{ + +// THE MAIN PROCESSING METHOD BODY +// Here we simply set the input 'In' value to the output 'Out' +// And print out the output value +// INPUT/OUTPUT ACCESSORS ARE OF THE FORM : +// void bbSet{Input|Output}NAME(const TYPE&) +// const TYPE& bbGet{Input|Output}NAME() const +// Where : +// * NAME is the name of the input/output +// (the one provided in the attribute 'name' of the tag 'input') +// * TYPE is the C++ type of the input/output +// (the one provided in the attribute 'type' of the tag 'input') + +// bbSetOutputOut( bbGetInputIn() ); +// std::cout << "Output value = " <SetInputData( bbGetInputIn() ); + strips->Update(); + vtkPolyData *poly = vtkPolyData::New(); + poly->SetPoints( strips->GetOutput()->GetPoints() ); + poly->SetPolys( strips->GetOutput()->GetLines() ); + bbSetOutputOut( poly ); + } // if bbGetInputIn +} +//===== +// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost) +//===== +void Stripper::bbUserSetDefaultValues() +{ + +// SET HERE THE DEFAULT INPUT/OUTPUT VALUES OF YOUR BOX +// Here we initialize the input 'In' to 0 + bbSetInputIn(NULL); + +} +//===== +// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost) +//===== +void Stripper::bbUserInitializeProcessing() +{ + +// THE INITIALIZATION METHOD BODY : +// Here does nothing +// but this is where you should allocate the internal/output pointers +// if any + + +} +//===== +// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost) +//===== +void Stripper::bbUserFinalizeProcessing() +{ + +// THE FINALIZATION METHOD BODY : +// Here does nothing +// but this is where you should desallocate the internal/output pointers +// if any + +} +} +// EO namespace bbcreaVtk + + diff --git a/bbtk_creaVtk_PKG/src/bbcreaVtkStripper.h b/bbtk_creaVtk_PKG/src/bbcreaVtkStripper.h new file mode 100644 index 0000000..fe70671 --- /dev/null +++ b/bbtk_creaVtk_PKG/src/bbcreaVtkStripper.h @@ -0,0 +1,48 @@ +//===== +// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost) +//===== +#ifndef __bbcreaVtkStripper_h_INCLUDED__ +#define __bbcreaVtkStripper_h_INCLUDED__ + +#include "bbcreaVtk_EXPORT.h" +#include "bbtkAtomicBlackBox.h" +#include "iostream" + +#include "vtkPolyData.h" + +namespace bbcreaVtk +{ + +class bbcreaVtk_EXPORT Stripper + : + public bbtk::AtomicBlackBox +{ + BBTK_BLACK_BOX_INTERFACE(Stripper,bbtk::AtomicBlackBox); +//===== +// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost) +//===== + BBTK_DECLARE_INPUT(In,vtkPolyData*); + BBTK_DECLARE_OUTPUT(Out,vtkPolyData*); + BBTK_PROCESS(Process); + void Process(); +//===== +// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost) +//===== +}; + +BBTK_BEGIN_DESCRIBE_BLACK_BOX(Stripper,bbtk::AtomicBlackBox); + BBTK_NAME("Stripper"); + BBTK_AUTHOR("InfoDev"); + BBTK_DESCRIPTION("Close contour polydata ??"); + BBTK_CATEGORY("empty"); + BBTK_INPUT(Stripper,In,"Input mesh",vtkPolyData*,""); + BBTK_OUTPUT(Stripper,Out,"Output mesh",vtkPolyData*,""); +BBTK_END_DESCRIBE_BLACK_BOX(Stripper); +//===== +// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost) +//===== +} +// EO namespace bbcreaVtk + +#endif // __bbcreaVtkStripper_h_INCLUDED__ + diff --git a/bbtk_creaVtk_PKG/src/bbcreaVtkTurnImage.cxx b/bbtk_creaVtk_PKG/src/bbcreaVtkTurnImage.cxx new file mode 100644 index 0000000..d64a3c7 --- /dev/null +++ b/bbtk_creaVtk_PKG/src/bbcreaVtkTurnImage.cxx @@ -0,0 +1,146 @@ +//===== +// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost) +//===== +#include "bbcreaVtkTurnImage.h" +#include "bbcreaVtkPackage.h" + +#include "creaVtk_MACROS.h" + +namespace bbcreaVtk +{ + +BBTK_ADD_BLACK_BOX_TO_PACKAGE(creaVtk,TurnImage) +BBTK_BLACK_BOX_IMPLEMENTATION(TurnImage,bbtk::AtomicBlackBox); +//===== +// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost) +//===== +void TurnImage::Process() +{ + +// THE MAIN PROCESSING METHOD BODY +// Here we simply set the input 'In' value to the output 'Out' +// And print out the output value +// INPUT/OUTPUT ACCESSORS ARE OF THE FORM : +// void bbSet{Input|Output}NAME(const TYPE&) +// const TYPE& bbGet{Input|Output}NAME() const +// Where : +// * NAME is the name of the input/output +// (the one provided in the attribute 'name' of the tag 'input') +// * TYPE is the C++ type of the input/output +// (the one provided in the attribute 'type' of the tag 'input') +// bbSetOutputOut( bbGetInputIn() ); +// std::cout << "Output value = " <GetExtent(ext); + dim[0] = ext[1]-ext[0]+1; + dim[1] = ext[3]-ext[2]+1; + dim[2] = ext[5]-ext[4]+1; + double spc[3]; + bbGetInputIn()->GetSpacing(spc); + + vtkImageData *newImage = vtkImageData::New(); + newImage->Initialize(); + if (bbGetInputDir()==1) + { + newImage->SetSpacing( spc[1],spc[2],spc[0] ); + newImage->SetDimensions( dim[1],dim[2], dim[0] ); + } else if (bbGetInputDir()==2) + { + newImage->SetSpacing( spc[0],spc[2],spc[1] ); + newImage->SetDimensions( dim[0],dim[2], dim[1] ); + } else { + newImage->SetSpacing( spc[0],spc[1],spc[2] ); + newImage->SetDimensions( dim[0],dim[1], dim[2] ); + }// if Dir + +//EED 2017-01-01 Migration VTK7 +#if (VTK_MAJOR_VERSION <= 5) + newImage->SetScalarType( bbGetInputIn()->GetScalarType() ); + newImage->SetNumberOfScalarComponents(1); + newImage->AllocateScalars(); +#endif +#if (VTK_MAJOR_VERSION >= 6) + newImage->AllocateScalars( bbGetInputIn()->GetScalarType(),1 ); +#endif + + DEF_POINTER_IMAGE_VTK_CREA(vIn,ssIn,pIn,stIn,bbGetInputIn()) + DEF_POINTER_IMAGE_VTK_CREA(vNI,ssNI,pNI,stNI,newImage) + + long int index=0; + int i,j,k; + double value; + for (k=0;kGetScalarComponentAsDouble (i,j,k,0); + if (bbGetInputDir()==1) + { + SETVALUE2_VTK_CREA(vIn,pNI,stNI, j + (dim[2]-k-1)*dim[1] + i*dim[1]*dim[2] ) +// newImage->SetScalarComponentFromDouble(j,dim[2]-k-1,i,0,value); + } else if (bbGetInputDir()==2) + { + SETVALUE2_VTK_CREA(vIn,pNI,stNI, i + (dim[2]-k-1)*dim[0] + j*dim[0]*dim[2] ) +// newImage->SetScalarComponentFromDouble(i,dim[2]-k-1,j,0,value); + } else { + SETVALUE2_VTK_CREA(vIn,pNI,stNI,index) +// newImage->SetScalarComponentFromDouble(i,j,k,0,value); + }// if Dir + index++; + } // for i + } // for j + } // for k + bbSetOutputOut(newImage); + } else { + bbSetOutputOut(NULL); + }// if In!=NULL +} +//===== +// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost) +//===== +void TurnImage::bbUserSetDefaultValues() +{ + +// SET HERE THE DEFAULT INPUT/OUTPUT VALUES OF YOUR BOX +// Here we initialize the input 'In' to 0 + bbSetInputIn(NULL); + bbSetInputDir(0); + +} +//===== +// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost) +//===== +void TurnImage::bbUserInitializeProcessing() +{ + +// THE INITIALIZATION METHOD BODY : +// Here does nothing +// but this is where you should allocate the internal/output pointers +// if any + + +} +//===== +// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost) +//===== +void TurnImage::bbUserFinalizeProcessing() +{ + +// THE FINALIZATION METHOD BODY : +// Here does nothing +// but this is where you should desallocate the internal/output pointers +// if any + +} +} +// EO namespace bbcreaVtk + + diff --git a/bbtk_creaVtk_PKG/src/bbcreaVtkTurnImage.h b/bbtk_creaVtk_PKG/src/bbcreaVtkTurnImage.h new file mode 100644 index 0000000..31cbdbe --- /dev/null +++ b/bbtk_creaVtk_PKG/src/bbcreaVtkTurnImage.h @@ -0,0 +1,53 @@ +//===== +// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost) +//===== +#ifndef __bbcreaVtkTurnImage_h_INCLUDED__ +#define __bbcreaVtkTurnImage_h_INCLUDED__ + +#include "bbcreaVtk_EXPORT.h" +#include "bbtkAtomicBlackBox.h" +#include "iostream" + +#include "vtkImageData.h" + +namespace bbcreaVtk +{ + +class bbcreaVtk_EXPORT TurnImage + : + public bbtk::AtomicBlackBox +{ + BBTK_BLACK_BOX_INTERFACE(TurnImage,bbtk::AtomicBlackBox); +//===== +// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost) +//===== + BBTK_DECLARE_INPUT(In,vtkImageData*); + BBTK_DECLARE_INPUT(Dir,int); + BBTK_DECLARE_OUTPUT(Out,vtkImageData*); + BBTK_PROCESS(Process); + void Process(); +//===== +// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost) +//===== +}; + +BBTK_BEGIN_DESCRIBE_BLACK_BOX(TurnImage,bbtk::AtomicBlackBox); + BBTK_NAME("TurnImage"); + BBTK_AUTHOR("InfoDev"); + BBTK_DESCRIPTION("No Description."); + BBTK_CATEGORY("empty"); + + BBTK_INPUT(TurnImage,In,"Input Image",vtkImageData*,""); + BBTK_INPUT(TurnImage,Dir,"(default 0) 0:XY(original) 1:YZ 2:XZ",int,""); + + BBTK_OUTPUT(TurnImage,Out,"Output image",vtkImageData*,""); + +BBTK_END_DESCRIBE_BLACK_BOX(TurnImage); +//===== +// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost) +//===== +} +// EO namespace bbcreaVtk + +#endif // __bbcreaVtkTurnImage_h_INCLUDED__ + diff --git a/bbtk_creaVtk_PKG/src/bbcreaVtkVectorsVisu.cxx b/bbtk_creaVtk_PKG/src/bbcreaVtkVectorsVisu.cxx index 062e8e7..d15268b 100644 --- a/bbtk_creaVtk_PKG/src/bbcreaVtkVectorsVisu.cxx +++ b/bbtk_creaVtk_PKG/src/bbcreaVtkVectorsVisu.cxx @@ -32,9 +32,10 @@ void VectorsVisu::Process() vectorsvisu.SetOpacity( bbGetInputOpacity() ); vectorsvisu.SetRenderer( bbGetInputRenderer() ); vectorsvisu.SetTypeForm( bbGetInputTypeForm() ); + vectorsvisu.SetOrientation( bbGetInputOrientation() ); + vectorsvisu.SetExternalLut( bbGetInputExternalLut() ); vectorsvisu.Process(); - bbSetOutputOut( vectorsvisu.GetProp3D() ); - + bbSetOutputOut( vectorsvisu.GetProp3D() ); } //===== // Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost) @@ -51,6 +52,8 @@ void VectorsVisu::bbUserSetDefaultValues() bbSetInputScaleFactor(500); bbSetInputOpacity(1); bbSetInputTypeForm(0); + bbSetInputOrientation(-1); + bbSetInputExternalLut(NULL); } //===== // Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost) diff --git a/bbtk_creaVtk_PKG/src/bbcreaVtkVectorsVisu.h b/bbtk_creaVtk_PKG/src/bbcreaVtkVectorsVisu.h index 27ad79c..4dfa23e 100644 --- a/bbtk_creaVtk_PKG/src/bbcreaVtkVectorsVisu.h +++ b/bbtk_creaVtk_PKG/src/bbcreaVtkVectorsVisu.h @@ -9,6 +9,7 @@ #include "vtkRenderer.h" #include "vtkDataObject.h" +#include "vtkScalarsToColors.h" #include "vtkVectorsVisu.h" @@ -29,6 +30,8 @@ class bbcreaVtk_EXPORT VectorsVisu BBTK_DECLARE_INPUT(ScaleFactor,double); BBTK_DECLARE_INPUT(Opacity,double); BBTK_DECLARE_INPUT(TypeForm,int); + BBTK_DECLARE_INPUT(Orientation,int); + BBTK_DECLARE_INPUT(ExternalLut,vtkScalarsToColors*); BBTK_DECLARE_OUTPUT(Out,vtkProp3D*); BBTK_PROCESS(Process); void Process(); @@ -42,17 +45,22 @@ private: }; BBTK_BEGIN_DESCRIBE_BLACK_BOX(VectorsVisu,bbtk::AtomicBlackBox); -BBTK_NAME("VectorsVisu"); -BBTK_AUTHOR("ED at InfoDev Creatis"); -BBTK_DESCRIPTION("No Description."); -BBTK_CATEGORY("empty"); - BBTK_INPUT(VectorsVisu,Active,"Active (false default)",bool,""); - BBTK_INPUT(VectorsVisu,In,"(needed) vtkDataObject. (Example vtkDataObject<-vtkDataSet<-vtkPointSet<-vtkPolyData (parrent class) )",vtkDataObject*,""); - BBTK_INPUT(VectorsVisu,ScaleFactor,"Scale factor (500 default)",double,""); - BBTK_INPUT(VectorsVisu,Opacity,"Opacity (1 default)",double,""); - BBTK_INPUT(VectorsVisu,Renderer,"vtkRenderer",vtkRenderer*,""); - BBTK_INPUT(VectorsVisu,TypeForm,"0 Line, 1 Arrow (default 0)",int,""); - BBTK_OUTPUT(VectorsVisu,Out,"vtkProp3D of an vtkActor",vtkProp3D*,""); + BBTK_NAME("VectorsVisu"); + BBTK_AUTHOR("ED at InfoDev Creatis"); + BBTK_DESCRIPTION("No Description."); + BBTK_CATEGORY("empty"); + + BBTK_INPUT(VectorsVisu,Active,"Active (false default)",bool,""); + BBTK_INPUT(VectorsVisu,In,"(needed) vtkDataObject. (Example vtkDataObject<-vtkDataSet<-vtkPointSet<-vtkPolyData (parrent class) )",vtkDataObject*,""); + BBTK_INPUT(VectorsVisu,ScaleFactor,"Scale factor (500 default)",double,""); + BBTK_INPUT(VectorsVisu,Opacity,"Opacity (1 default)",double,""); + BBTK_INPUT(VectorsVisu,Renderer,"vtkRenderer",vtkRenderer*,""); + BBTK_INPUT(VectorsVisu,TypeForm,"0 Line, 1 Arrow (default 0)",int,""); + BBTK_INPUT(VectorsVisu,Orientation,"(default -1) -1=3D, 0=yz, 1=xz, 2=xy",int,""); + BBTK_INPUT(VectorsVisu,ExternalLut,"Lookuptable",vtkScalarsToColors*,""); + + BBTK_OUTPUT(VectorsVisu,Out,"vtkProp3D of an vtkActor",vtkProp3D*,""); + BBTK_END_DESCRIBE_BLACK_BOX(VectorsVisu); //===== // Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost) diff --git a/bbtk_creaVtk_PKG/src/bbcreaVtkVoiMPR.cxx b/bbtk_creaVtk_PKG/src/bbcreaVtkVoiMPR.cxx new file mode 100644 index 0000000..2ecd5ca --- /dev/null +++ b/bbtk_creaVtk_PKG/src/bbcreaVtkVoiMPR.cxx @@ -0,0 +1,268 @@ +//===== +// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost) +//===== +#include "bbcreaVtkVoiMPR.h" +#include "bbcreaVtkPackage.h" + +namespace bbcreaVtk +{ + +BBTK_ADD_BLACK_BOX_TO_PACKAGE(creaVtk,VoiMPR) +BBTK_BLACK_BOX_IMPLEMENTATION(VoiMPR,bbtk::AtomicBlackBox); +//===== +// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost) +//===== +void VoiMPR::Process() +{ + +// THE MAIN PROCESSING METHOD BODY +// Here we simply set the input 'In' value to the output 'Out' +// And print out the output value +// INPUT/OUTPUT ACCESSORS ARE OF THE FORM : +// void bbSet{Input|Output}NAME(const TYPE&) +// const TYPE& bbGet{Input|Output}NAME() const +// Where : +// * NAME is the name of the input/output +// (the one provided in the attribute 'name' of the tag 'input') +// * TYPE is the C++ type of the input/output +// (the one provided in the attribute 'type' of the tag 'input') +// bbSetOutputOut( bbGetInputIn() ); +// std::cout << "Output value = " < vecVOI = bbGetInputIn(); + std::vector spc = bbGetInputSpacing(); + vecVOI[0] = vecVOI[0]*spc[0]; + vecVOI[1] = vecVOI[1]*spc[0]; + vecVOI[2] = vecVOI[2]*spc[1]; + vecVOI[3] = vecVOI[3]*spc[1]; + vecVOI[4] = vecVOI[4]*spc[2]; + vecVOI[5] = vecVOI[5]*spc[2]; + int dep; + std::vector vecPoint = bbGetInputActualPoint(); + vecPoint[0] = vecPoint[0]*spc[0]; + vecPoint[1] = vecPoint[1]*spc[1]; + vecPoint[2] = vecPoint[2]*spc[2]; + + if (vecPoint.size()==3) + { + if ((vecPoint[0]>=vecVOI[0]) && (vecPoint[0]<=vecVOI[1]) ) + { + showActorYZ=bbGetInputActive() && true; + } else { + showActorYZ=bbGetInputActive() && false; + } + if ((vecPoint[1]>=vecVOI[2]) && (vecPoint[1]<=vecVOI[3]) ) + { + showActorXZ=bbGetInputActive() && true; + } else { + showActorXZ=bbGetInputActive() && false; + } + if ((vecPoint[2]>=vecVOI[4]) && (vecPoint[2]<=vecVOI[5]) ) + { + showActorXY=bbGetInputActive() && true; + } else { + showActorXY=bbGetInputActive() && false; + } + + } else { + showActorXY=bbGetInputActive(); + showActorYZ=bbGetInputActive(); + showActorXZ=bbGetInputActive(); + } + + if (bbGetInputXYrender()!=NULL) + { + dep=-900; + pointsXY->SetPoint(0, vecVOI[0], vecVOI[2], dep); + pointsXY->SetPoint(1, vecVOI[0], vecVOI[3], dep); + pointsXY->SetPoint(2, vecVOI[1], vecVOI[3], dep); + pointsXY->SetPoint(3, vecVOI[1], vecVOI[2], dep); + pointsXY-> Modified(); + if ( showActorXY==true ) + { + if (actorAddedXY==false) + { + bbGetInputXYrender()->AddActor(polygonActorXY); + actorAddedXY=true; + } // + } else { + if (actorAddedXY==true) + { + bbGetInputXYrender()->RemoveActor(polygonActorXY); + actorAddedXY=false; + } // + }// Active + } // if XYrender + if (bbGetInputYZrender()!=NULL) + { + dep=900; + pointsYZ->SetPoint(0, dep,vecVOI[2], vecVOI[4] ); + pointsYZ->SetPoint(1, dep,vecVOI[2], vecVOI[5] ); + pointsYZ->SetPoint(2, dep,vecVOI[3], vecVOI[5] ); + pointsYZ->SetPoint(3, dep,vecVOI[3], vecVOI[4] ); + pointsYZ-> Modified(); + if ( showActorYZ==true ) + { + if (actorAddedYZ==false) + { + bbGetInputYZrender()->AddActor(polygonActorYZ); + actorAddedYZ=true; + } // + } else { + if (actorAddedYZ==true) + { + bbGetInputYZrender()->RemoveActor(polygonActorYZ); + actorAddedYZ=false; + } // + }// Active + } // if XYrender + if (bbGetInputXZrender()!=NULL) + { + dep=-900; + pointsXZ->SetPoint(0, vecVOI[0],dep, vecVOI[4] ); + pointsXZ->SetPoint(1, vecVOI[0],dep, vecVOI[5] ); + pointsXZ->SetPoint(2, vecVOI[1],dep, vecVOI[5] ); + pointsXZ->SetPoint(3, vecVOI[1],dep, vecVOI[4] ); + pointsXZ-> Modified(); + if ( showActorXZ==true ) + { + if (actorAddedXZ==false) + { + bbGetInputXZrender()->AddActor(polygonActorXZ); + actorAddedXZ=true; + } // + } else { + if (actorAddedXZ==true) + { + bbGetInputXZrender()->RemoveActor(polygonActorXZ); + actorAddedXZ=false; + } // + }// Active + } // if XYrender + } // In size +} +//===== +// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost) +//===== +void VoiMPR::bbUserSetDefaultValues() +{ + +// SET HERE THE DEFAULT INPUT/OUTPUT VALUES OF YOUR BOX +// Here we initialize the input 'In' to 0 + actorAddedXY = false; + actorAddedXZ = false; + actorAddedYZ = false; + bbSetInputActive(true); + bbSetInputXYrender(NULL); + bbSetInputYZrender(NULL); + bbSetInputXZrender(NULL); + + std::vector spc; + spc.push_back(1); + spc.push_back(1); + spc.push_back(1); + bbSetInputSpacing(spc); +} +//===== +// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost) +//===== +void VoiMPR::bbUserInitializeProcessing() +{ + +// THE INITIALIZATION METHOD BODY : +// Here does nothing +// but this is where you should allocate the internal/output pointers +// if any + + + pointsXY = vtkPoints ::New(); + linesXY = vtkCellArray ::New(); + polygonXY = vtkPolyData ::New(); + polygonMapperXY = vtkPolyDataMapper ::New(); + polygonActorXY = vtkActor ::New(); + pointsXY -> SetNumberOfPoints(4); + pointsXY -> SetPoint(0, 0, 0, 0); + pointsXY -> SetPoint(1, 0, 0, 0); + pointsXY -> SetPoint(2, 0, 0, 0); + pointsXY -> SetPoint(3, 0, 0, 0); + linesXY -> InsertNextCell(5); + linesXY -> InsertCellPoint(0); + linesXY -> InsertCellPoint(1); + linesXY -> InsertCellPoint(2); + linesXY -> InsertCellPoint(3); + linesXY -> InsertCellPoint(0); + polygonXY -> SetPoints(pointsXY); + polygonXY -> SetLines(linesXY); + polygonMapperXY -> SetInputData(polygonXY); + polygonMapperXY -> Update(); + polygonActorXY -> SetMapper(polygonMapperXY); + + + pointsXZ = vtkPoints ::New(); + linesXZ = vtkCellArray ::New(); + polygonXZ = vtkPolyData ::New(); + polygonMapperXZ = vtkPolyDataMapper ::New(); + polygonActorXZ = vtkActor ::New(); + pointsXZ -> SetNumberOfPoints(4); + pointsXZ -> SetPoint(0, 0, 0, 0); + pointsXZ -> SetPoint(1, 0, 0, 0); + pointsXZ -> SetPoint(2, 0, 0, 0); + pointsXZ -> SetPoint(3, 0, 0, 0); + linesXZ -> InsertNextCell(5); + linesXZ -> InsertCellPoint(0); + linesXZ -> InsertCellPoint(1); + linesXZ -> InsertCellPoint(2); + linesXZ -> InsertCellPoint(3); + linesXZ -> InsertCellPoint(0); + polygonXZ -> SetPoints(pointsXZ); + polygonXZ -> SetLines(linesXZ); + polygonMapperXZ -> SetInputData(polygonXZ); + polygonMapperXZ -> Update(); + polygonActorXZ -> SetMapper(polygonMapperXZ); + + pointsYZ = vtkPoints ::New(); + linesYZ = vtkCellArray ::New(); + polygonYZ = vtkPolyData ::New(); + polygonMapperYZ = vtkPolyDataMapper ::New(); + polygonActorYZ = vtkActor ::New(); + pointsYZ ->SetNumberOfPoints(4); + pointsYZ ->SetPoint(0, 0, 0, 0); + pointsYZ ->SetPoint(1, 0, 0, 0); + pointsYZ ->SetPoint(2, 0, 0, 0); + pointsYZ ->SetPoint(3, 0, 0, 0); + linesYZ ->InsertNextCell(5); + linesYZ ->InsertCellPoint(0); + linesYZ ->InsertCellPoint(1); + linesYZ ->InsertCellPoint(2); + linesYZ ->InsertCellPoint(3); + linesYZ ->InsertCellPoint(0); + polygonYZ -> SetPoints(pointsYZ); + polygonYZ -> SetLines(linesYZ); + polygonMapperYZ -> SetInputData(polygonYZ); + polygonMapperYZ -> Update(); + polygonActorYZ -> SetMapper(polygonMapperYZ); +} +//===== +// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost) +//===== +void VoiMPR::bbUserFinalizeProcessing() +{ + +// THE FINALIZATION METHOD BODY : +// Here does nothing +// but this is where you should desallocate the internal/output pointers +// if any + +} +} +// EO namespace bbcreaVtk + + diff --git a/bbtk_creaVtk_PKG/src/bbcreaVtkVoiMPR.h b/bbtk_creaVtk_PKG/src/bbcreaVtkVoiMPR.h new file mode 100644 index 0000000..be95b92 --- /dev/null +++ b/bbtk_creaVtk_PKG/src/bbcreaVtkVoiMPR.h @@ -0,0 +1,90 @@ +//===== +// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost) +//===== +#ifndef __bbcreaVtkVoiMPR_h_INCLUDED__ +#define __bbcreaVtkVoiMPR_h_INCLUDED__ + +#include "bbcreaVtk_EXPORT.h" +#include "bbtkAtomicBlackBox.h" +#include "iostream" + +#include "vtkPoints.h" +#include "vtkCellArray.h" +#include "vtkPolyData.h" +#include "vtkPolyDataMapper.h" +#include "vtkActor.h" +#include "vtkRenderer.h" + + +namespace bbcreaVtk +{ + +class bbcreaVtk_EXPORT VoiMPR + : + public bbtk::AtomicBlackBox +{ + BBTK_BLACK_BOX_INTERFACE(VoiMPR,bbtk::AtomicBlackBox); +//===== +// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost) +//===== + BBTK_DECLARE_INPUT(In,std::vector); + BBTK_DECLARE_INPUT(Spacing,std::vector); + BBTK_DECLARE_INPUT(ActualPoint,std::vector); + BBTK_DECLARE_INPUT(XYrender,vtkRenderer*); + BBTK_DECLARE_INPUT(YZrender,vtkRenderer*); + BBTK_DECLARE_INPUT(XZrender,vtkRenderer*); + BBTK_DECLARE_INPUT(Active,bool); +// BBTK_DECLARE_OUTPUT(Out,double); + BBTK_PROCESS(Process); + void Process(); + + vtkPoints *pointsXY; + vtkCellArray *linesXY; + vtkPolyData *polygonXY; + vtkPolyDataMapper *polygonMapperXY; + vtkActor *polygonActorXY; + bool actorAddedXY; + + vtkPoints *pointsXZ; + vtkCellArray *linesXZ; + vtkPolyData *polygonXZ; + vtkPolyDataMapper *polygonMapperXZ; + vtkActor *polygonActorXZ; + bool actorAddedXZ; + + vtkPoints *pointsYZ; + vtkCellArray *linesYZ; + vtkPolyData *polygonYZ; + vtkPolyDataMapper *polygonMapperYZ; + vtkActor *polygonActorYZ; + bool actorAddedYZ; + +//===== +// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost) +//===== +}; + +BBTK_BEGIN_DESCRIBE_BLACK_BOX(VoiMPR,bbtk::AtomicBlackBox); + BBTK_NAME("VoiMPR"); + BBTK_AUTHOR("InfoDev"); + BBTK_DESCRIPTION("No Description."); + BBTK_CATEGORY("empty"); + + BBTK_INPUT(VoiMPR,In,"input box (minX maxX minY maxY minZ maxZ)",std::vector,""); + BBTK_INPUT(VoiMPR,Spacing,"default [1 1 1]. Spacing [sx sy sz]",std::vector,""); + BBTK_INPUT(VoiMPR,ActualPoint,"Actual point [x y z]",std::vector,""); + BBTK_INPUT(VoiMPR,XYrender,"vtkRenderer XY",vtkRenderer*,""); + BBTK_INPUT(VoiMPR,YZrender,"vtkRenderer YZ",vtkRenderer*,""); + BBTK_INPUT(VoiMPR,XZrender,"vtkRenderer XZ",vtkRenderer*,""); + BBTK_INPUT(VoiMPR,Active,"(default true) Visible true / Not visible false",bool,""); +// BBTK_OUTPUT(VoiMPR,Out,"First output",double,""); + +BBTK_END_DESCRIBE_BLACK_BOX(VoiMPR); +//===== +// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost) +//===== +} +// EO namespace bbcreaVtk + +#endif // __bbcreaVtkVoiMPR_h_INCLUDED__ + diff --git a/bbtk_creaVtk_PKG/src/bbcreaVtkVoxelGrid.cxx b/bbtk_creaVtk_PKG/src/bbcreaVtkVoxelGrid.cxx new file mode 100644 index 0000000..676bde6 --- /dev/null +++ b/bbtk_creaVtk_PKG/src/bbcreaVtkVoxelGrid.cxx @@ -0,0 +1,91 @@ +//===== +// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost) +//===== +#include "bbcreaVtkVoxelGrid.h" +#include "bbcreaVtkPackage.h" + +#include "vtkVoxelGrid.h" + +namespace bbcreaVtk +{ + +BBTK_ADD_BLACK_BOX_TO_PACKAGE(creaVtk,VoxelGrid) +BBTK_BLACK_BOX_IMPLEMENTATION(VoxelGrid,bbtk::AtomicBlackBox); +//===== +// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost) +//===== +void VoxelGrid::Process() +{ + +// THE MAIN PROCESSING METHOD BODY +// Here we simply set the input 'In' value to the output 'Out' +// And print out the output value +// INPUT/OUTPUT ACCESSORS ARE OF THE FORM : +// void bbSet{Input|Output}NAME(const TYPE&) +// const TYPE& bbGet{Input|Output}NAME() const +// Where : +// * NAME is the name of the input/output +// (the one provided in the attribute 'name' of the tag 'input') +// * TYPE is the C++ type of the input/output +// (the one provided in the attribute 'type' of the tag 'input') +// bbSetOutputOut( bbGetInputIn() ); +// std::cout << "Output value = " <SetInputData( bbGetInputImage() ); + voxelgrid->SetConfigurationStyleToManual(); + voxelgrid->SetDivisions( bbGetInputDivisionsX(),bbGetInputDivisionsY(),bbGetInputDivisionsZ() ); + +// voxelgrid->SetConfigurationStyleToLeafSize(); +// voxelgrid->SetLeafSize( bbGetInputDivisionsX(),bbGetInputDivisionsY(),bbGetInputDivisionsZ() ); + +// voxelgrid->SetConfigurationStyleToAutomatic(); +// voxelgrid->SetNumberOfPointsPerBin( bbGetInputDivisionsX() ); + voxelgrid->Update(); + + bbSetOutputOut( voxelgrid->GetOutput() ); +} +//===== +// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost) +//===== +void VoxelGrid::bbUserSetDefaultValues() +{ + +// SET HERE THE DEFAULT INPUT/OUTPUT VALUES OF YOUR BOX +// Here we initialize the input 'In' to 0 + bbSetInputImage(NULL); + bbSetInputDivisionsX(100); + bbSetInputDivisionsY(100); + bbSetInputDivisionsZ(100); + +} +//===== +// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost) +//===== +void VoxelGrid::bbUserInitializeProcessing() +{ + +// THE INITIALIZATION METHOD BODY : +// Here does nothing +// but this is where you should allocate the internal/output pointers +// if any + + +} +//===== +// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost) +//===== +void VoxelGrid::bbUserFinalizeProcessing() +{ + +// THE FINALIZATION METHOD BODY : +// Here does nothing +// but this is where you should desallocate the internal/output pointers +// if any + +} +} +// EO namespace bbcreaVtk + + diff --git a/bbtk_creaVtk_PKG/src/bbcreaVtkVoxelGrid.h b/bbtk_creaVtk_PKG/src/bbcreaVtkVoxelGrid.h new file mode 100644 index 0000000..654516c --- /dev/null +++ b/bbtk_creaVtk_PKG/src/bbcreaVtkVoxelGrid.h @@ -0,0 +1,59 @@ +//===== +// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost) +//===== +#ifndef __bbcreaVtkVoxelGrid_h_INCLUDED__ +#define __bbcreaVtkVoxelGrid_h_INCLUDED__ + +#include "bbcreaVtk_EXPORT.h" +#include "bbtkAtomicBlackBox.h" +#include "iostream" + + +#include "vtkDataObject.h" +#include "vtkPolyData.h" + + +namespace bbcreaVtk +{ + +class bbcreaVtk_EXPORT VoxelGrid + : + public bbtk::AtomicBlackBox +{ + BBTK_BLACK_BOX_INTERFACE(VoxelGrid,bbtk::AtomicBlackBox); +//===== +// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost) +//===== + BBTK_DECLARE_INPUT(Image,vtkDataObject*); + BBTK_DECLARE_INPUT(DivisionsX,int); + BBTK_DECLARE_INPUT(DivisionsY,int); + BBTK_DECLARE_INPUT(DivisionsZ,int); + BBTK_DECLARE_OUTPUT(Out,vtkPolyData*); + BBTK_PROCESS(Process); + void Process(); +//===== +// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost) +//===== +}; + +BBTK_BEGIN_DESCRIBE_BLACK_BOX(VoxelGrid,bbtk::AtomicBlackBox); + BBTK_NAME("VoxelGrid"); + BBTK_AUTHOR("InfoDev"); + BBTK_DESCRIPTION("No Description."); + BBTK_CATEGORY("empty"); + + BBTK_INPUT(VoxelGrid,Image,"Input image",vtkDataObject*,""); + BBTK_INPUT(VoxelGrid,DivisionsX,"X divisions",int,""); + BBTK_INPUT(VoxelGrid,DivisionsY,"Y divisions",int,""); + BBTK_INPUT(VoxelGrid,DivisionsZ,"Z divisions",int,""); + + BBTK_OUTPUT(VoxelGrid,Out,"Output vtkPolydata",vtkPolyData*,""); +BBTK_END_DESCRIBE_BLACK_BOX(VoxelGrid); +//===== +// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost) +//===== +} +// EO namespace bbcreaVtk + +#endif // __bbcreaVtkVoxelGrid_h_INCLUDED__ + diff --git a/bbtk_creaVtk_PKG/src/bbcreaVtkWriteLstImages.cxx b/bbtk_creaVtk_PKG/src/bbcreaVtkWriteLstImages.cxx new file mode 100644 index 0000000..973a7b7 --- /dev/null +++ b/bbtk_creaVtk_PKG/src/bbcreaVtkWriteLstImages.cxx @@ -0,0 +1,119 @@ +//===== +// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost) +//===== +#include "bbcreaVtkWriteLstImages.h" +#include "bbcreaVtkPackage.h" + +#include "vtkMetaImageWriter.h" +#include +namespace bbcreaVtk +{ + +BBTK_ADD_BLACK_BOX_TO_PACKAGE(creaVtk,WriteLstImages) +BBTK_BLACK_BOX_IMPLEMENTATION(WriteLstImages,bbtk::AtomicBlackBox); +//===== +// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost) +//===== +void WriteLstImages::Process() +{ + +// THE MAIN PROCESSING METHOD BODY +// Here we simply set the input 'In' value to the output 'Out' +// And print out the output value +// INPUT/OUTPUT ACCESSORS ARE OF THE FORM : +// void bbSet{Input|Output}NAME(const TYPE&) +// const TYPE& bbGet{Input|Output}NAME() const +// Where : +// * NAME is the name of the input/output +// (the one provided in the attribute 'name' of the tag 'input') +// * TYPE is the C++ type of the input/output +// (the one provided in the attribute 'type' of the tag 'input') +// bbSetOutputOut( bbGetInputIn() ); +// std::cout << "Output value = " <SetInputData( inImg ); + w->SetCompression( bbGetInputCompression() ); + w->SetFileDimensionality(inImg->GetDataDimension()); // NTU + std::string filename = bbGetInputOutputDir()+"/"+bbGetInputFileName()+"-"+txtNum+".mhd"; + w->SetFileName(filename.c_str()); + w->Write(); + w->Delete(); + } // Type + + if (bbGetInputType()==1) // NIFTI + { + vtkNIFTIImageWriter* w = vtkNIFTIImageWriter::New(); + w->SetInputData( inImg ); + std::string filename = bbGetInputOutputDir()+"/"+bbGetInputFileName()+"-"+txtNum+".nii"; + w->SetFileName(filename.c_str()); + w->Write(); + w->Delete(); + } // Type + + + + } // for i +printf("EED WriteLstImages::Process END\n"); + +} +//===== +// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost) +//===== +void WriteLstImages::bbUserSetDefaultValues() +{ + +// SET HERE THE DEFAULT INPUT/OUTPUT VALUES OF YOUR BOX +// Here we initialize the input 'In' to 0 + bbSetInputType(0); + bbSetInputCompression(false); + bbSetInputFileName("void"); + bbSetInputOutputDir("."); +} +//===== +// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost) +//===== +void WriteLstImages::bbUserInitializeProcessing() +{ + +// THE INITIALIZATION METHOD BODY : +// Here does nothing +// but this is where you should allocate the internal/output pointers +// if any + + +} +//===== +// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost) +//===== +void WriteLstImages::bbUserFinalizeProcessing() +{ + +// THE FINALIZATION METHOD BODY : +// Here does nothing +// but this is where you should desallocate the internal/output pointers +// if any + +} +} +// EO namespace bbcreaVtk + + diff --git a/bbtk_creaVtk_PKG/src/bbcreaVtkWriteLstImages.h b/bbtk_creaVtk_PKG/src/bbcreaVtkWriteLstImages.h new file mode 100644 index 0000000..412b32f --- /dev/null +++ b/bbtk_creaVtk_PKG/src/bbcreaVtkWriteLstImages.h @@ -0,0 +1,61 @@ +//===== +// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost) +//===== +#ifndef __bbcreaVtkWriteLstImages_h_INCLUDED__ +#define __bbcreaVtkWriteLstImages_h_INCLUDED__ + +#include "bbcreaVtk_EXPORT.h" +#include "bbtkAtomicBlackBox.h" +#include "iostream" + +#include +#include "vtkImageData.h" + + +namespace bbcreaVtk +{ + +class bbcreaVtk_EXPORT WriteLstImages + : + public bbtk::AtomicBlackBox +{ + BBTK_BLACK_BOX_INTERFACE(WriteLstImages,bbtk::AtomicBlackBox); +//===== +// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost) +//===== + BBTK_DECLARE_INPUT(Type,int); + BBTK_DECLARE_INPUT(OutputDir,std::string); + BBTK_DECLARE_INPUT(LstImages,std::vector< vtkImageData* >); + BBTK_DECLARE_INPUT(FileName,std::string); + BBTK_DECLARE_INPUT(Compression,bool); +// BBTK_DECLARE_OUTPUT(Out,double); + BBTK_PROCESS(Process); + void Process(); +//===== +// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost) +//===== +}; + +BBTK_BEGIN_DESCRIBE_BLACK_BOX(WriteLstImages,bbtk::AtomicBlackBox); + BBTK_NAME("WriteLstImages"); + BBTK_AUTHOR("InfoDev"); + BBTK_DESCRIPTION("No Description."); + BBTK_CATEGORY("empty"); + + BBTK_INPUT(WriteLstImages,Type,"(default 0) 0:mhd 1:nii",int,""); + BBTK_INPUT(WriteLstImages,OutputDir,"Output directory",std::string,""); + BBTK_INPUT(WriteLstImages,LstImages,"Lst of images",std::vector< vtkImageData* >,""); + BBTK_INPUT(WriteLstImages,FileName,"File name (no extension)",std::string,""); + BBTK_INPUT(WriteLstImages,Compression,"(Default false) true/false just for mhd",bool,""); + +// BBTK_OUTPUT(WriteLstImages,Out,"First output",double,""); + +BBTK_END_DESCRIBE_BLACK_BOX(WriteLstImages); +//===== +// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost) +//===== +} +// EO namespace bbcreaVtk + +#endif // __bbcreaVtkWriteLstImages_h_INCLUDED__ + diff --git a/bbtk_creaVtk_PKG/src/bbcreaVtksave_YZ_XZ_volume.cxx b/bbtk_creaVtk_PKG/src/bbcreaVtksave_YZ_XZ_volume.cxx new file mode 100644 index 0000000..8fcdaa5 --- /dev/null +++ b/bbtk_creaVtk_PKG/src/bbcreaVtksave_YZ_XZ_volume.cxx @@ -0,0 +1,193 @@ +//===== +// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost) +//===== +#include "bbcreaVtksave_YZ_XZ_volume.h" +#include "bbcreaVtkPackage.h" + +#include "vtkMetaImageReader.h" +#include "vtkMetaImageWriter.h" +#include "vtkImageData.h" +#include "creaVtk_MACROS.h" + +namespace bbcreaVtk +{ + +BBTK_ADD_BLACK_BOX_TO_PACKAGE(creaVtk,save_YZ_XZ_volume) +BBTK_BLACK_BOX_IMPLEMENTATION(save_YZ_XZ_volume,bbtk::AtomicBlackBox); +//===== +// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost) +//===== +void save_YZ_XZ_volume::Process() +{ + +// THE MAIN PROCESSING METHOD BODY +// Here we simply set the input 'In' value to the output 'Out' +// And print out the output value +// INPUT/OUTPUT ACCESSORS ARE OF THE FORM : +// void bbSet{Input|Output}NAME(const TYPE&) +// const TYPE& bbGet{Input|Output}NAME() const +// Where : +// * NAME is the name of the input/output +// (the one provided in the attribute 'name' of the tag 'input') +// * TYPE is the C++ type of the input/output +// (the one provided in the attribute 'type' of the tag 'input') + FILE *ff = fopen(bbGetInputFileName().c_str(),"r"); + if (ff!=NULL) + { + fclose(ff); + vtkMetaImageReader *reader=vtkMetaImageReader::New(); + reader->SetFileName(bbGetInputFileName().c_str()); + reader->Update(); + vtkImageData *image = reader->GetOutput(); + int dim[3]; + int ext[6]; + image->GetExtent(ext); + dim[0] = ext[1]-ext[0]+1; + dim[1] = ext[3]-ext[2]+1; + dim[2] = ext[5]-ext[4]+1; + double spc[3]; + image->GetSpacing(spc); + + vtkImageData *newImageYZ = vtkImageData::New(); + newImageYZ->Initialize(); + newImageYZ->SetSpacing( spc[1],spc[2],spc[0] ); + newImageYZ->SetDimensions( dim[1],dim[2], dim[0] ); + +//EED 2017-01-01 Migration VTK7 +#if (VTK_MAJOR_VERSION <= 5) + newImageYZ->SetScalarType( image->GetScalarType() ); + newImageYZ->SetNumberOfScalarComponents(1); + newImageYZ->AllocateScalars(); +#endif +#if (VTK_MAJOR_VERSION >= 6) + newImageYZ->AllocateScalars( image->GetScalarType(),1 ); +#endif + + vtkImageData *newImageZX = vtkImageData::New(); + newImageZX->Initialize(); + newImageZX->SetSpacing( spc[0],spc[2],spc[1] ); + newImageZX->SetDimensions( dim[0],dim[2], dim[1] ); + +//EED 2017-01-01 Migration VTK7 +#if (VTK_MAJOR_VERSION <= 5) + newImageZX->SetScalarType( image->GetScalarType() ); + newImageZX->SetNumberOfScalarComponents(1); + newImageZX->AllocateScalars(); +#endif +#if (VTK_MAJOR_VERSION >= 6) + newImageZX->AllocateScalars( image->GetScalarType(),1 ); +#endif + + DEF_POINTER_IMAGE_VTK_CREA(imageV,imageSS,imageP,imageST,image) + DEF_POINTER_IMAGE_VTK_CREA(newImageYZ_V,newImageYZ_SS,newImageYZ_P,newImageYZ_ST,newImageYZ) + DEF_POINTER_IMAGE_VTK_CREA(newImageZX_V,newImageZX_SS,newImageZX_P,newImageZX_ST,newImageZX) + long int newImageYZ_index; + long int newImageZX_index; + + int i,j,k; +// double value; + for (k=0;kGetScalarComponentAsDouble (i,j,k,0); + GETVALUE_VTK_CREA(imageV,imageP,imageST) + imageP=imageP+imageSS; + +// newImageYZ->SetScalarComponentFromDouble( j , dim[2]-k-1 , i , 0 , value ); + newImageYZ_index=j + (dim[2]-k-1)*dim[1] + i*dim[1]*dim[2]; + SETVALUE2_VTK_CREA(imageV,newImageYZ_P,newImageYZ_ST,newImageYZ_index) + +// newImageZX->SetScalarComponentFromDouble( i , dim[2]-k-1 , j , 0 ,value ); + newImageZX_index=i + (dim[2]-k-1)*dim[0] + j*dim[0]*dim[2]; + SETVALUE2_VTK_CREA(imageV,newImageZX_P,newImageZX_ST,newImageZX_index) + } // for i + } // for j + } // for k + + //-- Split FileName + std::size_t found = bbGetInputFileName().find_last_of("/\\"); + std::string path = bbGetInputFileName().substr(0,found+1); + std::string filename = bbGetInputFileName().substr(found+1); +#ifdef _WIN32 + path=path+"YZ_ZX\\"; +#else + path=path+"YZ_ZX/"; +#endif + std::string command_mkdir = "mkdir "+path; + system(command_mkdir.c_str()); + std::string newFileNameYZ = path+filename+"_YZ.mhd"; + std::string newFileNameZX = path+filename+"_ZX.mhd"; + + //-- Save _YZ + vtkMetaImageWriter * writerYZ = vtkMetaImageWriter::New(); +//EED 2017-01-01 Migration VTK7 +#if (VTK_MAJOR_VERSION <= 5) + writerYZ->SetInput(newImageYZ); +#endif +#if (VTK_MAJOR_VERSION >= 6) + writerYZ->SetInputData(newImageYZ); +#endif + writerYZ->SetFileName(newFileNameYZ.c_str()); + writerYZ->SetCompression( bbGetInputCompression() ); + writerYZ->Write(); + + //-- Save _ZX + vtkMetaImageWriter * writerZX = vtkMetaImageWriter::New(); +//EED 2017-01-01 Migration VTK7 +#if (VTK_MAJOR_VERSION <= 5) + writerZX->SetInput(newImageZX); +#endif +#if (VTK_MAJOR_VERSION >= 6) + writerZX->SetInputData(newImageZX); +#endif + writerZX->SetFileName(newFileNameZX.c_str()); + writerZX->SetCompression( bbGetInputCompression() ); + writerZX->Write(); + + } else { + printf("EED Save-YZ-XZ-planes::Process %s Not Exist!\n", bbGetInputFileName().c_str() ); + } +} +//===== +// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost) +//===== +void save_YZ_XZ_volume::bbUserSetDefaultValues() +{ + +// SET HERE THE DEFAULT INPUT/OUTPUT VALUES OF YOUR BOX +// Here we initialize the input 'In' to 0 + bbSetInputFileName(""); + bbSetInputCompression( false ); +} +//===== +// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost) +//===== +void save_YZ_XZ_volume::bbUserInitializeProcessing() +{ + +// THE INITIALIZATION METHOD BODY : +// Here does nothing +// but this is where you should allocate the internal/output pointers +// if any + + +} +//===== +// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost) +//===== +void save_YZ_XZ_volume::bbUserFinalizeProcessing() +{ + +// THE FINALIZATION METHOD BODY : +// Here does nothing +// but this is where you should desallocate the internal/output pointers +// if any + +} +} +// EO namespace bbcreaVtk + + diff --git a/bbtk_creaVtk_PKG/src/bbcreaVtksave_YZ_XZ_volume.h b/bbtk_creaVtk_PKG/src/bbcreaVtksave_YZ_XZ_volume.h new file mode 100644 index 0000000..c34b9db --- /dev/null +++ b/bbtk_creaVtk_PKG/src/bbcreaVtksave_YZ_XZ_volume.h @@ -0,0 +1,51 @@ +//===== +// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost) +//===== +#ifndef __bbcreaVtksave_YZ_XZ_volume_h_INCLUDED__ +#define __bbcreaVtksave_YZ_XZ_volume_h_INCLUDED__ + +#include "bbcreaVtk_EXPORT.h" +#include "bbtkAtomicBlackBox.h" +#include "iostream" + +namespace bbcreaVtk +{ + +class bbcreaVtk_EXPORT save_YZ_XZ_volume + : + public bbtk::AtomicBlackBox +{ + BBTK_BLACK_BOX_INTERFACE(save_YZ_XZ_volume,bbtk::AtomicBlackBox); +//===== +// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost) +//===== + BBTK_DECLARE_INPUT(FileName,std::string); + BBTK_DECLARE_INPUT(Compression,bool); +// BBTK_DECLARE_OUTPUT(Out,double); + BBTK_PROCESS(Process); + void Process(); +//===== +// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost) +//===== +}; + +BBTK_BEGIN_DESCRIBE_BLACK_BOX(save_YZ_XZ_volume,bbtk::AtomicBlackBox); + BBTK_NAME("save_YZ_XZ_volume"); + BBTK_AUTHOR("InfoDev"); + BBTK_DESCRIPTION("No Description."); + BBTK_CATEGORY("empty"); + + BBTK_INPUT(save_YZ_XZ_volume,FileName,"File name",std::string,""); + BBTK_INPUT(save_YZ_XZ_volume,Compression,"(default false) Compression true/false",bool,""); + +//BBTK_OUTPUT(save_YZ_XZ_volume,Out,"First output",double,""); + +BBTK_END_DESCRIBE_BLACK_BOX(save_YZ_XZ_volume); +//===== +// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost) +//===== +} +// EO namespace bbcreaVtk + +#endif // __bbcreaVtksave_YZ_XZ_volume_h_INCLUDED__ + diff --git a/lib/creaVtk/vtkHausdorffDistancePointSetFilter.cxx b/lib/creaVtk/vtkHausdorffDistancePointSetFilter.cxx new file mode 100644 index 0000000..fde86bc --- /dev/null +++ b/lib/creaVtk/vtkHausdorffDistancePointSetFilter.cxx @@ -0,0 +1,269 @@ +/*========================================================================= + + Program: Visualization Toolkit + Module: vtkHausdorffDistancePointSetFilter.cxx + + Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen + All rights reserved. + See Copyright.txt or http://www.kitware.com/Copyright.htm for details. + + This software is distributed WITHOUT ANY WARRANTY; without even + the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR + PURPOSE. See the above copyright notice for more information. + +=========================================================================*/ +// Copyright (c) 2011 LTSI INSERM U642 +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without modification, +// are permitted provided that the following conditions are met: +// +// * Redistributions of source code must retain the above copyright notice, +// this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above copyright notice, +// this list of conditions and the following disclaimer in the documentation and/or +// other materials provided with the distribution. +// * Neither name of LTSI, INSERM nor the names +// of any contributors may be used to endorse or promote products derived from this +// software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS'' +// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +// DISCLAIMED. IN NO EVENT SHALL THE AUTHORS OR CONTRIBUTORS BE LIABLE FOR ANY +// DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +// ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +#include "vtkHausdorffDistancePointSetFilter.h" + +#include "vtkDoubleArray.h" +#include "vtkInformation.h" +#include "vtkInformationVector.h" +#include "vtkObjectFactory.h" +#include "vtkPointData.h" + +#include "vtkCellLocator.h" +#include "vtkGenericCell.h" +#include "vtkKdTreePointLocator.h" +#include "vtkPointSet.h" +#include "vtkSmartPointer.h" + +vtkStandardNewMacro(vtkHausdorffDistancePointSetFilter); + +//------------------------------------------------------------------------------ +vtkHausdorffDistancePointSetFilter::vtkHausdorffDistancePointSetFilter() +{ + this->RelativeDistance[0] = 0.0; + this->RelativeDistance[1] = 0.0; + this->HausdorffDistance = 0.0; + + this->SetNumberOfInputPorts(2); + this->SetNumberOfInputConnections(0, 1); + this->SetNumberOfInputConnections(1, 1); + + this->SetNumberOfOutputPorts(2); + + this->TargetDistanceMethod = POINT_TO_POINT; +} + +//------------------------------------------------------------------------------ +vtkHausdorffDistancePointSetFilter::~vtkHausdorffDistancePointSetFilter() = default; + +//------------------------------------------------------------------------------ +int vtkHausdorffDistancePointSetFilter::RequestData(vtkInformation* vtkNotUsed(request), + vtkInformationVector** inputVector, vtkInformationVector* outputVector) +{ + // Get the info objects + vtkInformation* inInfoA = inputVector[0]->GetInformationObject(0); + vtkInformation* inInfoB = inputVector[1]->GetInformationObject(0); + vtkInformation* outInfoA = outputVector->GetInformationObject(0); + vtkInformation* outInfoB = outputVector->GetInformationObject(1); + + if (inInfoA == nullptr || inInfoB == nullptr) + { + return 0; + } + + // Get the input + vtkPointSet* inputA = vtkPointSet::SafeDownCast(inInfoA->Get(vtkDataObject::DATA_OBJECT())); + vtkPointSet* inputB = vtkPointSet::SafeDownCast(inInfoB->Get(vtkDataObject::DATA_OBJECT())); + vtkPointSet* outputA = vtkPointSet::SafeDownCast(outInfoA->Get(vtkDataObject::DATA_OBJECT())); + vtkPointSet* outputB = vtkPointSet::SafeDownCast(outInfoB->Get(vtkDataObject::DATA_OBJECT())); + + if (inputA->GetNumberOfPoints() == 0 || inputB->GetNumberOfPoints() == 0) + { + return 0; + } + + // Re-initialize the distances + this->RelativeDistance[0] = 0.0; + this->RelativeDistance[1] = 0.0; + this->HausdorffDistance = 0.0; + + // TODO: using vtkStaticCellLocator, vtkStaticPointLocator is going to be much faster. + // Need to investigate and replace if appropriate. + vtkSmartPointer pointLocatorA = + vtkSmartPointer::New(); + vtkSmartPointer pointLocatorB = + vtkSmartPointer::New(); + + vtkSmartPointer cellLocatorA = vtkSmartPointer::New(); + vtkSmartPointer cellLocatorB = vtkSmartPointer::New(); + + if (this->TargetDistanceMethod == POINT_TO_POINT) + { + pointLocatorA->SetDataSet(inputA); + pointLocatorA->BuildLocator(); + pointLocatorB->SetDataSet(inputB); + pointLocatorB->BuildLocator(); + } + else + { + cellLocatorA->SetDataSet(inputA); + cellLocatorA->BuildLocator(); + cellLocatorB->SetDataSet(inputB); + cellLocatorB->BuildLocator(); + } + + double dist; + double currentPoint[3]; + double closestPoint[3]; + vtkIdType cellId; + vtkSmartPointer cell = vtkSmartPointer::New(); + int subId; + + vtkSmartPointer distanceAToB = vtkSmartPointer::New(); + distanceAToB->SetNumberOfComponents(1); + distanceAToB->SetNumberOfTuples(inputA->GetNumberOfPoints()); + distanceAToB->SetName("Distance"); + + vtkSmartPointer distanceBToA = vtkSmartPointer::New(); + distanceBToA->SetNumberOfComponents(1); + distanceBToA->SetNumberOfTuples(inputB->GetNumberOfPoints()); + distanceBToA->SetName("Distance"); + + // Find the nearest neighbors to each point and add edges between them, + // if they do not already exist and they are not self loops + for (int i = 0; i < inputA->GetNumberOfPoints(); i++) + { + inputA->GetPoint(i, currentPoint); + if (this->TargetDistanceMethod == POINT_TO_POINT) + { + vtkIdType closestPointId = pointLocatorB->FindClosestPoint(currentPoint); + inputB->GetPoint(closestPointId, closestPoint); + } + else + { + cellLocatorB->FindClosestPoint(currentPoint, closestPoint, cell, cellId, subId, dist); + } + + dist = std::sqrt(std::pow(currentPoint[0] - closestPoint[0], 2) + + std::pow(currentPoint[1] - closestPoint[1], 2) + + std::pow(currentPoint[2] - closestPoint[2], 2)); + distanceAToB->SetValue(i, dist); + + if (dist > this->RelativeDistance[0]) + { + this->RelativeDistance[0] = dist; + } + } + + for (int i = 0; i < inputB->GetNumberOfPoints(); i++) + { + inputB->GetPoint(i, currentPoint); + if (this->TargetDistanceMethod == POINT_TO_POINT) + { + vtkIdType closestPointId = pointLocatorA->FindClosestPoint(currentPoint); + inputA->GetPoint(closestPointId, closestPoint); + } + else + { + cellLocatorA->FindClosestPoint(currentPoint, closestPoint, cell, cellId, subId, dist); + } + + dist = std::sqrt(std::pow(currentPoint[0] - closestPoint[0], 2) + + std::pow(currentPoint[1] - closestPoint[1], 2) + + std::pow(currentPoint[2] - closestPoint[2], 2)); + distanceBToA->SetValue(i, dist); + + if (dist > this->RelativeDistance[1]) + { + this->RelativeDistance[1] = dist; + } + } + + if (this->RelativeDistance[0] >= RelativeDistance[1]) + { + this->HausdorffDistance = this->RelativeDistance[0]; + } + else + { + this->HausdorffDistance = this->RelativeDistance[1]; + } + + vtkSmartPointer relativeDistanceAtoB = vtkSmartPointer::New(); + relativeDistanceAtoB->SetNumberOfComponents(1); + relativeDistanceAtoB->SetName("RelativeDistanceAtoB"); + relativeDistanceAtoB->InsertNextValue(RelativeDistance[0]); + + vtkSmartPointer relativeDistanceBtoA = vtkSmartPointer::New(); + relativeDistanceBtoA->SetNumberOfComponents(1); + relativeDistanceBtoA->SetName("RelativeDistanceBtoA"); + relativeDistanceBtoA->InsertNextValue(RelativeDistance[1]); + + vtkSmartPointer hausdorffDistanceFieldDataA = + vtkSmartPointer::New(); + hausdorffDistanceFieldDataA->SetNumberOfComponents(1); + hausdorffDistanceFieldDataA->SetName("HausdorffDistance"); + hausdorffDistanceFieldDataA->InsertNextValue(HausdorffDistance); + + vtkSmartPointer hausdorffDistanceFieldDataB = + vtkSmartPointer::New(); + hausdorffDistanceFieldDataB->SetNumberOfComponents(1); + hausdorffDistanceFieldDataB->SetName("HausdorffDistance"); + hausdorffDistanceFieldDataB->InsertNextValue(HausdorffDistance); + + outputA->DeepCopy(inputA); + outputA->GetPointData()->AddArray(distanceAToB); + outputA->GetFieldData()->AddArray(relativeDistanceAtoB); + outputA->GetFieldData()->AddArray(hausdorffDistanceFieldDataA); + + outputB->DeepCopy(inputB); + outputB->GetPointData()->AddArray(distanceBToA); + outputB->GetFieldData()->AddArray(relativeDistanceBtoA); + outputB->GetFieldData()->AddArray(hausdorffDistanceFieldDataB); + + return 1; +} + +//------------------------------------------------------------------------------ +int vtkHausdorffDistancePointSetFilter::FillInputPortInformation(int port, vtkInformation* info) +{ + // The input should be two vtkPointsSets + if (port == 0) + { + info->Set(vtkAlgorithm::INPUT_REQUIRED_DATA_TYPE(), "vtkPointSet"); + return 1; + } + if (port == 1) + { + info->Set(vtkAlgorithm::INPUT_REQUIRED_DATA_TYPE(), "vtkPointSet"); + return 1; + } + return 0; +} + +//------------------------------------------------------------------------------ +void vtkHausdorffDistancePointSetFilter::PrintSelf(ostream& os, vtkIndent indent) +{ + this->Superclass::PrintSelf(os, indent); + os << indent << "HausdorffDistance: " << this->GetHausdorffDistance() << "\n"; + os << indent << "RelativeDistance: " << this->GetRelativeDistance()[0] << ", " + << this->GetRelativeDistance()[1] << "\n"; + os << indent << "TargetDistanceMethod: " << this->GetTargetDistanceMethodAsString() << "\n"; +} + diff --git a/lib/creaVtk/vtkHausdorffDistancePointSetFilter.h b/lib/creaVtk/vtkHausdorffDistancePointSetFilter.h new file mode 100644 index 0000000..7a922db --- /dev/null +++ b/lib/creaVtk/vtkHausdorffDistancePointSetFilter.h @@ -0,0 +1,145 @@ +/*========================================================================= + + Program: Visualization Toolkit + Module: vtkHausdorffDistancePointSetFilter.h + + Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen + All rights reserved. + See Copyright.txt or http://www.kitware.com/Copyright.htm for details. + + This software is distributed WITHOUT ANY WARRANTY; without even + the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR + PURPOSE. See the above copyright notice for more information. + +=========================================================================*/ +// Copyright (c) 2011 LTSI INSERM U642 +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without modification, +// are permitted provided that the following conditions are met: +// +// * Redistributions of source code must retain the above copyright notice, +// this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above copyright notice, +// this list of conditions and the following disclaimer in the documentation and/or +// other materials provided with the distribution. +// * Neither name of LTSI, INSERM nor the names +// of any contributors may be used to endorse or promote products derived from this +// software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS'' +// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +// DISCLAIMED. IN NO EVENT SHALL THE AUTHORS OR CONTRIBUTORS BE LIABLE FOR ANY +// DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +// ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +/** @class vtkHausdorffDistancePointSetFilter + * @brief Compute Hausdorff distance between two point sets + * + * This class computes the relative and hausdorff distances from two point + * sets (input port 0 and input port 1). If no topology is specified (ie. + * vtkPointSet or vtkPolyData without vtkPolys), the distances are + * computed between point location. If polys exist (ie triangulation), + * the TargetDistanceMethod allows for an interpolation of the cells to + * ensure a better minimal distance exploration. + * + * The outputs (port 0 and 1) have the same geometry and topology as its + * respective input port. Two FieldData arrays are added : HausdorffDistance + * and RelativeDistance. The former is equal on both outputs whereas the + * latter may differ. A PointData containing the specific point minimal + * distance is also added to both outputs. + * + * @author Frederic Commandeur + * @author Jerome Velut + * @author LTSI + * + * @see https://www.vtkjournal.org/browse/publication/839 + */ + +#ifndef vtkHausdorffDistancePointSetFilter_h +#define vtkHausdorffDistancePointSetFilter_h + +#include "vtkFiltersModelingModule.h" // For export macro +#include "vtkPointSetAlgorithm.h" + +class /*VTKFILTERSMODELING_EXPORT */ vtkHausdorffDistancePointSetFilter : public vtkPointSetAlgorithm +{ +public: + ///@{ + /** + * Standard methods for construction, type and printing. + */ + static vtkHausdorffDistancePointSetFilter* New(); + vtkTypeMacro(vtkHausdorffDistancePointSetFilter, vtkPointSetAlgorithm); + void PrintSelf(ostream& os, vtkIndent indent) override; + ///@} + + ///@{ + /** + * Get the Relative Distance from A to B and B to A. + */ + vtkGetVector2Macro(RelativeDistance, double); + ///@} + + ///@{ + /** + * Get the Hausdorff Distance. + */ + vtkGetMacro(HausdorffDistance, double); + ///@} + + enum DistanceMethod + { + POINT_TO_POINT, + POINT_TO_CELL + }; + + ///@{ + /** + * Specify the strategy for computing the distance. If no topology is specified (ie. + * vtkPointSet or vtkPolyData without vtkPolys), the distances are + * computed between point location. If polys exist (i.e. triangulation), + * the TargetDistanceMethod allows for an interpolation of the cells to + * ensure a better minimal distance exploration. + * + */ + vtkSetMacro(TargetDistanceMethod, int); + vtkGetMacro(TargetDistanceMethod, int); + void SetTargetDistanceMethodToPointToPoint() { this->SetTargetDistanceMethod(POINT_TO_POINT); } + void SetTargetDistanceMethodToPointToCell() { this->SetTargetDistanceMethod(POINT_TO_CELL); } + const char* GetTargetDistanceMethodAsString(); + ///@} + +protected: + vtkHausdorffDistancePointSetFilter(); + ~vtkHausdorffDistancePointSetFilter() override; + + int RequestData(vtkInformation*, vtkInformationVector**, vtkInformationVector*) override; + int FillInputPortInformation(int port, vtkInformation* info) override; + + int TargetDistanceMethod; //!< point-to-point if 0, point-to-cell if 1 + double RelativeDistance[2]; //!< relative distance between inputs + double HausdorffDistance; //!< hausdorff distance (max(relative distance)) + +private: + vtkHausdorffDistancePointSetFilter(const vtkHausdorffDistancePointSetFilter&) = delete; + void operator=(const vtkHausdorffDistancePointSetFilter&) = delete; +}; +inline const char* vtkHausdorffDistancePointSetFilter::GetTargetDistanceMethodAsString() +{ + if (this->TargetDistanceMethod == POINT_TO_POINT) + { + return "PointToPoint"; + } + else + { + return "PointToCell"; + } +} +#endif + diff --git a/lib/creaVtk/vtkImageDataStrucPoints.cpp b/lib/creaVtk/vtkImageDataStrucPoints.cpp index 1299cdc..79c9fb6 100644 --- a/lib/creaVtk/vtkImageDataStrucPoints.cpp +++ b/lib/creaVtk/vtkImageDataStrucPoints.cpp @@ -31,101 +31,128 @@ vtkImageDataStrucPoints::vtkImageDataStrucPoints() { + _structuredPoints=NULL; } vtkImageDataStrucPoints::~vtkImageDataStrucPoints() { } -void vtkImageDataStrucPoints::joinComponents(vtkImageData* imageX, vtkImageData* imageY, vtkImageData* imageZ) -{ - int ext[6]; - imageY->Modified(); -//EED 2017-01-01 Migration VTK7 -#if VTK_MAJOR_VERSION <= 5 - imageY->Update(); - imageY->GetWholeExtent(ext); -#else - imageY->GetExtent(ext); -#endif - int dim[3]; - double spc[3]; - dim[0]=ext[1]-ext[0]+1; - dim[1]=ext[3]-ext[2]+1; - dim[2]=ext[5]-ext[4]+1; - std::cout<<"dim "<< dim[0] <<" "<< dim[1] <<" "<< dim[2] <GetSpacing(spc); - - - double *ptrX = (double *)imageX->GetScalarPointer(); - double *ptrY = (double *)imageY->GetScalarPointer(); - double *ptrZ = (double *)imageZ->GetScalarPointer(); - - long int sizeimage = dim[0]*dim[1]*dim[2]; - - vtkDoubleArray *array = vtkDoubleArray::New(); - array->SetNumberOfTuples(sizeimage); - array->SetNumberOfComponents(3); - array->Allocate(sizeimage*3, 100 ); // ??? - array->SetName("velocity"); - - double vx; - double vy; - double vz; - - int i; - -printf("EED vtkImageDataStrucPoints::joinComponents sizeimage %d\n", sizeimage ); - for( i = 0 ; i < sizeimage ; i++ ) - { - vx = *ptrX; - vy = *ptrY; - vz = *ptrZ; - ptrX++; - ptrY++; - ptrZ++; - array->SetTuple3(i,vx, vy , vz ); - } // for i - - _structuredPoints = vtkStructuredPoints::New(); - _structuredPoints->SetDimensions(dim[0], dim[1], dim[2]); - _structuredPoints->SetSpacing(spc); - -//EED 2017-01-01 Migration VTK7 -#if VTK_MAJOR_VERSION <= 5 - _structuredPoints->SetScalarTypeToDouble(); - _structuredPoints->SetNumberOfScalarComponents(3); -#else - vtkInformation* info=_structuredPoints->GetInformation(); - vtkDataObject::SetPointDataActiveScalarInfo(info, VTK_DOUBLE, 3); - -#endif - - _structuredPoints->GetPointData()->SetVectors(array); - _structuredPoints->GetPointData()->SetNumberOfTuples(sizeimage); - _structuredPoints->Modified(); -//EED 2017-01-01 Migration VTK7 -#if VTK_MAJOR_VERSION <= 5 - _structuredPoints->Update(); -#else - //... -#endif - -/* - _structuredPoints->Print(cout); - vtkStructuredPointsWriter *writer2 = vtkStructuredPointsWriter::New(); - writer2->SetFileName("/home/davila/tmp/VectorfromCal_EED_ups.vtk"); - //writer->SetFileTypeToBinary(); - writer2->SetFileTypeToASCII(); - writer2->SetTensorsName("VectorfromCal"); - writer2->SetFieldDataName("GlyphVector"); - writer2->SetScalarsName("Scalar"); - writer2->SetInput(_structuredPoints); - writer2->Write(); -*/ - - +void vtkImageDataStrucPoints::joinComponents(vtkImageData* imageX, vtkImageData* imageY, vtkImageData* imageZ, + vtkImageData* Data1, vtkImageData* Data2, vtkImageData* Data3 , + vtkImageData* Data4, vtkImageData* Data5, vtkImageData* Data6 ) +{ + if ((imageX!=NULL) && (imageY!=NULL) && (imageZ!=NULL) ) + { + int ext[6]; + imageY->Modified(); + //EED 2017-01-01 Migration VTK7 + #if VTK_MAJOR_VERSION <= 5 + imageY->Update(); + imageY->GetWholeExtent(ext); + #else + imageY->GetExtent(ext); + #endif + int dim[3]; + double spc[3]; + dim[0]=ext[1]-ext[0]+1; + dim[1]=ext[3]-ext[2]+1; + dim[2]=ext[5]-ext[4]+1; + imageY->GetSpacing(spc); + double *ptrX=NULL, *ptrY=NULL, *ptrZ=NULL; + double *ptrD1=NULL, *ptrD2=NULL, *ptrD3=NULL, *ptrD4=NULL, *ptrD5=NULL, *ptrD6=NULL; + if (imageX!=NULL) ptrX = (double *)imageX->GetScalarPointer(); + if (imageY!=NULL) ptrY = (double *)imageY->GetScalarPointer(); + if (imageZ!=NULL) ptrZ = (double *)imageZ->GetScalarPointer(); + if (Data1 !=NULL) ptrD1 = (double *)Data1->GetScalarPointer(); + if (Data2 !=NULL) ptrD2 = (double *)Data2->GetScalarPointer(); + if (Data3 !=NULL) ptrD3 = (double *)Data3->GetScalarPointer(); + if (Data4 !=NULL) ptrD4 = (double *)Data4->GetScalarPointer(); + if (Data5 !=NULL) ptrD5 = (double *)Data5->GetScalarPointer(); + if (Data6 !=NULL) ptrD6 = (double *)Data6->GetScalarPointer(); + long int sizeimage = dim[0]*dim[1]*dim[2]; + int components=3; + // if ((Data1!=NULL) && (Data2==NULL) && (Data3==NULL) && (Data4==NULL) && (Data5==NULL) && (Data6==NULL) ) { components=4; } + // if ((Data1!=NULL) && (Data2!=NULL) && (Data3!=NULL) && (Data4==NULL) && (Data5==NULL) && (Data6==NULL) ) { components=6; } + // if ((Data1!=NULL) && (Data2!=NULL) && (Data3!=NULL) && (Data4!=NULL) && (Data5!=NULL) && (Data6!=NULL) ) { components=9; } + vtkDoubleArray *array = vtkDoubleArray::New(); + array->SetNumberOfTuples(sizeimage); + array->SetNumberOfComponents(components); + array->Allocate(sizeimage*components, 100 ); // ??? + array->SetName("velocity"); + + vtkDoubleArray *array2 = vtkDoubleArray::New(); + array2->SetNumberOfTuples(sizeimage); + array2->SetNumberOfComponents(1); + array2->Allocate(sizeimage*1, 100 ); // ??? + array2->SetName("angle"); + printf("EED Warnning .... vtkImageDataStrucPoints::joinComponents Limpiar este codigo ........ \n"); + printf("EED Warnning .... vtkImageDataStrucPoints::joinComponents Limpiar este codigo ........ \n"); + printf("EED Warnning .... vtkImageDataStrucPoints::joinComponents Limpiar este codigo ........ \n"); + printf("EED Warnning .... vtkImageDataStrucPoints::joinComponents Limpiar este codigo ........ \n"); + printf("EED Warnning .... vtkImageDataStrucPoints::joinComponents Limpiar este codigo ........ \n"); + printf("EED Warnning .... vtkImageDataStrucPoints::joinComponents Limpiar este codigo ........ \n"); + double vx,vy,vz,d1=0,d2=0,d3=0,d4=0,d5=0,d6=0; + int i; + for( i = 0 ; i < sizeimage ; i++ ) + { + if (ptrX !=NULL) { vx = *ptrX; ptrX++; } else { vx=0; } + if (ptrY !=NULL) { vy = *ptrY; ptrY++; } else { vy=0; } + if (ptrZ !=NULL) { vz = *ptrZ; ptrZ++; } else { vz=0; } + if (ptrD1!=NULL) { d1 = *ptrD1; ptrD1++;} + if (ptrD2!=NULL) { d2 = *ptrD2; ptrD2++;} + if (ptrD3!=NULL) { d3 = *ptrD3; ptrD3++;} + if (ptrD4!=NULL) { d4 = *ptrD4; ptrD4++;} + + if (components==3) { array->SetTuple3(i,vx,vy,vz); } + if (components==3) { array2->SetTuple1(i,d1); } + // if (components==4) { array->SetTuple4(i,vx,vy,vz,d1); } + // if (components==6) { array->SetTuple6(i,vx,vy,vz,d1,d2,d3); } + // if (components==9) { array->SetTuple9(i,vx,vy,vz,d1,d2,d3,d4,d5,d6); } + } // for i + + _structuredPoints = vtkStructuredPoints::New(); + _structuredPoints->SetDimensions(dim[0], dim[1], dim[2]); + _structuredPoints->SetSpacing(spc); + + //EED 2017-01-01 Migration VTK7 + #if VTK_MAJOR_VERSION <= 5 + _structuredPoints->SetScalarTypeToDouble(); + _structuredPoints->SetNumberOfScalarComponents(3); + #else + vtkInformation* info=_structuredPoints->GetInformation(); + vtkDataObject::SetPointDataActiveScalarInfo(info, VTK_DOUBLE, 3); + + #endif + + _structuredPoints->GetPointData()->SetVectors(array); + _structuredPoints->GetPointData()->AddArray(array2); + _structuredPoints->GetPointData()->SetNumberOfTuples(sizeimage); + _structuredPoints->Modified(); + //EED 2017-01-01 Migration VTK7 + #if VTK_MAJOR_VERSION <= 5 + _structuredPoints->Update(); + #else + //... + #endif + + /* + _structuredPoints->Print(cout); + vtkStructuredPointsWriter *writer2 = vtkStructuredPointsWriter::New(); + writer2->SetFileName("/home/davila/tmp/VectorfromCal_EED_ups.vtk"); + //writer->SetFileTypeToBinary(); + writer2->SetFileTypeToASCII(); + writer2->SetTensorsName("VectorfromCal"); + writer2->SetFieldDataName("GlyphVector"); + writer2->SetScalarsName("Scalar"); + writer2->SetInput(_structuredPoints); + writer2->Write(); + */ + + } else { + printf("EED Warnning! vtkImageDataStrucPoints::joinComponents imageX or image Y or image Z is EMPTY\n"); + _structuredPoints=NULL; + } // imageX imageY imageZ } vtkStructuredPoints* vtkImageDataStrucPoints::getStructuredPoints() diff --git a/lib/creaVtk/vtkImageDataStrucPoints.h b/lib/creaVtk/vtkImageDataStrucPoints.h index d5dd52c..e7642e9 100644 --- a/lib/creaVtk/vtkImageDataStrucPoints.h +++ b/lib/creaVtk/vtkImageDataStrucPoints.h @@ -39,7 +39,9 @@ class vtkImageDataStrucPoints public : vtkImageDataStrucPoints(); ~vtkImageDataStrucPoints(); - void joinComponents(vtkImageData* imageX, vtkImageData* imageY, vtkImageData* imageZ); + void joinComponents(vtkImageData* imageX, vtkImageData* imageY, vtkImageData* imageZ, + vtkImageData* Data1, vtkImageData* Data2, vtkImageData* Data3, + vtkImageData* Data4 , vtkImageData* Data5 , vtkImageData* Data6 ); vtkStructuredPoints* getStructuredPoints(); vtkStructuredPoints* _structuredPoints; diff --git a/lib/creaVtk/vtkTensorsVisu.cpp b/lib/creaVtk/vtkTensorsVisu.cpp index f96e104..182f1d7 100644 --- a/lib/creaVtk/vtkTensorsVisu.cpp +++ b/lib/creaVtk/vtkTensorsVisu.cpp @@ -37,7 +37,9 @@ vtkTensorsVisu::vtkTensorsVisu() : vtkVectorsTensorsVisuBase() ss = vtkSphereSource::New(); superquadratic = vtkSuperquadricSource::New(); cs = vtkCubeSource::New(); - tg = vtkTensorGlyph::New(); + + tg = NULL; + pdn = vtkPolyDataNormals::New(); pd = vtkPolyData::New(); pod = vtkPointData::New(); @@ -56,6 +58,8 @@ void vtkTensorsVisu::Process() { if(GetTypeForm()==2) // source superquadratic { + if (tg==NULL) { tg = vtkTensorGlyph::New(); } + superquadratic->SetThetaResolution(20); superquadratic->SetPhiResolution(20); #if VTK_MAJOR_VERSION <= 5 diff --git a/lib/creaVtk/vtkVectorsTensorsVisuBase.cpp b/lib/creaVtk/vtkVectorsTensorsVisuBase.cpp index 3d7c20b..9c53d97 100644 --- a/lib/creaVtk/vtkVectorsTensorsVisuBase.cpp +++ b/lib/creaVtk/vtkVectorsTensorsVisuBase.cpp @@ -105,41 +105,24 @@ void vtkLookupTableMapDirVectorEED(vtkLookupTableDirectionVector *self, T *input int inIncr, int outFormat) { double tmp,sum; -// double *mag; int i, j; double dirx,diry,dirz; - - -inIncr=3; - printf("EED length %d %p\n", length,input); -// mag = new double[length]; + double angle; for (i = 0; i < length; ++i) { - dirx = 0; - diry = 0; - dirz = 0; - sum = 0; - for (j = 0; j < inIncr; ++j) - { - if (j==0) dirx= static_cast(*input); - if (j==1) diry= static_cast(*input); - if (j==2) dirz= static_cast(*input); - tmp = static_cast(*input); - sum += (tmp * tmp); - ++input; - } - sum=sqrt(sum); - *output++ = (unsigned char) abs( (255*dirx/sum) ); - *output++ = (unsigned char) abs( (255*diry/sum) ); - *output++ = (unsigned char) abs( (255*dirz/sum) ); - *output++ = 255; -// printf("%d %d %d ",(int)(255*dirx/sum),(int)(255*diry/sum),(int)(255*dirz/sum)); -// printf(" C %d %f %f %f \n",inIncr,dirx,diry,dirz); - } - -// vtkLookupTableMapData(self, mag, output, length, 1, outFormat); - -// delete [] mag; + dirx = static_cast(input[0]); + diry = static_cast(input[1]); + dirz = static_cast(input[2]); + input = input+inIncr; + sum = sqrt( dirx*dirx + diry*diry + dirz*dirz ); + *output++ = (unsigned char) abs( (255*dirx/sum) ); + *output++ = (unsigned char) abs( (255*diry/sum) ); + *output++ = (unsigned char) abs( (255*dirz/sum) ); + *output++ = 255; + // printf("%d %d %d ",(int)(255*dirx/sum),(int)(255*diry/sum),(int)(255*dirz/sum)); + // printf(" C %d %f %f %f \n",inIncr,dirx,diry,dirz); + + } // for } @@ -151,7 +134,6 @@ void vtkLookupTableDirectionVector::MapScalarsThroughTable2(void *input, int inputIncrement, int outputFormat) { - printf("vtkLookupTableEED::MapScalarsThroughTable2 inputIncrement=%d inputDataType=%d\n",inputIncrement,inputDataType); // if (this->UseMagnitude && inputIncrement > 1) // { switch (inputDataType) @@ -194,8 +176,10 @@ vtkVectorsTensorsVisuBase::vtkVectorsTensorsVisuBase() _dataobject = NULL; _renderer = NULL; _typeForm = 0; + _orientation = 0; - _LutEED = vtkLookupTableDirectionVector::New(); + _LutEED = vtkLookupTableDirectionVector::New(); + _externalLut = NULL; //_LutEED->SetVectorMode(0); //_LutEED->SetVectorModeToMagnitude(); //_LutEED->SetVectorModeToComponent(); @@ -299,7 +283,6 @@ void vtkVectorsTensorsVisuBase::Process() // virtual //------------------------------------------------------------------------------ void vtkVectorsTensorsVisuBase::VisibilityActor() { - if ( (_active==true) && (_actorAdded==false) ){ if (GetRenderer()!=NULL) { @@ -338,4 +321,21 @@ void vtkVectorsTensorsVisuBase::SetColor(std::vector rgb) } } +//------------------------------------------------------------------------------ +void vtkVectorsTensorsVisuBase::SetOrientation(int orientation) +{ + _orientation = orientation; +} + +//------------------------------------------------------------------------------ +int vtkVectorsTensorsVisuBase::GetOrientation() +{ + return _orientation; +} + +//------------------------------------------------------------------------------ +void vtkVectorsTensorsVisuBase::SetExternalLut(vtkScalarsToColors* lut) +{ + _externalLut=lut; +} diff --git a/lib/creaVtk/vtkVectorsTensorsVisuBase.h b/lib/creaVtk/vtkVectorsTensorsVisuBase.h index 831fc2c..7d08c22 100644 --- a/lib/creaVtk/vtkVectorsTensorsVisuBase.h +++ b/lib/creaVtk/vtkVectorsTensorsVisuBase.h @@ -96,6 +96,8 @@ public : void SetTypeForm(int); void SetColorLaw(int); void SetColor(std::vector); + void SetOrientation(int orientation); + void SetExternalLut(vtkScalarsToColors* lut); bool GetActive(); vtkDataObject* GetDataObject(); @@ -104,6 +106,7 @@ public : double GetOpacity(); vtkProp3D* GetProp3D(); int GetTypeForm(); + int GetOrientation(); virtual void Process(); void VisibilityActor(); @@ -126,6 +129,7 @@ private: vtkDataObject *_dataobject; vtkRenderer *_renderer; int _typeForm; + int _orientation; protected: bool _firsttime; @@ -133,6 +137,8 @@ protected: vtkSmartPointer _pdm; vtkSmartPointer _actor; vtkLookupTableDirectionVector *_LutEED; + vtkScalarsToColors *_externalLut; // lookuptable + int _colorlaw; double _colorR,_colorG,_colorB; }; diff --git a/lib/creaVtk/vtkVectorsVisu.cpp b/lib/creaVtk/vtkVectorsVisu.cpp index 7fe9861..51392f7 100644 --- a/lib/creaVtk/vtkVectorsVisu.cpp +++ b/lib/creaVtk/vtkVectorsVisu.cpp @@ -31,26 +31,66 @@ //Borrame #include "vtkPointData.h" +#include "vtkArrayData.h" +#include "vtkDataObject.h" +#include +#include //------------------------------------------------------------------------------ vtkVectorsVisu::vtkVectorsVisu() :vtkVectorsTensorsVisuBase() { - _vtkarrowsource = vtkArrowSource::New(); - _vtkglyph = vtkGlyph3D::New(); - _vtklinesource = vtkLineSource::New(); + _vtkarrowsource = vtkArrowSource::New(); + _vtkglyph = NULL; + _vtklineGlyphPolyData = NULL; + _trans = vtkTransform ::New(); + double sizeCross = 0.05; + double point1[3]; double point2[3]; - point1[0]=1; - point1[1]=0; - point1[2]=0; - point2[0]=-1; - point2[1]=0; - point2[2]=0; - _vtklinesource->SetPoint1( point1 ); - _vtklinesource->SetPoint2( point2 ); + + point1[0] = 1; + point1[1] = 0; + point1[2] = 0; + point2[0] = -1; + point2[1] = 0; + point2[2] = 0; + vtkLineSource *vtklinesource1 = vtkLineSource ::New(); + vtklinesource1->SetPoint1( point1 ); + vtklinesource1->SetPoint2( point2 ); + vtklinesource1->Update(); + + point1[0] = 0; + point1[1] = sizeCross; + point1[2] = 0; + point2[0] = 0; + point2[1] = -sizeCross; + point2[2] = 0; + vtkLineSource *vtklinesource2 = vtkLineSource ::New(); + vtklinesource2->SetPoint1( point1 ); + vtklinesource2->SetPoint2( point2 ); + vtklinesource2->Update(); + + point1[0] = 0; + point1[1] = 0; + point1[2] = sizeCross; + point2[0] = 0; + point2[1] = 0; + point2[2] = -sizeCross; + vtkLineSource *vtklinesource3 = vtkLineSource ::New(); + vtklinesource3->SetPoint1( point1 ); + vtklinesource3->SetPoint2( point2 ); + vtklinesource3->Update(); + + + vtkAppendPolyData *appendPolyData = vtkAppendPolyData::New(); + appendPolyData->AddInputData( vtklinesource1->GetOutput() ); + appendPolyData->AddInputData( vtklinesource2->GetOutput() ); + appendPolyData->AddInputData( vtklinesource3->GetOutput() ); + appendPolyData->Update(); + _vtklineGlyphPolyData = appendPolyData->GetOutput(); } //------------------------------------------------------------------------------ @@ -62,50 +102,167 @@ vtkVectorsVisu::~vtkVectorsVisu() //------------------------------------------------------------------------------ void vtkVectorsVisu::Process() { + if (_vtkglyph==NULL) + { + if (GetOrientation()==-1) + { + _vtkglyph = vtkGlyph3D::New(); + } // _orientation + if ((GetOrientation()>=0) && (GetOrientation()<=2)) + { + _vtkglyph = vtkGlyph3D::New(); +// _vtkglyph = vtkGlyph2D::New(); + } // _orientation + } // _vtkglyph NULL + + if(_active==true) { -#if VTK_MAJOR_VERSION <= 5 - _vtkglyph->SetInput( GetDataObject() ); -#else - _vtkglyph->SetInputData( GetDataObject() ); -#endif - if(GetTypeForm()==1) // source Arrow + + if (GetDataObject()!=NULL) + { + #if VTK_MAJOR_VERSION <= 5 + _vtkglyph->SetInput( GetDataObject() ); + #else + _vtkglyph->SetInputData( GetDataObject() ); + #endif + if(GetTypeForm()==1) // source Arrow + { + #if VTK_MAJOR_VERSION <= 5 + _vtkglyph->SetSource( _vtkarrowsource->GetOutput() ); + #else + _vtkarrowsource->Update(); + _vtkglyph->SetSourceData( _vtkarrowsource->GetOutput() ); + #endif + } else { // source Line + #if VTK_MAJOR_VERSION <= 5 + _vtkglyph->SetSource( _vtklineGlyphPolyData ); + #else + _vtkglyph->SetSourceData( _vtklineGlyphPolyData ); + #endif + } + _vtkglyph->SetScaleModeToScaleByVector(); + + + if (_externalLut==NULL) { -#if VTK_MAJOR_VERSION <= 5 - _vtkglyph->SetSource( _vtkarrowsource->GetOutput() ); -#else - _vtkarrowsource->Update(); - _vtkglyph->SetSourceData( _vtkarrowsource->GetOutput() ); -#endif - } else { // source Line -#if VTK_MAJOR_VERSION <= 5 - _vtkglyph->SetSource( _vtklinesource->GetOutput() ); -#else - _vtklinesource->Update(); - _vtkglyph->SetSourceData( _vtklinesource->GetOutput() ); -#endif - } - _vtkglyph->SetScaleModeToScaleByVector(); - _vtkglyph->SetColorModeToColorByVector(); - _vtkglyph->SetScaleFactor( GetScaleFactor() ); - _vtkglyph->Update(); + _vtkglyph->SetColorModeToColorByVector(); + } else { + _vtkglyph->SetColorModeToColorByScalar(); + } // if _externalLut -#if VTK_MAJOR_VERSION <= 5 - _pdm->SetInput( _vtkglyph->GetOutput()); -#else - _pdm->SetInputData( _vtkglyph->GetOutput()); -#endif + _vtkglyph->SetScaleFactor( GetScaleFactor() ); + _vtkglyph->Update(); -vtkPointData *data = _vtkglyph->GetOutput()->GetPointData(); -//printf("EED -------------------------------------------\n"); -//_vtkglyph->GetOutput()->Print(std::cout); -//printf("EED -------------------------------------------\n"); -//data->Print(std::cout); -int i,sizeDa = data->GetNumberOfArrays(); -for (i=0;iGetArray(i)->Print(std::cout); -} + #if VTK_MAJOR_VERSION <= 5 + _pdm->SetInput( _vtkglyph->GetOutput()); + #else + _pdm->SetInputData( _vtkglyph->GetOutput()); + #endif + + vtkPointData *data = _vtkglyph->GetOutput()->GetPointData(); + //printf("EED -------------------------------------------\n"); + //_vtkglyph->GetOutput()->Print(std::cout); + //printf("EED -------------------------------------------\n"); + //data->Print(std::cout); + //int i,sizeDa = data->GetNumberOfArrays(); + //for (i=0;iGetArray(i)->Print(std::cout); + //} + + if (_externalLut==NULL) + { + _pdm->ScalarVisibilityOn(); + _pdm->SetColorModeToMapScalars(); + // _pdm->SetColorModeToDefault(); + // _pdm->SetColorModeToDirectScalars(); // NOT compile + _pdm->SetScalarModeToUsePointFieldData(); + // _pdm->ImmediateModeRenderingOn(); // obsolete + _LutEED->SetVectorModeToComponent(); + //_LutEED->SetVectorModeToRGBColors(); + //_LutEED->SetVectorModeToMagnitud(); + // _pdm->SetScalarModeToUsePointFieldData(); + _pdm->SetLookupTable( _LutEED ); + _pdm->SelectColorArray( "GlyphVector" ); + } else { + data->SetActiveScalars("angle"); + + _pdm->ScalarVisibilityOn(); + double scalarRange[2]; + scalarRange[0]=0; + scalarRange[1]=40; + printf("EED warnnning ..... vtkVectorsVisu::Process clean scalar Range ......\n"); + printf("EED warnnning ..... vtkVectorsVisu::Process clean scalar Range ......\n"); + printf("EED warnnning ..... vtkVectorsVisu::Process clean scalar Range ......\n"); + printf("EED warnnning ..... vtkVectorsVisu::Process clean scalar Range ......\n"); + printf("EED warnnning ..... vtkVectorsVisu::Process clean scalar Range ......\n"); + _pdm->SetScalarRange(scalarRange); + _pdm->SetColorModeToMapScalars(); + // _pdm->SetColorModeToDefault(); + // _pdm->SetColorModeToDirectScalars(); // NOT compile + // _pdm->SetScalarModeToUsePointFieldData(); +// _pdm->ImmediateModeRenderingOn(); // obsolete + _pdm->SetLookupTable( _externalLut ); + _pdm->SelectColorArray( "angle" ); + } // if _externalLut + + printf("EED warnnning ..... vtkVectorsVisu::Process Clean angle ......\n"); + printf("EED warnnning ..... vtkVectorsVisu::Process Clean angle ......\n"); + printf("EED warnnning ..... vtkVectorsVisu::Process Clean angle ......\n"); + printf("EED warnnning ..... vtkVectorsVisu::Process Clean angle ......\n"); + printf("EED warnnning ..... vtkVectorsVisu::Process Clean angle ......\n"); + + /* + _vtkglyph->Update(); + vtkPointData *pointdata=_vtkglyph->GetOutput()->GetPointData(); + int i,size=pointdata->GetNumberOfArrays(); + for (i=0;iGetArray(i); + printf(" vtkVectorsVisu::Process array name %d:<%s> size:%d\n", i, array->GetName(), array->GetSize() ); + } + */ + + + // vSliceMapperVec->SetLookupTable( vGreenToRedLut ); + // vSliceMapperVec->SetColorModeToMapScalars(); + + #if VTK_MAJOR_VERSION <= 5 + // .. + #else + _pdm->Update(); + #endif + + // Orientation -1 3D OK + + // Orientation 0 2D yz + if (GetOrientation()==0) + { + _trans->Identity(); + _trans->Translate(900,0,0); + _actor->SetUserTransform(_trans); + } + // Orientation 1 2D xz + if (GetOrientation()==1) + { + _trans->Identity(); + _trans->Translate(0,-900,0); + _actor->SetUserTransform(_trans); + } + // Orientation 2 2D xy + if (GetOrientation()==2) + { + _trans->Identity(); + _trans->Translate(0,0,-900); + _actor->SetUserTransform(_trans); + } + + _actor->SetMapper( _pdm ); + _actor->GetProperty()->SetOpacity( GetOpacity() ); + } else { + printf("EED Warnning! vtkVectorsVisu::Process GetDataObject() is EMPTY\n"); + }// if GetDataObject()!=NULL _pdm->ScalarVisibilityOn(); _pdm->SetColorModeToMapScalars(); @@ -134,7 +291,10 @@ for (i=0;iSetMapper( _pdm ); _actor->GetProperty()->SetOpacity( GetOpacity() ); - }// if _active + } else { + _vtkglyph->SetInputData( NULL ); + _vtkglyph->Update(); + }// if _active VisibilityActor(); } diff --git a/lib/creaVtk/vtkVectorsVisu.h b/lib/creaVtk/vtkVectorsVisu.h index 8fe751f..c9a34b0 100644 --- a/lib/creaVtk/vtkVectorsVisu.h +++ b/lib/creaVtk/vtkVectorsVisu.h @@ -32,8 +32,12 @@ #include "vtkArrowSource.h" #include "vtkLineSource.h" + #include "vtkGlyph3D.h" +#include "vtkGlyph2D.h" +#include + //--------------------------------------------- // Class Name: vtkVectorsVisu // [classdescription] @@ -51,7 +55,6 @@ public : virtual void Process(); - //--Method template---------------------------- // void FunctionName(int& parameterA); @@ -67,8 +70,9 @@ protected: //--------------------------------------------- private: vtkArrowSource *_vtkarrowsource; - vtkLineSource *_vtklinesource; - vtkGlyph3D *_vtkglyph; + vtkPolyData *_vtklineGlyphPolyData; + vtkGlyph3D *_vtkglyph; + vtkTransform *_trans; }; //-end of _vtkVectorsVISU_H_------------------------------------------------------