From: Eduardo DAVILA Date: Thu, 24 Aug 2017 20:04:03 +0000 (+0200) Subject: #3110 creaVtk Bug New Normal - branch vtk7itk4 compilation with vtk7 X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=commitdiff_plain;h=33a2fbec2921c504fd037bdcfd4f156cca8ee118;p=creaVtk.git #3110 creaVtk Bug New Normal - branch vtk7itk4 compilation with vtk7 --- diff --git a/bbtk_creaVtk_PKG/bbs/appli/exampleSlab-Widget-01.bbg b/bbtk_creaVtk_PKG/bbs/appli/exampleSlab-Widget-01.bbg new file mode 100644 index 0000000..d6aaac5 --- /dev/null +++ b/bbtk_creaVtk_PKG/bbs/appli/exampleSlab-Widget-01.bbg @@ -0,0 +1,127 @@ +# ---------------------------------- +# - BBTKGEditor v 1.4 BBG BlackBox Diagram file +# - /tmpEED/creaTools2/creatools_source/creaVtk/bbtk_creaVtk_PKG/bbs/appli/exampleSlab-Widget-01.bbg +# ---------------------------------- + +APP_START +CATEGORY: +DESCRIPTION:Description ?? +AUTHOR:Author ?? +COMPLEXBOX:FALSE +COMPLEXINPUTS:0 +BOXES:10 +BOX +creaVtk:Slab-Widget-01:Box01 +ISEXEC:FALSE +-34.489424:13.362700:-900.000000 +6.760576:3.362700:-900.000000 +FIN_BOX +BOX +std:FilesFromDirectory:Box02 +ISEXEC:FALSE +-36.840080:44.404203:-900.000000 +7.034920:34.404203:-900.000000 +FIN_BOX +BOX +std:Configuration:Box03 +ISEXEC:FALSE +-23.672903:80.263749:-900.000000 +15.752097:70.263749:-900.000000 +FIN_BOX +BOX +std:ConcatStrings:Box04 +ISEXEC:FALSE +-27.314889:63.454587:-900.000000 +12.410111:53.454587:-900.000000 +PORT +In10:"/gdcmvtk/dicom01" +FIN_BOX +BOX +creaMaracasVisu:ViewerNV:Box05 +ISEXEC:FALSE +-18.350002:-19.470613:-900.000000 +17.524998:-29.470613:-900.000000 +FIN_BOX +BOX +wx:LayoutSplit:Box06 +ISEXEC:TRUE +-36.559928:-67.656878:-900.000000 +0.115072:-77.656878:-900.000000 +PORT +Orientation:"H" +FIN_BOX +BOX +wx:LayoutTab:Box07 +ISEXEC:FALSE +-4.342367:-42.162982:-900.000000 +31.907633:-52.162982:-900.000000 +FIN_BOX +BOX +creaMaracasVisu:ViewerNV:Box08 +ISEXEC:FALSE +49.275957:-18.801149:-900.000000 +85.150957:-28.801149:-900.000000 +FIN_BOX +BOX +wx:Slider:Box09 +ISEXEC:FALSE +34.879012:44.964509:-900.000000 +86.279012:34.964509:-900.000000 +PORT +Max:"100" +PORT +ReactiveOnTrack:"true" +FIN_BOX +BOX +wx:LayoutLine:Box10 +ISEXEC:FALSE +-70.738557:-23.392751:-900.000000 +-13.178557:-33.392751:-900.000000 +FIN_BOX +CONNECTIONS:15 +CONNECTION +Box03:DataPath:Box04:In1 +NumberOfControlPoints:0 +CONNECTION +Box04:Out:Box02:In +NumberOfControlPoints:0 +CONNECTION +Box02:Out:Box01:LstFileNames +NumberOfControlPoints:0 +CONNECTION +Box01:ImageSlab2D:Box05:In +NumberOfControlPoints:0 +CONNECTION +Box05:Widget:Box07:Widget1 +NumberOfControlPoints:0 +CONNECTION +Box08:Widget:Box07:Widget2 +NumberOfControlPoints:0 +CONNECTION +Box01:Image3D:Box08:In +NumberOfControlPoints:0 +CONNECTION +Box07:Widget:Box06:Widget2 +NumberOfControlPoints:0 +CONNECTION +Box01:boxChange:Box05:BoxExecute +NumberOfControlPoints:0 +CONNECTION +Box01:boxChange:Box08:BoxExecute +NumberOfControlPoints:0 +CONNECTION +Box09:Out:Box01:Slice_In +NumberOfControlPoints:0 +CONNECTION +Box09:BoxChange:Box01:boxExecute +NumberOfControlPoints:0 +CONNECTION +Box01:widget:Box10:Widget2 +NumberOfControlPoints:0 +CONNECTION +Box09:Widget:Box10:Widget1 +NumberOfControlPoints:0 +CONNECTION +Box10:Widget:Box06:Widget1 +NumberOfControlPoints:0 +APP_END diff --git a/bbtk_creaVtk_PKG/bbs/appli/exampleSlab-Widget-01.bbs b/bbtk_creaVtk_PKG/bbs/appli/exampleSlab-Widget-01.bbs new file mode 100644 index 0000000..dcaf1d4 --- /dev/null +++ b/bbtk_creaVtk_PKG/bbs/appli/exampleSlab-Widget-01.bbs @@ -0,0 +1,78 @@ +# ---------------------------------- +# - BBTKGEditor v 1.4 BBS BlackBox Script +# - /tmpEED/creaTools2/creatools_source/creaVtk/bbtk_creaVtk_PKG/bbs/appli/exampleSlab-Widget-01.bbs +# ---------------------------------- + +# BBTK GEditor Script +# ---------------------- + +include std +include itkvtk +include creaVtk +include std +include creaMaracasVisu +include wx + +author "Author ??" +description "Description ??" +category "" + +new creaVtk:Slab-Widget-01 Box01 + +new std:FilesFromDirectory Box02 + +new std:Configuration Box03 + +new std:ConcatStrings Box04 + set Box04.In10 "/gdcmvtk/dicom01" + +new creaMaracasVisu:ViewerNV Box05 + +new wx:LayoutSplit Box06 + set Box06.Orientation "H" + +new wx:LayoutTab Box07 + +new creaMaracasVisu:ViewerNV Box08 + +new wx:Slider Box09 + set Box09.Max "100" + set Box09.ReactiveOnTrack "true" + +new wx:LayoutLine Box10 + + +connect Box03.DataPath Box04.In1 + +connect Box04.Out Box02.In + +connect Box02.Out Box01.LstFileNames + +connect Box01.ImageSlab2D Box05.In + +connect Box05.Widget Box07.Widget1 + +connect Box08.Widget Box07.Widget2 + +connect Box01.Image3D Box08.In + +connect Box07.Widget Box06.Widget2 + +connect Box01.boxChange Box05.BoxExecute + +connect Box01.boxChange Box08.BoxExecute + +connect Box09.Out Box01.Slice_In + +connect Box09.BoxChange Box01.boxExecute + +connect Box01.widget Box10.Widget2 + +connect Box09.Widget Box10.Widget1 + +connect Box10.Widget Box06.Widget1 + + + +# Complex input ports +exec Box06 diff --git a/bbtk_creaVtk_PKG/bbs/appli/exampleStreamLineScalarSegmentation.bbg b/bbtk_creaVtk_PKG/bbs/appli/exampleStreamLineScalarSegmentation.bbg index 6c43b6a..cedf7a1 100644 --- a/bbtk_creaVtk_PKG/bbs/appli/exampleStreamLineScalarSegmentation.bbg +++ b/bbtk_creaVtk_PKG/bbs/appli/exampleStreamLineScalarSegmentation.bbg @@ -1,6 +1,6 @@ # ---------------------------------- # - BBTKGEditor v 1.4 BBG BlackBox Diagram file -# - /home/davila/Creatis/creaTools/creatools_source/creaVtk/bbtk_creaVtk_PKG/bbs/appli/exampleStreamLineScalarSegmentation.bbg +# - /tmpEED/creaTools2/creatools_source/creaVtk/bbtk_creaVtk_PKG/bbs/appli/exampleStreamLineScalarSegmentation.bbg # ---------------------------------- APP_START @@ -14,7 +14,7 @@ BOX vtk:PolyDataReader:Box01 ISEXEC:FALSE -88.546051:6.171672:-900.000000 --42.971051:-3.828328:-900.000000 +-46.546051:-3.828328:-900.000000 PORT In:"/home/davila/Borrame/FIB/example01/V1_IM_fibers.vtk" FIN_BOX @@ -22,25 +22,25 @@ BOX creaMaracasVisu:ViewerNV:Box02 ISEXEC:FALSE 17.274671:53.788961:-900.000000 -77.914671:43.788961:-900.000000 +80.994671:43.788961:-900.000000 FIN_BOX BOX vtk:LoadHola:Box03 ISEXEC:FALSE -92.289200:111.539584:-900.000000 --46.714200:101.539584:-900.000000 +-56.739200:101.539584:-900.000000 FIN_BOX BOX wx:LayoutTab:Box08 ISEXEC:FALSE 137.278039:-199.459007:-900.000000 -194.838039:-209.459007:-900.000000 +173.528039:-209.459007:-900.000000 FIN_BOX BOX wx:LayoutSplit:Box09 ISEXEC:TRUE 100.030854:-227.815281:-900.000000 -145.605854:-237.815281:-900.000000 +136.705854:-237.815281:-900.000000 PORT Orientation:"H" FIN_BOX @@ -48,19 +48,19 @@ BOX wx:FileSelector:Box14 ISEXEC:FALSE -8.045537:111.400732:-900.000000 -37.529463:101.400732:-900.000000 +29.329463:101.400732:-900.000000 FIN_BOX BOX creaImageIO:ImagesChooserDialogBox:Box15 ISEXEC:FALSE 44.418152:133.616105:-900.000000 -115.593152:123.616105:-900.000000 +95.893152:123.616105:-900.000000 FIN_BOX BOX vtk:UnMosaic:Box16 ISEXEC:FALSE 59.016557:113.304403:-900.000000 -104.591557:103.304403:-900.000000 +94.841557:103.304403:-900.000000 PORT NbImagesInMosaic:"10" PORT @@ -70,7 +70,7 @@ BOX creaMaracasVisu:ImageChangeInformation:Box17 ISEXEC:FALSE 73.555765:95.217887:-900.000000 -144.730765:85.217887:-900.000000 +125.080765:85.217887:-900.000000 PORT NewSpacing:"2.65626 2.65625 6.25" FIN_BOX @@ -78,35 +78,35 @@ BOX toolsbbtk:SaveMHD-Button:Box18 ISEXEC:FALSE 203.504265:-47.784362:-900.000000 -249.079265:-57.784362:-900.000000 +246.029265:-57.784362:-900.000000 FIN_BOX BOX vtk:vtkImageDataPointerRelay:Box20 ISEXEC:FALSE 30.936680:79.756254:-900.000000 -102.111680:69.756254:-900.000000 +83.111680:69.756254:-900.000000 FIN_BOX BOX vtk:MetaImageReader:Box21 ISEXEC:FALSE -7.094553:96.485348:-900.000000 -38.480447:86.485348:-900.000000 +37.580447:86.485348:-900.000000 PORT In:"/home/davila/Borrame/FIB/example01/V1_IM_b_0_dir_1.mhd" FIN_BOX BOX creaVtk:StreamLine_Visu_Widget:Box26 ISEXEC:FALSE -22.700614:-93.328771:-900.000000 -93.875614:-103.328771:-900.000000 +10.631846:-112.824473:-900.000000 +60.306846:-122.824473:-900.000000 PORT Title:"Segmented Stream Line" FIN_BOX BOX creaVtk:StreamLine_Visu_Widget:Box27 ISEXEC:FALSE --108.718370:-94.326200:-900.000000 --37.543370:-104.326200:-900.000000 +-107.480548:-100.515312:-900.000000 +-57.805548:-110.515312:-900.000000 PORT Title:"Complete Stream Line" FIN_BOX @@ -114,7 +114,7 @@ BOX wx:LayoutLine:Box29 ISEXEC:FALSE -9.970267:-146.347569:-900.000000 -47.589733:-156.347569:-900.000000 +26.604733:-156.347569:-900.000000 PORT Orientation:"V" FIN_BOX @@ -122,19 +122,19 @@ BOX creaVtk:StreamLineColorInfo:Box32 ISEXEC:FALSE -99.959608:-16.963324:-900.000000 --28.784608:-26.963324:-900.000000 +-54.234608:-26.963324:-900.000000 FIN_BOX BOX creaVtk:StreamLineNumeration:Box33 ISEXEC:FALSE --19.206371:-40.822235:-900.000000 -51.968629:-50.822235:-900.000000 +-9.922704:-40.822235:-900.000000 +38.352296:-50.822235:-900.000000 FIN_BOX BOX creaVtk:StreamLineSegmentationByScalar:Box34 ISEXEC:FALSE --25.171099:-59.634068:-900.000000 -46.003901:-69.634068:-900.000000 +-13.046067:-63.656991:-900.000000 +45.753933:-73.656991:-900.000000 PORT ScalarArrayName:"creaNumeration" FIN_BOX @@ -147,8 +147,8 @@ FIN_BOX BOX creaMaracasVisu:SliderMinMax:Box37 ISEXEC:FALSE --8.653391:-11.457421:-900.000000 -45.826609:-21.457421:-900.000000 +-1.620310:-9.769481:-900.000000 +52.859690:-19.769481:-900.000000 PORT InMax:"1000" PORT @@ -162,7 +162,7 @@ BOX vtk:UpdateRender:Box38 ISEXEC:FALSE -58.618472:-74.417405:-900.000000 --13.043472:-84.417405:-900.000000 +-18.293472:-84.417405:-900.000000 PORT Active:"true" FIN_BOX diff --git a/bbtk_creaVtk_PKG/bbs/appli/exampleStreamLineScalarSegmentation.bbs b/bbtk_creaVtk_PKG/bbs/appli/exampleStreamLineScalarSegmentation.bbs index 5f52976..63717d0 100644 --- a/bbtk_creaVtk_PKG/bbs/appli/exampleStreamLineScalarSegmentation.bbs +++ b/bbtk_creaVtk_PKG/bbs/appli/exampleStreamLineScalarSegmentation.bbs @@ -1,6 +1,6 @@ # ---------------------------------- # - BBTKGEditor v 1.4 BBS BlackBox Script -# - /home/davila/Creatis/creaTools/creatools_source/creaVtk/bbtk_creaVtk_PKG/bbs/appli/exampleStreamLineScalarSegmentation.bbs +# - /tmpEED/creaTools2/creatools_source/creaVtk/bbtk_creaVtk_PKG/bbs/appli/exampleStreamLineScalarSegmentation.bbs # ---------------------------------- # BBTK GEditor Script @@ -19,61 +19,61 @@ author "Author ??" description "Description ??" category "" -new PolyDataReader Box01 +new vtk:PolyDataReader Box01 set Box01.In "/home/davila/Borrame/FIB/example01/V1_IM_fibers.vtk" -new ViewerNV Box02 +new creaMaracasVisu:ViewerNV Box02 -new LoadHola Box03 +new vtk:LoadHola Box03 -new LayoutTab Box08 +new wx:LayoutTab Box08 -new LayoutSplit Box09 +new wx:LayoutSplit Box09 set Box09.Orientation "H" -new FileSelector Box14 +new wx:FileSelector Box14 -new ImagesChooserDialogBox Box15 +new creaImageIO:ImagesChooserDialogBox Box15 -new UnMosaic Box16 +new vtk:UnMosaic Box16 set Box16.NbImagesInMosaic "10" set Box16.NbImagesPerRow "4" -new ImageChangeInformation Box17 +new creaMaracasVisu:ImageChangeInformation Box17 set Box17.NewSpacing "2.65626 2.65625 6.25" -new SaveMHD-Button Box18 +new toolsbbtk:SaveMHD-Button Box18 -new vtkImageDataPointerRelay Box20 +new vtk:vtkImageDataPointerRelay Box20 -new MetaImageReader Box21 +new vtk:MetaImageReader Box21 set Box21.In "/home/davila/Borrame/FIB/example01/V1_IM_b_0_dir_1.mhd" -new StreamLine_Visu_Widget Box26 +new creaVtk:StreamLine_Visu_Widget Box26 set Box26.Title "Segmented Stream Line" -new StreamLine_Visu_Widget Box27 +new creaVtk:StreamLine_Visu_Widget Box27 set Box27.Title "Complete Stream Line" -new LayoutLine Box29 +new wx:LayoutLine Box29 set Box29.Orientation "V" -new StreamLineColorInfo Box32 +new creaVtk:StreamLineColorInfo Box32 -new StreamLineNumeration Box33 +new creaVtk:StreamLineNumeration Box33 -new StreamLineSegmentationByScalar Box34 +new creaVtk:StreamLineSegmentationByScalar Box34 set Box34.ScalarArrayName "creaNumeration" -new LayoutLine Box35 +new wx:LayoutLine Box35 -new SliderMinMax Box37 +new creaMaracasVisu:SliderMinMax Box37 set Box37.InMax "1000" set Box37.InMin "0" set Box37.ShowActual "false" set Box37.WinTitle "Threshold" -new UpdateRender Box38 +new vtk:UpdateRender Box38 set Box38.Active "true" @@ -130,5 +130,4 @@ connect Box02.Renderer1 Box38.Renderer # Complex input ports -message exec Box09 diff --git a/bbtk_creaVtk_PKG/bbs/appli/exampleVectorsTensorsVisu2.bbg b/bbtk_creaVtk_PKG/bbs/appli/exampleVectorsTensorsVisu2.bbg index 9d7e26e..83790f2 100644 --- a/bbtk_creaVtk_PKG/bbs/appli/exampleVectorsTensorsVisu2.bbg +++ b/bbtk_creaVtk_PKG/bbs/appli/exampleVectorsTensorsVisu2.bbg @@ -1,6 +1,6 @@ # ---------------------------------- # - BBTKGEditor v 1.4 BBG BlackBox Diagram file -# - /home/davila/Creatis/creaVtk/bbtk_creaVtk_PKG/bbs/appli/exampleVectorsTensorsVisu2.bbg +# - /tmpEED/creaTools2/creatools_source/creaVtk/bbtk_creaVtk_PKG/bbs/appli/exampleVectorsTensorsVisu2.bbg # ---------------------------------- APP_START @@ -9,12 +9,12 @@ DESCRIPTION:Description ?? AUTHOR:Author ?? COMPLEXBOX:FALSE COMPLEXINPUTS:0 -BOXES:8 +BOXES:11 BOX creaMaracasVisu:ViewerNV:Box03 ISEXEC:FALSE 57.113475:115.543057:-900.000000 -117.753475:105.543057:-900.000000 +120.833475:105.543057:-900.000000 PORT nTypeView:"5" FIN_BOX @@ -22,7 +22,7 @@ BOX wx:LayoutSplit:Box05 ISEXEC:TRUE 2.692816:13.173065:-900.000000 -48.267816:3.173065:-900.000000 +41.772816:3.173065:-900.000000 PORT Orientation:"H" FIN_BOX @@ -30,13 +30,13 @@ BOX vtk:LoadHola:Box09 ISEXEC:FALSE 63.433818:139.636078:-900.000000 -109.008818:129.636078:-900.000000 +98.983818:129.636078:-900.000000 FIN_BOX BOX vtk:StructuredPointsReader:Box10 ISEXEC:FALSE -33.586603:117.343597:-900.000000 -37.588397:107.343597:-900.000000 +15.113397:107.343597:-900.000000 PORT In:"/home/davila/Creatis/creaVtk/data/Vectors.vtk" FIN_BOX @@ -44,7 +44,7 @@ BOX vtk:StructuredPointsReader:Box31 ISEXEC:FALSE -113.697803:117.483182:-900.000000 --42.522803:107.483182:-900.000000 +-64.997803:107.483182:-900.000000 PORT In:"/home/davila/tmp/tmpDTI-Cardiac/Data/tensorOriginal3D.vtk" FIN_BOX @@ -52,13 +52,13 @@ BOX creaVtk:VectorsTensors_Widget:Box26 ISEXEC:FALSE -108.278239:75.575832:-900.000000 --37.103239:65.575832:-900.000000 +-59.803239:65.575832:-900.000000 FIN_BOX BOX creaVtk:VectorsTensors_manualread_Widget:Box12 ISEXEC:FALSE -27.351004:73.971951:-900.000000 -43.823996:63.971951:-900.000000 +34.098996:63.971951:-900.000000 FIN_BOX BOX wx:LayoutTab:Box13 @@ -66,7 +66,29 @@ ISEXEC:FALSE -78.562635:36.838418:-900.000000 -21.002635:26.838418:-900.000000 FIN_BOX -CONNECTIONS:9 +BOX +std:Configuration:Box14 +ISEXEC:FALSE +-71.449878:163.381269:-900.000000 +-32.024878:153.381269:-900.000000 +FIN_BOX +BOX +std:ConcatStrings:Box15 +ISEXEC:FALSE +-40.374478:144.783113:-900.000000 +-0.649478:134.783113:-900.000000 +PORT +In2:"/creaVtk/Vectors.vtk" +FIN_BOX +BOX +std:ConcatStrings:Box16 +ISEXEC:FALSE +-107.715185:145.714117:-900.000000 +-67.990185:135.714117:-900.000000 +PORT +In2:"/creaVtk/Tensors.vtk" +FIN_BOX +CONNECTIONS:13 CONNECTION Box03:Widget:Box05:Widget2 NumberOfControlPoints:0 @@ -94,4 +116,16 @@ NumberOfControlPoints:0 CONNECTION Box13:Widget:Box05:Widget1 NumberOfControlPoints:0 +CONNECTION +Box14:DataPath:Box15:In1 +NumberOfControlPoints:0 +CONNECTION +Box15:Out:Box10:In +NumberOfControlPoints:0 +CONNECTION +Box14:DataPath:Box16:In1 +NumberOfControlPoints:0 +CONNECTION +Box16:Out:Box31:In +NumberOfControlPoints:0 APP_END diff --git a/bbtk_creaVtk_PKG/bbs/appli/exampleVectorsTensorsVisu2.bbs b/bbtk_creaVtk_PKG/bbs/appli/exampleVectorsTensorsVisu2.bbs index 70a6213..c9c204c 100644 --- a/bbtk_creaVtk_PKG/bbs/appli/exampleVectorsTensorsVisu2.bbs +++ b/bbtk_creaVtk_PKG/bbs/appli/exampleVectorsTensorsVisu2.bbs @@ -1,6 +1,6 @@ # ---------------------------------- # - BBTKGEditor v 1.4 BBS BlackBox Script -# - /home/davila/Creatis/creaVtk/bbtk_creaVtk_PKG/bbs/appli/exampleVectorsTensorsVisu2.bbs +# - /tmpEED/creaTools2/creatools_source/creaVtk/bbtk_creaVtk_PKG/bbs/appli/exampleVectorsTensorsVisu2.bbs # ---------------------------------- # BBTK GEditor Script @@ -12,30 +12,39 @@ include creaMaracasVisu include wx include vtk include creaVtk +include std author "Author ??" description "Description ??" category "" -new ViewerNV Box03 +new creaMaracasVisu:ViewerNV Box03 set Box03.nTypeView "5" -new LayoutSplit Box05 +new wx:LayoutSplit Box05 set Box05.Orientation "H" -new LoadHola Box09 +new vtk:LoadHola Box09 -new StructuredPointsReader Box10 +new vtk:StructuredPointsReader Box10 set Box10.In "/home/davila/Creatis/creaVtk/data/Vectors.vtk" -new StructuredPointsReader Box31 +new vtk:StructuredPointsReader Box31 set Box31.In "/home/davila/tmp/tmpDTI-Cardiac/Data/tensorOriginal3D.vtk" -new VectorsTensors_Widget Box26 +new creaVtk:VectorsTensors_Widget Box26 + +new creaVtk:VectorsTensors_manualread_Widget Box12 + +new wx:LayoutTab Box13 + +new std:Configuration Box14 -new VectorsTensors_manualread_Widget Box12 +new std:ConcatStrings Box15 + set Box15.In2 "/creaVtk/Vectors.vtk" -new LayoutTab Box13 +new std:ConcatStrings Box16 + set Box16.In2 "/creaVtk/Tensors.vtk" connect Box03.Widget Box05.Widget2 @@ -56,6 +65,14 @@ connect Box26.widget Box13.Widget1 connect Box13.Widget Box05.Widget1 +connect Box14.DataPath Box15.In1 + +connect Box15.Out Box10.In + +connect Box14.DataPath Box16.In1 + +connect Box16.Out Box31.In + # Complex input ports diff --git a/bbtk_creaVtk_PKG/src/bbcreaVtkStreamLineNumeration.cxx b/bbtk_creaVtk_PKG/src/bbcreaVtkStreamLineNumeration.cxx index 578b30c..b9b71f7 100644 --- a/bbtk_creaVtk_PKG/src/bbcreaVtkStreamLineNumeration.cxx +++ b/bbtk_creaVtk_PKG/src/bbcreaVtkStreamLineNumeration.cxx @@ -20,7 +20,6 @@ BBTK_BLACK_BOX_IMPLEMENTATION(StreamLineNumeration,bbtk::AtomicBlackBox); //===== void StreamLineNumeration::Process() { - // THE MAIN PROCESSING METHOD BODY // Here we simply set the input 'In' value to the output 'Out' // And print out the output value @@ -32,9 +31,7 @@ void StreamLineNumeration::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') - std::string namascalararray="creaNumeration"; - if (bbGetInputStreamLinesIn()!=NULL) { vtkIdList *_vtkidlist = vtkIdList::New(); @@ -42,13 +39,10 @@ void StreamLineNumeration::Process() long int nLinesCell = vtkcellarray->GetNumberOfCells(); long int ii,iLine; long int numberofids; - - vtkDoubleArray *numeration = vtkDoubleArray::New(); numeration->SetName( namascalararray.c_str() ); numeration->SetNumberOfComponents(1); numeration->SetNumberOfTuples(nLinesCell); - // FOR EACH LINE ii=0; for ( iLine=0 ; iLineGetPointData()->AddArray( numeration ); + bbGetInputStreamLinesIn()->GetPointData()->Modified( ); + bbGetInputStreamLinesIn()->GetPointData()->Update( ); } // if bbGetInputStreamLinesIn() - bbSetOutputStreamLinesOut( bbGetInputStreamLinesIn() ); bbSetOutputNameOfScalarArray( namascalararray ); - } //===== @@ -75,34 +69,30 @@ void StreamLineNumeration::bbUserSetDefaultValues() // SET HERE THE DEFAULT INPUT/OUTPUT VALUES OF YOUR BOX // Here we initialize the input 'In' to 0 bbSetInputStreamLinesIn( 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 StreamLineNumeration::bbUserInitializeProcessing() { - // THE INITIALIZATION METHOD BODY : // Here does nothing // but this is where you should allocate the internal/output pointers -// if any - - +// 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 StreamLineNumeration::bbUserFinalizeProcessing() { - // THE FINALIZATION METHOD BODY : // Here does nothing // but this is where you should desallocate the internal/output pointers -// if any - -} +// if any } -// EO namespace bbcreaVtk + +} // EO namespace bbcreaVtk diff --git a/lib/creaVtk/creaVtkStreamLineScalarSeg.cpp b/lib/creaVtk/creaVtkStreamLineScalarSeg.cpp index 5a33531..2106ece 100644 --- a/lib/creaVtk/creaVtkStreamLineScalarSeg.cpp +++ b/lib/creaVtk/creaVtkStreamLineScalarSeg.cpp @@ -34,7 +34,7 @@ // ------------------------------------------------------------------------ creaVtkStreamLineScalarSeg::creaVtkStreamLineScalarSeg() { - _vtkidlist = vtkIdList::New(); + _vtkidlist = vtkIdList::New(); _newvtkpolydata = vtkPolyData::New(); _newvtkcellarray = vtkCellArray::New(); } @@ -79,31 +79,25 @@ void creaVtkStreamLineScalarSeg::Process() printf(".\n "); printf(".\n "); } - if ((_StreamLinesIn!=NULL) && (_ScalarArrayName!="") ) { int iLine; - _newvtkcellarray->Initialize(); - - vtkCellArray *vtkcellarray = _StreamLinesIn->GetLines(); - int nLinesCell = vtkcellarray->GetNumberOfCells(); + vtkCellArray *vtkcellarray = _StreamLinesIn->GetLines(); + int nLinesCell = vtkcellarray->GetNumberOfCells(); // int vtkcellarraysize = vtkcellarray->GetSize(); - int numberofids; - int ii; - vtkDataArray *scalarArray = _StreamLinesIn->GetPointData()->GetArray( _ScalarArrayName.c_str() ); - - - vtkDoubleArray *newScalarArray = vtkDoubleArray::New(); + int numberofids; + int ii; + vtkDataArray *scalarArray = _StreamLinesIn->GetPointData()->GetArray( _ScalarArrayName.c_str() ); + vtkDoubleArray *newScalarArray = vtkDoubleArray::New(); newScalarArray->SetName( _ScalarArrayName.c_str() ); newScalarArray->SetNumberOfComponents(1); - // FOR EACH LINE double scalarValue; - long int iLineNew=0; - ii=0; - for ( iLine=0 ; iLineGetCell(ii, _vtkidlist ); numberofids = _vtkidlist->GetNumberOfIds(); scalarValue = scalarArray->GetTuple1(iLine); @@ -112,29 +106,27 @@ void creaVtkStreamLineScalarSeg::Process() _newvtkcellarray->InsertNextCell( _vtkidlist ); newScalarArray->InsertTuple1( iLineNew, scalarValue ); iLineNew++; - } - + } // if Threshold ii=ii+numberofids+1; - } // for iLine - + } // for iLine _newvtkpolydata->SetPoints( _StreamLinesIn->GetPoints() ); _newvtkpolydata->SetLines( _newvtkcellarray ); int iArrays,arraysSize = _StreamLinesIn->GetPointData()->GetNumberOfArrays(); for ( iArrays=0 ; iArraysGetPointData()->AddArray( _StreamLinesIn->GetPointData()->GetArray(iArrays) ); - } + } // iArrays _newvtkpolydata->GetPointData()->RemoveArray( _ScalarArrayName.c_str() ); _newvtkpolydata->GetPointData()->AddArray( newScalarArray ); //EED 2017-01-01 Migration VTK7 #if VTK_MAJOR_VERSION <= 5 _newvtkpolydata->Update(); #else + _newvtkcellarray->Modified(); _newvtkpolydata->Modified(); +// _newvtkpolydata->BuildCells(); #endif - - _StreamLinesOut = _newvtkpolydata; - + _StreamLinesOut = _newvtkpolydata; } // _StreamLinesIn }