#-----------------------------------------------------------------------------
SET(PROJECT_MAJOR_VERSION 1)
-SET(PROJECT_MINOR_VERSION 1)
-SET(PROJECT_BUILD_VERSION 1)
+SET(PROJECT_MINOR_VERSION 2)
+SET(PROJECT_BUILD_VERSION 0)
#==================================
LINK_DIRECTORIES(/usr/lib/x86_64-linux-gnu/)
#JCP Ubuntu this file not found glibconfig.h, config of wxgtk goes wrong somewhere
+
+
ADD_SUBDIRECTORY(install)
ADD_SUBDIRECTORY(lib)
ADD_SUBDIRECTORY(bbtk)
--- /dev/null
+# ----------------------------------
+# - BBTKGEditor v 1.4 BBG BlackBox Diagram file
+# - /tmpEED/creaTools2/creatools_source/creaMaracasVisu/bbtk/bbs/appli/exampleBars.bbg
+# ----------------------------------
+
+APP_START
+CATEGORY:example
+DESCRIPTION:creaMaracasVisu::ColorBar box example.
+AUTHOR:eduardo.davila@creatis.insa-lyon.fr
+COMPLEXBOX:FALSE
+COMPLEXINPUTS:0
+BOXES:8
+BOX
+wx:LayoutSplit:s
+ISEXEC:TRUE
+-61.769617:-74.306605:-900.000000
+-22.689617:-84.306605:-900.000000
+PORT
+Orientation:"H"
+FIN_BOX
+BOX
+wx:LayoutSplit:ss
+ISEXEC:FALSE
+-100.000000:40.000000:-900.000000
+-56.204020:30.000000:-900.000000
+PORT
+Orientation:"H"
+FIN_BOX
+BOX
+wx:LayoutLine:s1
+ISEXEC:FALSE
+-20.767371:-17.157332:-900.000000
+36.792629:-27.157332:-900.000000
+PORT
+Orientation:"V"
+FIN_BOX
+BOX
+wx:LayoutLine:s2
+ISEXEC:FALSE
+-98.935007:-15.740026:-900.000000
+-41.375007:-25.740026:-900.000000
+PORT
+Orientation:"V"
+FIN_BOX
+BOX
+creaMaracasVisu:SliderMinMax:sliderMM_h
+ISEXEC:FALSE
+-41.534742:24.549538:-900.000000
+12.945258:14.549538:-900.000000
+PORT
+InH:"90"
+PORT
+InMax:"350"
+PORT
+InMin:"0"
+PORT
+InW:"300"
+PORT
+Orientation:"1"
+PORT
+ShowLabels:"1"
+FIN_BOX
+BOX
+creaMaracasVisu:SliderMinMax:sliderMM_v
+ISEXEC:FALSE
+-127.689828:84.008983:-900.000000
+-73.209828:74.008983:-900.000000
+PORT
+InH:"30"
+PORT
+InMax:"350"
+PORT
+InMin:"0"
+PORT
+InW:"300"
+PORT
+Orientation:"0"
+PORT
+ShowLabels:"1"
+FIN_BOX
+BOX
+creaMaracasVisu:ColorBar:colorB_h
+ISEXEC:FALSE
+-9.584941:6.084280:-900.000000
+44.895059:-3.915720:-900.000000
+PORT
+Blues:" 255 0 15 0 0 0"
+PORT
+Greens:" 0 220 220 100 240 55"
+PORT
+InH:"50"
+PORT
+InMax:"350"
+PORT
+InMin:"0"
+PORT
+InW:"300"
+PORT
+Orientation:"1"
+PORT
+Reds:" 0 255 0 255 220 30"
+PORT
+Values:" 0 30 70 130 250 310"
+FIN_BOX
+BOX
+creaMaracasVisu:ColorBar:colorB_v
+ISEXEC:FALSE
+-59.530251:80.986130:-900.000000
+-5.050251:70.986130:-900.000000
+PORT
+Blues:" 255 0 15 0 0 0"
+PORT
+Greens:" 0 220 220 100 240 55"
+PORT
+InH:"50"
+PORT
+InMax:"350"
+PORT
+InMin:"0"
+PORT
+InW:"300"
+PORT
+Orientation:"0"
+PORT
+Reds:" 0 255 0 255 220 30"
+PORT
+Values:" 0 30 70 130 250 310"
+FIN_BOX
+CONNECTIONS:7
+CONNECTION
+s1:Widget:s:Widget1
+NumberOfControlPoints:0
+CONNECTION
+s2:Widget:s:Widget2
+NumberOfControlPoints:0
+CONNECTION
+sliderMM_h:Widget:s1:Widget1
+NumberOfControlPoints:0
+CONNECTION
+colorB_h:Widget:s1:Widget2
+NumberOfControlPoints:0
+CONNECTION
+ss:Widget:s2:Widget1
+NumberOfControlPoints:0
+CONNECTION
+sliderMM_v:Widget:ss:Widget1
+NumberOfControlPoints:0
+CONNECTION
+colorB_v:Widget:ss:Widget2
+NumberOfControlPoints:0
+APP_END
-# ---------------------------------------------------------------------
-#
-# Copyright (c) CREATIS (Centre de Recherche en Acquisition et Traitement de l'Image
-# pour la Sant�)
-# Authors : Eduardo Davila, Frederic Cervenansky, Claire Mouton
-# Previous Authors : Laurent Guigues, Jean-Pierre Roux
-# CreaTools website : www.creatis.insa-lyon.fr/site/fr/creatools_accueil
-#
-# This software is governed by the CeCILL-B license under French law and
-# abiding by the rules of distribution of free software. You can use,
-# modify and/ or redistribute the software under the terms of the CeCILL-B
-# license as circulated by CEA, CNRS and INRIA at the following URL
-# http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.html
-# or in the file LICENSE.txt.
-#
-# As a counterpart to the access to the source code and rights to copy,
-# modify and redistribute granted by the license, users are provided only
-# with a limited warranty and the software's author, the holder of the
-# economic rights, and the successive licensors have only limited
-# liability.
-#
-# The fact that you are presently reading this means that you have had
-# knowledge of the CeCILL-B license and that you accept its terms.
-# ------------------------------------------------------------------------ */
+# ----------------------------------
+# - BBTKGEditor v 1.4 BBS BlackBox Script
+# - /tmpEED/creaTools2/creatools_source/creaMaracasVisu/bbtk/bbs/appli/exampleBars.bbs
+# ----------------------------------
+# BBTK GEditor Script
+# ----------------------
+
+include std
+include itkvtk
+include wx
+include creaMaracasVisu
+
+author "eduardo.davila@creatis.insa-lyon.fr"
description "creaMaracasVisu::ColorBar box example. "
category "example"
-author "eduardo.davila@creatis.insa-lyon.fr"
-load std
-load wx
-load creaMaracasVisu
-
-new LayoutSplit s
- set s.Orientation H
-new LayoutSplit ss
- set ss.Orientation H
-
-new LayoutLine s1
-new LayoutLine s2
-
-set s1.Orientation V
-set ss.Orientation H
-set s2.Orientation V
-
-new SliderMinMax sliderMM_h
-set sliderMM_h.Orientation 1
-set sliderMM_h.InW 300
-set sliderMM_h.InH 90
-set sliderMM_h.InMax 350
-set sliderMM_h.InMin 0
-set sliderMM_h.ShowLabels 1
-
-new SliderMinMax sliderMM_v
-set sliderMM_v.Orientation 0
-set sliderMM_v.InW 300
-set sliderMM_v.InH 30
-set sliderMM_v.InMax 350
-set sliderMM_v.InMin 0
-set sliderMM_v.ShowLabels 1
-
-new ColorBar colorB_h
-set colorB_h.Orientation 1
-set colorB_h.InW 300
-set colorB_h.InH 50
-set colorB_h.InMax 350
-set colorB_h.InMin 0
-set colorB_h.Reds " 0 255 0 255 220 30"
-set colorB_h.Greens " 0 220 220 100 240 55"
-set colorB_h.Blues " 255 0 15 0 0 0"
-set colorB_h.Values " 0 30 70 130 250 310"
-
-
-new ColorBar colorB_v
-set colorB_v.Orientation 0
-set colorB_v.InW 300
-set colorB_v.InH 50
-set colorB_v.InMax 350
-set colorB_v.InMin 0
-set colorB_v.Reds " 0 255 0 255 220 30"
-set colorB_v.Greens " 0 220 220 100 240 55"
-set colorB_v.Blues " 255 0 15 0 0 0"
-set colorB_v.Values " 0 30 70 130 250 310"
-
-
-connect s1.Widget s.Widget1
-connect s2.Widget s.Widget2
-connect sliderMM_h.Widget s1.Widget1
-connect colorB_h.Widget s1.Widget2
-connect ss.Widget s2.Widget1
-connect sliderMM_v.Widget ss.Widget1
-connect colorB_v.Widget ss.Widget2
+new wx:LayoutSplit s
+ set s.Orientation "H"
+
+new wx:LayoutSplit ss
+ set ss.Orientation "H"
+
+new wx:LayoutLine s1
+ set s1.Orientation "V"
+
+new wx:LayoutLine s2
+ set s2.Orientation "V"
+
+new creaMaracasVisu:SliderMinMax sliderMM_h
+ set sliderMM_h.InH "90"
+ set sliderMM_h.InMax "350"
+ set sliderMM_h.InMin "0"
+ set sliderMM_h.InW "300"
+ set sliderMM_h.Orientation "1"
+ set sliderMM_h.ShowLabels "1"
+
+new creaMaracasVisu:SliderMinMax sliderMM_v
+ set sliderMM_v.InH "30"
+ set sliderMM_v.InMax "350"
+ set sliderMM_v.InMin "0"
+ set sliderMM_v.InW "300"
+ set sliderMM_v.Orientation "0"
+ set sliderMM_v.ShowLabels "1"
+
+new creaMaracasVisu:ColorBar colorB_h
+ set colorB_h.Blues " 255 0 15 0 0 0"
+ set colorB_h.Greens " 0 220 220 100 240 55"
+ set colorB_h.InH "50"
+ set colorB_h.InMax "350"
+ set colorB_h.InMin "0"
+ set colorB_h.InW "300"
+ set colorB_h.Orientation "1"
+ set colorB_h.Reds " 0 255 0 255 220 30"
+ set colorB_h.Values " 0 30 70 130 250 310"
+
+new creaMaracasVisu:ColorBar colorB_v
+ set colorB_v.Blues " 255 0 15 0 0 0"
+ set colorB_v.Greens " 0 220 220 100 240 55"
+ set colorB_v.InH "50"
+ set colorB_v.InMax "350"
+ set colorB_v.InMin "0"
+ set colorB_v.InW "300"
+ set colorB_v.Orientation "0"
+ set colorB_v.Reds " 0 255 0 255 220 30"
+ set colorB_v.Values " 0 30 70 130 250 310"
+
+
+connect s1.Widget s.Widget1
+
+connect s2.Widget s.Widget2
+
+connect sliderMM_h.Widget s1.Widget1
+
+connect colorB_h.Widget s1.Widget2
+
+connect ss.Widget s2.Widget1
+
+connect sliderMM_v.Widget ss.Widget1
+
+connect colorB_v.Widget ss.Widget2
+
+
+# Complex input ports
exec s
# ----------------------------------
# - BBTKGEditor v 1.4 BBG BlackBox Diagram file
-# - /home/davila/Creatis/creaTools/creatools_source/creaMaracasVisu/bbtk/bbs/appli/exampleContourControlPoints_Wdiget.bbg
+# - /tmpEED/creaTools2/creatools_source/creaMaracasVisu/bbtk/bbs/appli/exampleContourControlPoints_Wdiget.bbg
# ----------------------------------
APP_START
BOX
creaMaracasVisu:ContourControlPoints_Widget:Box00
ISEXEC:FALSE
--113.173864:13.069948:-900.000000
--41.998864:3.069948:-900.000000
+-72.595496:17.578656:-900.000000
+-18.145496:7.578656:-900.000000
FIN_BOX
BOX
vtk:LoadHola:Box01
ISEXEC:FALSE
-37.427577:74.558110:-900.000000
-8.147423:64.558110:-900.000000
+-1.877577:64.558110:-900.000000
FIN_BOX
BOX
creaMaracasVisu:ViewerNV:Box02
ISEXEC:FALSE
-52.873879:47.230038:-900.000000
-7.766121:37.230038:-900.000000
+10.846121:37.230038:-900.000000
+PORT
+nTypeView:"0"
FIN_BOX
BOX
wx:LayoutSplit:Box03
ISEXEC:TRUE
--55.547277:-20.199010:-900.000000
--9.972277:-30.199010:-900.000000
+-22.483422:-16.592044:-900.000000
+16.596578:-26.592044:-900.000000
PORT
Orientation:"H"
FIN_BOX
std:MagicBox:Box04
ISEXEC:TRUE
-108.718200:-16.931523:-900.000000
--63.143200:-26.931523:-900.000000
+-72.643200:-26.931523:-900.000000
FIN_BOX
CONNECTIONS:5
CONNECTION
Box01:Out:Box02:In
NumberOfControlPoints:0
CONNECTION
-Box02:wxVtkBaseView4:Box00:wxvtkbaseview
-NumberOfControlPoints:0
-CONNECTION
Box00:Widget_Contour:Box03:Widget1
NumberOfControlPoints:0
CONNECTION
CONNECTION
Box00:BoxChange2:Box04:In
NumberOfControlPoints:0
+CONNECTION
+Box02:wxVtkBaseView1:Box00:wxvtkbaseview
+NumberOfControlPoints:0
APP_END
# ----------------------------------
# - BBTKGEditor v 1.4 BBS BlackBox Script
-# - /home/davila/Creatis/creaTools/creatools_source/creaMaracasVisu/bbtk/bbs/appli/exampleContourControlPoints_Wdiget.bbs
+# - /tmpEED/creaTools2/creatools_source/creaMaracasVisu/bbtk/bbs/appli/exampleContourControlPoints_Wdiget.bbs
# ----------------------------------
# BBTK GEditor Script
description "Description ??"
category "<VOID>"
-new ContourControlPoints_Widget Box00
+new creaMaracasVisu:ContourControlPoints_Widget Box00
-new LoadHola Box01
+new vtk:LoadHola Box01
-new ViewerNV Box02
+new creaMaracasVisu:ViewerNV Box02
+ set Box02.nTypeView "0"
-new LayoutSplit Box03
+new wx:LayoutSplit Box03
set Box03.Orientation "H"
-new MagicBox Box04
+new std:MagicBox Box04
connect Box01.Out Box02.In
-connect Box02.wxVtkBaseView4 Box00.wxvtkbaseview
-
connect Box00.Widget_Contour Box03.Widget1
connect Box02.Widget Box03.Widget2
connect Box00.BoxChange2 Box04.In
+connect Box02.wxVtkBaseView1 Box00.wxvtkbaseview
+
# Complex input ports
--- /dev/null
+# ----------------------------------
+# - BBTKGEditor v 1.4 BBG BlackBox Diagram file
+# - /tmpEED/creaTools2/creatools_source/creaMaracasVisu/bbtk/bbs/appli/exampleCutModule.bbg
+# ----------------------------------
+
+APP_START
+CATEGORY:example
+DESCRIPTION:Cutter.. application that helps to clean the image
+AUTHOR:info-dev@creatis.insa-lyon.fr
+COMPLEXBOX:FALSE
+COMPLEXINPUTS:0
+BOXES:8
+BOX
+vtk:LoadHola:reader
+ISEXEC:FALSE
+0.000000:70.000000:-900.000000
+36.250000:60.000000:-900.000000
+FIN_BOX
+BOX
+creaMaracasVisu:ViewerNV:view1
+ISEXEC:FALSE
+-89.230154:33.720365:-900.000000
+-25.510154:23.720365:-900.000000
+PORT
+nTypeView:"6"
+FIN_BOX
+BOX
+creaMaracasVisu:CutModule:cut
+ISEXEC:FALSE
+-8.425873:1.603538:-900.000000
+27.574127:-8.396462:-900.000000
+PORT
+BoxExecute:"1"
+FIN_BOX
+BOX
+creaMaracasVisu:ViewerNV:view2
+ISEXEC:FALSE
+-71.799075:-21.894050:-900.000000
+-8.079075:-31.894050:-900.000000
+PORT
+nTypeView:"6"
+FIN_BOX
+BOX
+wx:LayoutLine:layoutline1
+ISEXEC:FALSE
+-94.983439:-90.878949:-900.000000
+-37.423439:-100.878949:-900.000000
+FIN_BOX
+BOX
+wx:LayoutTab:laytab
+ISEXEC:FALSE
+-88.351604:-61.749353:-900.000000
+-30.791604:-71.749353:-900.000000
+FIN_BOX
+BOX
+wx:LayoutLine:layoutline2
+ISEXEC:FALSE
+0.000000:-110.000000:-900.000000
+57.560000:-120.000000:-900.000000
+FIN_BOX
+BOX
+wx:LayoutSplit:layoutsplit
+ISEXEC:TRUE
+-100.000000:-140.000000:-900.000000
+-59.325000:-150.000000:-900.000000
+PORT
+Orientation:"H"
+PORT
+Proportion:"80"
+FIN_BOX
+CONNECTIONS:11
+CONNECTION
+reader:Out:view1:In
+NumberOfControlPoints:0
+CONNECTION
+view1:Interactor1:cut:Interactor
+NumberOfControlPoints:0
+CONNECTION
+view1:Renderer1:cut:Renderer
+NumberOfControlPoints:0
+CONNECTION
+reader:Out:cut:In
+NumberOfControlPoints:0
+CONNECTION
+cut:Out:view2:In
+NumberOfControlPoints:0
+CONNECTION
+laytab:Widget:layoutline1:Widget1
+NumberOfControlPoints:0
+CONNECTION
+view1:Widget:laytab:Widget1
+NumberOfControlPoints:0
+CONNECTION
+view2:Widget:laytab:Widget2
+NumberOfControlPoints:0
+CONNECTION
+cut:Widget:layoutline2:Widget1
+NumberOfControlPoints:0
+CONNECTION
+layoutline1:Widget:layoutsplit:Widget1
+NumberOfControlPoints:0
+CONNECTION
+layoutline2:Widget:layoutsplit:Widget2
+NumberOfControlPoints:0
+APP_END
-# ---------------------------------------------------------------------
-#
-# Copyright (c) CREATIS (Centre de Recherche en Acquisition et Traitement de l'Image
-# pour la Sant�)
-# Authors : Eduardo Davila, Frederic Cervenansky, Claire Mouton
-# Previous Authors : Laurent Guigues, Jean-Pierre Roux
-# CreaTools website : www.creatis.insa-lyon.fr/site/fr/creatools_accueil
-#
-# This software is governed by the CeCILL-B license under French law and
-# abiding by the rules of distribution of free software. You can use,
-# modify and/ or redistribute the software under the terms of the CeCILL-B
-# license as circulated by CEA, CNRS and INRIA at the following URL
-# http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.html
-# or in the file LICENSE.txt.
-#
-# As a counterpart to the access to the source code and rights to copy,
-# modify and redistribute granted by the license, users are provided only
-# with a limited warranty and the software's author, the holder of the
-# economic rights, and the successive licensors have only limited
-# liability.
-#
-# The fact that you are presently reading this means that you have had
-# knowledge of the CeCILL-B license and that you accept its terms.
-# ------------------------------------------------------------------------ */
+# ----------------------------------
+# - BBTKGEditor v 1.4 BBS BlackBox Script
+# - /tmpEED/creaTools2/creatools_source/creaMaracasVisu/bbtk/bbs/appli/exampleCutModule.bbs
+# ----------------------------------
+
+# BBTK GEditor Script
+# ----------------------
+
+include std
+include itkvtk
+include vtk
+include creaMaracasVisu
+include wx
-description "Cutter.. application that helps to clean the image"
author "info-dev@creatis.insa-lyon.fr"
+description "Cutter.. application that helps to clean the image"
category "example"
+new vtk:LoadHola reader
-include vtk/boxes/bbLoadHola
-load vtk
-load wxvtk
-load creaMaracasVisu
-load std
-load wx
-
-new LoadHola reader
-
-#new FileSelector openFileDialog
- # set openFileDialog.Wildcard "(*.mhd)|*.mhd"
-#new MetaImageReader reader1
-# connect openFileDialog.Out reader1.In
-#new ImageCastToUShort image
-# connect reader1.Out image.In
-
-new ViewerNV view1
- set view1.nTypeView "6"
- connect reader.Out view1.In
-
-new CutModule cut
- connect view1.Interactor1 cut.Interactor
- connect view1.Renderer1 cut.Renderer
- connect reader.Out cut.In
-
-new ViewerNV view2
- set view2.nTypeView "6"
- connect cut.Out view2.In
-
-#connect view1.BoxChange cut.BoxExecute
-
-
-new LayoutLine layoutline1
- new LayoutTab laytab
- connect laytab.Widget layoutline1.Widget1
- connect view1.Widget laytab.Widget1
- connect view2.Widget laytab.Widget2
-
-new LayoutLine layoutline2
- connect cut.Widget layoutline2.Widget1
-
-new LayoutSplit layoutsplit
- set layoutsplit.Orientation H
- set layoutsplit.Proportion 80
- connect layoutline1.Widget layoutsplit.Widget1
- connect layoutline2.Widget layoutsplit.Widget2
-
-exec layoutsplit
+new creaMaracasVisu:ViewerNV view1
+ set view1.nTypeView "6"
+
+new creaMaracasVisu:CutModule cut
+ set cut.BoxExecute "1"
+
+new creaMaracasVisu:ViewerNV view2
+ set view2.nTypeView "6"
+
+new wx:LayoutLine layoutline1
+
+new wx:LayoutTab laytab
+
+new wx:LayoutLine layoutline2
+
+new wx:LayoutSplit layoutsplit
+ set layoutsplit.Orientation "H"
+ set layoutsplit.Proportion "80"
+
+
+connect reader.Out view1.In
-set cut.BoxExecute 1
-exec cut
+connect view1.Interactor1 cut.Interactor
+
+connect view1.Renderer1 cut.Renderer
+
+connect reader.Out cut.In
+
+connect cut.Out view2.In
+
+connect laytab.Widget layoutline1.Widget1
+
+connect view1.Widget laytab.Widget1
+
+connect view2.Widget laytab.Widget2
+
+connect cut.Widget layoutline2.Widget1
+
+connect layoutline1.Widget layoutsplit.Widget1
+
+connect layoutline2.Widget layoutsplit.Widget2
+
+
+
+# Complex input ports
+exec layoutsplit
--- /dev/null
+# ----------------------------------
+# - BBTKGEditor v 1.4 BBG BlackBox Diagram file
+# - /tmpEED/creaTools2/creatools_source/creaMaracasVisu/bbtk/bbs/appli/exampleCutModule2.bbg
+# ----------------------------------
+
+APP_START
+CATEGORY:<VOID>
+DESCRIPTION:Description ??
+AUTHOR:Author ??
+COMPLEXBOX:FALSE
+COMPLEXINPUTS:0
+BOXES:13
+BOX
+wx:FileSelector:filselect0
+ISEXEC:FALSE
+0.000000:70.000000:-900.000000
+39.975000:60.000000:-900.000000
+PORT
+Message:"Select image"
+PORT
+Wildcard:"*.mhd"
+FIN_BOX
+BOX
+vtk:MetaImageReader:gimm
+ISEXEC:FALSE
+-100.000000:40.000000:-900.000000
+-55.325000:30.000000:-900.000000
+FIN_BOX
+BOX
+vtk:ImageCastToUShort:image
+ISEXEC:FALSE
+0.000000:10.000000:-900.000000
+45.675000:0.000000:-900.000000
+FIN_BOX
+BOX
+creaMaracasVisu:VolumeRendering:volrend
+ISEXEC:FALSE
+-48.033456:-80.465195:-900.000000
+-2.808456:-90.465195:-900.000000
+FIN_BOX
+BOX
+creaMaracasVisu:SurfaceRendering:surrend
+ISEXEC:FALSE
+10.539740:-71.364337:-900.000000
+58.859740:-81.364337:-900.000000
+FIN_BOX
+BOX
+creaMaracasVisu:ViewerNV:view1
+ISEXEC:FALSE
+-100.000000:-80.000000:-900.000000
+-64.125000:-90.000000:-900.000000
+PORT
+nTypeView:"6"
+FIN_BOX
+BOX
+creaMaracasVisu:CutModule2:cut
+ISEXEC:FALSE
+-88.021070:-141.334361:-900.000000
+-52.021070:-151.334361:-900.000000
+PORT
+BoxExecute:"1"
+FIN_BOX
+BOX
+creaMaracasVisu:ViewerNV:view2
+ISEXEC:FALSE
+5.967113:-27.766014:-900.000000
+69.687113:-37.766014:-900.000000
+PORT
+nTypeView:"6"
+FIN_BOX
+BOX
+wx:LayoutSplit:layoutsplit1
+ISEXEC:FALSE
+0.000000:-170.000000:-900.000000
+41.775000:-180.000000:-900.000000
+PORT
+Orientation:"V"
+FIN_BOX
+BOX
+wx:LayoutSplit:layoutsplit2
+ISEXEC:FALSE
+17.931142:-200.854573:-900.000000
+59.706142:-210.854573:-900.000000
+PORT
+Orientation:"H"
+FIN_BOX
+BOX
+wx:LayoutTab:laytab
+ISEXEC:FALSE
+52.128983:-169.610140:-900.000000
+109.688983:-179.610140:-900.000000
+FIN_BOX
+BOX
+wx:LayoutLine:layoutline1
+ISEXEC:FALSE
+-84.047961:-198.470708:-900.000000
+-26.487961:-208.470708:-900.000000
+FIN_BOX
+BOX
+wx:LayoutSplit:layoutsplit3
+ISEXEC:TRUE
+-15.952039:-244.422747:-900.000000
+25.822961:-254.422747:-900.000000
+PORT
+Orientation:"H"
+PORT
+Proportion:"80"
+PORT
+WinTitle:"Cutting Tool"
+FIN_BOX
+CONNECTIONS:20
+CONNECTION
+filselect0:Out:gimm:In
+NumberOfControlPoints:0
+CONNECTION
+gimm:Out:image:In
+NumberOfControlPoints:0
+CONNECTION
+image:Out:volrend:In1
+NumberOfControlPoints:0
+CONNECTION
+gimm:Out:view1:In
+NumberOfControlPoints:0
+CONNECTION
+view1:Interactor1:cut:Interactor
+NumberOfControlPoints:0
+CONNECTION
+view1:Renderer1:cut:Renderer
+NumberOfControlPoints:0
+CONNECTION
+image:Out:cut:In
+NumberOfControlPoints:0
+CONNECTION
+image:Out:view2:In
+NumberOfControlPoints:0
+CONNECTION
+view1:BoxChange:cut:BoxExecute
+NumberOfControlPoints:0
+CONNECTION
+volrend:Widget:layoutsplit1:Widget1
+NumberOfControlPoints:0
+CONNECTION
+surrend:Widget:layoutsplit1:Widget2
+NumberOfControlPoints:0
+CONNECTION
+layoutsplit1:Widget:layoutsplit2:Widget1
+NumberOfControlPoints:0
+CONNECTION
+laytab:Widget:layoutsplit2:Widget2
+NumberOfControlPoints:0
+CONNECTION
+view1:Widget:laytab:Widget2
+NumberOfControlPoints:0
+CONNECTION
+view2:Widget:laytab:Widget1
+NumberOfControlPoints:0
+CONNECTION
+cut:Widget:layoutline1:Widget1
+NumberOfControlPoints:0
+CONNECTION
+layoutline1:Widget:layoutsplit3:Widget2
+NumberOfControlPoints:0
+CONNECTION
+layoutsplit2:Widget:layoutsplit3:Widget1
+NumberOfControlPoints:0
+CONNECTION
+view2:Renderer1:volrend:Renderer
+NumberOfControlPoints:0
+CONNECTION
+view2:Renderer1:surrend:Renderer
+NumberOfControlPoints:0
+APP_END
-# ---------------------------------------------------------------------
-#
-# Copyright (c) CREATIS (Centre de Recherche en Acquisition et Traitement de l'Image
-# pour la Sant�)
-# Authors : Eduardo Davila, Frederic Cervenansky, Claire Mouton
-# Previous Authors : Laurent Guigues, Jean-Pierre Roux
-# CreaTools website : www.creatis.insa-lyon.fr/site/fr/creatools_accueil
-#
-# This software is governed by the CeCILL-B license under French law and
-# abiding by the rules of distribution of free software. You can use,
-# modify and/ or redistribute the software under the terms of the CeCILL-B
-# license as circulated by CEA, CNRS and INRIA at the following URL
-# http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.html
-# or in the file LICENSE.txt.
-#
-# As a counterpart to the access to the source code and rights to copy,
-# modify and redistribute granted by the license, users are provided only
-# with a limited warranty and the software's author, the holder of the
-# economic rights, and the successive licensors have only limited
-# liability.
-#
-# The fact that you are presently reading this means that you have had
-# knowledge of the CeCILL-B license and that you accept its terms.
-# ------------------------------------------------------------------------ */
-
-load vtk
-load wxvtk
-load creaMaracasVisu
-load std
-load wx
-
-new FileSelector filselect0
- set filselect0.Message "Select image"
- set filselect0.Wildcard "*.mhd"
- #set filselect0.DefaultDir "C:\Creatis\creaAppli\Data\Images"
-new MetaImageReader gimm
- connect filselect0.Out gimm.In
-new ImageCastToUShort image
- connect gimm.Out image.In
-
-new VolumeRendering volrend
- connect image.Out volrend.In1
-new SurfaceRendering surrend
- # connect image.Out surrend.In0
-
-new ViewerNV view1
-set view1.nTypeView 6
- connect gimm.Out view1.In
-
-new CutModule2 cut
- connect view1.Interactor1 cut.Interactor
- connect view1.Renderer1 cut.Renderer
- connect image.Out cut.In
-
-new ViewerNV view2
- set view2.nTypeView 6
- connect image.Out view2.In
-
-connect view1.BoxChange cut.BoxExecute
-
-new LayoutSplit layoutsplit1
- set layoutsplit1.Orientation V
- connect volrend.Widget layoutsplit1.Widget1
- connect surrend.Widget layoutsplit1.Widget2
-
- new LayoutSplit layoutsplit2
- set layoutsplit2.Orientation H
- connect layoutsplit1.Widget layoutsplit2.Widget1
- #connect view1.Widget layoutsplit2.Widget2
-
- new LayoutTab laytab
- connect laytab.Widget layoutsplit2.Widget2
- connect view1.Widget laytab.Widget2
- connect view2.Widget laytab.Widget1
-
-new LayoutLine layoutline1
- connect cut.Widget layoutline1.Widget1
-
-new LayoutSplit layoutsplit3
- set layoutsplit3.Orientation H
- set layoutsplit3.Proportion 80
- set layoutsplit3.WinTitle "Cutting Tool"
- connect layoutline1.Widget layoutsplit3.Widget2
- connect layoutsplit2.Widget layoutsplit3.Widget1
-
-exec layoutsplit3
+# ----------------------------------
+# - BBTKGEditor v 1.4 BBS BlackBox Script
+# - /tmpEED/creaTools2/creatools_source/creaMaracasVisu/bbtk/bbs/appli/exampleCutModule2.bbs
+# ----------------------------------
+
+# BBTK GEditor Script
+# ----------------------
+
+include std
+include itkvtk
+include wx
+include vtk
+include creaMaracasVisu
+
+author "Author ??"
+description "Description ??"
+category "<VOID>"
+
+new wx:FileSelector filselect0
+ set filselect0.Message "Select image"
+ set filselect0.Wildcard "*.mhd"
+
+new vtk:MetaImageReader gimm
+
+new vtk:ImageCastToUShort image
+
+new creaMaracasVisu:VolumeRendering volrend
+
+new creaMaracasVisu:SurfaceRendering surrend
+
+new creaMaracasVisu:ViewerNV view1
+ set view1.nTypeView "6"
+
+new creaMaracasVisu:CutModule2 cut
+ set cut.BoxExecute "1"
+
+new creaMaracasVisu:ViewerNV view2
+ set view2.nTypeView "6"
+
+new wx:LayoutSplit layoutsplit1
+ set layoutsplit1.Orientation "V"
+
+new wx:LayoutSplit layoutsplit2
+ set layoutsplit2.Orientation "H"
+
+new wx:LayoutTab laytab
+
+new wx:LayoutLine layoutline1
+
+new wx:LayoutSplit layoutsplit3
+ set layoutsplit3.Orientation "H"
+ set layoutsplit3.Proportion "80"
+ set layoutsplit3.WinTitle "Cutting Tool"
+
+
+connect filselect0.Out gimm.In
-set cut.BoxExecute 1
-exec cut
+connect gimm.Out image.In
+
+connect image.Out volrend.In1
+
+connect gimm.Out view1.In
+
+connect view1.Interactor1 cut.Interactor
+
+connect view1.Renderer1 cut.Renderer
+
+connect image.Out cut.In
+
+connect image.Out view2.In
+
+connect view1.BoxChange cut.BoxExecute
+
+connect volrend.Widget layoutsplit1.Widget1
+
+connect surrend.Widget layoutsplit1.Widget2
+
+connect layoutsplit1.Widget layoutsplit2.Widget1
+
+connect laytab.Widget layoutsplit2.Widget2
+
+connect view1.Widget laytab.Widget2
+
+connect view2.Widget laytab.Widget1
+
+connect cut.Widget layoutline1.Widget1
+
+connect layoutline1.Widget layoutsplit3.Widget2
+
+connect layoutsplit2.Widget layoutsplit3.Widget1
connect view2.Renderer1 volrend.Renderer
+
connect view2.Renderer1 surrend.Renderer
-exec volrend
-exec surrend
-#connect cut.BoxChange volrend.BoxExecute
-#connect cut.BoxChange volrend.BoxExecute
\ No newline at end of file
+
+# Complex input ports
+exec layoutsplit3
--- /dev/null
+# ----------------------------------
+# - BBTKGEditor v 1.4 BBG BlackBox Diagram file
+# - /tmpEED/creaTools2/creatools_source/creaMaracasVisu/bbtk/bbs/appli/exampleGaussianSmooth.bbg
+# ----------------------------------
+
+APP_START
+CATEGORY:example
+DESCRIPTION:creaMaracasVisu::ImageGaussianSmooth box example.
+AUTHOR:eduardo.davila@creatis.insa-lyon.fr
+COMPLEXBOX:FALSE
+COMPLEXINPUTS:0
+BOXES:16
+BOX
+vtk:MetaImageReader:reader
+ISEXEC:FALSE
+0.000000:70.000000:-900.000000
+45.375000:60.000000:-900.000000
+FIN_BOX
+BOX
+std:PrependPackageDataPath:prependDatapath
+ISEXEC:FALSE
+-11.011355:95.088209:-900.000000
+52.863645:85.088209:-900.000000
+PORT
+In:"vtk/hola.mhd"
+FIN_BOX
+BOX
+wx:Slider:slider
+ISEXEC:FALSE
+-83.338572:-22.487918:-900.000000
+-31.938572:-32.487918:-900.000000
+FIN_BOX
+BOX
+wxvtk:Viewer2D:viewer2DImageOriginal
+ISEXEC:FALSE
+91.631632:-110.401163:-900.000000
+144.231632:-120.401163:-900.000000
+FIN_BOX
+BOX
+itk:BinaryThresholdImageFilter:threshold
+ISEXEC:FALSE
+-18.127317:-16.805823:-900.000000
+37.122683:-26.805823:-900.000000
+PORT
+InsideValue:"255"
+PORT
+LowerThreshold:"2000"
+PORT
+OutsideValue:"0"
+PORT
+UpperThreshold:"5000"
+FIN_BOX
+BOX
+wxvtk:Viewer2D:viewer2DImageSegmented
+ISEXEC:FALSE
+-48.678506:-77.410383:-900.000000
+7.521494:-87.410383:-900.000000
+FIN_BOX
+BOX
+vtk:ImageGaussianSmooth:smooth
+ISEXEC:FALSE
+0.000000:-110.000000:-900.000000
+50.200000:-120.000000:-900.000000
+PORT
+StdDevX:"1"
+PORT
+StdDevY:"1"
+PORT
+StdDevZ:"1"
+FIN_BOX
+BOX
+wxvtk:Viewer2D:viewer2DImageSmooth
+ISEXEC:FALSE
+-117.891897:-134.114508:-900.000000
+-65.616897:-144.114508:-900.000000
+FIN_BOX
+BOX
+wx:LayoutLine:upLayout
+ISEXEC:FALSE
+30.133721:-194.012809:-900.000000
+87.693721:-204.012809:-900.000000
+PORT
+Orientation:"H"
+FIN_BOX
+BOX
+wxvtk:Viewer3D:viewernvImagethreshold3D
+ISEXEC:FALSE
+-115.773120:-240.256768:-900.000000
+-52.053120:-250.256768:-900.000000
+FIN_BOX
+BOX
+vtk:IsoSurfaceExtractor:isoextractorthreshold
+ISEXEC:FALSE
+-72.980106:-269.550509:-900.000000
+-13.605106:-279.550509:-900.000000
+PORT
+Isovalue:"128"
+PORT
+Opacity:"1"
+FIN_BOX
+BOX
+wxvtk:Viewer3D:viewernvImageSmooth3D
+ISEXEC:FALSE
+75.623093:-232.691315:-900.000000
+139.343093:-242.691315:-900.000000
+FIN_BOX
+BOX
+vtk:IsoSurfaceExtractor:isoextractorsmooth
+ISEXEC:FALSE
+45.200582:-284.585347:-900.000000
+102.800582:-294.585347:-900.000000
+PORT
+Isovalue:"128"
+PORT
+Opacity:"1"
+FIN_BOX
+BOX
+wx:LayoutLine:downLayout
+ISEXEC:FALSE
+-100.000000:-320.000000:-900.000000
+-42.440000:-330.000000:-900.000000
+PORT
+Orientation:"H"
+FIN_BOX
+BOX
+wx:LayoutSplit:splitUp
+ISEXEC:FALSE
+0.000000:-350.000000:-900.000000
+39.080000:-360.000000:-900.000000
+FIN_BOX
+BOX
+wx:LayoutSplit:mainSplit
+ISEXEC:TRUE
+-100.000000:-380.000000:-900.000000
+-60.111566:-390.000000:-900.000000
+FIN_BOX
+CONNECTIONS:25
+CONNECTION
+prependDatapath:Out:reader:In
+NumberOfControlPoints:0
+CONNECTION
+reader:Out:viewer2DImageOriginal:In
+NumberOfControlPoints:0
+CONNECTION
+slider:Out:viewer2DImageOriginal:Slice
+NumberOfControlPoints:0
+CONNECTION
+slider:BoxChange:viewer2DImageOriginal:BoxExecute
+NumberOfControlPoints:0
+CONNECTION
+reader:Out:threshold:In
+NumberOfControlPoints:0
+CONNECTION
+threshold:Out:viewer2DImageSegmented:In
+NumberOfControlPoints:0
+CONNECTION
+slider:Out:viewer2DImageSegmented:Slice
+NumberOfControlPoints:0
+CONNECTION
+slider:BoxChange:viewer2DImageSegmented:BoxExecute
+NumberOfControlPoints:0
+CONNECTION
+threshold:Out:smooth:In
+NumberOfControlPoints:0
+CONNECTION
+smooth:Out:viewer2DImageSmooth:In
+NumberOfControlPoints:0
+CONNECTION
+slider:Out:viewer2DImageSmooth:Slice
+NumberOfControlPoints:0
+CONNECTION
+slider:BoxChange:viewer2DImageSmooth:BoxExecute
+NumberOfControlPoints:0
+CONNECTION
+viewer2DImageOriginal:Widget:upLayout:Widget1
+NumberOfControlPoints:0
+CONNECTION
+viewer2DImageSegmented:Widget:upLayout:Widget2
+NumberOfControlPoints:0
+CONNECTION
+viewer2DImageSmooth:Widget:upLayout:Widget3
+NumberOfControlPoints:0
+CONNECTION
+threshold:Out:isoextractorthreshold:In
+NumberOfControlPoints:0
+CONNECTION
+viewernvImagethreshold3D:Renderer:isoextractorthreshold:Renderer
+NumberOfControlPoints:0
+CONNECTION
+smooth:Out:isoextractorsmooth:In
+NumberOfControlPoints:0
+CONNECTION
+viewernvImageSmooth3D:Renderer:isoextractorsmooth:Renderer
+NumberOfControlPoints:0
+CONNECTION
+viewernvImagethreshold3D:Widget:downLayout:Widget1
+NumberOfControlPoints:0
+CONNECTION
+viewernvImageSmooth3D:Widget:downLayout:Widget2
+NumberOfControlPoints:0
+CONNECTION
+slider:Widget:splitUp:Widget1
+NumberOfControlPoints:0
+CONNECTION
+upLayout:Widget:splitUp:Widget2
+NumberOfControlPoints:0
+CONNECTION
+splitUp:Widget:mainSplit:Widget1
+NumberOfControlPoints:0
+CONNECTION
+downLayout:Widget:mainSplit:Widget2
+NumberOfControlPoints:0
+APP_END
-# ---------------------------------------------------------------------
-#
-# Copyright (c) CREATIS (Centre de Recherche en Acquisition et Traitement de l'Image
-# pour la Sant�)
-# Authors : Eduardo Davila, Frederic Cervenansky, Claire Mouton
-# Previous Authors : Laurent Guigues, Jean-Pierre Roux
-# CreaTools website : www.creatis.insa-lyon.fr/site/fr/creatools_accueil
-#
-# This software is governed by the CeCILL-B license under French law and
-# abiding by the rules of distribution of free software. You can use,
-# modify and/ or redistribute the software under the terms of the CeCILL-B
-# license as circulated by CEA, CNRS and INRIA at the following URL
-# http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.html
-# or in the file LICENSE.txt.
-#
-# As a counterpart to the access to the source code and rights to copy,
-# modify and redistribute granted by the license, users are provided only
-# with a limited warranty and the software's author, the holder of the
-# economic rights, and the successive licensors have only limited
-# liability.
-#
-# The fact that you are presently reading this means that you have had
-# knowledge of the CeCILL-B license and that you accept its terms.
-# ------------------------------------------------------------------------ */
+# ----------------------------------
+# - BBTKGEditor v 1.4 BBS BlackBox Script
+# - /tmpEED/creaTools2/creatools_source/creaMaracasVisu/bbtk/bbs/appli/exampleGaussianSmooth.bbs
+# ----------------------------------
-description "creaMaracasVisu::ImageGaussianSmooth box example. "
-category "example"
-author "eduardo.davila@creatis.insa-lyon.fr"
+# BBTK GEditor Script
+# ----------------------
include std
+include itkvtk
include vtk
+include std
include wx
-include itk
-include itkvtk
include wxvtk
+include itk
+
+author "eduardo.davila@creatis.insa-lyon.fr"
+description "creaMaracasVisu::ImageGaussianSmooth box example. "
+category "example"
+
+new vtk:MetaImageReader reader
+
+new std:PrependPackageDataPath prependDatapath
+ set prependDatapath.In "vtk/hola.mhd"
+
+new wx:Slider slider
+
+new wxvtk:Viewer2D viewer2DImageOriginal
+
+new itk:BinaryThresholdImageFilter threshold
+ set threshold.InsideValue "255"
+ set threshold.LowerThreshold "2000"
+ set threshold.OutsideValue "0"
+ set threshold.UpperThreshold "5000"
+
+new wxvtk:Viewer2D viewer2DImageSegmented
+
+new vtk:ImageGaussianSmooth smooth
+ set smooth.StdDevX "1"
+ set smooth.StdDevY "1"
+ set smooth.StdDevZ "1"
+
+new wxvtk:Viewer2D viewer2DImageSmooth
+
+new wx:LayoutLine upLayout
+ set upLayout.Orientation "H"
+
+new wxvtk:Viewer3D viewernvImagethreshold3D
+
+new vtk:IsoSurfaceExtractor isoextractorthreshold
+ set isoextractorthreshold.Isovalue "128"
+ set isoextractorthreshold.Opacity "1"
+
+new wxvtk:Viewer3D viewernvImageSmooth3D
+
+new vtk:IsoSurfaceExtractor isoextractorsmooth
+ set isoextractorsmooth.Isovalue "128"
+ set isoextractorsmooth.Opacity "1"
+
+new wx:LayoutLine downLayout
+ set downLayout.Orientation "H"
+
+new wx:LayoutSplit splitUp
+
+new wx:LayoutSplit mainSplit
+
+
+connect prependDatapath.Out reader.In
+
+connect reader.Out viewer2DImageOriginal.In
-new MetaImageReader reader
-include std/boxes/bbPrependPackageDataPath.bbs
-new PrependPackageDataPath prependDatapath
- set prependDatapath.In "vtk/hola.mhd"
- connect prependDatapath.Out reader.In
+connect slider.Out viewer2DImageOriginal.Slice
-#---------------------------------------------------------------------
+connect slider.BoxChange viewer2DImageOriginal.BoxExecute
-new Slider slider
+connect reader.Out threshold.In
-#---------------------------------------------------------------------
+connect threshold.Out viewer2DImageSegmented.In
-new Viewer2D viewer2DImageOriginal
- connect reader.Out viewer2DImageOriginal.In
- connect slider.Out viewer2DImageOriginal.Slice
- connect slider.BoxChange viewer2DImageOriginal.BoxExecute
-
-#---------------------------------------------------------------------
+connect slider.Out viewer2DImageSegmented.Slice
-new BinaryThresholdImageFilter threshold
- set threshold.LowerThreshold 2000
- set threshold.UpperThreshold 5000
- set threshold.InsideValue 255
- set threshold.OutsideValue 0
- connect reader.Out threshold.In
+connect slider.BoxChange viewer2DImageSegmented.BoxExecute
-new Viewer2D viewer2DImageSegmented
- connect threshold.Out viewer2DImageSegmented.In
- connect slider.Out viewer2DImageSegmented.Slice
- connect slider.BoxChange viewer2DImageSegmented.BoxExecute
+connect threshold.Out smooth.In
-#---------------------------------------------------------------------
+connect smooth.Out viewer2DImageSmooth.In
-new ImageGaussianSmooth smooth
- connect threshold.Out smooth.In
- set smooth.StdDevX 1
- set smooth.StdDevY 1
- set smooth.StdDevZ 1
+connect slider.Out viewer2DImageSmooth.Slice
-new Viewer2D viewer2DImageSmooth
- connect smooth.Out viewer2DImageSmooth.In
- connect slider.Out viewer2DImageSmooth.Slice
- connect slider.BoxChange viewer2DImageSmooth.BoxExecute
+connect slider.BoxChange viewer2DImageSmooth.BoxExecute
-#---------------------------------------------------------------------
+connect viewer2DImageOriginal.Widget upLayout.Widget1
-new LayoutLine upLayout
- set upLayout.Orientation H
- connect viewer2DImageOriginal.Widget upLayout.Widget1
- connect viewer2DImageSegmented.Widget upLayout.Widget2
- connect viewer2DImageSmooth.Widget upLayout.Widget3
+connect viewer2DImageSegmented.Widget upLayout.Widget2
+connect viewer2DImageSmooth.Widget upLayout.Widget3
-#---------------------------------------------------------------------
+connect threshold.Out isoextractorthreshold.In
-new Viewer3D viewernvImagethreshold3D
-# set viewernvImagethreshold3D.nTypeView "5"
+connect viewernvImagethreshold3D.Renderer isoextractorthreshold.Renderer
-new IsoSurfaceExtractor isoextractorthreshold
- connect threshold.Out isoextractorthreshold.In
- set isoextractorthreshold.Opacity 1
- set isoextractorthreshold.Isovalue 128
- connect viewernvImagethreshold3D.Renderer isoextractorthreshold.Renderer
+connect smooth.Out isoextractorsmooth.In
+connect viewernvImageSmooth3D.Renderer isoextractorsmooth.Renderer
-#---------------------------------------------------------------------
-new Viewer3D viewernvImageSmooth3D
-# set viewernvImageSmooth3D.nTypeView "5"
+connect viewernvImagethreshold3D.Widget downLayout.Widget1
-new IsoSurfaceExtractor isoextractorsmooth
- connect smooth.Out isoextractorsmooth.In
- set isoextractorsmooth.Opacity 1
- set isoextractorsmooth.Isovalue 128
- connect viewernvImageSmooth3D.Renderer isoextractorsmooth.Renderer
+connect viewernvImageSmooth3D.Widget downLayout.Widget2
+connect slider.Widget splitUp.Widget1
-#---------------------------------------------------------------------
+connect upLayout.Widget splitUp.Widget2
-new LayoutLine downLayout
- set downLayout.Orientation H
- connect viewernvImagethreshold3D.Widget downLayout.Widget1
- connect viewernvImageSmooth3D.Widget downLayout.Widget2
+connect splitUp.Widget mainSplit.Widget1
-#---------------------------------------------------------------------
-new LayoutSplit splitUp
- connect slider.Widget splitUp.Widget1
- connect upLayout.Widget splitUp.Widget2
+connect downLayout.Widget mainSplit.Widget2
-new LayoutSplit mainSplit
- connect splitUp.Widget mainSplit.Widget1
- connect downLayout.Widget mainSplit.Widget2
-#---------------------------------------------------------------------
-exec isoextractorthreshold
-exec isoextractorsmooth
+# Complex input ports
exec mainSplit
--- /dev/null
+# ----------------------------------
+# - BBTKGEditor v 1.4 BBG BlackBox Diagram file
+# - /tmpEED/creaTools2/creatools_source/creaMaracasVisu/bbtk/bbs/appli/exampleHistogramView.bbg
+# ----------------------------------
+
+APP_START
+CATEGORY:example
+DESCRIPTION:creaMaracasVisu::HistogramView box example.
+AUTHOR:eduardo.davila@creatis.insa-lyon.fr
+COMPLEXBOX:FALSE
+COMPLEXINPUTS:0
+BOXES:3
+BOX
+vtk:MetaImageReader:reader
+ISEXEC:FALSE
+-32.252498:44.574673:-900.000000
+13.122502:34.574673:-900.000000
+FIN_BOX
+BOX
+std:PrependPackageDataPath:prependDatapath
+ISEXEC:FALSE
+-46.088890:84.729742:-900.000000
+17.786110:74.729742:-900.000000
+PORT
+In:"vtk/hola.mhd"
+FIN_BOX
+BOX
+creaMaracasVisu:HistogramView:histogramview
+ISEXEC:TRUE
+-29.427462:2.937409:-900.000000
+19.672538:-7.062591:-900.000000
+FIN_BOX
+CONNECTIONS:2
+CONNECTION
+prependDatapath:Out:reader:In
+NumberOfControlPoints:0
+CONNECTION
+reader:Out:histogramview:In
+NumberOfControlPoints:0
+APP_END
-# ---------------------------------------------------------------------
-#
-# Copyright (c) CREATIS (Centre de Recherche en Acquisition et Traitement de l'Image
-# pour la Sant�)
-# Authors : Eduardo Davila, Frederic Cervenansky, Claire Mouton
-# Previous Authors : Laurent Guigues, Jean-Pierre Roux
-# CreaTools website : www.creatis.insa-lyon.fr/site/fr/creatools_accueil
-#
-# This software is governed by the CeCILL-B license under French law and
-# abiding by the rules of distribution of free software. You can use,
-# modify and/ or redistribute the software under the terms of the CeCILL-B
-# license as circulated by CEA, CNRS and INRIA at the following URL
-# http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.html
-# or in the file LICENSE.txt.
-#
-# As a counterpart to the access to the source code and rights to copy,
-# modify and redistribute granted by the license, users are provided only
-# with a limited warranty and the software's author, the holder of the
-# economic rights, and the successive licensors have only limited
-# liability.
-#
-# The fact that you are presently reading this means that you have had
-# knowledge of the CeCILL-B license and that you accept its terms.
-# ------------------------------------------------------------------------ */
+# ----------------------------------
+# - BBTKGEditor v 1.4 BBS BlackBox Script
+# - /tmpEED/creaTools2/creatools_source/creaMaracasVisu/bbtk/bbs/appli/exampleHistogramView.bbs
+# ----------------------------------
+# BBTK GEditor Script
+# ----------------------
+
+include std
+include itkvtk
+include vtk
+include std
+include creaMaracasVisu
+
+author "eduardo.davila@creatis.insa-lyon.fr"
description "creaMaracasVisu::HistogramView box example. "
category "example"
-author "eduardo.davila@creatis.insa-lyon.fr"
+new vtk:MetaImageReader reader
+new std:PrependPackageDataPath prependDatapath
+ set prependDatapath.In "vtk/hola.mhd"
-load wx
-load std
-load creaMaracasVisu
-load vtk
+new creaMaracasVisu:HistogramView histogramview
-new MetaImageReader reader
-include std/boxes/bbPrependPackageDataPath.bbs
-new PrependPackageDataPath prependDatapath
- set prependDatapath.In "vtk/hola.mhd"
- connect prependDatapath.Out reader.In
-new HistogramView histogramview
+connect prependDatapath.Out reader.In
-print $prependDatapath.Out$\n
connect reader.Out histogramview.In
+
+
+
+# Complex input ports
exec histogramview
-48.256510:-25.995767:-900.000000
-2.681510:-35.995767:-900.000000
FIN_BOX
-CONNECTIONS:7
+CONNECTIONS:6
CONNECTION
Box00:Out:Box01:In
NumberOfControlPoints:0
Box01:wxVtkBaseView4:Box08:wxvtkbaseview
NumberOfControlPoints:0
CONNECTION
-Box01:Renderer4:Box08:vtkRenderer
-NumberOfControlPoints:0
-CONNECTION
Box08:BoxChange2:Box09:BoxExecute
NumberOfControlPoints:0
CONNECTION
connect Box01.wxVtkBaseView4 Box08.wxvtkbaseview
-connect Box01.Renderer4 Box08.vtkRenderer
+#connect Box01.Renderer4 Box08.vtkRenderer
connect Box08.BoxChange2 Box09.BoxExecute
# ----------------------------------
# - BBTKGEditor v 1.4 BBG BlackBox Diagram file
-# - /tmpEED/creaTools/creatools_source/creaMaracasVisu/bbtk/bbs/appli/exampleManualContourModel_Box.bbg
+# - /tmpEED/creaTools2/creatools_source/creaMaracasVisu/bbtk/bbs/appli/exampleManualContourModel_Box.bbg
# ----------------------------------
APP_START
creaMaracasVisu:ShowNPoints:Box00
ISEXEC:FALSE
-39.494457:11.050643:-900.000000
-8.825543:1.050643:-900.000000
+21.145543:1.050643:-900.000000
FIN_BOX
BOX
vtk:LoadHola:Box01
ISEXEC:FALSE
-9.258012:83.442946:-900.000000
-54.833012:73.442946:-900.000000
+58.553215:97.570230:-900.000000
+94.103215:87.570230:-900.000000
FIN_BOX
BOX
creaMaracasVisu:ViewerNV:Box02
ISEXEC:FALSE
20.955874:40.973496:-900.000000
-81.595874:30.973496:-900.000000
+84.675874:30.973496:-900.000000
FIN_BOX
BOX
wx:LayoutSplit:Box03
ISEXEC:TRUE
13.204164:-71.936977:-900.000000
-58.779164:-81.936977:-900.000000
+52.284164:-81.936977:-900.000000
PORT
Orientation:"H"
FIN_BOX
creaMaracasVisu:ManualContourModel_Box:Box04
ISEXEC:FALSE
-49.983835:-14.091828:-900.000000
-21.191165:-24.091828:-900.000000
+2.116165:-24.091828:-900.000000
PORT
OpenClose:"false"
FIN_BOX
creaMaracasVisu:DrawAxe3D:Box05
ISEXEC:FALSE
-52.874467:-40.107511:-900.000000
--7.299467:-50.107511:-900.000000
+-15.174467:-50.107511:-900.000000
PORT
Colour:"1 1 0"
FIN_BOX
vtk:Transform:Box06
ISEXEC:FALSE
-57.714085:25.260177:-900.000000
--12.139085:15.260177:-900.000000
+-22.139085:15.260177:-900.000000
FIN_BOX
BOX
vtk:ImageVtkProperties:Box07
ISEXEC:FALSE
-40.107511:44.925230:-900.000000
-5.467489:34.925230:-900.000000
+5.242489:34.925230:-900.000000
FIN_BOX
BOX
vtk:UpdateRender:Box08
ISEXEC:FALSE
-36.735108:-55.042440:-900.000000
-8.839892:-65.042440:-900.000000
+3.589892:-65.042440:-900.000000
PORT
Active:"true"
FIN_BOX
vtk:vtkImageDataPointerRelay:Box09
ISEXEC:FALSE
-6.137882:66.826620:-900.000000
-65.037118:56.826620:-900.000000
+46.037118:56.826620:-900.000000
FIN_BOX
BOX
creaImageIO:ImagesChooserDialogBox:Box10
ISEXEC:FALSE
--43.926443:95.650480:-900.000000
-27.248557:85.650480:-900.000000
+-22.885808:101.962671:-900.000000
+28.589192:91.962671:-900.000000
FIN_BOX
BOX
creaMaracasVisu:ImageChangeInformation:Box11
ISEXEC:FALSE
-48.435663:82.829799:-900.000000
-22.739337:72.829799:-900.000000
+3.089337:72.829799:-900.000000
FIN_BOX
CONNECTIONS:22
CONNECTION
Box09:Out:Box00:Image
NumberOfControlPoints:0
CONNECTION
-Box10:Out:Box11:In
+Box11:Out:Box09:In
NumberOfControlPoints:0
CONNECTION
-Box11:Out:Box09:In
+Box01:Out:Box11:In
NumberOfControlPoints:0
APP_END
# ----------------------------------
# - BBTKGEditor v 1.4 BBS BlackBox Script
-# - /tmpEED/creaTools/creatools_source/creaMaracasVisu/bbtk/bbs/appli/exampleManualContourModel_Box.bbs
+# - /tmpEED/creaTools2/creatools_source/creaMaracasVisu/bbtk/bbs/appli/exampleManualContourModel_Box.bbs
# ----------------------------------
# BBTK GEditor Script
connect Box09.Out Box00.Image
-connect Box10.Out Box11.In
-
connect Box11.Out Box09.In
+connect Box01.Out Box11.In
+
# Complex input ports
--- /dev/null
+# ----------------------------------
+# - BBTKGEditor v 1.4 BBG BlackBox Diagram file
+# - /tmpEED/creaTools2/creatools_source/creaMaracasVisu/bbtk/bbs/appli/exampleOpenDialog.bbg
+# ----------------------------------
+
+APP_START
+CATEGORY:<VOID>
+DESCRIPTION:Description ??
+AUTHOR:Author ??
+COMPLEXBOX:FALSE
+COMPLEXINPUTS:0
+BOXES:2
+BOX
+creaMaracasVisu:OpenImageDialog:diag
+ISEXEC:FALSE
+0.000000:70.000000:-900.000000
+43.075000:60.000000:-900.000000
+FIN_BOX
+BOX
+creaMaracasVisu:ViewerNV:Box01
+ISEXEC:TRUE
+-8.078183:42.109680:-900.000000
+55.641817:32.109680:-900.000000
+FIN_BOX
+CONNECTIONS:1
+CONNECTION
+diag:Out:Box01:In
+NumberOfControlPoints:0
+APP_END
-# ---------------------------------------------------------------------
-#
-# Copyright (c) CREATIS (Centre de Recherche en Acquisition et Traitement de l'Image
-# pour la Sant�)
-# Authors : Eduardo Davila, Frederic Cervenansky, Claire Mouton
-# Previous Authors : Laurent Guigues, Jean-Pierre Roux
-# CreaTools website : www.creatis.insa-lyon.fr/site/fr/creatools_accueil
-#
-# This software is governed by the CeCILL-B license under French law and
-# abiding by the rules of distribution of free software. You can use,
-# modify and/ or redistribute the software under the terms of the CeCILL-B
-# license as circulated by CEA, CNRS and INRIA at the following URL
-# http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.html
-# or in the file LICENSE.txt.
-#
-# As a counterpart to the access to the source code and rights to copy,
-# modify and redistribute granted by the license, users are provided only
-# with a limited warranty and the software's author, the holder of the
-# economic rights, and the successive licensors have only limited
-# liability.
-#
-# The fact that you are presently reading this means that you have had
-# knowledge of the CeCILL-B license and that you accept its terms.
-# ------------------------------------------------------------------------ */
-
-load std
-load wx
-load creaMaracasVisu
-
-new OpenImageDialog diag
-
-exec diag
\ No newline at end of file
+# ----------------------------------
+# - BBTKGEditor v 1.4 BBS BlackBox Script
+# - /tmpEED/creaTools2/creatools_source/creaMaracasVisu/bbtk/bbs/appli/exampleOpenDialog.bbs
+# ----------------------------------
+
+# BBTK GEditor Script
+# ----------------------
+
+include std
+include itkvtk
+include creaMaracasVisu
+
+author "Author ??"
+description "Description ??"
+category "<VOID>"
+
+new creaMaracasVisu:OpenImageDialog diag
+
+new creaMaracasVisu:ViewerNV Box01
+
+
+connect diag.Out Box01.In
+
+
+
+# Complex input ports
+exec Box01
--- /dev/null
+# ----------------------------------
+# - BBTKGEditor v 1.4 BBG BlackBox Diagram file
+# - /tmpEED/creaTools2/creatools_source/creaMaracasVisu/bbtk/bbs/appli/examplePlaneNPoints.bbg
+# ----------------------------------
+
+APP_START
+CATEGORY:example
+DESCRIPTION: 3points -> 1-plane
+AUTHOR:info-dev@creatis.insa-lyon.fr
+COMPLEXBOX:FALSE
+COMPLEXINPUTS:0
+BOXES:14
+BOX
+wx:FileSelector:openFileDialog
+ISEXEC:FALSE
+-71.844270:101.006474:-900.000000
+-25.744270:91.006474:-900.000000
+PORT
+Wildcard:"(*.mhd)|*.mhd"
+FIN_BOX
+BOX
+vtk:MetaImageReader:reader
+ISEXEC:FALSE
+-69.371653:76.678391:-900.000000
+-23.996653:66.678391:-900.000000
+FIN_BOX
+BOX
+vtk:ImagePlanes:planes
+ISEXEC:FALSE
+-45.753456:-110.244621:-900.000000
+-6.128456:-120.244621:-900.000000
+FIN_BOX
+BOX
+creaMaracasVisu:TransferFunctionView:transferfunc
+ISEXEC:FALSE
+-104.537533:28.400350:-900.000000
+-52.362533:18.400350:-900.000000
+FIN_BOX
+BOX
+creaMaracasVisu:ViewerNV:viewernv
+ISEXEC:FALSE
+14.746982:-12.565354:-900.000000
+78.466982:-22.565354:-900.000000
+PORT
+nTypeView:"6 1 2 0"
+FIN_BOX
+BOX
+creaMaracasVisu:ShowNPoints:showpoints
+ISEXEC:FALSE
+-22.483814:-50.506036:-900.000000
+38.156186:-60.506036:-900.000000
+PORT
+Radio:"1"
+FIN_BOX
+BOX
+creaMaracasVisu:ImageActor:imgactor
+ISEXEC:FALSE
+-15.503237:-152.350307:-900.000000
+25.446763:-162.350307:-900.000000
+FIN_BOX
+BOX
+wxvtk:Viewer2D:view2d
+ISEXEC:FALSE
+-15.299387:-191.047245:-900.000000
+23.780613:-201.047245:-900.000000
+FIN_BOX
+BOX
+wx:CommandButton:execplanes
+ISEXEC:FALSE
+-122.135259:-88.324409:-900.000000
+-73.735259:-98.324409:-900.000000
+PORT
+Label:"Refresh planes"
+FIN_BOX
+BOX
+wx:LayoutLine:layoutline0
+ISEXEC:FALSE
+-100.000000:-200.000000:-900.000000
+-42.440000:-210.000000:-900.000000
+FIN_BOX
+BOX
+wx:LayoutLine:layoutline1
+ISEXEC:FALSE
+0.000000:-230.000000:-900.000000
+57.560000:-240.000000:-900.000000
+FIN_BOX
+BOX
+wx:LayoutSplit:mainSplit
+ISEXEC:TRUE
+-100.000000:-260.000000:-900.000000
+-60.300000:-270.000000:-900.000000
+PORT
+Orientation:"H"
+PORT
+Proportion:"10"
+FIN_BOX
+BOX
+vtk:LoadHola:Box12
+ISEXEC:FALSE
+7.751619:76.570867:-900.000000
+43.301619:66.570867:-900.000000
+FIN_BOX
+BOX
+vtk:vtkImageDataPointerRelay:Box13
+ISEXEC:FALSE
+-12.289151:51.614436:-900.000000
+39.885849:41.614436:-900.000000
+FIN_BOX
+CONNECTIONS:28
+CONNECTION
+openFileDialog:Out:reader:In
+NumberOfControlPoints:0
+CONNECTION
+transferfunc:ColorFunction:viewernv:ColorFunction
+NumberOfControlPoints:0
+CONNECTION
+transferfunc:WindowLevel:viewernv:WindowLevel
+NumberOfControlPoints:0
+CONNECTION
+transferfunc:ColorLevel:viewernv:ColorLevel
+NumberOfControlPoints:0
+CONNECTION
+showpoints:lstPointsX:planes:PointsX
+NumberOfControlPoints:0
+CONNECTION
+showpoints:lstPointsY:planes:PointsY
+NumberOfControlPoints:0
+CONNECTION
+showpoints:lstPointsZ:planes:PointsZ
+NumberOfControlPoints:0
+CONNECTION
+viewernv:BoxChange:showpoints:BoxExecute
+NumberOfControlPoints:0
+CONNECTION
+viewernv:Point:showpoints:In
+NumberOfControlPoints:0
+CONNECTION
+viewernv:Renderer1:showpoints:Renderer
+NumberOfControlPoints:0
+CONNECTION
+planes:Image3Pts:imgactor:In
+NumberOfControlPoints:0
+CONNECTION
+viewernv:Renderer1:imgactor:Renderer
+NumberOfControlPoints:0
+CONNECTION
+planes:Transform3Pts:imgactor:Transform
+NumberOfControlPoints:0
+CONNECTION
+execplanes:BoxChange:planes:BoxExecute
+NumberOfControlPoints:0
+CONNECTION
+execplanes:BoxChange:view2d:BoxExecute
+NumberOfControlPoints:0
+CONNECTION
+execplanes:BoxChange:imgactor:BoxExecute
+NumberOfControlPoints:0
+CONNECTION
+showpoints:Widget:layoutline0:Widget1
+NumberOfControlPoints:0
+CONNECTION
+execplanes:Widget:layoutline0:Widget2
+NumberOfControlPoints:0
+CONNECTION
+transferfunc:Widget:layoutline0:Widget3
+NumberOfControlPoints:0
+CONNECTION
+viewernv:Widget:layoutline1:Widget1
+NumberOfControlPoints:0
+CONNECTION
+layoutline0:Widget:mainSplit:Widget1
+NumberOfControlPoints:0
+CONNECTION
+layoutline1:Widget:mainSplit:Widget2
+NumberOfControlPoints:0
+CONNECTION
+planes:Image3Pts:view2d:In
+NumberOfControlPoints:0
+CONNECTION
+Box12:Out:Box13:In
+NumberOfControlPoints:0
+CONNECTION
+Box13:Out:transferfunc:In
+NumberOfControlPoints:0
+CONNECTION
+Box13:Out:planes:In
+NumberOfControlPoints:0
+CONNECTION
+Box13:Out:showpoints:Image
+NumberOfControlPoints:0
+CONNECTION
+Box13:Out:viewernv:In
+NumberOfControlPoints:0
+APP_END
-# ---------------------------------------------------------------------
-#
-# Copyright (c) CREATIS (Centre de Recherche en Acquisition et Traitement de l'Image
-# pour la Sant�)
-# Authors : Eduardo Davila, Frederic Cervenansky, Claire Mouton
-# Previous Authors : Laurent Guigues, Jean-Pierre Roux
-# CreaTools website : www.creatis.insa-lyon.fr/site/fr/creatools_accueil
-#
-# This software is governed by the CeCILL-B license under French law and
-# abiding by the rules of distribution of free software. You can use,
-# modify and/ or redistribute the software under the terms of the CeCILL-B
-# license as circulated by CEA, CNRS and INRIA at the following URL
-# http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.html
-# or in the file LICENSE.txt.
-#
-# As a counterpart to the access to the source code and rights to copy,
-# modify and redistribute granted by the license, users are provided only
-# with a limited warranty and the software's author, the holder of the
-# economic rights, and the successive licensors have only limited
-# liability.
-#
-# The fact that you are presently reading this means that you have had
-# knowledge of the CeCILL-B license and that you accept its terms.
-# ------------------------------------------------------------------------ */
+# ----------------------------------
+# - BBTKGEditor v 1.4 BBS BlackBox Script
+# - /tmpEED/creaTools2/creatools_source/creaMaracasVisu/bbtk/bbs/appli/examplePlaneNPoints.bbs
+# ----------------------------------
+
+# BBTK GEditor Script
+# ----------------------
+
+include std
+include itkvtk
+include wx
+include vtk
+include creaMaracasVisu
+include wxvtk
-description " 3points -> 1-plane "
author "info-dev@creatis.insa-lyon.fr"
+description " 3points -> 1-plane "
category "example"
-include vtk/boxes/bbLoadHola
-load vtk
-load wxvtk
-load creaMaracasVisu
-load std
-load wx
-
-//new LoadHola reader
-
-new FileSelector openFileDialog
- set openFileDialog.Wildcard "(*.mhd)|*.mhd"
-new MetaImageReader reader
- connect openFileDialog.Out reader.In
-
-new ImagePlanes planes
-connect reader.Out planes.In
-
-#new Viewer3D viewer
-
-#connect planes.PlaneX viewer.Obs1
-#connect planes.PlaneY viewer.Obs2
-#connect planes.PlaneZ viewer.Obs3
-#connect planes.Plane3Pts viewer.Obs4
-#set viewer.WinTitle "Show N Points"
-#set viewer.WinWidth 350
-#set viewer.WinHeight 400
-
-new TransferFunctionView transferfunc
- connect reader.Out transferfunc.In
-
-new ViewerNV viewernv
- set viewernv.nTypeView "6 1 2 0"
- #set viewernv.nTypeView "6"
- connect reader.Out viewernv.In
- connect transferfunc.ColorFunction viewernv.ColorFunction
- connect transferfunc.WindowLevel viewernv.WindowLevel
- connect transferfunc.ColorLevel viewernv.ColorLevel
-
-new ShowNPoints showpoints
- connect reader.Out showpoints.Image
- connect showpoints.lstPointsX planes.PointsX
- connect showpoints.lstPointsY planes.PointsY
- connect showpoints.lstPointsZ planes.PointsZ
- #set planes.PointsX "10 10 50"
- #set planes.PointsY "10 50 20"
- #set planes.PointsZ "10 10 30"
- connect viewernv.BoxChange showpoints.BoxExecute
- connect viewernv.Point showpoints.In
- connect viewernv.Renderer1 showpoints.Renderer
- set showpoints.Radio 1
-
-new ImageActor imgactor
- connect planes.Image3Pts imgactor.In
- connect viewernv.Renderer1 imgactor.Renderer
- connect planes.Transform3Pts imgactor.Transform
-
-new Viewer2D view2d
-new CommandButton execplanes
- set execplanes.Label "Refresh planes"
- connect execplanes.BoxChange planes.BoxExecute
- connect execplanes.BoxChange view2d.BoxExecute
- connect execplanes.BoxChange imgactor.BoxExecute
- #connect execplanes.BoxChange viewer.BoxExecute
-
-new LayoutLine layoutline0
+new wx:FileSelector openFileDialog
+ set openFileDialog.Wildcard "(*.mhd)|*.mhd"
+
+new vtk:MetaImageReader reader
+
+new vtk:ImagePlanes planes
+
+new creaMaracasVisu:TransferFunctionView transferfunc
+
+new creaMaracasVisu:ViewerNV viewernv
+ set viewernv.nTypeView "6 1 2 0"
+
+new creaMaracasVisu:ShowNPoints showpoints
+ set showpoints.Radio "1"
+
+new creaMaracasVisu:ImageActor imgactor
+
+new wxvtk:Viewer2D view2d
+
+new wx:CommandButton execplanes
+ set execplanes.Label "Refresh planes"
+
+new wx:LayoutLine layoutline0
+
+new wx:LayoutLine layoutline1
+
+new wx:LayoutSplit mainSplit
+ set mainSplit.Orientation "H"
+ set mainSplit.Proportion "10"
+
+new vtk:LoadHola Box12
+
+new vtk:vtkImageDataPointerRelay Box13
+
+
+connect openFileDialog.Out reader.In
+
+connect transferfunc.ColorFunction viewernv.ColorFunction
+
+connect transferfunc.WindowLevel viewernv.WindowLevel
+
+connect transferfunc.ColorLevel viewernv.ColorLevel
+
+connect showpoints.lstPointsX planes.PointsX
+
+connect showpoints.lstPointsY planes.PointsY
+
+connect showpoints.lstPointsZ planes.PointsZ
+
+connect viewernv.BoxChange showpoints.BoxExecute
+
+connect viewernv.Point showpoints.In
+
+connect viewernv.Renderer1 showpoints.Renderer
+
+connect planes.Image3Pts imgactor.In
+
+connect viewernv.Renderer1 imgactor.Renderer
+
+connect planes.Transform3Pts imgactor.Transform
+
+connect execplanes.BoxChange planes.BoxExecute
+
+connect execplanes.BoxChange view2d.BoxExecute
+
+connect execplanes.BoxChange imgactor.BoxExecute
+
connect showpoints.Widget layoutline0.Widget1
+
connect execplanes.Widget layoutline0.Widget2
+
connect transferfunc.Widget layoutline0.Widget3
-new LayoutLine layoutline1
connect viewernv.Widget layoutline1.Widget1
-new LayoutSplit mainSplit
-set mainSplit.Orientation H
-set mainSplit.Proportion 10
connect layoutline0.Widget mainSplit.Widget1
-connect layoutline1.Widget mainSplit.Widget2
-exec mainSplit
+connect layoutline1.Widget mainSplit.Widget2
connect planes.Image3Pts view2d.In
+
+connect Box12.Out Box13.In
+
+connect Box13.Out transferfunc.In
+
+connect Box13.Out planes.In
+
+connect Box13.Out showpoints.Image
+
+connect Box13.Out viewernv.In
+
+
+
+# Complex input ports
+exec mainSplit
--- /dev/null
+# ----------------------------------
+# - BBTKGEditor v 1.4 BBG BlackBox Diagram file
+# - /tmpEED/creaTools2/creatools_source/creaMaracasVisu/bbtk/bbs/appli/examplePlanesViewerNV_01.bbg
+# ----------------------------------
+
+APP_START
+CATEGORY:example
+DESCRIPTION:Example of the box vtk::ImagePlanes.
+AUTHOR:laurent.guigues@creatis.insa-lyon.fr
+COMPLEXBOX:FALSE
+COMPLEXINPUTS:0
+BOXES:3
+BOX
+vtk:LoadHola:reader
+ISEXEC:FALSE
+0.000000:70.000000:-900.000000
+35.550000:60.000000:-900.000000
+FIN_BOX
+BOX
+vtk:ImagePlanes:planes
+ISEXEC:TRUE
+-55.397404:-18.807244:-900.000000
+-15.772404:-28.807244:-900.000000
+FIN_BOX
+BOX
+creaMaracasVisu:ViewerNV:viewer
+ISEXEC:FALSE
+0.000000:10.000000:-900.000000
+63.720000:0.000000:-900.000000
+PORT
+WinHeight:"400"
+PORT
+WinTitle:"ExampleImagePlanes"
+PORT
+WinWidth:"350"
+PORT
+nTypeView:"7"
+FIN_BOX
+CONNECTIONS:3
+CONNECTION
+reader:Out:viewer:In
+NumberOfControlPoints:0
+CONNECTION
+reader:Out:planes:In
+NumberOfControlPoints:0
+CONNECTION
+viewer:Interactor1:planes:Interactor
+NumberOfControlPoints:0
+APP_END
-# ---------------------------------------------------------------------
-#
-# Copyright (c) CREATIS (Centre de Recherche en Acquisition et Traitement de l'Image
-# pour la Sant�)
-# Authors : Eduardo Davila, Frederic Cervenansky, Claire Mouton
-# Previous Authors : Laurent Guigues, Jean-Pierre Roux
-# CreaTools website : www.creatis.insa-lyon.fr/site/fr/creatools_accueil
-#
-# This software is governed by the CeCILL-B license under French law and
-# abiding by the rules of distribution of free software. You can use,
-# modify and/ or redistribute the software under the terms of the CeCILL-B
-# license as circulated by CEA, CNRS and INRIA at the following URL
-# http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.html
-# or in the file LICENSE.txt.
-#
-# As a counterpart to the access to the source code and rights to copy,
-# modify and redistribute granted by the license, users are provided only
-# with a limited warranty and the software's author, the holder of the
-# economic rights, and the successive licensors have only limited
-# liability.
-#
-# The fact that you are presently reading this means that you have had
-# knowledge of the CeCILL-B license and that you accept its terms.
-# ------------------------------------------------------------------------ */
+# ----------------------------------
+# - BBTKGEditor v 1.4 BBS BlackBox Script
+# - /tmpEED/creaTools2/creatools_source/creaMaracasVisu/bbtk/bbs/appli/examplePlanesViewerNV_01.bbs
+# ----------------------------------
+
+# BBTK GEditor Script
+# ----------------------
+
+include std
+include itkvtk
+include vtk
+include creaMaracasVisu
-description "Example of the box vtk::ImagePlanes."
author "laurent.guigues@creatis.insa-lyon.fr"
+description "Example of the box vtk::ImagePlanes."
category "example"
-include vtk/boxes/bbLoadHola
-load vtk
-load creaMaracasVisu
+new vtk:LoadHola reader
-new LoadHola reader
-new ImagePlanes planes
-new ViewerNV viewer
-connect reader.Out viewer.In
+new vtk:ImagePlanes planes
+
+new creaMaracasVisu:ViewerNV viewer
+ set viewer.WinHeight "400"
+ set viewer.WinTitle "ExampleImagePlanes"
+ set viewer.WinWidth "350"
set viewer.nTypeView "7"
+
+connect reader.Out viewer.In
+
connect reader.Out planes.In
+
connect viewer.Interactor1 planes.Interactor
-load std
-set viewer.WinTitle "ExampleImagePlanes"
-set viewer.WinWidth 350
-set viewer.WinHeight 400
-#set viewer.Slice 20
+
+# Complex input ports
exec planes
--- /dev/null
+# ----------------------------------
+# - BBTKGEditor v 1.4 BBG BlackBox Diagram file
+# - /tmpEED/creaTools2/creatools_source/creaMaracasVisu/bbtk/bbs/appli/examplePlanesViewerNV_02.bbg
+# ----------------------------------
+
+APP_START
+CATEGORY:example
+DESCRIPTION:Example of the box vtk::ImagePlanes.
+AUTHOR:laurent.guigues@creatis.insa-lyon.fr
+COMPLEXBOX:FALSE
+COMPLEXINPUTS:0
+BOXES:3
+BOX
+vtk:LoadHola:reader
+ISEXEC:FALSE
+0.000000:70.000000:-900.000000
+35.550000:60.000000:-900.000000
+FIN_BOX
+BOX
+vtk:ImagePlanes:planes
+ISEXEC:FALSE
+-63.636100:34.318141:-900.000000
+-24.011100:24.318141:-900.000000
+FIN_BOX
+BOX
+creaMaracasVisu:ViewerNV:viewer
+ISEXEC:TRUE
+-16.761485:-12.159251:-900.000000
+46.958515:-22.159251:-900.000000
+PORT
+WinHeight:"400"
+PORT
+WinTitle:"ExampleImagePlanes"
+PORT
+WinWidth:"350"
+PORT
+nTypeView:"6"
+FIN_BOX
+CONNECTIONS:5
+CONNECTION
+reader:Out:viewer:In
+NumberOfControlPoints:0
+CONNECTION
+reader:Out:planes:In
+NumberOfControlPoints:0
+CONNECTION
+planes:PlaneX:viewer:Obs1
+NumberOfControlPoints:0
+CONNECTION
+planes:PlaneY:viewer:Obs2
+NumberOfControlPoints:0
+CONNECTION
+planes:PlaneZ:viewer:Obs3
+NumberOfControlPoints:0
+APP_END
-# ---------------------------------------------------------------------
-#
-# Copyright (c) CREATIS (Centre de Recherche en Acquisition et Traitement de l'Image
-# pour la Sant�)
-# Authors : Eduardo Davila, Frederic Cervenansky, Claire Mouton
-# Previous Authors : Laurent Guigues, Jean-Pierre Roux
-# CreaTools website : www.creatis.insa-lyon.fr/site/fr/creatools_accueil
-#
-# This software is governed by the CeCILL-B license under French law and
-# abiding by the rules of distribution of free software. You can use,
-# modify and/ or redistribute the software under the terms of the CeCILL-B
-# license as circulated by CEA, CNRS and INRIA at the following URL
-# http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.html
-# or in the file LICENSE.txt.
-#
-# As a counterpart to the access to the source code and rights to copy,
-# modify and redistribute granted by the license, users are provided only
-# with a limited warranty and the software's author, the holder of the
-# economic rights, and the successive licensors have only limited
-# liability.
-#
-# The fact that you are presently reading this means that you have had
-# knowledge of the CeCILL-B license and that you accept its terms.
-# ------------------------------------------------------------------------ */
+# ----------------------------------
+# - BBTKGEditor v 1.4 BBS BlackBox Script
+# - /tmpEED/creaTools2/creatools_source/creaMaracasVisu/bbtk/bbs/appli/examplePlanesViewerNV_02.bbs
+# ----------------------------------
+
+# BBTK GEditor Script
+# ----------------------
+
+include std
+include itkvtk
+include vtk
+include creaMaracasVisu
-description "Example of the box vtk::ImagePlanes."
author "laurent.guigues@creatis.insa-lyon.fr"
+description "Example of the box vtk::ImagePlanes."
category "example"
-include vtk/boxes/bbLoadHola
-load vtk
-load creaMaracasVisu
+new vtk:LoadHola reader
-new LoadHola reader
-new ImagePlanes planes
-new ViewerNV viewer
-connect reader.Out viewer.In
+new vtk:ImagePlanes planes
+
+new creaMaracasVisu:ViewerNV viewer
+ set viewer.WinHeight "400"
+ set viewer.WinTitle "ExampleImagePlanes"
+ set viewer.WinWidth "350"
set viewer.nTypeView "6"
+
+connect reader.Out viewer.In
+
connect reader.Out planes.In
+
connect planes.PlaneX viewer.Obs1
+
connect planes.PlaneY viewer.Obs2
+
connect planes.PlaneZ viewer.Obs3
-load std
-set viewer.WinTitle "ExampleImagePlanes"
-set viewer.WinWidth 350
-set viewer.WinHeight 400
-#set viewer.Slice 20
+
+# Complex input ports
exec viewer
# ----------------------------------
# - BBTKGEditor v 1.4 BBG BlackBox Diagram file
-# - /tmpEED/creaTools/creatools_source/creaMaracasVisu/bbtk/bbs/boxes/ManualPaint2.bbg
+# - /home/davila/Creatis/C8/creatools_source/creaMaracasVisu/bbtk/bbs/boxes/ManualPaint2.bbg
# ----------------------------------
APP_START
colorBarPosition
-192.926981:179.217332:-900.000000
FIN_COMPLEX_PORT
-BOXES:17
+BOXES:24
BOX
creaMaracasVisu:ManualPaint_Model:Box00
ISEXEC:FALSE
--75.289692:-71.460987:-900.000000
--14.649692:-81.460987:-900.000000
+-95.174180:-58.098371:-900.000000
+-34.534180:-68.098371:-900.000000
PORT
2D3D:"1"
PORT
std:StringSelect:Box02
ISEXEC:FALSE
-37.673227:82.948986:-900.000000
-7.901773:72.948986:-900.000000
+4.486773:72.948986:-900.000000
FIN_BOX
BOX
creaMaracasVisu:ColorLayerImageView:Box03
ISEXEC:FALSE
--110.108419:-104.278922:-900.000000
--38.933419:-114.278922:-900.000000
+64.897021:-66.295426:-900.000000
+134.777021:-76.295426:-900.000000
PORT
TypeControlsInterface:"2"
PORT
std:TransposeVectorVectorString:Box04
ISEXEC:FALSE
-31.305556:125.161505:-900.000000
-39.869444:115.161505:-900.000000
+22.919444:115.161505:-900.000000
PORT
In0:"Desactivate Big-Blue Small-Blue Big-Clean Small-Clean"
PORT
std:GetVectorStringElement:Box05
ISEXEC:FALSE
-86.200317:53.438683:-900.000000
--15.025317:43.438683:-900.000000
+-36.800317:43.438683:-900.000000
PORT
I:"1"
FIN_BOX
std:GetVectorStringElement:Box11
ISEXEC:FALSE
-71.696483:40.964713:-900.000000
--0.521483:30.964713:-900.000000
+-22.296483:30.964713:-900.000000
PORT
I:"2"
FIN_BOX
std:GetVectorStringElement:Box12
ISEXEC:FALSE
-58.354926:28.065688:-900.000000
-12.820074:18.065688:-900.000000
+-8.954926:18.065688:-900.000000
PORT
I:"3"
FIN_BOX
std:ConcatStrings:Box13
ISEXEC:FALSE
-37.058068:-18.986769:-900.000000
-8.516932:-28.986769:-900.000000
+2.666932:-28.986769:-900.000000
PORT
In2:" "
FIN_BOX
std:GetVectorStringElement:Box14
ISEXEC:FALSE
-22.770985:-0.972910:-900.000000
-48.404015:-10.972910:-900.000000
+26.629015:-10.972910:-900.000000
PORT
I:"5"
FIN_BOX
std:GetVectorStringElement:Box15
ISEXEC:FALSE
-40.934702:12.586010:-900.000000
-30.240298:2.586010:-900.000000
+8.465298:2.586010:-900.000000
PORT
I:"4"
FIN_BOX
std:TransposeVectorVectorString:Box17
ISEXEC:FALSE
-117.618980:121.580114:-900.000000
--46.443980:111.580114:-900.000000
+-63.393980:111.580114:-900.000000
PORT
In0:"Desactivate Big-Blue Small-Blue Big-Clean Small-Clean"
FIN_BOX
BOX
wx:LayoutLine:Box19
ISEXEC:FALSE
--172.905988:-105.174791:-900.000000
--115.345988:-115.174791:-900.000000
+-182.190843:-97.578092:-900.000000
+-124.630843:-107.578092:-900.000000
PORT
Orientation:"H"
FIN_BOX
std:MagicBox:Box20
ISEXEC:FALSE
-82.351641:163.241009:-900.000000
--36.776641:153.241009:-900.000000
+-46.276641:153.241009:-900.000000
FIN_BOX
BOX
std:GetVectorStringElement:Box21
ISEXEC:FALSE
-1.581707:-33.301126:-900.000000
-69.593293:-43.301126:-900.000000
+47.818293:-43.301126:-900.000000
PORT
I:"6"
FIN_BOX
-CONNECTIONS:59
+BOX
+vtk:vtkImageDataPointerRelay:Box22
+ISEXEC:FALSE
+174.217065:39.039232:-900.000000
+226.392065:29.039232:-900.000000
+FIN_BOX
+BOX
+vtk:UpdateRender:Box23
+ISEXEC:FALSE
+39.953010:-129.847284:-900.000000
+80.278010:-139.847284:-900.000000
+PORT
+Active:"true"
+FIN_BOX
+BOX
+std:MagicBox:Box24
+ISEXEC:FALSE
+70.058448:54.161651:-900.000000
+106.133448:44.161651:-900.000000
+FIN_BOX
+BOX
+std:MagicBox:Box25
+ISEXEC:FALSE
+105.814564:70.785341:-900.000000
+141.889564:60.785341:-900.000000
+FIN_BOX
+BOX
+std:MagicBox:Box26
+ISEXEC:FALSE
+130.034953:54.490000:-900.000000
+166.109953:44.490000:-900.000000
+FIN_BOX
+BOX
+vtk:UpdateRender:Box27
+ISEXEC:FALSE
+90.902525:-130.949226:-900.000000
+131.227525:-140.949226:-900.000000
+PORT
+Active:"true"
+FIN_BOX
+BOX
+vtk:UpdateRender:Box28
+ISEXEC:FALSE
+141.007963:-130.644372:-900.000000
+181.332963:-140.644372:-900.000000
+PORT
+Active:"true"
+FIN_BOX
+CONNECTIONS:69
CONNECTION
Box01:Out:Box02:In
NumberOfControlPoints:0
Box03:Widget:Box09:Widget2
NumberOfControlPoints:0
CONNECTION
-Box00:Out:Box03:In
-NumberOfControlPoints:0
-CONNECTION
Box05:Out:Box00:Active
NumberOfControlPoints:0
CONNECTION
Image_ManualPaint_Model:Image_ManualPaint_Model:Box00:Image
NumberOfControlPoints:0
CONNECTION
-Image2_ManualPaint_Model:Image2_ManualPaint_Model:Box00:Image2
-NumberOfControlPoints:0
-CONNECTION
BoxExecute_ManualPaint_Model:BoxExecute_ManualPaint_Model:Box00:BoxExecute
NumberOfControlPoints:0
CONNECTION
-wxvtkbaseview1:wxvtkbaseview1:Box03:WxVtkBaseView
-NumberOfControlPoints:0
-CONNECTION
-wxvtkbaseview2:wxvtkbaseview2:Box03:WxVtkBaseView1
-NumberOfControlPoints:0
-CONNECTION
-wxvtkbaseview3:wxvtkbaseview3:Box03:WxVtkBaseView2
-NumberOfControlPoints:0
-CONNECTION
Box09:Widget:widgetOut:widgetOut
NumberOfControlPoints:0
CONNECTION
CONNECTION
colorBarPosition:colorBarPosition:Box03:ColorBarPosition
NumberOfControlPoints:0
+CONNECTION
+Image2_ManualPaint_Model:Image2_ManualPaint_Model:Box22:In
+NumberOfControlPoints:0
+CONNECTION
+Box22:Out:Box00:Image2
+NumberOfControlPoints:0
+CONNECTION
+Box22:Out:Box03:In
+NumberOfControlPoints:0
+CONNECTION
+wxvtkbaseview1:wxvtkbaseview1:Box24:In
+NumberOfControlPoints:0
+CONNECTION
+Box24:Out:Box03:WxVtkBaseView
+NumberOfControlPoints:0
+CONNECTION
+wxvtkbaseview2:wxvtkbaseview2:Box25:In
+NumberOfControlPoints:0
+CONNECTION
+Box25:Out:Box03:WxVtkBaseView1
+NumberOfControlPoints:0
+CONNECTION
+wxvtkbaseview3:wxvtkbaseview3:Box26:In
+NumberOfControlPoints:0
+CONNECTION
+Box26:Out:Box03:WxVtkBaseView2
+NumberOfControlPoints:0
+CONNECTION
+Box24:Out:Box23:Renderer
+NumberOfControlPoints:0
+CONNECTION
+Box00:BoxChange:Box23:BoxExecute
+NumberOfControlPoints:0
+CONNECTION
+Box25:Out:Box27:Renderer
+NumberOfControlPoints:0
+CONNECTION
+Box26:Out:Box28:Renderer
+NumberOfControlPoints:0
+CONNECTION
+Box00:BoxChange:Box27:BoxExecute
+NumberOfControlPoints:0
+CONNECTION
+Box00:BoxChange:Box28:BoxExecute
+NumberOfControlPoints:0
APP_END
# ----------------------------------
# - BBTKGEditor v 1.4 BBS BlackBox Script (Complex Box)
-# - /tmpEED/creaTools/creatools_source/creaMaracasVisu/bbtk/bbs/boxes/ManualPaint2.bbs
+# - /home/davila/Creatis/C8/creatools_source/creaMaracasVisu/bbtk/bbs/boxes/ManualPaint2.bbs
# ----------------------------------
include std
include creaMaracasVisu
include wx
include std
+include vtk
define ManualPaint2 creaMaracasVisu
new std:GetVectorStringElement Box21
set Box21.I "6"
+new vtk:vtkImageDataPointerRelay Box22
+
+new vtk:UpdateRender Box23
+ set Box23.Active "true"
+
+new std:MagicBox Box24
+
+new std:MagicBox Box25
+
+new std:MagicBox Box26
+
+new vtk:UpdateRender Box27
+ set Box27.Active "true"
+
+new vtk:UpdateRender Box28
+ set Box28.Active "true"
+
connect Box01.Out Box02.In
connect Box04.Out0 Box02.In0
connect Box04.Out9 Box02.In9
connect Box02.Out Box05.In
connect Box03.Widget Box09.Widget2
-connect Box00.Out Box03.In
connect Box05.Out Box00.Active
connect Box02.Out Box11.In
connect Box11.Out Box00.DistanceFill
connect Box20.Out Box04.In0
connect Box02.Out Box21.In
connect Box21.Out Box00.ToleranceFill
+connect Box22.Out Box00.Image2
+connect Box22.Out Box03.In
+connect Box24.Out Box03.WxVtkBaseView
+connect Box25.Out Box03.WxVtkBaseView1
+connect Box26.Out Box03.WxVtkBaseView2
+connect Box24.Out Box23.Renderer
+connect Box00.BoxChange Box23.BoxExecute
+connect Box25.Out Box27.Renderer
+connect Box26.Out Box28.Renderer
+connect Box00.BoxChange Box27.BoxExecute
+connect Box00.BoxChange Box28.BoxExecute
# Complex input ports
input TitleOptions Box20.In " "
input MaxRange_ManualPaint_Model Box04.In5 " "
input Point_ManualPaint_Model Box00.Point " "
input Image_ManualPaint_Model Box00.Image " "
-input Image2_ManualPaint_Model Box00.Image2 " "
input BoxExecute_ManualPaint_Model Box00.BoxExecute " "
-input wxvtkbaseview1 Box03.WxVtkBaseView " "
-input wxvtkbaseview2 Box03.WxVtkBaseView1 " "
-input wxvtkbaseview3 Box03.WxVtkBaseView2 " "
input Tolerance_Fill_ManualPaint_Model Box04.In6 " "
input colorBarPosition Box03.ColorBarPosition " "
+input Image2_ManualPaint_Model Box22.In " "
+input wxvtkbaseview1 Box24.In " "
+input wxvtkbaseview2 Box25.In " "
+input wxvtkbaseview3 Box26.In " "
# Complex output ports
output widgetOut Box09.Widget " "
# ----------------------------------
# - BBTKGEditor v 1.4 BBG BlackBox Diagram file
-# - /home/davila/Creatis/creaTools/creatools_source/creaMaracasVisu/bbtk/bbs/boxes/Ruler01_XY.bbg
+# - /tmpEED/creaTools2/creatools_source/creaMaracasVisu/bbtk/bbs/boxes/Ruler01_XY.bbg
# ----------------------------------
APP_START
wxvtkbaseview
105.349495:86.477605:-900.000000
FIN_COMPLEX_PORT
-BOXES:19
+BOXES:20
BOX
vtk:ImageVtkProperties:Box00
ISEXEC:FALSE
-162.336304:62.553214:-900.000000
--116.761304:52.553214:-900.000000
+-116.986304:52.553214:-900.000000
FIN_BOX
BOX
std:ConcatStrings:Box03
ISEXEC:FALSE
-102.095937:63.057960:-900.000000
--56.520937:53.057960:-900.000000
+-62.370937:53.057960:-900.000000
FIN_BOX
BOX
std:ConcatStrings:Box05
ISEXEC:FALSE
-153.040731:-106.636945:-900.000000
--107.465731:-116.636945:-900.000000
+-113.315731:-116.636945:-900.000000
FIN_BOX
BOX
vtk:UpdateRender:Box07
ISEXEC:FALSE
117.890633:-108.600457:-900.000000
-163.465633:-118.600457:-900.000000
+158.215633:-118.600457:-900.000000
PORT
Active:"true"
FIN_BOX
std:GetVectorFloatElement:Box14
ISEXEC:FALSE
-206.131681:2.977152:-900.000000
--134.956681:-7.022848:-900.000000
+-157.406681:-7.022848:-900.000000
PORT
I:"0"
FIN_BOX
std:ConcatStrings:Box16
ISEXEC:FALSE
122.643426:-194.996817:-900.000000
-168.218426:-204.996817:-900.000000
+162.368426:-204.996817:-900.000000
PORT
In2:"p ("
PORT
std:Mul:Box17
ISEXEC:FALSE
-224.173311:-46.164514:-900.000000
--191.398311:-56.164514:-900.000000
+-194.373311:-56.164514:-900.000000
FIN_BOX
BOX
std:MagicBox:Box18
ISEXEC:FALSE
-226.697757:58.736032:-900.000000
--181.122757:48.736032:-900.000000
+-190.622757:48.736032:-900.000000
FIN_BOX
BOX
std:MagicBox:Box19
ISEXEC:FALSE
-11.287735:-51.026800:-900.000000
-34.287265:-61.026800:-900.000000
+24.787265:-61.026800:-900.000000
FIN_BOX
BOX
std:MagicBox:Box20
ISEXEC:FALSE
112.639656:-54.547113:-900.000000
-158.214656:-64.547113:-900.000000
+148.714656:-64.547113:-900.000000
PORT
BoxProcessMode:"Reactive"
FIN_BOX
std:MagicBox:Box26
ISEXEC:FALSE
27.050629:-105.869439:-900.000000
-72.625629:-115.869439:-900.000000
+63.125629:-115.869439:-900.000000
FIN_BOX
BOX
vtk:Text2D:Box22
ISEXEC:FALSE
76.588028:-260.395303:-900.000000
-109.363028:-270.395303:-900.000000
+109.288028:-270.395303:-900.000000
PORT
Color:"0 1 1"
FIN_BOX
std:MagicBox:Box23
ISEXEC:FALSE
-50.113589:33.218740:-900.000000
--4.538589:23.218740:-900.000000
+-14.038589:23.218740:-900.000000
FIN_BOX
BOX
creaMaracasVisu:DrawAxe3D:Box25
ISEXEC:FALSE
-58.274452:-271.614376:-900.000000
--12.699452:-281.614376:-900.000000
+-20.574452:-281.614376:-900.000000
PORT
Colour:"0 1 1"
PORT
vtk:Transform:Box27
ISEXEC:FALSE
-127.484254:-220.579013:-900.000000
--81.909254:-230.579013:-900.000000
+-91.909254:-230.579013:-900.000000
PORT
RotateWXYZ:"45 0 0 1"
FIN_BOX
creaMaracasVisu:ChInfo3Dto2DRuler:Box28
ISEXEC:FALSE
-67.559786:-150.667179:-900.000000
--21.984786:-160.667179:-900.000000
+-23.234786:-160.667179:-900.000000
PORT
Direction:"0"
FIN_BOX
vtk:Transform:Box29
ISEXEC:FALSE
-157.550533:-151.214722:-900.000000
--111.975533:-161.214722:-900.000000
+-121.975533:-161.214722:-900.000000
FIN_BOX
BOX
creaMaracasVisu:wxVtkBaseView_Info:Box30
ISEXEC:FALSE
87.518493:10.369667:-900.000000
-158.693493:0.369667:-900.000000
+133.668493:0.369667:-900.000000
FIN_BOX
BOX
std:MagicBox:Box31
ISEXEC:FALSE
-34.175716:55.173035:-900.000000
-11.399284:45.173035:-900.000000
+1.899284:45.173035:-900.000000
FIN_BOX
-CONNECTIONS:39
+BOX
+wx:OutputText:Box32
+ISEXEC:FALSE
+-220.624234:-223.740652:-900.000000
+-183.849234:-233.740652:-900.000000
+FIN_BOX
+CONNECTIONS:41
CONNECTION
Box00:Spacing:Box05:In1
NumberOfControlPoints:0
CONNECTION
Box14:Out:Box17:In2
NumberOfControlPoints:0
+CONNECTION
+Box05:Out:Box32:In
+NumberOfControlPoints:0
+CONNECTION
+Box26:Out:Box32:BoxExecute
+NumberOfControlPoints:0
APP_END
# ----------------------------------
# - BBTKGEditor v 1.4 BBS BlackBox Script (Complex Box)
-# - /home/davila/Creatis/creaTools/creatools_source/creaMaracasVisu/bbtk/bbs/boxes/Ruler01_XY.bbs
+# - /tmpEED/creaTools2/creatools_source/creaMaracasVisu/bbtk/bbs/boxes/Ruler01_XY.bbs
# ----------------------------------
include std
include vtk
include std
include creaMaracasVisu
+include wx
define Ruler01_XY creaMaracasVisu
category "<VOID>"
-new ImageVtkProperties Box00
+new vtk:ImageVtkProperties Box00
-new ConcatStrings Box03
+new std:ConcatStrings Box03
-new ConcatStrings Box05
+new std:ConcatStrings Box05
-new UpdateRender Box07
+new vtk:UpdateRender Box07
set Box07.Active "true"
-new GetVectorFloatElement Box14
+new std:GetVectorFloatElement Box14
set Box14.I "0"
-new ConcatStrings Box16
+new std:ConcatStrings Box16
set Box16.In2 "p ("
set Box16.In4 "u) "
set Box16.In5 " ang="
set Box16.In7 " ."
-new Mul Box17
+new std:Mul Box17
-new MagicBox Box18
+new std:MagicBox Box18
-new MagicBox Box19
+new std:MagicBox Box19
-new MagicBox Box20
+new std:MagicBox Box20
set Box20.BoxProcessMode "Reactive"
-new MagicBox Box26
+new std:MagicBox Box26
-new Text2D Box22
+new vtk:Text2D Box22
set Box22.Color "0 1 1"
-new MagicBox Box23
+new std:MagicBox Box23
-new DrawAxe3D Box25
+new creaMaracasVisu:DrawAxe3D Box25
set Box25.Colour "0 1 1"
set Box25.lstPointX "0 286.1111"
set Box25.lstPointY "0 0"
set Box25.lstPointZ "-900 -900"
-new Transform Box27
+new vtk:Transform Box27
set Box27.RotateWXYZ "45 0 0 1"
-new ChInfo3Dto2DRuler Box28
+new creaMaracasVisu:ChInfo3Dto2DRuler Box28
set Box28.Direction "0"
-new Transform Box29
+new vtk:Transform Box29
-new wxVtkBaseView_Info Box30
+new creaMaracasVisu:wxVtkBaseView_Info Box30
-new MagicBox Box31
+new std:MagicBox Box31
+
+new wx:OutputText Box32
connect Box00.Spacing Box05.In1
connect Box30.vtkRenderer Box19.In
connect Box03.Out Box29.Translate
connect Box14.Out Box17.In2
+connect Box05.Out Box32.In
+connect Box26.Out Box32.BoxExecute
# Complex input ports
input SizeReal Box18.In " "
bbSetOutputNewImage( clivp->GetColorLayerImageViewManager()->GetImageChangeInformation(0) );
bbSetOutputLookupTable( clivp->GetColorLayerImageViewManager()->GetLookupTable(0) );
+printf("EED ColorLayerImageView::Process A ptrLookupTable:%p\n",clivp->GetColorLayerImageViewManager()->GetLookupTable(0));
+printf("EED ColorLayerImageView::Process B ptrLookupTable:%p\n",bbGetOutputLookupTable() );
+
if (firsttime==true)
{
firsttime=false;
#include "wxVtkBaseView.h"
#include <vtkScalarsToColors.h>
+#include <vtkScalarsToColors.h>
+
+
namespace bbcreaMaracasVisu
{
BBTK_OUTPUT(ColorLayerImageView,NewImage,"Image with correct Spacing",vtkImageData*,"");
BBTK_OUTPUT(ColorLayerImageView,LookupTable,"LookupTable",vtkScalarsToColors*,"");
-
BBTK_END_DESCRIBE_BLACK_BOX(ColorLayerImageView);
//=====
// Don't edit this file. This file is generated from xml description..
// bbSetOutputOut( bbGetInputIn() );
// std::cout << "Output value = " <<bbGetOutputOut() << std::endl;
+
if (bbGetInputImage()!=NULL)
{
+
manualpaintmodel->SetActive( bbGetInputActive() );
manualpaintmodel->SetTool( bbGetInputTool() );
manualpaintmodel->Set2D3D( bbGetInput2D3D() );
manualpaintmodel->SetDistanceFill( bbGetInputDistanceFill() );
manualpaintmodel->SetRangeMin( bbGetInputRange()[0] );
manualpaintmodel->SetRangeMax( bbGetInputRange()[1] );
+
if (bbGetInputPoint().size()==3)
{
manualpaintmodel->PaintImage( bbGetInputPoint()[0] , bbGetInputPoint()[1] , bbGetInputPoint()[2] );
} // if Points
+
+
if ( bbGetInputByLstPointsX().size()!=0 )
{
int i,size = bbGetInputByLstPointsX().size();
// int ia,ja,ka;
// int ii,jj,kk;
int ext[6];
+//EED 2017-01-01 Migration VTK7
+#if VTK_MAJOR_VERSION <= 5
bbGetInputByImagePoints()->GetWholeExtent(ext);
+#else
+ bbGetInputByImagePoints()->GetExtent(ext);
+#endif
+
int dimX=ext[1]-ext[0]+1;
int dimY=ext[3]-ext[2]+1;
int dimZ=ext[5]-ext[4]+1;
printf("ManualPaint_Model %d%\n", 100 );
} // if ByImagePoints
+
+
+
} else {
printf("EED Warning: Image not set. Box creaMaracasVisu::ManualPaint_Model (BBTK) \n");
- } // if
+ } // if bbGetInputImage()
+
if (bbGetInputImage2()!=NULL)
{
} else {
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)
// bbSetOutputOut( bbGetInputIn() );
// std::cout << "Output value = " <<bbGetOutputOut() << std::endl;
+
if (bbGetInputwxVtkBaseView()!=NULL)
{
vtkMPRBaseData* vtkmprbasedata = (vtkMPRBaseData*) (bbGetInputwxVtkBaseView()->GetVtkBaseData());
vtkmprbasedata->SetY( bbGetInputPoint()[1] );
vtkmprbasedata->SetZ( bbGetInputPoint()[2] );
wxCommandEvent newevent(wxEVT_COMMAND_MENU_SELECTED,12121); // Refres
+//EED 2017-09-16 Migration wxWidgets 2.8 to 3.0
+#if wxMAJOR_VERSION <= 2
bbGetInputwxVtkBaseView()->GetWxVTKRenderWindowInteractor ()->GetParent()->ProcessEvent( newevent );
+#else
+ bbGetInputwxVtkBaseView()->GetWxVTKRenderWindowInteractor ()->GetParent()->ProcessWindowEvent( newevent );
+#endif
+
+
} // if bbGetInputPosition
} // bbGetInputwxVtkBaseView
}
//std::cout<<"MSJ: test SliceImage::Process()"<<this<<std::endl;
if ( bbGetInputIn()!=NULL )
{
+
+//EED 2017-01-01 Migration VTK7
+#if VTK_MAJOR_VERSION <= 5
imageReslice->SetInput( bbGetInputIn() );
+#else
+ imageReslice->SetInputData( bbGetInputIn() );
+#endif
+
imageReslice->SetInformationInput(bbGetInputIn() );
double slice=bbGetInputSlice();
}
imageReslice->SetOutputDimensionality(2);
imageReslice->SetInterpolationModeToLinear();
+
+
+//EED 2017-01-01 Migration VTK7
+#if VTK_MAJOR_VERSION <= 5
imagedata = imageReslice->GetOutput();
imagedata->Update();
imagedata->UpdateInformation();
+#else
+ imageReslice->Update();
+ imagedata = imageReslice->GetOutput();
+#endif
+
}
bbSetOutputOut( imagedata );
}
vtkSmartPointer<vtkTubeFilter> tube = vtkSmartPointer<vtkTubeFilter>::New();
tube->CappingOn();
+
+//EED 2017-01-01 Migration VTK7
+#if VTK_MAJOR_VERSION <= 5
tube->SetInput(polyData);
+#else
+ tube->SetInputData(polyData);
+#endif
+
tube->SetNumberOfSides(nTv);
tube->SetVaryRadiusToVaryRadiusByAbsoluteScalar();
vtkSmartPointer<vtkTubeFilter> tube = vtkSmartPointer<vtkTubeFilter>::New();
+//EED 2017-01-01 Migration VTK7
+#if VTK_MAJOR_VERSION <= 5
tube->SetInput(polyData);
+#else
+ tube->SetInputData(polyData);
+#endif
tube->SetNumberOfSides(nTv);
tube->SetVaryRadiusToVaryRadiusByAbsoluteScalar();
tube->CappingOn();
vtksphere->SetRadius( 1 );
vtkPolyDataMapper *sphereMapper = vtkPolyDataMapper::New();
+//EED 2017-01-01 Migration VTK7
+#if VTK_MAJOR_VERSION <= 5
sphereMapper->SetInput( vtksphere->GetOutput() );
+#else
+ sphereMapper->SetInputData( vtksphere->GetOutput() );
+#endif
sphereActor = vtkActor::New();
sphereActor->SetMapper(sphereMapper);
w2i = vtkWindowToImageFilter::New();
png = vtkPNGWriter::New();
w2i->SetInput( bbGetInputRenderer()->GetRenderWindow() );
+
+//EED 2017-01-01 Migration VTK7
+#if VTK_MAJOR_VERSION <= 5
png->SetInput( w2i->GetOutput() );
+#else
+ png->SetInputData( w2i->GetOutput() );
+#endif
+
png->SetFileName( newFileName.c_str() );
png->Write();
png->Delete();
mimage->SetDimensions(bbGetInputIn()->GetDimensions());
mimage->SetExtent(bbGetInputIn()->GetExtent());
mimage->SetOrigin(bbGetInputIn()->GetOrigin());
+//EED 2017-01-01 Migration VTK7
+#if VTK_MAJOR_VERSION <= 5
mimage->SetScalarType( outputformat );
mimage->AllocateScalars();
+#else
+ mimage->AllocateScalars( outputformat , 1);
+#endif
int sizeLstPointR = bbGetInputlstPointR().size();
int iAxe,sizeAxe = bbGetInputlstPointX().size();
initializeVOIWidget();
}
}
- void wxWidgetVOI::initializeVOIWidget(){
+
+ void wxWidgetVOI::initializeVOIWidget()
+ {
wxSizer* sizer = this->GetSizer();
/// \TODO fix deprecated warning: virtual bool wxSizer::Remove(wxWindow*) is deprecated (declared at /usr/include/wx-2.8/wx/sizer.h:513)
- if(mcontourvoiwidget!=NULL){
- sizer->Remove( mcontourvoiwidget );
+ if(mcontourvoiwidget!=NULL)
+ {
+//EED 2017-09-16 Migration wxWidgets 2.8 to 3.0
+#if wxMAJOR_VERSION <= 2
+ sizer->Remove( mcontourvoiwidget );
+#else
+ sizer->Detach( mcontourvoiwidget );
+#endif
mcontourvoiwidget->Destroy();
}
this->Refresh();
}
- void wxWidgetVOI::setBaseView(wxVtkBaseView * wxvtkbaseview){
+ void wxWidgetVOI::setBaseView(wxVtkBaseView * wxvtkbaseview)
+ {
this->wxvtkbaseview = wxvtkbaseview;
}
- void wxWidgetVOI::setImageData(vtkImageData * imagedata){
+
+ void wxWidgetVOI::setImageData(vtkImageData * imagedata)
+ {
this->imagedata = imagedata;
}
polydatamapper = vtkPolyDataMapper::New();
mvtkactor = vtkActor::New();
+//EED 2017-01-01 Migration VTK7
+#if VTK_MAJOR_VERSION <= 5
polydatamapper->SetInput(mallData);
+#else
+ polydatamapper->SetInputData(mallData);
+#endif
+
mvtkactor->SetMapper(polydatamapper);
bbSetOutputOut(mvtkactor);
}
vtkActor *vtkactor = vtkActor::New();
// polydatamapper->ScalarVisibilityOff();
+//EED 2017-01-01 Migration VTK7
+#if VTK_MAJOR_VERSION <= 5
polydatamapper->SetInput(polydata);
+#else
+ polydatamapper->SetInputData(polydata);
+#endif
vtkactor->SetMapper(polydatamapper);
vecVtkPolyData.push_back( polydata );
//------------------------------------------------
void HistogramView::Process()
{
-printf("EED HistogramView::Process Start \n");
if (firsttime==true)
{
firsttime=false;
// histogram_wxwidget = new Histogram( wxpanel , -1, wxPoint(0,0), wxSize(400,400),wxNO_BORDER );
_histogramMinMaxLevel->Configure( bbGetInputIn() );
}
-printf("EED HistogramView::Process End \n");
}
//------------------------------------------------
}
// EO namespace bbcreaMaracasVisu
-
vtkRenderer *render = bbGetInputRenderer();
vtkImageData *img = bbGetInputIn();
vtkLinearTransform* transform = bbGetInputTransform();
-
- if(img != NULL)
+
+
+ if(img != NULL)
{
if (bbGetInputLookupTable()==NULL)
{
+//EED 2017-01-01 Migration VTK7
+#if VTK_MAJOR_VERSION <= 5
imageactor->SetInput( img );
+#else
+ imageactor->SetInputData( img );
+#endif
} else {
/*
vtkLookupTable *table = vtkLookupTable::New();
// imageshiftscale->SetOutputScalarTypeToUnsignedChar();
// color->SetInput( imageshiftscale->GetOutput() );
+
+
+//EED 2017-01-01 Migration VTK7
+#if VTK_MAJOR_VERSION <= 5
color->SetInput( img );
color->Update();
imageactor->GetMapper()->SetInput( color->GetOutput() );
+#else
+ color->SetInputData( img );
+ imageactor->GetMapper()->SetInputData( color->GetOutput() );
+#endif
imageactor->GetProperty()->SetInterpolationTypeToNearest();
}
}
mchange = vtkImageChangeInformation::New();
img->GetExtent( ext );
+
+//EED 2017-01-01 Migration VTK7
+#if VTK_MAJOR_VERSION <= 5
mchange->SetInput( img );
+#else
+ mchange->SetInputData( img );
+#endif
+
mchange->SetOutputExtentStart(0,0,0);
if (bbGetInputNewSpacing().size()==3)
{
mchange->Update(); //important
bbSetOutputOut( mchange->GetOutput() );
} // if img
+
}
// if (firsttime==true)
// {
// firsttime=false;
-
-
- printf("EED PlotterView::Process %d %d \n ", bbGetInputInY().size(),bbGetInputInY2().size());
-
+
pGraphicalFunction *pGF = mwxwidget->getFunction(0);
pGraphicalFunction *pGF2 = mwxwidget->getFunction(1);
} // if bbGetInputInY
// } // if firsttime
+
if (pGF!=NULL)
{
}
}// if pGF
-
if (pGF2!=NULL)
{
// -Erasing points-
int i,sizePoints = pGF2->getSizePoints();
for (i=0; i<sizePoints;i++)
{
+//EED 2017-09-16 Migration wxWidgets 2.8 to 3.0
+#if wxMAJOR_VERSION <= 2
pGF2->deletePointAt(1); // EED here NOT 0 is 1
+#else
+ pGF2->deletePointAt(0); // EED here NOT 0 is 1
+#endif
} // for i
// -Add Points-
double px;
px = i;
}
pGF2->AddNewPoint( px, bbGetInputInY2()[i] );
- }
+ } // for
}// if pGF
-
mwxwidget->UpdateAll();
-
-
}
//---------------------------------------------------
void PlotterView::CreateWidget(wxWindow* parent)
{
- bbtkDebugMessageInc("Core",9,"PlotterView::CreateWxWindow()"<<std::endl);
-
- mwxwidget = new pPlotterWindow( parent , -1,wxDefaultPosition, wxDefaultSize, 0 );
- mwxwidget->AddLayer(new pPlotterScaleX());
- mwxwidget->AddLayer(new pPlotterScaleY());
-
+ bbtkDebugMessageInc("Core",9,"PlotterView::CreateWxWindow()"<<std::endl);
+ mwxwidget = new pPlotterWindow( parent , -1,wxDefaultPosition, wxDefaultSize, 0 );
+ mwxwidget->AddLayer(new pPlotterScaleX());
+ mwxwidget->AddLayer(new pPlotterScaleY());
mwxwidget->setMinScrY(0);
mwxwidget->setMaxScrY(5000);
-
-
- bbtkDebugDecTab("Core",9);
- bbSetOutputWidget( mwxwidget );
+ bbtkDebugDecTab("Core",9);
+ bbSetOutputWidget( mwxwidget );
}
//---------------------------------------------------
_ctfun->AddRGBPoint( greylevelcolors[i] , red[i],green[i], blue[i]);
}
-
+//EED 2017-01-01 Migration VTK7
+#if VTK_MAJOR_VERSION <= 5
_tfun->Update();
+#else
+ //...
+#endif
bbSetOutputOpacityFunction(_tfun);
bbSetOutputColorFunction(_ctfun );
bbSetOutputActive( mwxwidget->GetActive() );
private:
//HistogramWidget *mwxwidget;
- HistogramDialogComboBox *mwxwidget;
- vtkImageData* _currentimg;
+ HistogramDialogComboBox *mwxwidget;
+ vtkImageData* _currentimg;
- vtkPiecewiseFunction* _tfun;
- vtkColorTransferFunction* _ctfun;
+ vtkPiecewiseFunction* _tfun;
+ vtkColorTransferFunction* _ctfun;
};
#include "volumerendererdata.h"
#include "vtkObjectFactory.h"
+
+//EED 2017-01-01 Migration VTK7
+#if VTK_MAJOR_VERSION <= 5
vtkCxxRevisionMacro(VolumeRendererData, "$Revision: 1.11 $");
+#else
+ //...
+#endif
+
vtkStandardNewMacro(VolumeRendererData);
VolumeRendererData::VolumeRendererData()
{
public:
static VolumeRendererData *New();
+
+//EED 2017-01-01 Migration VTK7
+#if VTK_MAJOR_VERSION <= 5
vtkTypeRevisionMacro(VolumeRendererData,vtkObject);
+#else
+ vtkTypeMacro(VolumeRendererData,vtkObject);
+#endif
+
//
vtkSetObjectMacro(ImageData, vtkImageData);
//iconfil+= "/OpenImage.png";
//wxBitmap* bitmap0 = new wxBitmap(wxString(iconfil.c_str(),wxConvUTF8), wxBITMAP_TYPE_PNG);
wxBitmap bitmap0(OpenImage_xpm);
+
+//EED 2017-09-16 Migration wxWidgets 2.8 to 3.0
+#if wxMAJOR_VERSION <= 2
this->AddTool(1, wxString(_T("test")),bitmap0, NULL, wxITEM_NORMAL, wxString(_T("Open File")));
+#else
+ this->AddTool(1, wxString(_T("test")),bitmap0, wxString(_T("Open File")), wxITEM_NORMAL );
+#endif
+
/*iconfil+= "/Open.png";
wxBitmap* bitmap2 = new wxBitmap(wxString(iconfil.c_str(),wxConvUTF8), wxBITMAP_TYPE_PNG);
//iconfil+= "/OpenImage.png";
//wxBitmap* bitmap0 = new wxBitmap(wxString(iconfil.c_str(),wxConvUTF8), wxBITMAP_TYPE_PNG);
wxBitmap bitmap0(OpenImage_xpm);
+
+
+//EED 2017-09-16 Migration wxWidgets 2.8 to 3.0
+#if wxMAJOR_VERSION <= 2
this->AddTool(1, wxString(_T("test")),bitmap0, NULL, wxITEM_NORMAL, wxString(_T("Open File")));
+#else
+ this->AddTool(1, wxString(_T("test")),bitmap0 , wxString(_T("Open File")), wxITEM_NORMAL );
+#endif
+
/*iconfil+= "/Open.png";
wxBitmap* bitmap2 = new wxBitmap(wxString(iconfil.c_str(),wxConvUTF8), wxBITMAP_TYPE_PNG);
${WXWIDGETS_LIBRARIES}
# ${KWWidgets_LIBRARIES}
${VTK_LIBRARIES}
- creaMaracasVisu
+##EED-creaMaracasVisu-SHARED creaMaracasVisu
#${ITK_LIBRARIES}
# ${GDCM_LIBRARIES}
# ${BOOST_LIBRARIES}
#include "surfacerenderingimagestencilexport.h"
-#include "vtkObjectFactory.h"
#include "vtkMetaImageWriter.h"
#include "math.h"
+
vtkStandardNewMacro(SurfaceRenderingImageStencilExport)
SurfaceRenderingImageStencilExport::SurfaceRenderingImageStencilExport()
ImageOutput = 0;
}
-SurfaceRenderingImageStencilExport::~SurfaceRenderingImageStencilExport(){
+SurfaceRenderingImageStencilExport::~SurfaceRenderingImageStencilExport()
+{
- if(ImageOutput){
+ if(ImageOutput)
+ {
ImageOutput->Delete();
}
}
-void SurfaceRenderingImageStencilExport::Update(){
- this->Execute(0);
-}
-void SurfaceRenderingImageStencilExport::Execute(vtkImageData *data){
- vtkPolyData* polydata = (vtkPolyData*)this->GetInput();
+//EED 2017-01-01 Migration VTK7
+#if VTK_MAJOR_VERSION <= 5
+
+ void SurfaceRenderingImageStencilExport::Update(){
+ this->Execute(0);
+ }
+
+
+ // This method is much too long, and has to be broken up!
+ // Furthermore we are loosing the normals !!!
+ void SurfaceRenderingImageStencilExport::Execute(vtkImageData *data){
+ {
vtkSmartPointer<vtkPolyDataToImageStencil> polytostencil = vtkSmartPointer<vtkPolyDataToImageStencil>::New();
+
+ vtkPolyData* polydata = (vtkPolyData*)this->GetInput();
polytostencil->SetInput(polydata);
polytostencil->Update();
imagein->SetScalarTypeToUnsignedShort();
imagein->AllocateScalars();
-
int* extent = imagein->GetExtent();
- for (int x = extent[0]; x <= extent[1]; x++){
- for (int y = extent[2]; y <= extent[3]; y++){
- for (int z =extent[4]; z <= extent[5]; z++){
+ int x, y, z;
+ for (x = extent[0]; x <= extent[1]; x++){
+ for (y = extent[2]; y <= extent[3]; y++){
+ for (z =extent[4]; z <= extent[5]; z++){
unsigned short* pixel = static_cast<unsigned short*>(imagein->GetScalarPointer(x,y,z));
*pixel = 0;
- }
- }
- }
+ } // for x
+ } // for y
+ } // for z
vtkSmartPointer<vtkImageStencil> stencil = vtkSmartPointer<vtkImageStencil>::New();
+
stencil->SetInput(imagein);
stencil->SetStencil(polytostencil->GetOutput());
+
stencil->ReverseStencilOn();
stencil->SetBackgroundValue(128);
stencil->Update();
- if(ImageOutput){
+ if(ImageOutput)
+ {
ImageOutput->Delete();
}
ImageOutput = vtkImageData::New();
ImageOutput->DeepCopy(stencil->GetOutput());
-}
+ }
+
+#else
+
+int SurfaceRenderingImageStencilExport::RequestData( vtkInformation *vtkNotUsed(request), vtkInformationVector **inputVector, vtkInformationVector *outputVector)
+{
+
+ // get the info objects
+ vtkInformation *inInfo = inputVector[0]->GetInformationObject(0);
+ vtkInformation *outInfo = outputVector->GetInformationObject(0);
+
+ // get the input and output
+ vtkPolyData *input = vtkPolyData::SafeDownCast( inInfo->Get(vtkDataObject::DATA_OBJECT()));
+ vtkPolyData *output = vtkPolyData::SafeDownCast( outInfo->Get(vtkDataObject::DATA_OBJECT()));
+
+
+ vtkSmartPointer<vtkPolyDataToImageStencil> polytostencil = vtkSmartPointer<vtkPolyDataToImageStencil>::New();
+
+// vtkPolyData* polydata = (vtkPolyData*)this->GetInput();
+ vtkPolyData* polydata = input;
+ polytostencil->SetInputData(polydata);
+ polytostencil->Update();
+
+ double *bounds = polydata->GetBounds();
+ vtkSmartPointer<vtkImageData> imagein = vtkSmartPointer<vtkImageData>::New();
+
+ imagein->SetExtent(bounds[0] - 1, bounds[1] + 1, bounds[2] - 1, bounds[3] + 1, bounds[4] - 1, bounds[5] + 1);
+ imagein->AllocateScalars(VTK_UNSIGNED_SHORT,1);
-vtkImageData* SurfaceRenderingImageStencilExport::GetOutput(){
- return ImageOutput;
+
+ int* extent = imagein->GetExtent();
+
+ int x,y,z;
+ for (x = extent[0]; x <= extent[1]; x++){
+ for (y = extent[2]; y <= extent[3]; y++){
+ for (z =extent[4]; z <= extent[5]; z++){
+ unsigned short* pixel = static_cast<unsigned short*>(imagein->GetScalarPointer(x,y,z));
+ *pixel = 0;
+ } // for z
+ } // for y
+ } // for z
+
+ vtkSmartPointer<vtkImageStencil> stencil = vtkSmartPointer<vtkImageStencil>::New();
+
+ stencil->SetInputData(imagein);
+ stencil->SetStencilData(polytostencil->GetOutput());
+
+ stencil->ReverseStencilOn();
+ stencil->SetBackgroundValue(128);
+ stencil->Update();
+
+// if(ImageOutput)
+// {
+// ImageOutput->Delete();
+// }
+// ImageOutput = vtkImageData::New();
+// ImageOutput->DeepCopy(stencil->GetOutput());
+
+ output->ShallowCopy( stencil->GetOutput() );
+ stencil->Delete();
+
+
+ return 1;
}
+
+#endif
+
+
+
+
+
+
+
+//-------------------------------------------------------------------------------------------
+
+//EED 2017-01-01 Migration VTK7
+#if VTK_MAJOR_VERSION <= 5
+ vtkImageData* SurfaceRenderingImageStencilExport::GetOutputData()
+ {
+ return ImageOutput;
+ }
+#else
+ // ..
+#endif
+
#ifndef SURFACERENDERINGIMAGESTENCILEXPORT_H
#define SURFACERENDERINGIMAGESTENCILEXPORT_H
-#include <vtkDataSetToImageFilter.h>
+#include "vtkObjectFactory.h"
+
+//EED 2017-01-01 Migration VTK7
+#if VTK_MAJOR_VERSION <= 5
+ #include <vtkDataSetToImageFilter.h>
+#else
+ #include "vtkImageAlgorithm.h"
+ #include "vtkDataObject.h"
+ #include "vtkInformation.h"
+ #include "vtkDemandDrivenPipeline.h"
+ #include "vtkInformationVector.h"
+#endif
+
#include <vtkSmartPointer.h>
#include <vtkPolyDataToImageStencil.h>
#include <vtkImageStencil.h>
#include <vtkImageData.h>
#include <vtkPolyData.h>
+//EED 2017-01-01 Migration VTK7
+#if VTK_MAJOR_VERSION <= 5
class SurfaceRenderingImageStencilExport : public vtkDataSetToImageFilter
+#else
+class SurfaceRenderingImageStencilExport : public vtkImageAlgorithm
+#endif
{
public:
static SurfaceRenderingImageStencilExport *New();
+#if VTK_MAJOR_VERSION <= 5
vtkTypeMacro(SurfaceRenderingImageStencilExport,vtkDataSetToImageFilter)
-
virtual void Update();
- vtkImageData* GetOutput();
+ virtual vtkImageData* GetOutputData();
+#else
+ vtkTypeMacro(SurfaceRenderingImageStencilExport,vtkImageAlgorithm)
+#endif
+
+
protected:
+//EED 2017-01-01 Migration VTK7
+#if VTK_MAJOR_VERSION <= 5
+ // Usual data generation method
virtual void Execute(vtkImageData *data);
+#else
+ virtual int RequestData( vtkInformation *vtkNotUsed(request), vtkInformationVector **inputVector, vtkInformationVector *outputVector);
+#endif
private:
}
_dataMapper = vtkPolyDataMapper::New();
+
+//EED 2017-01-01 Migration VTK7
+#if VTK_MAJOR_VERSION <= 5
_dataMapper->SetInput(polydata);
+#else
+ _dataMapper->SetInputData(polydata);
+#endif
vtkActor* dataActor = vtkActor::New();
dataActor->SetMapper(_dataMapper);
vtkSmartPointer<vtkPLYWriter> plywriter =
vtkSmartPointer<vtkPLYWriter>::New();
plywriter->SetFileName(filename);
+//EED 2017-01-01 Migration VTK7
+#if VTK_MAJOR_VERSION <= 5
plywriter->SetInput(_dataMapper->GetInput());
+#else
+ plywriter->SetInputData(_dataMapper->GetInput());
+#endif
plywriter->Write();
}else if(ext.compare(STL) == 0){
vtkSmartPointer<vtkSTLWriter> stlWriter =
vtkSmartPointer<vtkSTLWriter>::New();
stlWriter->SetFileName(filename);
+//EED 2017-01-01 Migration VTK7
+#if VTK_MAJOR_VERSION <= 5
stlWriter->SetInput(_dataMapper->GetInput());
+#else
+ stlWriter->SetInputData(_dataMapper->GetInput());
+#endif
stlWriter->SetFileTypeToBinary();
stlWriter->Write();
}else if(ext.compare(VTK) == 0){
vtkSmartPointer<vtkPolyDataWriter> polydataWriter =
vtkSmartPointer<vtkPolyDataWriter>::New();
polydataWriter->SetFileName(filename);
+//EED 2017-01-01 Migration VTK7
+#if VTK_MAJOR_VERSION <= 5
polydataWriter->SetInput(_dataMapper->GetInput());
+#else
+ polydataWriter->SetInputData(_dataMapper->GetInput());
+#endif
polydataWriter->SetFileTypeToBinary();
polydataWriter->Write();
}else{
void wxMaracasSurfaceRenderingManagerData::exportImageStencil(const char* filename){
if(_dataMapper){
vtkSmartPointer< SurfaceRenderingImageStencilExport> stencilexport = vtkSmartPointer< SurfaceRenderingImageStencilExport >::New();
+//EED 2017-01-01 Migration VTK7
+#if VTK_MAJOR_VERSION <= 5
stencilexport->SetInput( _dataMapper->GetInput());
+#else
+ stencilexport->SetInputData( _dataMapper->GetInput());
+#endif
stencilexport->Update();
vtkImageData* imgstencil = stencilexport->GetOutput();
vtkSmartPointer<vtkMetaImageWriter> metawriter = vtkSmartPointer<vtkMetaImageWriter>::New();
metawriter->SetFileName(filename);
+//EED 2017-01-01 Migration VTK7
+#if VTK_MAJOR_VERSION <= 5
metawriter->SetInput(imgstencil);
+#else
+ metawriter->SetInputData(imgstencil);
+#endif
metawriter->Write();
}else{
cout<<"No poly data set to data mapper."<<endl;
_prop3D=NULL;
_tresholdFilter = vtkImageThreshold::New();
+//EED 2017-01-01 Migration VTK7
+#if VTK_MAJOR_VERSION <= 5
_tresholdFilter->SetInput(this->_imagedata);
+#else
+ _tresholdFilter->SetInputData(this->_imagedata);
+#endif
_tresholdFilter->SetInValue(255);
_tresholdFilter->SetOutValue(0);
_cubesFilter = vtkMarchingCubes::New();
+//EED 2017-01-01 Migration VTK7
+#if VTK_MAJOR_VERSION <= 5
_cubesFilter->SetInput(_tresholdFilter->GetOutput());
+#else
+ _cubesFilter->SetInputData(_tresholdFilter->GetOutput());
+#endif
//_cubesFilter->ComputeGradientsOn();
_cubesFilter->ComputeScalarsOn();
_cubesFilter->ComputeNormalsOn();
_cubesFilter->SetNumberOfContours( 1 );
_cleanFilter = vtkCleanPolyData::New();
- _cleanFilter->SetInput ( _cubesFilter->GetOutput() );
+//EED 2017-01-01 Migration VTK7
+#if VTK_MAJOR_VERSION <= 5
+ _cleanFilter->SetInput( _cubesFilter->GetOutput() );
+#else
+ _cleanFilter->SetInputData( _cubesFilter->GetOutput() );
+#endif
_smooth = vtkSmoothPolyDataFilter::New();
+//EED 2017-01-01 Migration VTK7
+#if VTK_MAJOR_VERSION <= 5
_smooth->SetInput(_cleanFilter->GetOutput());
+#else
+ _smooth->SetInputData(_cleanFilter->GetOutput());
+#endif
_smooth->SetNumberOfIterations(6);
_smooth->SetRelaxationFactor(0.3);
//_smooth->FeatureEdgeSmoothingOff();
_boxWidgetS1->SetInteractor( interactor );
_boxWidgetS1->SetPlaceFactor(1.25);
+//EED 2017-01-01 Migration VTK7
+#if VTK_MAJOR_VERSION <= 5
_boxWidgetS1->SetInput( this->_imagedata );
+#else
+ _boxWidgetS1->SetInputData( this->_imagedata );
+#endif
_boxWidgetS1->PlaceWidget();
boxSurfaceObserver* observer = boxSurfaceObserver::New();
vtkStripper* striper = vtkStripper::New();
+//EED 2017-01-01 Migration VTK7
+#if VTK_MAJOR_VERSION <= 5
striper->SetInput( _smooth->GetOutput() );
+#else
+ striper->SetInputData( _smooth->GetOutput() );
+#endif
//striper->SetInput( _cleanFilter->GetOutput() );
striper->Update();
+//EED 2017-01-01 Migration VTK7
+#if VTK_MAJOR_VERSION <= 5
_boxWidgetS1->SetInput(striper->GetOutput());
+#else
+ _boxWidgetS1->SetInputData(striper->GetOutput());
+#endif
//_boxWidgetS1->PlaceWidget();
_boxWidgetS1->GetPlanes( _tissuePlanes );
_tissueClipper = vtkClipPolyData::New();
+//EED 2017-01-01 Migration VTK7
+#if VTK_MAJOR_VERSION <= 5
_tissueClipper->SetInput( striper->GetOutput() );
+#else
+ _tissueClipper->SetInputData( striper->GetOutput() );
+#endif
_tissueClipper->SetClipFunction( _tissuePlanes );
_tissueClipper->InsideOutOn( );
+//EED 2017-01-01 Migration VTK7
+#if VTK_MAJOR_VERSION <= 5
_dataMapper->SetInput( _tissueClipper->GetOutput() );
+#else
+ _dataMapper->SetInputData( _tissueClipper->GetOutput() );
+#endif
observer->SetPlanes( _tissuePlanes );
observer->SetActor( dataActor );
_boxWidgetS1->AddObserver( vtkCommand::InteractionEvent , observer );
_boxWidgetS1->EnabledOff();
}else{
//_dataMapper->SetInput(_cleanFilter->GetOutput());
+//EED 2017-01-01 Migration VTK7
+#if VTK_MAJOR_VERSION <= 5
_dataMapper->SetInput(_smooth->GetOutput());
+#else
+ _dataMapper->SetInputData(_smooth->GetOutput());
+#endif
}
dataActor->SetMapper(_dataMapper);
void ImagePlaneWidget::initializeImageActors(){
- int *w_ext = _img->GetWholeExtent();
//cout<<w_ext[0]<<" "<<w_ext[1]<<" "<<w_ext[2]<<" "<<w_ext[3]<<" "<<w_ext[4]<<" "<<w_ext[5]<<" "<<endl;
_imageactorx = vtkImageActor::New();
+
+//EED 2017-01-01 Migration VTK7
+#if VTK_MAJOR_VERSION <= 5
+ int *w_ext = _img->GetWholeExtent();
_imageactorx->SetInput(_img);
+#else
+ int *w_ext = _img->GetExtent();
+ _imageactorx->SetInputData(_img);
+#endif
+
xslice = (w_ext[4] + w_ext[5])/2;
_imageactorx->SetDisplayExtent(w_ext[0], w_ext[1], w_ext[2], w_ext[3], xslice, xslice);
_imageactory = vtkImageActor::New();
+
+//EED 2017-01-01 Migration VTK7
+#if VTK_MAJOR_VERSION <= 5
_imageactory->SetInput(_img);
+#else
+ _imageactory->SetInputData(_img);
+#endif
+
yslice = (w_ext[2] + w_ext[3])/2;
_imageactory->SetDisplayExtent(w_ext[0], w_ext[1], yslice, yslice, w_ext[4], w_ext[5]);
_imageactorz = vtkImageActor::New();
+
+//EED 2017-01-01 Migration VTK7
+#if VTK_MAJOR_VERSION <= 5
_imageactorz->SetInput(_img);
+#else
+ _imageactorz->SetInputData(_img);
+#endif
+
zslice = (w_ext[0] + w_ext[1])/2;
_imageactorz->SetDisplayExtent(zslice, zslice, w_ext[2], w_ext[3], w_ext[4], w_ext[5]);
// Set input X,Y and Z plane
_xwidget->Off( );
+
+//EED 2017-01-01 Migration VTK7
+#if VTK_MAJOR_VERSION <= 5
_xwidget->SetInput( _img );
+#else
+ _xwidget->SetInputData( _img );
+#endif
+
_xwidget->SetPlaneOrientationToXAxes( );
_xwidget->SetSliceIndex( sliceX );
_xwidget->TextureInterpolateOff();
_xwidget->GetTextProperty()->SetColor(0.3, 0.3, 0.3);
_ywidget->Off( );
+
+//EED 2017-01-01 Migration VTK7
+#if VTK_MAJOR_VERSION <= 5
_ywidget->SetInput( _img );
+#else
+ _ywidget->SetInputData( _img );
+#endif
+
_ywidget->SetPlaneOrientationToYAxes( );
_ywidget->SetSliceIndex( sliceY );
_ywidget->TextureInterpolateOff();
_ywidget->On( );
_zwidget->Off( );
+
+
+//EED 2017-01-01 Migration VTK7
+#if VTK_MAJOR_VERSION <= 5
_zwidget->SetInput( _img );
+#else
+ _zwidget->SetInputData( _img );
+#endif
+
+
_zwidget->SetPlaneOrientationToZAxes( );
_zwidget->SetSliceIndex( sliceZ );
_zwidget->TextureInterpolateOff();
}
-void ImagePlaneWidget::invariant(){
+void ImagePlaneWidget::invariant()
+{
if(_img == NULL){
throw "Image data is not initialized";
}
}
-void ImagePlaneWidget::setSliceXImageActor(int value){
+void ImagePlaneWidget::setSliceXImageActor(int value)
+{
+//EED 2017-01-01 Migration VTK7
+#if VTK_MAJOR_VERSION <= 5
int *w_ext = _img->GetWholeExtent();
+#else
+ int *w_ext = _img->GetExtent();
+#endif
+
xslice = value;
_imageactorx->SetDisplayExtent(w_ext[0], w_ext[1], w_ext[2], w_ext[3], xslice, xslice);
m_Interactor->Render();
}
-void ImagePlaneWidget::setSliceYImageActor(int value){
+
+void ImagePlaneWidget::setSliceYImageActor(int value)
+{
+//EED 2017-01-01 Migration VTK7
+#if VTK_MAJOR_VERSION <= 5
int *w_ext = _img->GetWholeExtent();
+#else
+ int *w_ext = _img->GetExtent();
+#endif
yslice = value;
_imageactory->SetDisplayExtent(w_ext[0], w_ext[1], yslice, yslice, w_ext[4], w_ext[5]);
m_Interactor->Render();
}
-void ImagePlaneWidget::setSliceZImageActor(int value){
+
+
+void ImagePlaneWidget::setSliceZImageActor(int value)
+{
+
+//EED 2017-01-01 Migration VTK7
+#if VTK_MAJOR_VERSION <= 5
int *w_ext = _img->GetWholeExtent();
+#else
+ int *w_ext = _img->GetExtent();
+#endif
+
zslice = value;
_imageactorz->SetDisplayExtent(zslice, zslice, w_ext[2], w_ext[3], w_ext[4], w_ext[5]);
m_Interactor->Render();
/**
** Start of the manager class
**/
-VolumeRendererManager::VolumeRendererManager(){
- _renderer = NULL;
- _idCount=0;
+VolumeRendererManager::VolumeRendererManager()
+{
+ _renderer = NULL;
+ _idCount = 0;
}
-VolumeRendererManager::~VolumeRendererManager(){
- _renderer = 0;
- _idCount=0;
- image = 0;
+
+VolumeRendererManager::~VolumeRendererManager()
+{
+ _renderer = 0;
+ _idCount = 0;
+ image = 0;
for(unsigned i = 0; i < prop3Dvect.size();i++){
prop3Dvect[i]->Delete();
}
/**
** Sets the renderer to manage the prop3D from the view
**/
-void VolumeRendererManager::setRenderer(vtkRenderer* renderer){
+void VolumeRendererManager::setRenderer(vtkRenderer* renderer)
+{
_renderer = renderer;
}
/**
** Updates Volume
**/
-void VolumeRendererManager::Update(int ppid){
+void VolumeRendererManager::Update(int ppid)
+{
VolumeRendererManagerData* data = this->getViewData(ppid);
data->Update();
_renderer->Render();
if this flag is set to false and the volume has multiple components, vtkImageAppendComponents is used to create
a single representation of the image.
*/
-int VolumeRendererManager::addVolume(vtkImageData* img, vtkRenderWindowInteractor* interactor, bool independentcomponents){
- if(img->GetNumberOfScalarComponents() > 1 && !independentcomponents){
-
-
+int VolumeRendererManager::addVolume(vtkImageData* img, vtkRenderWindowInteractor* interactor, bool independentcomponents)
+{
+ if(img->GetNumberOfScalarComponents() > 1 && !independentcomponents)
+ {
image = img;
-
vtkSmartPointer< vtkImageLuminance > luminance = vtkSmartPointer< vtkImageLuminance >::New();
+//EED 2017-01-01 Migration VTK7
+#if VTK_MAJOR_VERSION <= 5
luminance->SetInput(img);
+#else
+ luminance->SetInputData(img);
+#endif
+
luminance->Update();
vtkSmartPointer< vtkImageAppendComponents > append = vtkSmartPointer< vtkImageAppendComponents >::New();
+
+//EED 2017-01-01 Migration VTK7
+#if VTK_MAJOR_VERSION <= 5
append->SetInput(0, img);
append->SetInput(1, luminance->GetOutput());
+#else
+ append->SetInputData(0, img);
+ append->SetInputData(1, luminance->GetOutput());
+#endif
+
append->Update();
for(unsigned i = 0; i < img->GetNumberOfScalarComponents(); i++){
vectimg.push_back(vtkImageData::New());
- vectimg[i]->SetNumberOfScalarComponents(1);
vectimg[i]->SetExtent(img->GetExtent());
vectimg[i]->SetSpacing(img->GetSpacing());
vectimg[i]->SetOrigin(img->GetOrigin());
+
+//EED 2017-01-01 Migration VTK7
+#if VTK_MAJOR_VERSION <= 5
+ vectimg[i]->SetNumberOfScalarComponents(1);
vectimg[i]->SetScalarType(img->GetScalarType());
vectimg[i]->AllocateScalars();
+#else
+ vectimg[i]->AllocateScalars(img->GetScalarType(),1);
+#endif
+
}
int *extent = img->GetExtent();
vtkImageData* img = reader->GetOutput();
vtkImageCast* cast = vtkImageCast::New();
+//EED 2017-01-01 Migration VTK7
+#if VTK_MAJOR_VERSION <= 5
cast->SetInput(img);
+#else
+ cast->SetInputData(img);
+#endif
+
cast->SetOutputScalarTypeToUnsignedShort();
cast->Update();
//reader->Delete();
#include "boxSurfaceObserver.h"
#include "vtkProperty.h"
-#include <vtkVolumeRayCastMapper.h>
+
+#if (VTK_MAJOR_VERSION <= 7)
+ #include <vtkVolumeRayCastMapper.h>
+#else
+ #include <vtkFixedPointVolumeRayCastMapper.h>
+#endif
+
+
+//EED 2017-01-01 Migration VTK7
+#if VTK_MAJOR_VERSION <= 5
+ //...
+#else
+#include <vtkGPUVolumeRayCastMapper.h>
+#endif
// EED This is code for Juan Carlos Prieto TESTES
//#if VTK_MAJOR_VERSION >= 5
using namespace std;
-VolumeRendererManagerData::VolumeRendererManagerData(vtkImageData* vol, bool usegpu){
+VolumeRendererManagerData::VolumeRendererManagerData(vtkImageData* vol, bool usegpu)
+{
Initialize(vol, "", usegpu);
}
-VolumeRendererManagerData::VolumeRendererManagerData(vtkImageData* vol, std::string dataname){
+VolumeRendererManagerData::VolumeRendererManagerData(vtkImageData* vol, std::string dataname)
+{
Initialize(vol, dataname);
}
-VolumeRendererManagerData::VolumeRendererManagerData(vtkImageData* vol, vtkRenderer* render, std::string dataname){
+VolumeRendererManagerData::VolumeRendererManagerData(vtkImageData* vol, vtkRenderer* render, std::string dataname)
+{
Initialize(vol, dataname);
render->AddActor(this->getProp3D());
}
-void VolumeRendererManagerData::Initialize(vtkImageData* vol, std::string dataname, bool usegpu){
- _id = 0;
- _vol = vol;
- _dataname = dataname;
-
+void VolumeRendererManagerData::Initialize(vtkImageData* vol, std::string dataname, bool usegpu)
+{
+ _id = 0;
+ _vol = vol;
+ _dataname = dataname;
- _volumePlanes = vtkPlanes::New();
+ _volumePlanes = vtkPlanes::New();
_volumeProperty = vtkVolumeProperty::New();
_volumeProperty->SetInterpolationTypeToLinear();
_newvol->SetProperty(_volumeProperty );
- _compositeFunction = 0;
- _MIPFunction = 0;
+#if (VTK_MAJOR_VERSION <= 7)
+ _compositeFunction = 0;
+ _MIPFunction = 0;
+#else
+ // ..
+#endif
- BoxWidget = 0;
+ BoxWidget = 0;
/* EED9Juin2011
if(usegpu && _vol->GetDataDimension() > 2){
#if VTK_MAJOR_VERSION >= 6
cout<<"using SmartVolumeRenderingMapper render GPU"<<endl;
- vtkSmartVolumeMapper * smartvolumemapper = vtkSmartVolumeMapper::New();
+ vtkSmartVolumeMapper * smartvolumemapper = vtkSmartVolumeMapper::New();
VolumeMapper = smartvolumemapper;
- smartvolumemapper->AutoAdjustSampleDistancesOn();
+// smartvolumemapper->AutoAdjustSampleDistancesOn();
#else
_compositeFunction = vtkVolumeRayCastCompositeFunction::New();
- _MIPFunction = vtkVolumeRayCastMIPFunction::New();
- vtkVolumeRayCastMapper* volumeMapper = vtkVolumeRayCastMapper::New();
- VolumeMapper = volumeMapper;
+ _MIPFunction = vtkVolumeRayCastMIPFunction::New();
+ vtkVolumeRayCastMapper* volumeMapper = vtkVolumeRayCastMapper::New();
+ VolumeMapper = volumeMapper;
volumeMapper->SetVolumeRayCastFunction(_compositeFunction);
volumeMapper->AutoAdjustSampleDistancesOn();
#endif
VolumeMapper->SetClippingPlanes( _volumePlanes );
_newvol->SetMapper(VolumeMapper );
+
+//EED 2017-01-01 Migration VTK7
+#if VTK_MAJOR_VERSION <= 5
VolumeMapper->SetInput( _vol );
+#else
+ VolumeMapper->SetInputData( _vol );
+#endif
+
+
VolumeMapper->Update();
_newvol->Update();
}
_volumeProperty->Delete();
_newvol->Delete();
+
+#if (VTK_MAJOR_VERSION <= 7)
if(_compositeFunction)
_compositeFunction->Delete();
if(_MIPFunction)
_MIPFunction->Delete();
+#else
+ // ..
+#endif
+
if(VolumeMapper)
VolumeMapper->Delete();
BoxWidget->SetInteractor( interactor );
BoxWidget->SetPlaceFactor(1.01);
+//EED 2017-01-01 Migration VTK7
+#if VTK_MAJOR_VERSION <= 5
BoxWidget->SetInput( _vol );
+#else
+ BoxWidget->SetInputData( _vol );
+#endif
+
BoxWidget->InsideOutOn();
BoxWidget->PlaceWidget();
/**
** Check if the variables are setted correctly
**/
-void VolumeRendererManagerData::checkInvariant()throw (char *){
- if(!_compositeFunction){
- throw "No composite function initialized";
- }
- if(!_MIPFunction){
- throw "No MIP function initialized";
- }
+void VolumeRendererManagerData::checkInvariant()throw (char *)
+{
+#if (VTK_MAJOR_VERSION <= 7)
+ if(!_compositeFunction)
+ {
+ throw "No composite function initialized";
+ }
+ if(!_MIPFunction)
+ {
+ throw "No MIP function initialized";
+ }
+#else
+ // ..
+#endif
+
if(!VolumeMapper){
throw "No volume mapper initialized";
}
//checkInvariant();
if(VolumeMapper!=NULL){
#if VTK_MAJOR_VERSION >= 6
- if(dynamic_cast<vtkVolumeRayCastMapper*>(VolumeMapper))
- {
- vtkVolumeRayCastMapper* volumemapper = dynamic_cast<vtkVolumeRayCastMapper*>(VolumeMapper);
- if(function == 0){
- volumemapper->SetVolumeRayCastFunction(_compositeFunction);
- }else{
- volumemapper->SetVolumeRayCastFunction(_MIPFunction);
- }
- }else if(dynamic_cast<vtkGPUVolumeRayCastMapper*>(VolumeMapper)){
- vtkGPUVolumeRayCastMapper* volumemapper = dynamic_cast<vtkGPUVolumeRayCastMapper*>(VolumeMapper);
- if(function == 0){
- volumemapper->SetBlendModeToComposite();
- }else if(function == 1){
- volumemapper->SetBlendModeToMaximumIntensity();
- }else if(function == 2){
- volumemapper->SetBlendModeToMinimumIntensity();
- }
- }
+
+ #if (VTK_MAJOR_VERSION <= 7)
+ if(dynamic_cast<vtkVolumeRayCastMapper*>(VolumeMapper))
+ {
+ vtkVolumeRayCastMapper* volumemapper = dynamic_cast<vtkVolumeRayCastMapper*>(VolumeMapper);
+ if(function == 0) {
+ volumemapper->SetVolumeRayCastFunction(_compositeFunction);
+ } else {
+ volumemapper->SetVolumeRayCastFunction(_MIPFunction);
+ }
+ } else if(dynamic_cast<vtkGPUVolumeRayCastMapper*>(VolumeMapper)){
+ vtkGPUVolumeRayCastMapper* volumemapper = dynamic_cast<vtkGPUVolumeRayCastMapper*>(VolumeMapper);
+ if(function == 0) {
+ volumemapper->SetBlendModeToComposite();
+ } else if(function == 1) {
+ volumemapper->SetBlendModeToMaximumIntensity();
+ } else if(function == 2) {
+ volumemapper->SetBlendModeToMinimumIntensity();
+ }
+ }
+
+ #else
+ if(dynamic_cast<vtkFixedPointVolumeRayCastMapper*>(VolumeMapper))
+ {
+ vtkFixedPointVolumeRayCastMapper* volumemapper = dynamic_cast<vtkFixedPointVolumeRayCastMapper*>(VolumeMapper);
+ // ... for composote or MIP
+ } else if(dynamic_cast<vtkGPUVolumeRayCastMapper*>(VolumeMapper)){
+ vtkGPUVolumeRayCastMapper* volumemapper = dynamic_cast<vtkGPUVolumeRayCastMapper*>(VolumeMapper);
+ if(function == 0) {
+ volumemapper->SetBlendModeToComposite();
+ } else if(function == 1) {
+ volumemapper->SetBlendModeToMaximumIntensity();
+ } else if(function == 2) {
+ volumemapper->SetBlendModeToMinimumIntensity();
+ }
+ }
+ #endif
+
+
+
#else
vtkVolumeRayCastMapper* volumemapper = dynamic_cast<vtkVolumeRayCastMapper*>(VolumeMapper);
if(function == 0){
#define VolumeRendererManagerData_H_
#include "vtkCommand.h"
-#include <vtkVolumeRayCastCompositeFunction.h>
+
+#if (VTK_MAJOR_VERSION <= 7)
+ #include "vtkVolumeRayCastCompositeFunction.h"
+ #include "vtkVolumeRayCastMIPFunction.h"
+#else
+ // ..
+#endif
+
+
#include <vtkPlanes.h>
#include <vtkVolumeMapper.h>
#include <vtkImageData.h>
#include <vtkProp3D.h>
#include <vtkRenderer.h>
-#include <vtkVolumeRayCastMIPFunction.h>
#include <vtkLookupTable.h>
#include <vtkBoxWidget.h>
#include <vtkAbstractMapper.h>
*/
int _id;
+#if (VTK_MAJOR_VERSION <= 7)
vtkVolumeRayCastCompositeFunction *_compositeFunction;
- vtkPlanes *_volumePlanes;
-
+ vtkVolumeRayCastMIPFunction *_MIPFunction;
+#else
+ //..
+#endif
+
+ vtkPlanes *_volumePlanes;
vtkVolumeProperty *_volumeProperty;
vtkVolume *_newvol;
vtkPiecewiseFunction *_tfun;
vtkColorTransferFunction *_ctfun;
- vtkVolumeRayCastMIPFunction *_MIPFunction;
/**
** boxwidget to control the volume
**/
#creaMaracasVisu_CutModule_interface
- BaseVolumeRenderer
- BaseSurfaceRenderer
- KernelVolumeRenderer
- KernelViewerWidgets
- KernelSurfaceRenderer
+ BaseVolumeRenderer
+ BaseSurfaceRenderer
+ KernelVolumeRenderer
+ KernelViewerWidgets
+ KernelSurfaceRenderer
+ GUIWxSurfaceRenderer
+ GUIWxVolumeRenderer
#EED CM
#KernelVolumeRenderer
# CREATE THE TARGET
+set (${LIBRARY_NAME}_SHARED SHARED)
+message(EED mmmmmmmmmmmmmmmmmmmmmmmmmmmmmm "${${LIBRARY_NAME}_SHARED}" )
+message(EED mmmmmmmmmmmmmmmmmmmmmmmmmmmmmm ${LIBRARY_NAME} )
ADD_LIBRARY (${LIBRARY_NAME} ${${LIBRARY_NAME}_SHARED} ${${LIBRARY_NAME}_SOURCES} ${${LIBRARY_NAME}_HEADERS})
# LINK
#include <vtkProperty2D.h>
#include <vtkCamera.h>
+//EED 2017-01-01 Migration VTK7
+#if VTK_MAJOR_VERSION <= 5
vtkCxxRevisionMacro(vtkInteractorStyleCutter, "$Revision: 1.2 $");
+#else
+// ..
+#endif
vtkStandardNewMacro(vtkInteractorStyleCutter);
//----------------------------------------------------------------------------
pd->SetLines( Lines );
vtkPolyDataMapper2D *bboxMapper = vtkPolyDataMapper2D::New();
+//EED 2017-01-01 Migration VTK7
+#if VTK_MAJOR_VERSION <= 5
bboxMapper->SetInput( pd );
+#else
+ bboxMapper->SetInputData( pd );
+#endif
this->BboxActor = vtkActor2D::New();
this->BboxActor->SetMapper( bboxMapper );
// Description:
// Instantiate the object.
static vtkInteractorStyleCutter *New();
+
+//EED 2017-01-01 Migration VTK7
+#if VTK_MAJOR_VERSION <= 5
vtkTypeRevisionMacro(vtkInteractorStyleCutter, vtkInteractorStyle);
+#else
+ vtkTypeMacro(vtkInteractorStyleCutter, vtkInteractorStyle);
+#endif
+
+
void PrintSelf(ostream& os, vtkIndent indent);
bool Finished();
void CutModelData::ChangeShape(int selection)throw( CutModelException){
checkInvariant();
- if(selection == 0){
+ if(selection == 0)
+ {
+//EED 2017-01-01 Migration VTK7
+#if VTK_MAJOR_VERSION <= 5
_Mapper->SetInput(_spherefigure->getPolyData());
+#else
+ _Mapper->SetInputData(_spherefigure->getPolyData());
+#endif
}else if(selection == 1){
+
+#if VTK_MAJOR_VERSION <= 5
_Mapper->SetInput(_cylinderfigure->getPolyData());
+#else
+ _Mapper->SetInputData(_cylinderfigure->getPolyData());
+#endif
+
}else if(selection == 2){
+//EED 2017-01-01 Migration VTK7
+#if VTK_MAJOR_VERSION <= 5
_Mapper->SetInput(_cubefigure->getPolyData());
+#else
+ _Mapper->SetInputData(_cubefigure->getPolyData());
+#endif
}else{
throw CutModelException("Shape type not found");
}
_img2 = vtkImageData::New();
_img2->SetExtent(_img->GetExtent());
_img2->SetSpacing(_img->GetSpacing());
+//EED 2017-01-01 Migration VTK7
+#if VTK_MAJOR_VERSION <= 5
_img2->AllocateScalars();
-
+#else
+ //...
+#endif
_img2->DeepCopy(_img);
}
else
_img = vtkImageData::New();
_img->SetExtent(_img2->GetExtent());
_img->SetSpacing(_img2->GetSpacing());
+//EED 2017-01-01 Migration VTK7
+#if VTK_MAJOR_VERSION <= 5
_img->AllocateScalars();
+#else
+ //...
+#endif
_img->DeepCopy(_img2);
}
sample->CappingOn();
contour = vtkContourFilter::New();
+//EED 2017-01-01 Migration VTK7
+#if VTK_MAJOR_VERSION <= 5
contour->SetInput((vtkDataObject *)sample->GetOutput());
+#else
+ contour->SetInputData((vtkDataObject *)sample->GetOutput());
+#endif
contour->SetValue(0,1);
actor = contour->GetOutput();
actor3D = vtkActor::New();
+//EED 2017-01-01 Migration VTK7
+#if VTK_MAJOR_VERSION <= 5
mapper->SetInput(actor);
+#else
+ mapper->SetInputData(actor);
+#endif
mapper->SetScalarModeToUseCellData();
actor3D->SetMapper( mapper);
_render->AddActor(actor3D);
#include "CutModelPolygon.h"
#include "vtkInteractorStyleTrackballCamera.h"
#include "vtkInteractorStyleCutter.h"
-#include "wxVTKRenderWindowInteractor.h"
+#include "creawxVTKRenderWindowInteractor.h"
#include "vtkImplicitSelectionLoop.h"
#include "vtkPolyDataMapper.h"
#include "vtkSampleFunction.h"
initializeOutputImage();
int ext[6];
+//EED 2017-01-01 Migration VTK7
+#if VTK_MAJOR_VERSION <= 5
_inImage->GetWholeExtent(ext);
+#else
+ _inImage->GetExtent(ext);
+#endif
int dimX=ext[1]-ext[0]+1;
int dimY=ext[3]-ext[2]+1;
int dimZ=ext[5]-ext[4]+1;
}// for i
_inImage->Modified();
+//EED 2017-01-01 Migration VTK7
+#if VTK_MAJOR_VERSION <= 5
_inImage->Update();
+#else
+ // ..
+#endif
}
void CutModelSaveBinInfo::savePolyData(vtkPolyData* polydata){
vtkPolyDataWriter * writer = vtkPolyDataWriter ::New();
writer->SetFileName(_stdFilename.c_str());
+
+//EED 2017-01-01 Migration VTK7
+#if VTK_MAJOR_VERSION <= 5
writer->SetInput(polydata);
+#else
+ writer->SetInputData(polydata);
+#endif
+
writer->SetFileTypeToBinary();
writer->Write();
writer->Delete();
vtkPolyData* poly = reader->GetOutput();
vtkPolyDataMapper* mapper = vtkPolyDataMapper::New();
+//EED 2017-01-01 Migration VTK7
+#if VTK_MAJOR_VERSION <= 5
mapper->SetInput(poly);
+#else
+ mapper->SetInputData(poly);
+#endif
vtkActor* actor = vtkActor::New();
actor->SetMapper(mapper);
vtkMatrix4x4* actmatrix = actor->GetMatrix();
- widgets/wxVTKRenderWindowInteractor.cxx
- widgets/wxVTKRenderWindowInteractor.h
+## widgets/wxVTKRenderWindowInteractor.cxx
+## widgets/wxVTKRenderWindowInteractor.h
widgets/wxVTKRenderWindowInteractorEditContour.cxx
widgets/wxVTKRenderWindowInteractorEditContour.h
widgets/vtk3DSurfaceWidget.cxx
wxMaracasHelpDialog.h
wxMaracasQuantification.cxx
wxMaracasQuantification.h
- widgets/wxVTKRenderWindowInteractor.cxx
- widgets/wxVTKRenderWindowInteractor.h
+## widgets/wxVTKRenderWindowInteractor.cxx
+## widgets/wxVTKRenderWindowInteractor.h
widgets/wxVTKRenderWindowInteractorEditContour.cxx
widgets/wxVTKRenderWindowInteractorEditContour.h
widgets/vtk3DSurfaceWidget.cxx
table->SetRampToLinear();
table->Build();
- vtkImageMapToColors *mapperImage = vtkImageMapToColors::New();
+ vtkImageMapToColors *mapperImage = vtkImageMapToColors::New();
+ vtkImageActor *actorImage = vtkImageActor::New();
+
mapperImage->SetLookupTable(table);
+
+
+//EED 2017-01-01 Migration VTK7
+#if VTK_MAJOR_VERSION <= 5
mapperImage->SetInput( imagedataMaskResult );
- vtkImageActor *actorImage = vtkImageActor::New();
actorImage->SetInput( mapperImage->GetOutput() );
+#else
+ mapperImage->SetInputData( imagedataMaskResult );
+ actorImage->SetInputData( mapperImage->GetOutput() );
+#endif
+
+
actorImage->SetOpacity(1);
wxvtkbaseview->GetRenderer()->AddActor(actorImage);
imagedataValueResult = vtkImageData::New();
// imagedataValueResult->SetScalarType(scalartype);
- imagedataValueResult->SetScalarTypeToUnsignedShort();
imagedataValueResult->SetSpacing(spc);
imagedataValueResult->SetDimensions( newDim );
+
+//EED 2017-01-01 Migration VTK7
+#if VTK_MAJOR_VERSION <= 5
+ imagedataValueResult->SetScalarTypeToUnsignedShort();
imagedataValueResult->AllocateScalars();
+#else
+ imagedataValueResult->AllocateScalars(VTK_UNSIGNED_SHORT,1);
+#endif
+
imagedataMaskResult = vtkImageData::New();
// imagedataMaskResult->SetScalarType(scalartype);
- imagedataMaskResult->SetScalarTypeToUnsignedShort();
imagedataMaskResult->SetSpacing(spc);
imagedataMaskResult->SetDimensions( newDim );
+
+//EED 2017-01-01 Migration VTK7
+#if VTK_MAJOR_VERSION <= 5
+ imagedataMaskResult->SetScalarTypeToUnsignedShort();
imagedataMaskResult->AllocateScalars();
+#else
+ imagedataMaskResult->AllocateScalars(VTK_UNSIGNED_SHORT,1);
+#endif
+
}
// RaC 20-11-09 Changes in InitLstContoursLinesYPoints
int ext[6];
+
+//EED 2017-01-01 Migration VTK7
+#if VTK_MAJOR_VERSION <= 5
this->imagedata->GetWholeExtent(ext);
+#else
+ this->imagedata->GetExtent(ext);
+#endif
+
_sizeImageY = ext[3]-ext[2]+1;
// init vtk image result : valuesImage maskImage
imagedataValueResult->Modified();
imagedataMaskResult->Modified();
+
+//EED 2017-01-01 Migration VTK7
+#if VTK_MAJOR_VERSION <= 5
imagedataValueResult->Update();
imagedataMaskResult->Update();
+#else
+ //...
+#endif
+
} // if
}
imagedataValueResult->Delete();
}
imagedataValueResult = vtkImageData::New();
+ imagedataValueResult->SetSpacing(spc);
+ imagedataValueResult->SetDimensions( newDim );
+
+//EED 2017-01-01 Migration VTK7
+#if VTK_MAJOR_VERSION <= 5
//EED 2017-12-18
imagedataValueResult->SetScalarType(scalartype);
//imagedataValueResult->SetScalarTypeToUnsignedShort();
-
- imagedataValueResult->SetSpacing(spc);
- imagedataValueResult->SetDimensions( newDim );
imagedataValueResult->AllocateScalars();
+#else
+ imagedataValueResult->AllocateScalars(scalartype,1);
+#endif
+
if (imagedataMaskResult!=NULL)
{
}
imagedataMaskResult = vtkImageData::New();
-//EED 2017-12-18
-// imagedataMaskResult->SetScalarType(scalartype);
-// imagedataMaskResult->SetScalarTypeToUnsignedShort();
- imagedataMaskResult->SetScalarTypeToUnsignedChar();
imagedataMaskResult->SetSpacing(spc);
imagedataMaskResult->SetDimensions( newDim );
+
+//EED 2017-01-01 Migration VTK7
+#if VTK_MAJOR_VERSION <= 5
+ //EED 2017-12-18
+ //imagedataMaskResult->SetScalarTypeToUnsignedShort();
+ imagedataMaskResult->SetScalarTypeToUnsignedChar();
imagedataMaskResult->AllocateScalars();
+#else
+ imagedataMaskResult->AllocateScalars(VTK_UNSIGNED_CHAR,1);
+#endif
+
}
char* slash;
#if defined(WIN32)
- GetModuleFileName(NULL, buf, 511);
+
+ wchar_t buf2[512];
+ long result = GetModuleFileName(NULL, buf2, 511);
+ int ret = wcstombs ( buf, buf2, sizeof(pname) );
+// GetModuleFileName(NULL, buf, 511);
+
slash = strrchr(buf, '\\');
if (slash)
{
contour_mapped.push_back(vtkPolyDataMapper::New());
contour_mapped.back()->ImmediateModeRenderingOn();
contour_mapped.back()->ScalarVisibilityOff( );
+
+
+//EED 2017-01-01 Migration VTK7
+#if VTK_MAJOR_VERSION <= 5
contour_mapped.back()->SetInput(contour);
+#else
+ contour_mapped.back()->SetInputData(contour);
+#endif
+
contour_actor.push_back(vtkActor::New());
contour_actor.back()->SetMapper(contour_mapped.back());
aLineGrid->Allocate(1,1);
aLineGrid->InsertNextCell(aLine->GetCellType(),aLine->GetPointIds());
aLineGrid->SetPoints(pointsLine);
-
+//EED 2017-01-01 Migration VTK7
+#if VTK_MAJOR_VERSION <= 5
contour_mapped.back()->SetInput(aLineGrid);
+#else
+ contour_mapped.back()->SetInputData(aLineGrid);
+#endif
+
contour_mapped.back()->ImmediateModeRenderingOn();
contour_actor.back()->SetMapper(contour_mapped.back());
point_mapped.push_back(vtkPolyDataMapper::New());
// point_mapped.back()->ImmediateModeRenderingOn();
//point_mapped.back()->ScalarVisibilityOff( );
+
+
+//EED 2017-01-01 Migration VTK7
+#if VTK_MAJOR_VERSION <= 5
point_mapped.back()->SetInput(aSphere->GetOutput());
+#else
+ point_mapped.back()->SetInputData(aSphere->GetOutput());
+#endif
point_actor.push_back(vtkActor::New());
point_actor.back()->SetMapper(point_mapped.back());
{
if (GetBaseColorNb() != (int)_grey_level_boundary.size()-1)
{
- std::cout << "CM ColorLayerImageView::ConfigLookupTable : ERROR!!! Inconsistency between the sizes of vectors _base_color and _grey_level_boundary. _base_color.size()/3 (=" <<_base_color.size()/3 << ") should be equal to _grey_level_boundary.size()+1 (=" << _grey_level_boundary.size()<<"+1)." << std::endl;
- std::cout << "CM The default values for the base colors and the grey level boundaries will be set." << std::endl;
+//EED std::cout << "CM ColorLayerImageView::ConfigLookupTable : ERROR!!! Inconsistency between the sizes of vectors _base_color and _grey_level_boundary. _base_color.size()/3 (=" <<_base_color.size()/3 << ") should be equal to _grey_level_boundary.size()+1 (=" << _grey_level_boundary.size()<<"+1)." << std::endl;
+//EED std::cout << "CM The default values for the base colors and the grey level boundaries will be set." << std::endl;
SetDefaultGreyLevelBoundary();
} // if
} // _color_type
{
if (GetBaseColorNb() != (int)_grey_level_boundary.size())
{
- std::cout << "CM ColorLayerImageView::ConfigLookupTable : ERROR!!! Inconsistency between the sizes of vectors _base_color and _grey_level_boundary. _base_color.size()/3 (=" <<_base_color.size()/3 << ") should be equal to _grey_level_boundary.size() (=" << _grey_level_boundary.size()<<")." << std::endl;
- std::cout << "CM The default values for the base colors and the grey level boundaries will be set." << std::endl;
+//EED std::cout << "CM ColorLayerImageView::ConfigLookupTable : ERROR!!! Inconsistency between the sizes of vectors _base_color and _grey_level_boundary. _base_color.size()/3 (=" <<_base_color.size()/3 << ") should be equal to _grey_level_boundary.size() (=" << _grey_level_boundary.size()<<")." << std::endl;
+//EED std::cout << "CM The default values for the base colors and the grey level boundaries will be set." << std::endl;
SetDefaultGreyLevelBoundary();
} // if
} // _color_type
//----------------------------------------------------------------------------
int ColorLayerImageView::GrayLevel_TO_colorTableIndex( double VALUE )
{
+
+//EED 2017-01-01 Migration VTK7
+#if VTK_MAJOR_VERSION <= 5
GetImage()->Update();
+#else
+ //...
+#endif
+
+
+
//EED 20 oct 2015
// GetImage()->GetScalarRange(_range);
return NULL;
}
+//----------------------------------------------------------------------------
+vtkLookupTable* ColorLayerImageViewManager::GetLookupTable(int id)
+{
+printf("EED ColorLayerImageViewManager::GetLookupTable 0 \n");
+ if (_colorLayerImageViewLst[id]!=NULL)
+ {
+printf("EED ColorLayerImageViewManager::GetLookupTable 1 \n");
+ return _colorLayerImageViewLst[id]->GetThresholdTable( );
+ } // if
+printf("EED ColorLayerImageViewManager::GetLookupTable 2 \n");
+ return NULL;
+}
+
//----------------------------------------------------------------------------
void ColorLayerImageViewManager::GetDimensionBase(int id,int *dim)
{
} // for
}
-//----------------------------------------------------------------------------
-vtkScalarsToColors* ColorLayerImageViewManager::GetLookupTable(int id)
-{
- vtkScalarsToColors* lookuptable;
- if (_colorLayerImageViewLst[id]!=NULL)
- {
- lookuptable = _colorLayerImageViewLst[id]->GetLookupTable( );
- } // if
- return lookuptable;
-}
// EOF
void GetDimensionOriginalLayer (int id,int *dim);
void GetSpcOriginalLayer (int id,double *spc);
void SetNewSpacingLayer (double *spc);
- vtkScalarsToColors* GetLookupTable(int id);
-
+ vtkLookupTable* GetLookupTable(int id);
private:
std::vector< ColorLayerImageView* > _colorLayerImageViewLst;
sizer = new wxFlexGridSizer(2);
_interpolationCheckBox = new wxCheckBox(this, -1, _T("Interpolate") );
_interpolationCheckBox->SetValue(true);
- _opacity = new wxSlider(this, wxID_ANY, opacity, 0, 100, wxDefaultPosition, wxSize(2,40), wxSL_HORIZONTAL|wxSL_LABELS, wxDefaultValidator);
+ _opacity = new wxSlider(this, wxID_ANY, opacity, 0, 100, wxDefaultPosition, wxDefaultSize, wxSL_HORIZONTAL|wxSL_LABELS, wxDefaultValidator);
Connect( _interpolationCheckBox->GetId(), wxEVT_COMMAND_CHECKBOX_CLICKED, (wxObjectEventFunction) &ColorLayerImageViewPanel::onThresholdInterpolation );
Connect( _opacity->GetId(), wxEVT_SCROLL_THUMBTRACK, (wxObjectEventFunction) &ColorLayerImageViewPanel::onChangeOpacity );
#include "wxMPRBaseData.h"
#include "wxVtk2DBaseView.h"
-#include "wxVTKRenderWindowInteractor.h"
+#include "creawxVTKRenderWindowInteractor.h"
#include "vtkTextProperty.h"
spcBase[5]=0;
_image = image;
+
+//EED 2017-01-01 Migration VTK7
+#if VTK_MAJOR_VERSION <= 5
_image->Update();
_image->GetWholeExtent(ext);
+#else
+ _image->GetExtent(ext);
+#endif
+
dimensionOriginalLayer[0] = ext[1]-ext[0]+1;
dimensionOriginalLayer[1] = ext[3]-ext[2]+1;
dimensionOriginalLayer[2] = ext[5]-ext[4]+1;
vtkImageData *imagebase = GetwxVtkBaseView()->GetVtkBaseData()->GetImageData();
if (imagebase!=NULL)
{
+
+//EED 2017-01-01 Migration VTK7
+#if VTK_MAJOR_VERSION <= 5
imagebase->GetWholeExtent(ext);
+#else
+ imagebase->GetExtent(ext);
+#endif
+
dimBase[0]=ext[1]-ext[0]+1;
dimBase[1]=ext[3]-ext[2]+1;
dimBase[2]=ext[5]-ext[4]+1;
} // if imagebase
} // if wxvtkbaseview
_image->GetScalarRange( _range );
- _thresholdTable = vtkLookupTable::New();
+// _thresholdTable = vtkLookupTable::New();
+
+//EED 2017-01-01 Migration VTK7
+#if VTK_MAJOR_VERSION <= 5
_imageChangeInformation->SetInput(_image);
+#else
+ _imageChangeInformation->SetInputData(_image);
+ _imageChangeInformation->Update();
+#endif
+
}
//------------------------------------------------------------------------------
//------------------------------------------------------------------------------
void LayerImageBase::SetNewSpacingLayer(double spc[3])
{
- _newSpcLayer[0]=spc[0];
- _newSpcLayer[1]=spc[1];
- _newSpcLayer[2]=spc[2];
+ _newSpcLayer[0] = spc[0];
+ _newSpcLayer[1] = spc[1];
+ _newSpcLayer[2] = spc[2];
_imageChangeInformation->SetOutputSpacing( _newSpcLayer );
}
//----------------------------------------------------------------------------
vtkLookupTable* LayerImageBase::GetThresholdTable()
{
+printf("EED LayerImageBase::GetThresholdTable\n");
return _thresholdTable;
}
} // !GetActorPresent()
ConfigLookupTable(); // virtual method
+
+//EED 2017-01-01 Migration VTK7
+#if VTK_MAJOR_VERSION <= 5
_imageReslicer->SetInput( GetImage() );
+#else
+ _imageReslicer->SetInputData( GetImage() );
+#endif
+
_imageReslicer->SetInformationInput( GetImage() );
if (directionViewer==0)
_imageReslicer->SetInterpolationModeToNearestNeighbor();
_imageReslicer->Modified();
-
+//EED 2017-01-01 Migration VTK7
+#if VTK_MAJOR_VERSION <= 5
+ // ..
+#else
+ _imageReslicer->Update();
+#endif
vtkImageData *img = _imageReslicer->GetOutput();
// img->Update();
// img->UpdateInformation();
-
// _thresholdTable->Update();
+
+//EED 2017-01-01 Migration VTK7
+#if VTK_MAJOR_VERSION <= 5
_thresholdMapper->SetInput( img );
+#else
+ _thresholdMapper->SetInputData( img );
+#endif
+
_thresholdMapper->SetLookupTable( _thresholdTable );
+
+
+//EED 2017-01-01 Migration VTK7
+#if VTK_MAJOR_VERSION <= 5
_thresholdActor->SetInput( _thresholdMapper->GetOutput() );
+#else
+ _thresholdMapper->Update();
+ _thresholdActor->SetInputData( _thresholdMapper->GetOutput() );
+#endif
+
_thresholdActor->SetOpacity(_opacity);
-
_scalarbarActor->SetLookupTable( _thresholdTable );
// _scalarbarActor->SetLookupTable( _thresholdMapper->GetLookupTable() );
_scalarbarActor->SetTitle("Value");
_scalarbarActor->SetNumberOfLabels(4);
int fontsize = _scalarbarActor->GetLabelTextProperty()->GetFontSize();
_scalarbarActor->GetLabelTextProperty()->SetFontSize(fontsize/2);
-
// _scalarbarActor->SetTextPad(4); ??
-
-
} // _image
}
wxVtkBaseView * baseView = _baseView;
baseView->GetRenderer()->RemoveActor( _thresholdActor );
baseView->GetRenderer()->RemoveActor( _scalarbarActor );
-
_actorPresent = false;
- }
-}
-
-//----------------------------------------------------------------------------
-vtkLookupTable *LayerImageBase::GetvtkLookupTable()
-{
- return _thresholdTable;
+ } // if _actorPresent
}
//----------------------------------------------------------------------------
return _thresholdTable;
}
-
-
-
// EOF
#include "InteractorStyleMaracas.h"
#include "vtkImageChangeInformation.h"
-
//----------------------------------------------------------------------------------
//----------------------------------------------------------------------------------
//----------------------------------------------------------------------------------
void onThresholdRemove();
wxVtkBaseView *GetwxVtkBaseView();
void Refresh();
- vtkLookupTable *GetvtkLookupTable();
+ vtkLookupTable *GetThresholdTable();
+
vtkImageReslice *GetvtkImageReslice();
virtual int GetX();
virtual int GetY();
void CleanXYZ(double &x, double &y, double &z);
protected:
- vtkLookupTable *GetThresholdTable();
double _range[2];
std::vector<double> _rangeForColorBar;
std::vector<int> _colorBarPosition;
lstActorsSphere[id]->GetProperty()->SetOpacity( mopacity );
lstSourceSphere[id]->SetRadius( radio );
+//EED 2017-01-01 Migration VTK7
+#if VTK_MAJOR_VERSION <= 5
+ // ..
+#else
+ lstSourceSphere[id]->Update();
+#endif
+
lstActorsText[id]->SetInput( label.c_str() );
lstActorsText[id]->SetPosition( radio+spc[0]*x , spc[1]*y , spc[2]*z );
}
//NTU: For updating points
lstSourceSphere.push_back(vtksphere);
vtkPolyDataMapper *sphereMapper = vtkPolyDataMapper::New();
+
+//EED 2017-01-01 Migration VTK7
+#if VTK_MAJOR_VERSION <= 5
sphereMapper->SetInput( vtksphere->GetOutput() );
+#else
+ vtksphere->Update();
+ sphereMapper->SetInputData( vtksphere->GetOutput() );
+#endif
+
vtkActor *sphereActor = vtkActor::New();
sphereActor->SetMapper(sphereMapper);
sphereActor->SetOrigin(0, 0, 0);
//------------------------------------------------------------------------
void WidgetShowNPoints::OnSavePoints(wxCommandEvent& event)
{
+
+//EED 2017-09-16 Migration wxWidgets 2.8 to 3.0
+#if wxMAJOR_VERSION <= 2
wxFileDialog* FD = new wxFileDialog( 0,
_T("Save points .."),
_T(""),
_T("(*.xls)|*.xls"),
wxSAVE | wxOVERWRITE_PROMPT,
wxDefaultPosition);
- //EED
+#else
+ wxFileDialog* FD = new wxFileDialog( 0,
+ _T("Save points .."),
+ _T(""),
+ _T(""),
+ _T("(*.xls)|*.xls"),
+ wxFD_SAVE | wxFD_OVERWRITE_PROMPT,
+ wxDefaultPosition);
+#endif
+
+
int result_FD = FD->ShowModal();
//------------------------------------------------------------------------
void WidgetShowNPoints::OnLoadPoints(wxCommandEvent& event)
{
+
+//EED 2017-09-16 Migration wxWidgets 2.8 to 3.0
+#if wxMAJOR_VERSION <= 2
wxFileDialog* FD = new wxFileDialog( 0,
_T("Load points .."),
_T(""),
_T("(*.xls)|*.xls"),
wxOPEN | wxFILE_MUST_EXIST,
wxDefaultPosition);
+#else
+ wxFileDialog* FD = new wxFileDialog( 0,
+ _T("Load points .."),
+ _T(""),
+ _T(""),
+ _T("(*.xls)|*.xls"),
+ wxFD_OPEN | wxFD_FILE_MUST_EXIST,
+ wxDefaultPosition);
+#endif
int i;
//EED
int result_FD = FD->ShowModal();
vtkBoxWidget *boxwidget = reinterpret_cast<vtkBoxWidget*>(wdg);
boxwidget->GetPlanes(_planes);
+ if ((_mCubes!=NULL)&&(_tissueStripper!=NULL)&&(_tissueClipper!=NULL))
+ {
+ _mCubes->Update();
+ _tissueStripper->Update();
+ _tissueClipper->Update();
+ } // if surface
+
+
if ( _vtkVolumeRayCastMapper != NULL )
{
_vtkVolumeRayCastMapper->RemoveAllClippingPlanes();
-// vtkPlanes *planes = vtkPlanes::New();
-// boxwidget->GetPlanes(planes);
-// _vtkVolumeRayCastMapper->SetClippingPlanes(planes);
_vtkVolumeRayCastMapper->SetClippingPlanes(_planes);
- }
+ } // if volume
+
// _actor->VisibilityOn();
}
//-------------------------------------------------------------------
-void boxSurfaceObserver::SetvtkVolumeRayCastMapper(vtkVolumeRayCastMapper *vtkvolumeraycastmapper)
+#if (VTK_MAJOR_VERSION <= 7)
+ void boxSurfaceObserver::SetvtkVolumeRayCastMapper(vtkVolumeRayCastMapper *vtkvolumeraycastmapper)
+#else
+ void boxSurfaceObserver::SetvtkFixedPointVolumeRayCastMapper(vtkFixedPointVolumeRayCastMapper *vtkvolumeraycastmapper)
+#endif
{
_vtkVolumeRayCastMapper = vtkvolumeraycastmapper;
}
+
+//-------------------------------------------------------------------
+void boxSurfaceObserver::SetFilters(vtkAlgorithm *mCubes , vtkAlgorithm *tissueStripper , vtkAlgorithm *tissueClipper)
+{
+ _mCubes = mCubes;
+ _tissueStripper = tissueStripper;
+ _tissueClipper = tissueClipper;
+
+
+}
+
#include "vtkPlanes.h"
#include "vtkProp.h"
-#include "vtkVolumeRayCastMapper.h"
+
+#if (VTK_MAJOR_VERSION <= 7)
+ #include "vtkVolumeRayCastMapper.h"
+#else
+ #include <vtkFixedPointVolumeRayCastMapper.h>
+#endif
+
#include "vtkObject.h"
#include "vtkCommand.h"
class boxSurfaceObserver : public vtkCommand
{
public:
- vtkPlanes *_planes;
- vtkProp *_actor;
- vtkVolumeRayCastMapper *_vtkVolumeRayCastMapper;
+ vtkPlanes *_planes;
+ vtkProp *_actor;
+
+ vtkAlgorithm *_mCubes;
+ vtkAlgorithm *_tissueStripper;
+ vtkAlgorithm *_tissueClipper;
+#if (VTK_MAJOR_VERSION <= 7)
+ vtkVolumeRayCastMapper *_vtkVolumeRayCastMapper;
+#else
+ vtkFixedPointVolumeRayCastMapper *_vtkVolumeRayCastMapper;
+#endif
boxSurfaceObserver()
{
- _vtkVolumeRayCastMapper = NULL;
+ _mCubes = NULL;
+ _tissueStripper = NULL;
+ _tissueClipper = NULL;
+ _vtkVolumeRayCastMapper = NULL;
+
}
virtual char const *GetClassName() const { return "boxSurfaceObserver";}
static boxSurfaceObserver *New(){
- boxSurfaceObserver * result;
- result = new boxSurfaceObserver();
+ boxSurfaceObserver *result;
+ result = new boxSurfaceObserver();
return result;
}
virtual void Execute(vtkObject *wdg, unsigned long eventId, void* calldata) ;
void SetPlanes(vtkPlanes *planes);
void SetActor(vtkProp *actor);
+#if (VTK_MAJOR_VERSION <= 7)
void SetvtkVolumeRayCastMapper(vtkVolumeRayCastMapper *vtkvolumeraycastmapper);
+#else
+ void SetvtkFixedPointVolumeRayCastMapper(vtkFixedPointVolumeRayCastMapper *vtkvolumeraycastmapper);
+#endif
+ void SetFilters(vtkAlgorithm *_mCubes , vtkAlgorithm *_tissueStripper , vtkAlgorithm *_tissueClipper);
};
-
#endif /*BOXSURFACEOBSERVER_H_*/
VTKMetaImageReaderPointerType::New();
readerUndo->SetFileName(undoImagePath.c_str());
this->m_UndoImage = readerUndo->GetOutput();
+//EED 2017-01-01 Migration VTK7
+#if VTK_MAJOR_VERSION <= 5
this->m_UndoImage->Update();
+#else
+ // ..
+#endif
//Loading Redo Image
VTKMetaImageReaderPointerType readerRedo =
VTKMetaImageReaderPointerType::New();
readerRedo->SetFileName(redoImagePath.c_str());
+//EED 2017-01-01 Migration VTK7
+#if VTK_MAJOR_VERSION <= 5
+ // ..
+#else
+ readerRedo->Update();
+#endif
+
this->m_RedoImage = readerRedo->GetOutput();
+//EED 2017-01-01 Migration VTK7
+#if VTK_MAJOR_VERSION <= 5
this->m_RedoImage->Update();
+#else
+ // ...
+#endif
//Updating status
this->m_OnMemory = true;
}
void ImageInfoUR::SaveImageAsMHD(const StringType& filename,
VTKImageDataPointerType image) {
VTKMetaImageWriterPointerType w = VTKMetaImageWriterPointerType::New();
+//EED 2017-01-01 Migration VTK7
+#if VTK_MAJOR_VERSION <= 5
w->SetInput(image);
+#else
+ w->SetInputData(image);
+#endif
w->SetCompression(false);
w->SetFileDimensionality(image->GetDataDimension());
w->SetFileName(filename.c_str());
void ImageUndoRedo::SetImage( VTKImageDataPointerType image )
{
this->m_CurrentImage = image;
+
+//EED 2017-01-01 Migration VTK7
+#if VTK_MAJOR_VERSION <= 5
this->m_CurrentImage->Update( );
+#else
+ // ..
+#endif
+
this->UpdateUndoImage( );
}
// ----------------------------------------------------------------------------------
// ----------------------------------------------------------------------------------
void ImageUndoRedo::UpdateUndoImage( )
{
+//EED 2017-01-01 Migration VTK7
+#if VTK_MAJOR_VERSION <= 5
this->m_CurrentImage->Update( );
+#else
+ // ...
+#endif
this->m_UndoImage = VTKImageDataPointerType::New( );
this->m_UndoImage->DeepCopy( m_CurrentImage );
+//EED 2017-01-01 Migration VTK7
+#if VTK_MAJOR_VERSION <= 5
this->m_UndoImage->Update( );
+#else
+ // ..
+#endif
}
// ----------------------------------------------------------------------------------
ImageUndoRedo::VTKImageDataPointerType ImageUndoRedo::GetImageRegion(
extract->SetVOI( region.minX, region.maxX, region.minY, region.maxY,
region.minZ, region.maxZ );
extract->SetSampleRate( 1, 1, 1 );
+//EED 2017-01-01 Migration VTK7
+#if VTK_MAJOR_VERSION <= 5
extract->SetInput( img );
+#else
+ extract->SetInputData( img );
+#endif
VTKImageDataPointerType imgResult = extract->GetOutput( );
+
+//EED 2017-01-01 Migration VTK7
+#if VTK_MAJOR_VERSION <= 5
imgResult->Update( );
+#else
+ // ..
+#endif
+
return ( imgResult );
}
// ----------------------------------------------------------------------------------
interactorstylebaseview = vtkInteractorStyleBaseView2D::New();
SetInteractorStyleBaseView(interactorstylebaseview);
- wxVTKRenderWindowInteractor *iren = GetWxVTKRenderWindowInteractor();
+ crea::wxVTKRenderWindowInteractor *iren = GetWxVTKRenderWindowInteractor();
interactorstylebaseview->SetInteractor ( iren );
iren->SetInteractorStyle(interactorstylebaseview);
interactorstylebaseview->SetwxVtkBaseView(this);
_wxVTKiren = wxVTKiren;
}
//----------------------------------------------------------------------------
-wxVTKRenderWindowInteractor *wxVtk2DView_TMP::GetWxVTKRenderWindowInteractor() // virtual
+crea::wxVTKRenderWindowInteractor *wxVtk2DView_TMP::GetWxVTKRenderWindowInteractor() // virtual
{
return _wxVTKiren;
}
_pts->SetPoint(2, XX , YY , p0[2]);
_pts->SetPoint(3, p0[0] , YY , p0[2]);
_imageViewer->Render();
- }
+ } // if
}
- if ( event == vtkCommand::LeftButtonReleaseEvent ){
+ if ( event == vtkCommand::LeftButtonReleaseEvent )
+ {
_bboxEnabled = false;
//EED} else if ( event == vtkCommand::MouseWheelForwardEvent ){
} else if ( event == wxEVT_MOUSEWHEEL+10000 ){
} else {
//neither ctrl nor shift has been pressed:
slice += 5;
- }
+ } // if
slice = slice > min ? slice : min;
slice = slice < max ? slice : max;
} else if ( event == wxEVT_MOUSEWHEEL+10001 ){
// _sliceEnabled = false;
- if( _wxVTKiren->GetControlKey () ){
+ if( _wxVTKiren->GetControlKey () )
+ {
slice -= 10;
} else if( _wxVTKiren->GetShiftKey () ) {
slice--;
//neither ctrl nor shift has been pressed:
slice -= 5;
slice = (slice /5) * 5;
- }
+ } // if
slice = slice > min ? slice : min;
slice = slice < max ? slice : max;
-
#if (VTK_MAJOR_VERSION >= 5)
_imageViewer->SetSlice( slice );
#else
_imageViewer->SetZSlice( slice );
#endif
-
//This is not nedeed any more since vtkImageViewer2.cxx -r1.9
//imageViewer->GetRenderer()->ResetCameraClippingRange();
wxMouseEvent mouseEvent;
mouseEvent.m_wheelRotation=-130;
- if (_intVtkPanWid!=NULL) {
+ if (_intVtkPanWid!=NULL)
+ {
_intVtkPanWid->CallBackOnMouseWheel(mouseEvent);
- }
+ } // if
_imageViewer->Render();
-
}
-
}
-//----------------------------------------------------------------------------
-void wxImageViewerWidgetRoi::ConstructVTK(vtkImageData *imageData){
+//----------------------------------------------------------------------------
+void wxImageViewerWidgetRoi::ConstructVTK(vtkImageData *imageData)
+{
wxImageViewerWidget::ConstructVTK(imageData);
_interactorStyle2DMaracas->SetObserver(_Observer);
_pts->SetPoint(2, 1000 , 1000 , 1000 );
_pts->SetPoint(3, -1000 , 1000 , 0 );
-
vtkCellArray *lines = vtkCellArray::New();
lines->InsertNextCell(5);
lines->InsertCellPoint(0);
_pd->SetLines( lines );
lines->Delete(); //do not delete lines ??
-
_bboxActor = vtkActor::New();
_bboxMapper = vtkPolyDataMapper::New();
}
//----------------------------------------------------------------------------
-bool wxImageViewerWidgetRoi::GetRoiSelected(){
+bool wxImageViewerWidgetRoi::GetRoiSelected()
+{
return _RoiSelected;
}
public:
wxVtk2DView_TMP(vtkImageViewer2 *imageviewer2);
~wxVtk2DView_TMP();
- virtual vtkRenderer *GetRenderer();
- virtual vtkRenderWindow *GetRenWin();
- virtual void Configure();
- void SetWxVTKRenderWindowInteractor( wxVTKRenderWindowInteractor *wxVTKiren);
- virtual wxVTKRenderWindowInteractor *GetWxVTKRenderWindowInteractor();
+ virtual vtkRenderer *GetRenderer();
+ virtual vtkRenderWindow *GetRenWin();
+ virtual void Configure();
+ void SetWxVTKRenderWindowInteractor( wxVTKRenderWindowInteractor *wxVTKiren);
+ virtual crea::wxVTKRenderWindowInteractor *GetWxVTKRenderWindowInteractor();
private:
wxVTKRenderWindowInteractor *_wxVTKiren;
#include <vtkDataSetMapper.h>
#include <vtkUnstructuredGrid.h>
-#include "wxVTKRenderWindowInteractor.h"
+#include "creawxVTKRenderWindowInteractor.h"
#include <vector>
#include "wxVtkBaseView.h"
bool manualContour3DControler::OnLeftButtonDown()
{
int X,Y;
- wxVTKRenderWindowInteractor *wxVTKiren;
+ crea::wxVTKRenderWindowInteractor *wxVTKiren;
wxVTKiren = _vtkInteractorStyleBaseView->GetWxVtk3DBaseView()->GetWxVTKRenderWindowInteractor();
wxVTKiren->GetEventPosition(X,Y);
MouseClickLeft(X,Y);
char keyCode = _vtkInteractorStyleBaseView->GetInteractor()-> GetKeyCode();
int X,Y;
- wxVTKRenderWindowInteractor *_wxVTKiren;
+ crea::wxVTKRenderWindowInteractor *_wxVTKiren;
_wxVTKiren= _vtkInteractorStyleBaseView->GetWxVtk2DBaseView()->GetWxVTKRenderWindowInteractor();
_wxVTKiren->GetEventPosition(X, Y);
//int Z = GetZ(); // JPRx
if ( _vtkInteractorStyleBaseView!=NULL)
{
int X,Y;
- wxVTKRenderWindowInteractor *_wxVTKiren;
+ crea::wxVTKRenderWindowInteractor *_wxVTKiren;
_wxVTKiren= _vtkInteractorStyleBaseView->GetWxVtk2DBaseView()->GetWxVTKRenderWindowInteractor();
_wxVTKiren->GetEventPosition( X , Y );
if ( _vtkInteractorStyleBaseView!=NULL )
{
int X,Y;
- wxVTKRenderWindowInteractor *wxVTKiren;
+ crea::wxVTKRenderWindowInteractor *wxVTKiren;
wxVTKiren = _vtkInteractorStyleBaseView->GetWxVtk2DBaseView()->GetWxVTKRenderWindowInteractor();
wxVTKiren->GetEventPosition(X,Y);
if ( _vtkInteractorStyleBaseView!=NULL )
{
int X,Y;
- wxVTKRenderWindowInteractor *wxVTKiren;
+ crea::wxVTKRenderWindowInteractor *wxVTKiren;
wxVTKiren = _vtkInteractorStyleBaseView->GetWxVtk2DBaseView()->GetWxVTKRenderWindowInteractor();
wxVTKiren->GetEventPosition(X,Y);
MouseReleaseLeft(X,Y);
if ( _vtkInteractorStyleBaseView!=NULL )
{
int X,Y;
- wxVTKRenderWindowInteractor *wxVTKiren;
+ crea::wxVTKRenderWindowInteractor *wxVTKiren;
wxVTKiren = _vtkInteractorStyleBaseView->GetWxVtk2DBaseView()->GetWxVTKRenderWindowInteractor();
wxVTKiren->GetEventPosition(X,Y);
if ( _vtkInteractorStyleBaseView!=NULL )
{
int X,Y;
- wxVTKRenderWindowInteractor *wxVTKiren;
+ crea::wxVTKRenderWindowInteractor *wxVTKiren;
wxVTKiren = _vtkInteractorStyleBaseView->GetWxVtk2DBaseView()->GetWxVTKRenderWindowInteractor();
wxVTKiren->GetEventPosition(X,Y);
GetManualViewBaseContour()->InitMove( X, Y,GetZ());
if( _vtkInteractorStyleBaseView!= NULL )
{
int X,Y;
- wxVTKRenderWindowInteractor *wxVTKiren;
+ crea::wxVTKRenderWindowInteractor *wxVTKiren;
wxVTKiren = _vtkInteractorStyleBaseView->GetWxVtk2DBaseView()->GetWxVTKRenderWindowInteractor();
wxVTKiren->GetEventPosition(X, Y);
//#include "widgets/InteractorStyleMaracas.h"
#include "InteractorStyleMaracas.h"
-#include "wxVTKRenderWindowInteractor.h"
+#include "creawxVTKRenderWindowInteractor.h"
//--
virtual bool OnRightButtonUp();
void SetModelView(manualBaseModel *manContModel, manualViewBaseContour *manViewBaseCont);
- manualBaseModel * GetManualContourModel();
+ manualBaseModel * GetManualContourModel();
manualViewBaseContour * GetManualViewBaseContour();
_cntSplineX = vtkKochanekSpline::New( );
_cntSplineY = vtkKochanekSpline::New( );
_cntSplineZ = vtkKochanekSpline::New( );
-
this->SetCloseContour(true);
-
_cntSplineX->SetDefaultTension( 0 );
_cntSplineX->SetDefaultBias( 0 );
_cntSplineX->SetDefaultContinuity( 0 );
-
_cntSplineY->SetDefaultTension( 0 );
_cntSplineY->SetDefaultBias( 0 );
_cntSplineY->SetDefaultContinuity( 0 );
-
_cntSplineZ->SetDefaultTension( 0 );
_cntSplineZ->SetDefaultBias( 0 );
_cntSplineZ->SetDefaultContinuity( 0 );
-
//JSTG 25-02-08 -------------------------------------------------------------------------------------------------
-
// this parameter is reset in the VIRTUAL manualContourBaseControler::Configure
_sizePointsContour = 100; //JSTG 25-02-08 The change in the inisialization of these variable is critical.
-
_delta_JSTG = 0.0;
//---------------------------------------------------------------------------------------------------------------
-
//CMRU 17-08-09 -------------------------------------------------------------------------------------------------
_realSize = 0.0;
_label = "";
//---------------------------------------------------------------------------------------------------------------
-
}
// ----------------------------------------------------------------------------
delete _lstPoints[i];
}
_lstPoints.clear();
-
_cntSplineX->RemoveAllPoints();
_cntSplineY->RemoveAllPoints();
_cntSplineZ->RemoveAllPoints();
-
_cntSplineX->Delete();
_cntSplineY->Delete();
_cntSplineZ->Delete();
}
+
// ----------------------------------------------------------------------------
int manualContourModel::AddPoint(double x,double y,double z)
{
mp->SetPoint(x,y,z);
AddManualPoint(mp);
//UpdateSpline();
-
return _lstPoints.size()-1;
}
// ----------------------------------------------------------------------------
void manualContourModel::MovePoint(int i,double dx,double dy,double dz)
{
+printf("EED manualContourModel::MovePoint %p \n", this);
manualPoint *mp=_lstPoints[i];
double x=mp->GetX()+dx;
double y=mp->GetY()+dy;
}
// ----------------------------------------------------------------------------
-
-
/*void manualContourModel::GetSplinePoint(double t, double &x, double &y, double &z)
{
if (_lstPoints.size()==0)
z = _cntSplineZ->Evaluate(t);
}
}*/
+
// ----------------------------------------------------------------------------
double manualContourModel::GetPathSize(double *spc)
{
double result = 0;
double x1,y1,z1;
double x2,y2,z2;
-
// JSTG 25-02-08 -----------------------------
//double t,delta;
//int i,np,nps;
int i;
//--------------------------------------------
-
if (_lstPoints.size()==2)
{
x1 = spc[0] * _lstPoints[0]->GetX();
}
if (_lstPoints.size()>2)
{
-
// JSTG 25-02-08 ------------------------------------------
//np = _lstPoints.size( );
//nps = 200;
UpdateSpline();
//GetSplinePoint(0,x1,y1,z1);
GetSpline_i_Point(0,&x1,&y1,&z1);
-
x1 = spc[0] * x1;
y1 = spc[1] * y1;
z1 = spc[2] * z1;
z1=z2;
}// for
}
-
return result;
}
-
// ----------------------------------------------------------------------------
double manualContourModel::GetPathArea(double *spc)
{
double x2,y2,z2;
bool okArea=true;
int i, j;
-
// This uses Green's theorem:
// A = 1/2 * sum( xiyi+1 - xi+1yi); pO == pN
// A < 0 -> A = |A| (a negative value could raise because points are
x2=spc[0]*x2;
y2=spc[1]*y2;
z2=spc[2]*z2;
- area +=
- (x1 * y2 ) -
- ( x2 * y1 );
+ area += (x1 * y2 ) - ( x2 * y1 );
if (z1!=z2)
{
okArea=false;
// p[x,y,z] : data in
// rp[x,y,z] : data out result point
// rn[x,y,z] : data out result normal
-
void manualContourModel::GetNearestPointAndNormal(double *p, double *rp, double *rn)
{
double distMin=999999999;
rn[0] = x2-x1;
rn[1] = y2-y1;
rn[2] = z2-z1;
- }
- x2=x1;
- y2=y1;
- z2=z1;
+ } // if
+ x2 = x1;
+ y2 = y1;
+ z2 = z1;
}// for
-
// JSTG 25-02-08 ------------------------------------------
//if (tback==0)
if (iback==0)
//GetSplinePoint(t,x1,y1,z1);
GetSpline_i_Point(i,&x1,&y1,&z1);
//----------------------------------------------------------
- rn[0]=rp[0]-x1;
- rn[1]=rp[1]-y1;
- rn[2]=rp[2]-z1;
- }
+ rn[0] = rp[0]-x1;
+ rn[1] = rp[1]-y1;
+ rn[2] = rp[2]-z1;
+ } // if iback
} else {
rp[0] = 0;
rp[1] = 0;
rn[0] = -1;
rn[1] = 0;
rn[2] = 0;
- }
+ } // if np
}
// ----------------------------------------------------------------------------
-manualContourModel * manualContourModel :: Clone() // virtual
+manualContourModel * manualContourModel::Clone() // virtual
{
manualContourModel * clone = new manualContourModel();
CopyAttributesTo(clone);
#include <vtkDataSetMapper.h>
#include <vtkUnstructuredGrid.h>
-#include "wxVTKRenderWindowInteractor.h"
+#include "creawxVTKRenderWindowInteractor.h"
//--
int nps = GetNumberOfPointsSpline();
_deltaAngle=(3.14159265*2)/(nps-1);
- if (np==2){
+ if (np==2)
+ {
mpA = GetManualPoint(0);
mpB = GetManualPoint(1);
difX = mpA->GetX() - mpB->GetX();
double _centerX;
double _centerY;
double _centerZ;
-
virtual int GetTypeModel();
virtual void UpdateSpline();
};
{
manualViewContour::RefreshContour();
int i;
-
//EED 27 Juin 2012
//Boundaring box
_minX=99999;
_maxX=-99999;
_maxY=-99999;
_maxZ=-99999;
-
-
double pp[3];
// JSTG 25-02-08 ----------------------------------------
//int nps = GetNumberOfPointsSpline();
{
_pts->GetPoint( i, pp );
FilterCordinateXYZ(pp[0],pp[1],pp[2]);
-
//EED 27 sep 2006
_pts->SetPoint( i, pp[0] , pp[1] ,pp[2] );
-
-
//EED 27 Juin 2012
//Boundaring box
if (pp[0] < _minX) { _minX = pp[0]; }
if (pp[0] > _maxX) { _maxX = pp[0]; }
if (pp[1] > _maxY) { _maxY = pp[1]; }
if (pp[2] > _maxZ) { _maxY = pp[2]; }
-
}// for
-
//EED 2017-03-02
- if (_pts!=NULL) {
+ if (_pts!=NULL)
+ {
_pts->Modified();
}
-
}
// ----------------------------------------------------------------------------
_spc[0] = 1;
_spc[1] = 1;
_spc[2] = 1;
-
_coulorEdit_r = 1;
_coulorEdit_g = 1;
_coulorEdit_b = 0;
-
_coulorNormal_r = 1;
_coulorNormal_g = 0;
_coulorNormal_b = 1;
-
_coulorSelection_r = 0;
_coulorSelection_g = 1;
_coulorSelection_b = 0;
-
_widthline = 1;
-
}
// ----------------------------------------------------------------------------
manualViewBaseContour::~manualViewBaseContour()
}
// ---------------------------------------------------------------------------
-void manualViewBaseContour :: RemoveCompleteContourActor()
+void manualViewBaseContour::RemoveCompleteContourActor()
{
/*vtkRenderer * theRenderer =*/ _wxvtkbaseview->GetRenderer(); // JPRx ??
//Removing the spline
_bboxMapper = vtkPolyDataMapper::New();
_bboxMapper->ScalarVisibilityOff( );
+
+//EED 2017-01-01 Migration VTK7
+#if VTK_MAJOR_VERSION <= 5
_bboxMapper->SetInput(_pd);
+#else
+ _bboxMapper->SetInputData(_pd);
+#endif
+
+
_bboxMapper->ImmediateModeRenderingOn();
_contourVtkActor->SetMapper(_bboxMapper);
_contourVtkActor->GetProperty()->BackfaceCullingOff();
#include <vtkDataSetMapper.h>
#include <vtkUnstructuredGrid.h>
-#include "wxVTKRenderWindowInteractor.h"
+#include "creawxVTKRenderWindowInteractor.h"
//--
void SetWidthLine(double width);
double GetWidthLine();
- virtual void ConstructVTKObjects();
+ virtual void ConstructVTKObjects();
void SetCellArray(bool type);
//---------------------------------------------------
vtkActor *_contourVtkActor;
vtkPolyDataMapper *_bboxMapper;
- void DeleteVtkObjects();
+ void DeleteVtkObjects();
//---------------------------------------------------
void manualViewBullEyeSector::RefreshContour()
{
//EED004
- int i,nps;
- double x,y,z;
- double xx,yy,zz;
+ int i,nps;
+ double x,y,z;
+ double xx,yy,zz;
//----------------------------------
-
//EED 27 Juin 2012
//Boundaring box
- _minX=99999;
- _minY=99999;
- _minZ=99999;
- _maxX=-99999;
- _maxY=-99999;
- _maxZ=-99999;
-
+ _minX = 99999;
+ _minY = 99999;
+ _minZ = 99999;
+ _maxX = -99999;
+ _maxY = -99999;
+ _maxZ = -99999;
_manContModel->UpdateSpline();
nps = _manContModel->GetNumberOfPointsSpline();
-
if ( _pts!=NULL )
{
for( i = 0; i < nps; i++ )
yy = y*_spc[1];
zz = z*_spc[2];
_pts->SetPoint(i , xx , yy , zz );
-
//EED 27 Juin 2012
//Boundaring box
if (xx < _minX) { _minX = xx; }
if (xx > _maxX) { _maxX = xx; }
if (yy > _maxY) { _maxY = yy; }
if (zz > _maxZ) { _maxY = zz; }
-
-
}// for
//EED 2017-03-02
_pts->Modified();
} // if _pts
-
}
// ----------------------------------------------------------------------------
// ----------------------------------------------------------------------------
-// EED08
-
manualViewCircle::manualViewCircle()
{
// _sizePointsContour=5; // default 100
{
}
-
// ----------------------------------------------------------------------------
manualViewCircle * manualViewCircle :: Clone()
{
}
// ---------------------------------------------------------------------------
-
void manualViewCircle::CopyAttributesTo( manualViewCircle * cloneObject)
{
// Fathers object
manualViewBaseContour::CopyAttributesTo(cloneObject);
}
-
// ----------------------------------------------------------------------------
int manualViewCircle::GetType() // virtual
{
maxX=mpA->GetX()+radio;
maxY=mpA->GetY()+radio;
} else {
- minX=0;
- maxX=0;
- minY=0;
- maxY=0;
- }
+ minX = 0;
+ maxX = 0;
+ minY = 0;
+ maxY = 0;
+ } // if np
}
void manualViewCircle::InitMove(int x, int y, int z) // virtual
{
manualPoint *mp;
- double XX=x;
- double YY=y;
- double ZZ=z;
+ double XX = x;
+ double YY = y;
+ double ZZ = z;
TransfromCoordViewWorld(XX,YY,ZZ);
-
- if (_manContModel->GetSizeLstPoints()==2){
+ if (_manContModel->GetSizeLstPoints()==2)
+ {
mp = _manContModel->GetManualPoint(0);
- _dp0[0]= mp->GetX() - XX;
- _dp0[1]= mp->GetY() - YY;
- _dp0[2]= mp->GetZ();
-
- mp = _manContModel->GetManualPoint(1);
- _dp1[0]= mp->GetX() - XX;
- _dp1[1]= mp->GetY() - YY;
- _dp1[2]= mp->GetZ();
+ _dp0[0] = mp->GetX() - XX;
+ _dp0[1] = mp->GetY() - YY;
+ _dp0[2] = mp->GetZ();
+ mp = _manContModel->GetManualPoint(1);
+ _dp1[0] = mp->GetX() - XX;
+ _dp1[1] = mp->GetY() - YY;
+ _dp1[2] = mp->GetZ();
/*
mp = _manContModel->GetManualPoint(2);
_dp2[0]= mp->GetX() - XX;
_dp2[1]= mp->GetY() - YY;
_dp2[2]= mp->GetZ();
-
mp = _manContModel->GetManualPoint(3);
_dp3[0]= mp->GetX() - XX;
_dp3[1]= mp->GetY() - YY;
_dp3[2]= mp->GetZ();
*/
- }
+ } // if
}
-
// ----------------------------------------------------------------------------
void manualViewCircle::MoveContour(int x, int y, int z) // virtual
{
+printf("EED manualViewCircle::MoveContour %p \n", this);
manualPoint *mp;
double XX=x;
double YY=y;
double ZZ=z;
TransfromCoordViewWorld(XX,YY,ZZ);
-
mp = _manContModel->GetManualPoint(0);
mp->SetPoint(_dp0[0]+XX,_dp0[1]+YY,_dp0[2]);
-
mp = _manContModel->GetManualPoint(1);
mp->SetPoint(_dp1[0]+XX,_dp1[1]+YY,_dp0[2]);
-
// mp = _manContModel->GetManualPoint(2);
// mp->SetPoint(_dp2[0]+XX,_dp2[1]+YY,_dp0[2]);
-
// mp = _manContModel->GetManualPoint(3);
// mp->SetPoint(_dp3[0]+XX,_dp3[1]+YY,_dp0[2]);
-
UpdateViewPoint(0);
UpdateViewPoint(1);
// UpdateViewPoint(2);
// UpdateViewPoint(3);
+}
+// ----------------------------------------------------------------------------
+bool manualViewCircle::ShowLineVersion()
+{
+ return false;
}
+
+
virtual void InitMove(int x, int y, int z);
virtual void MoveContour(int x, int y, int z);
void GetMinMax(double &minX,double &minY, double &maxX, double &maxY);
+ virtual bool ShowLineVersion();
private:
double _dp0[3];
manualViewContour::manualViewContour()
{
_id_viewPoint_for_text = 0;
- _initialConoturModel = new manualContourModel();
-
+ _initialConoturModel = new manualContourModel();
_minX = 99999;
_minY = 99999;
_maxX = -99999;
}
// ----------------------------------------------------------------------------
-
void manualViewContour::Open(FILE *pFile)
{
}
// ----------------------------------------------------------------------------
-void manualViewContour::RefreshContour() // virtual
+bool manualViewContour::ShowLineVersion() // virtual
{
- int i,np,nps;
+ bool result = false;
+ int np = GetNumberOfPoints( );
+ if (np==2)
+ {
+ result=true;
+ }
+ return result;
+}
+// ----------------------------------------------------------------------------
+void manualViewContour::RefreshContour() // virtual
+{
+ int i,nps;
//JSTG 25-02-08 --------------------
//double t,delta, x,y,z;
double x,y,z;
double xx,yy,zz;
//----------------------------------
-
- np = GetNumberOfPoints( );
-
- if (np==2)
+ if ( ShowLineVersion()==true )
{
SetCellArray(false);
manualPoint *mpA = _manContModel->GetManualPoint(0);
manualPoint *mpB = _manContModel->GetManualPoint(1);
if ( _pts!=NULL )
{
- xx=mpA->GetX() * _spc[0];
- yy=mpA->GetY() * _spc[1];
- zz=mpA->GetZ() * _spc[2];
- _minX=xx;
- _minY=yy;
- _maxX=xx;
- _maxY=yy;
+ xx = mpA->GetX() * _spc[0];
+ yy = mpA->GetY() * _spc[1];
+ zz = mpA->GetZ() * _spc[2];
+ _minX = xx;
+ _minY = yy;
+ _maxX = xx;
+ _maxY = yy;
_pts->SetPoint(0 , xx , yy , zz );
xx=mpB->GetX() * _spc[0];
yy=mpB->GetY() * _spc[1];
//EED 27 Juin 2012
//Boundaring box
- _minX=99999;
- _minY=99999;
- _maxX=-99999;
- _maxY=-99999;
+ _minX = 99999;
+ _minY = 99999;
+ _maxX = -99999;
+ _maxY = -99999;
if ( _pts!=NULL )
{
+ int np = GetNumberOfPoints( );
if (np>=2 )
{
for( i = 0; i < nps; i++ )
//--------------------------------------------------------------
// EED 27 sep 2006
// _pts->SetPoint(i, x,y,z );
- xx=x*_spc[0];
- yy=y*_spc[1];
- zz=z*_spc[2];
+ xx = x*_spc[0];
+ yy = y*_spc[1];
+ zz = z*_spc[2];
_pts->SetPoint(i,xx,yy,zz );
//EED 27 Juin 2012
if (yy < _minY) { _minY = yy; }
if (xx > _maxX) { _maxX = xx; }
if (yy > _maxY) { _maxY = yy; }
-
}// for
}else{
_pts->SetPoint(0, 0 , 0 , 0);
} // if
} // _pts!=NULL
} //np==2
-
- _minX=_minX-1.0;
- _minY=_minY-1.0;
- _maxX=_maxX+1.0;
- _maxY=_maxY+1.0;
+ _minX = _minX-1.0;
+ _minY = _minY-1.0;
+ _maxX = _maxX+1.0;
+ _maxY = _maxY+1.0;
//EED 2017-03-02
- _pts->Modified();
+ if (_pts!=NULL)
+ {
+ _pts->Modified();
+ }
}
// ----------------------------------------------------------------------------
// ----------------------------------------------------------------------------
bool manualViewContour::ifTouchContour(int x,int y,int z)
{
- bool result=false;
-
- double xx=x;
- double yy=y;
- double zz=z;
+ bool result = false;
+ double xx = x;
+ double yy = y;
+ double zz = z;
double ppA[3];
double ppB[3];
double d1,d2,d3;
TransfromCoordViewWorld(xx,yy,zz);
-
//EED 27 sep 2006
xx = xx * _spc[0];
yy = yy * _spc[1];
zz = zz * _spc[2];
-
- if ( (xx>=_minX) && (yy>=_minY) && (xx<=_maxX) && (yy<=_maxY)) { // inside the boundaring box
-
-
- if (_manContModel->GetSizeLstPoints()==2)
+ if ( (xx>=_minX) && (yy>=_minY) && (xx<=_maxX) && (yy<=_maxY))
+ { // inside the boundaring box
+ if ( ShowLineVersion()==true )
{
manualPoint *mpA = _manContModel->GetManualPoint(0);
manualPoint *mpB = _manContModel->GetManualPoint(1);
_pts->GetPoint(0, ppA);
double dirVec[3];
-
// direction of the segment
dirVec[0] = mpB->GetX() - mpA->GetX();
dirVec[1] = mpB->GetY() - mpA->GetY();
dirVec[2] = mpB->GetZ() - mpA->GetZ();
-
-
// proj = mpA + k*dirVec
double num;
double den = 0.0 ;
- num = dirVec[0]*( xx-mpA->GetX() );
- num = num + dirVec[1]*( yy-mpA->GetY() );
- num = num + dirVec[2]*( zz-mpA->GetZ() );
+ num = dirVec[0]*( xx-mpA->GetX() );
+ num = num + dirVec[1]*( yy-mpA->GetY() );
+ num = num + dirVec[2]*( zz-mpA->GetZ() );
den=dirVec[0]*dirVec[0] + dirVec[1]*dirVec[1] + dirVec[2]*dirVec[2];
double k;
if (den!=0)
{
- k=num/den;
+ k = num/den;
} else {
- k=99999999;
+ k = 99999999;
}
// projection of th point xx,yy,zz in segment mpA,mpB
double projX = mpA->GetX() + k*dirVec[0];
{
result=true;
} // if d1
- } else{
+ } else {
unsigned int i, nps,nps_t;
nps = _sizePointsContour;
if (this->_manContModel->IfCloseContour()==true)
{
nps_t = nps;
} else {
- nps_t = nps-1;
+ nps_t = nps-1;
} // if close
for( i = 0; i < nps_t; i++ )
{
d3 = sqrt( (ppB[0]-ppA[0])*(ppB[0]-ppA[0]) + (ppB[1]-ppA[1])*(ppB[1]-ppA[1]) + (ppB[2]-ppA[2])*(ppB[2]-ppA[2]));
if ( ((d1+d2)>=d3) && ((d1+d2)<=d3*1.3) )
{
- result=true;
- i=nps;
+ result = true;
+ i = nps;
} // if
} // for i
} // if GetSizeLstPoints()==2
} // if min max
-
return result;
}
virtual ~manualViewContour();
virtual manualViewContour * Clone();
void CopyAttributesTo( manualViewContour *cloneObject );
- virtual int GetType();
+ virtual int GetType();
virtual void Save(FILE *pFile);
virtual void Open(FILE *pFile);
+ virtual bool ShowLineVersion();
virtual void RefreshContour();
virtual bool ifTouchContour(int x,int y, int z);
virtual void InitMove(int x, int y, int z);
{
}
-
// ----------------------------------------------------------------------------
manualViewLine * manualViewLine :: Clone()
{
}
// ---------------------------------------------------------------------------
-
void manualViewLine::CopyAttributesTo( manualViewLine * cloneObject)
{
// Fathers object
return 6;
}
-
// ----------------------------------------------------------------------------
-
void manualViewLine::InitMove(int x, int y, int z) // virtual
{
manualPoint *mp;
double YY=y;
double ZZ=z;
TransfromCoordViewWorld(XX,YY,ZZ);
-
if (_manContModel->GetSizeLstPoints()==2)
{
mp = _manContModel->GetManualPoint(0);
- _dp0[0]= mp->GetX() - XX;
- _dp0[1]= mp->GetY() - YY;
- _dp0[2]= mp->GetZ();
-
+ _dp0[0] = mp->GetX() - XX;
+ _dp0[1] = mp->GetY() - YY;
+ _dp0[2] = mp->GetZ();
mp = _manContModel->GetManualPoint(1);
- _dp1[0]= mp->GetX() - XX;
- _dp1[1]= mp->GetY() - YY;
- _dp1[2]= mp->GetZ();
-
- }
+ _dp1[0] = mp->GetX() - XX;
+ _dp1[1] = mp->GetY() - YY;
+ _dp1[2] = mp->GetZ();
+ } // if
}
-
// ----------------------------------------------------------------------------
void manualViewLine::MoveContour(int x, int y, int z) // virtual
{
manualPoint *mp;
- double XX=x;
- double YY=y;
- double ZZ=z;
+ double XX = x;
+ double YY = y;
+ double ZZ = z;
TransfromCoordViewWorld(XX,YY,ZZ);
-
mp = _manContModel->GetManualPoint(0);
mp->SetPoint(_dp0[0]+XX,_dp0[1]+YY,_dp0[2]);
-
mp = _manContModel->GetManualPoint(1);
mp->SetPoint(_dp1[0]+XX,_dp1[1]+YY,_dp0[2]);
-
-
UpdateViewPoint(0);
UpdateViewPoint(1);
}
_pointVtkActor = vtkActor::New();
_bboxMapper = vtkPolyDataMapper::New();
+
+
+//EED 2017-01-01 Migration VTK7
+#if VTK_MAJOR_VERSION <= 5
_bboxMapper->SetInput(_pd);
+#else
+ _bboxMapper->SetInputData(_pd);
+#endif
+
+
// _bboxMapper->ImmediateModeRenderingOn();
_pointVtkActor->SetMapper(_bboxMapper);
// _pointVtkActor->GetProperty()->BackfaceCullingOn();
#include <vtkDataSetMapper.h>
#include <vtkUnstructuredGrid.h>
-#include "wxVTKRenderWindowInteractor.h"
+#include "creawxVTKRenderWindowInteractor.h"
#include <vector>
#include "wxVtkBaseView.h"
// ----------------------------------------------------------------------------
-manualViewPoints * manualViewPoints :: Clone()
+manualViewPoints * manualViewPoints::Clone()
{
manualViewPoints * clone = new manualViewPoints();
CopyAttributesTo(clone);
if (np>=2)
{
manualPoint *mp;
- for( i = 0; i < np+1; i++ ) {
+ for( i = 0; i < np+1; i++ )
+ {
ii=i%np;
mp = _manContModel->GetManualPoint(ii);
-
//EEDx6
double XX=mp->GetX(),YY=mp->GetY(),ZZ=mp->GetZ();
// wxVtk2DBaseView *wxvtk2Dbasevie = (wxVtk2DBaseView*)this->GetWxVtkBaseView();
//EED 27 sep 2007
// _pts->SetPoint(i, XX,YY,ZZ );
_pts->SetPoint(i, XX*_spc[0] , YY*_spc[1] , ZZ*_spc[2] );
- } // rof
-
+ } // for
} else {
_pts->SetPoint(0, 0 , 0 , 0);
_pts->SetPoint(1, 0 , 0 , 0);
} // if
}
-
//EED 2017-03-02
if (_pts!=NULL)
{
bool manualInteractorWindowLevel::OnMouseMove() // virtual
{
+
+printf("EED Warning manualInteractorWindowLevel::OnMouseMove Clean this put in a specific class for camera Interaction ....\n");
+printf("EED Warning manualInteractorWindowLevel::OnMouseMove Clean this put in a specific class for camera Interaction ....\n");
+printf("EED Warning manualInteractorWindowLevel::OnMouseMove Clean this put in a specific class for camera Interaction ....\n");
+printf("EED Warning manualInteractorWindowLevel::OnMouseMove Clean this put in a specific class for camera Interaction ....\n");
+printf("EED Warning manualInteractorWindowLevel::OnMouseMove Clean this put in a specific class for camera Interaction ....\n");
+printf("EED Warning manualInteractorWindowLevel::OnMouseMove Clean this put in a specific class for camera Interaction ....\n");
+printf("EED Warning manualInteractorWindowLevel::OnMouseMove Clean this put in a specific class for camera Interaction ....\n");
+
+// EED Mising in the wheal event and the ctrl+MouseRight Event
+ wxVtk2DBaseView *wxvtk2Dbaseview = (wxVtk2DBaseView*)_vtkInteractorStyleBaseView->GetWxVtk2DBaseView();
+ vtkBaseData *vtkbasedata = wxvtk2Dbaseview->GetVtkBaseData();
+ double parallelscaling=wxvtk2Dbaseview->GetRenderer()->GetActiveCamera()->GetParallelScale();
+ vtkbasedata->SetCameraParallelScale( parallelscaling );
+ this->_vtkInteractorStyleBaseView->SetParent_refresh_waiting();
+//-----------------
+
+
if (_stateWindowLevel==true)
{
int tmpPx,tmpPy;
- wxVTKRenderWindowInteractor *wxVTKiren;
+ crea::wxVTKRenderWindowInteractor *wxVTKiren;
wxVTKiren = _vtkInteractorStyleBaseView->GetWxVtk2DBaseView()->GetWxVTKRenderWindowInteractor();
wxVTKiren->GetEventPosition( tmpPx , tmpPy );
double colorWin;
if ((_vtkInteractorStyleBaseView->GetInteractor()->GetControlKey()==0) &&
(_vtkInteractorStyleBaseView->GetInteractor()->GetShiftKey()==0) ){
_stateWindowLevel = true;
- wxVTKRenderWindowInteractor *wxVTKiren;
+ crea::wxVTKRenderWindowInteractor *wxVTKiren;
wxVTKiren = _vtkInteractorStyleBaseView->GetWxVtk2DBaseView()->GetWxVTKRenderWindowInteractor();
wxVTKiren->GetEventPosition( _backPx , _backPy );
_backWindow = ((wxVtk2DBaseView*)_vtkInteractorStyleBaseView->GetWxVtk2DBaseView())->_imageViewer2XYZ->GetVtkImageViewer2()->GetColorWindow();
{
pixelModify=false;
scalarComponent = _image->GetScalarComponentAsFloat(i,j, k, 0);
- if ((_RangeMin <= scalarComponent)
- && (scalarComponent <= _RangeMax ))
+ if ((_RangeMin <= scalarComponent) && (scalarComponent <= _RangeMax ))
{
if (_brushform == 0)
{
//---------------------------------------------------------------------------
void FillFilter::SetImages(vtkImageData *image,vtkImageData *image2) // virtual
{
- baseFilterManualPaint::SetImages(image,image2);
+
+
+ baseFilterManualPaint::SetImages(image,image2);
if ((_maxX!=_maxXback) || (_maxY!=_maxYback) || (_maxZ!=_maxZback))
{
_auxImageFill->SetDimensions(_maxX + 1, _maxY + 1, _maxZ + 1);
_auxImageFill->SetOrigin(0, 0, 0);
_auxImageFill->SetExtent(0, _maxX, 0, _maxY, 0, _maxZ);
+//EED 2017-01-01 Migration VTK7
+#if VTK_MAJOR_VERSION <= 5
_auxImageFill->SetWholeExtent(0, _maxX, 0, _maxY, 0, _maxZ);
_auxImageFill->SetScalarTypeToUnsignedChar();
_auxImageFill->AllocateScalars();
+#else
+ _auxImageFill->AllocateScalars(VTK_UNSIGNED_CHAR,1);
+#endif
_ptrAuxImageFill = (unsigned char *)_auxImageFill->GetScalarPointer();
memset(_ptrAuxImageFill, 0, (_maxX+1) * (_maxY+1) * (_maxZ+1) );
}
_maxXback=_maxX;
_maxYback=_maxY;
- _maxYback=_maxZ;
+ _maxZback=_maxZ;
}
_countRecursiveFillProblem = 0;
_countProgressingFill = 0;
_usingAuxImageFill = false;
+
ivi = _px + _py*(_maxX+1) + _pz*(_maxX+1)*(_maxY+1); // index vector image
+
+
+DEF_POINTER_IMAGE_VTK_CREA_set(v_image,ss_image,p_image,st_image,_image)
+DEF_POINTER_IMAGE_VTK_CREA_set(v_image2,ss_image2,p_image2,st_image2,_image2)
+
+
+
//EED01
// FillToolRecursive(_px, _py, _pz);
FillToolRecursive(_px, _py, _pz, ivi);
//---------------------------------------------------------------------------
void FillFilter::FillToolRecursive(int px, int py, int pz,long int ivi)
{
-DEF_POINTER_IMAGE_VTK_CREA(v_image,ss_image,p_image,st_image,_image)
-DEF_POINTER_IMAGE_VTK_CREA(v_image2,ss_image2,p_image2,st_image2,_image2)
+//ups ??EED DEF_POINTER_IMAGE_VTK_CREA(v_image,ss_image,p_image,st_image,_image)
+//ups ??EED DEF_POINTER_IMAGE_VTK_CREA(v_image2,ss_image2,p_image2,st_image2,_image2)
_countRecursiveFill++;
_countProgressingFill++;
{
if (_usingAuxImageFill == true)
{
- this->_IMManager->AddModifiedPixel(px, py, pz); //DFCH
+//UPS ??EED this->_IMManager->AddModifiedPixel(px, py, pz); //DFCH
//EED01
// _auxImageFill->SetScalarComponentFromFloat(px, py, pz, 0, 0);
_ptrAuxImageFill[ ivi ]=0;
}
- _tmpDistfill = (px-_pxfill)*(px-_pxfill)
- + (py-_pyfill)*(py-_pyfill)
- + (pz-_pzfill)*(pz-_pzfill);
+ difX=px-_pxfill;
+ difY=py-_pyfill;
+ difZ=pz-_pzfill;
+ _tmpDistfill = difX*difX + difY*difY + difZ*difZ;
+// _tmpDistfill = (px-_pxfill)*(px-_pxfill)
+// + (py-_pyfill)*(py-_pyfill)
+// + (pz-_pzfill)*(pz-_pzfill);
//if (_countRecursiveFill >1 )
//{
if (_auxGrayLevelValidationFill == true)
{
- this->_IMManager->AddModifiedPixel(px, py, pz); //DFCH
+//UPS ??EED this->_IMManager->AddModifiedPixel(px, py, pz); //DFCH
if (_image2!=NULL)
{
//EED01
#include "baseFilterManualPaint.h"
+
class FillFilter : public baseFilterManualPaint {
public:
FillFilter();
int _maxYback;
int _maxZback;
+
+ int difX;
+ int difY;
+ int difZ;
protected:
+
+//DEF_POINTER_IMAGE_VTK_CREA_definition( v_image , ss_image , p_image , st_image )
+ double v_image ;
+ int ss_image ;
+ char *p_image ;
+ int st_image ;
+
+//macro not working ???
+// DEF_POINTER_IMAGE_VTK_CREA_definition(v_image2,ss_image2,p_image2,st_image2)
+ double v_image2 ;
+ int ss_image2 ;
+ char *p_image2 ;
+ int st_image2 ;
+
+
+
+
};
_image = image;
_image2 = image2;
int ext[6];
+//EED 2017-01-01 Migration VTK7
+#if VTK_MAJOR_VERSION <= 5
_image->GetWholeExtent(ext);
+#else
+ _image->GetExtent(ext);
+#endif
_minX = 0;
_minY = 0;
_minZ = 0;
if (_image2!=NULL)
{
int extB[6];
+
+//EED 2017-01-01 Migration VTK7
+#if VTK_MAJOR_VERSION <= 5
_image2->GetWholeExtent(extB);
+#else
+ _image2->GetExtent(extB);
+#endif
+
_maxX = std::min( ext[1]-ext[0] , extB[1]-extB[0] );
_maxY = std::min( ext[3]-ext[2] , extB[3]-extB[2] );
_maxZ = std::min( ext[5]-ext[4] , extB[5]-extB[4] );
#include "vtkInteractorManualPaint.h"
#include "wxVtk2DBaseView.h"
-#include "wxVTKRenderWindowInteractor.h"
+#include "creawxVTKRenderWindowInteractor.h"
-vtkInteractorManualPaint::vtkInteractorManualPaint(ManualPaintControler* mpc) {
- _manualPaintControler = mpc;
- _state = false;
- _stateKey = false;
- _stateMouse = false;
+vtkInteractorManualPaint::vtkInteractorManualPaint(ManualPaintControler* mpc)
+{
+ _manualPaintControler = mpc;
+ _state = false;
+ _stateKey = false;
+ _stateMouse = false;
}
//---------------------------------------------------------------------------
-vtkInteractorManualPaint::~vtkInteractorManualPaint() {
+vtkInteractorManualPaint::~vtkInteractorManualPaint()
+{
}
//---------------------------------------------------------------------------
-bool vtkInteractorManualPaint::OnChar() {
+bool vtkInteractorManualPaint::OnChar()
+{
vtkRenderWindowInteractor *interactor = _vtkInteractorStyleBaseView->GetInteractor();
- if (interactor->GetKeyCode() == 97) {
+ if (interactor->GetKeyCode() == 97)
+ {
_stateKey = !_stateKey;
}
return true;
}
//---------------------------------------------------------------------------
-bool vtkInteractorManualPaint::OnLeftButtonDown() {
+bool vtkInteractorManualPaint::OnLeftButtonDown()
+{
vtkRenderWindowInteractor *interactor =
_vtkInteractorStyleBaseView->GetInteractor();
if (interactor->GetControlKey() == 1) {
}
//---------------------------------------------------------------------------
-bool vtkInteractorManualPaint::OnLeftButtonUp() {
+bool vtkInteractorManualPaint::OnLeftButtonUp()
+{
if((_state == true) || (_stateKey == true))
+ {
_manualPaintControler->SetImageUndo();
+ }
_state = false;
return true;
}
{
wxVtk2DBaseView *wxvtk2Dbaseview =
(wxVtk2DBaseView*) _vtkInteractorStyleBaseView->GetWxVtk2DBaseView();
- wxVTKRenderWindowInteractor *wxVTKiren =
+ crea::wxVTKRenderWindowInteractor *wxVTKiren =
wxvtk2Dbaseview->GetWxVTKRenderWindowInteractor();
int px, py;
wxVTKiren->GetEventPosition(px, py);
this->_gConfigSizer->Add( _mBarSlices, 1, wxGROW );
//GrayLevel Slider
this->_gConfigSizer->Add( _txtGrayLevel );
+
+//EED 2017-09-16 Migration wxWidgets 2.8 to 3.0
+#if wxMAJOR_VERSION <= 2
wxFlexGridSizer *sizerGrayLevel = new wxFlexGridSizer( 2, wxHORIZONTAL );
+#else
+ wxFlexGridSizer *sizerGrayLevel = new wxFlexGridSizer( 2 );
+#endif
+
sizerGrayLevel->Add( _sldGrayLevel, 1, wxGROW );
sizerGrayLevel->Add( _graylevelCtrl, 1,
wxALIGN_BOTTOM | wxALIGN_LEFT | wxALL, 5 );
new wxStaticText( this, -1, _T("Brush Settings") ) );
//BrushSize Slider
this->_brushSizer->Add( _txtBrushSize );
+
+//EED 2017-09-16 Migration wxWidgets 2.8 to 3.0
+#if wxMAJOR_VERSION <= 2
wxFlexGridSizer *sizersdlBrushSize = new wxFlexGridSizer( 2, wxHORIZONTAL );
+#else
+ wxFlexGridSizer *sizersdlBrushSize = new wxFlexGridSizer( 2 );
+#endif
+
sizersdlBrushSize->Add( _sldBrushSize, 1, wxGROW );
sizersdlBrushSize->Add( _BrushSizeCtrl, 1,
wxALIGN_BOTTOM | wxALIGN_LEFT | wxALL, 5 );
//-----------------------------------------------------------------------------
void HistogramMinMaxLevel::onBarRangeChange(wxCommandEvent& event)
{
- printf ("EED HistogramMinMaxLevel::onBarrangeChange\n");
Histogram* histogram = (Histogram*)GetConcretComponent();
pPlotterWindow* plotterwindow = histogram->GetPlotterWindow();
sizer->Add(bottomBox,0,wxCENTER);
SetAutoLayout( TRUE );
SetSizer( sizer );
+//EED 2017-09-16 Migration wxWidgets 2.8 to 3.0
+#if wxMAJOR_VERSION <= 2
SetBestSize(wxSize(600,600));
+#else
+ SetSize(wxSize(600,600));
+#endif
}
wxPanel* HistogramDialog::getPanExtraControls(){
wxBoxSizer* sizer0 = new wxBoxSizer(wxVERTICAL);
void HistogramDialog::OnSaveData(wxCommandEvent& event)
{
- wxString nameF=wxFileSelector(_T("Save Data"), _T(" "),_T(""),_T(""),_T("*.*"),wxSAVE, NULL, -1, -1);//wxFileSelector(_T("Save Data"),wxSAVE);
+ //wxFileSelector(_T("Save Data"),wxSAVE);
+//EED 2017-09-16 Migration wxWidgets 2.8 to 3.0
+#if wxMAJOR_VERSION <= 2
+ wxString nameF=wxFileSelector(_T("Save Data"), _T(" "),_T(""),_T(""),_T("*.*"),wxSAVE, NULL, -1, -1);
+#else
+ wxString nameF=wxFileSelector(_T("Save Data"), _T(" "),_T(""),_T(""),_T("*.*"),wxFD_SAVE, NULL, -1, -1);
+#endif
+
std::ofstream file;
if(nameF.CompareTo( _T("/0") )>0)
file.open( (const char*)(nameF.mb_str()) );
return refreshed;
}
+#if (VTK_MAJOR_VERSION <= 7)
void HistogramDialog::setVolumeMapper(vtkVolumeRayCastMapper* volMapper)
+#else
+ void HistogramDialog::setVolumeMapper(vtkFixedPointVolumeRayCastMapper* volMapper)
+#endif
{
volumeMapper=volMapper;
}
//#include <vector>
#include <vtkPiecewiseFunction.h>
#include <vtkColorTransferFunction.h>
- #include <vtkVolumeRayCastMapper.h>
+#if (VTK_MAJOR_VERSION <= 7)
+ #include <vtkVolumeRayCastMapper.h>
+#else
+ #include <vtkFixedPointVolumeRayCastMapper.h>
+#endif
#include <vtkVolume.h>
//#include "../wxMPRWidget.h"
bool getRefreshed();
void setCTF(vtkColorTransferFunction* cf);
void setTF(vtkPiecewiseFunction* tf);
+#if (VTK_MAJOR_VERSION <= 7)
void setVolumeMapper(vtkVolumeRayCastMapper* volMapper);
+#else
+ void setVolumeMapper(vtkFixedPointVolumeRayCastMapper* volMapper);
+#endif
void setVolume(vtkVolume* vol);
//void setMPR3Dview(wxVtkMPR3DView *wxvtkmpr3Dview1);
//void setClipping3DView(wxVtkClipping3DView *wxvtkclipping3Dview1);
/*
cancel Button
*/
- //wxButton *cancelBtn;
- wxBitmapButton *cancelBtn;
+ //wxButton *cancelBtn;
+ wxBitmapButton *cancelBtn;
/*
save Button
*/
- wxButton *saveDataBtn;
+ wxButton *saveDataBtn;
/*
Load Button
*/
- wxButton *loadDataBtn;
+ wxButton *loadDataBtn;
/*
Refresh Button
*/
- wxButton *refreshBtn;
-
- wxPanel *_panextracontrols;
-
+ wxButton *refreshBtn;
+ wxPanel *_panextracontrols;
// the user had pressed refresh
bool refreshed;
- vtkColorTransferFunction *_ctfun;
+ vtkColorTransferFunction *_ctfun;
vtkPiecewiseFunction *_tfun;
- vtkVolumeRayCastMapper *volumeMapper;
+#if (VTK_MAJOR_VERSION <= 7)
+ vtkVolumeRayCastMapper *volumeMapper;
+#else
+ vtkFixedPointVolumeRayCastMapper *volumeMapper;
+#endif
vtkVolume *newvol;
//things to refresh
//wxVtkMPR3DView *wxvtkmpr3Dview;
- //wxVtkClipping3DView *wxvtkclipping3Dview;
+ //wxVtkClipping3DView *wxvtkclipping3Dview;
wxSizer* getControls(bool extracontrols = false);
//----------------------------------------------------------------------------
IMPLEMENT_CLASS(HistogramWidget, wxWindow)
+
//----------------------------------------------------------------------------
// Event Table
//----------------------------------------------------------------------------
pHistogram* histogram;
pPlotter* plotter;
- int idTransferenceFunction;
- int histogramSize;
- int idHistogram;
+ int idTransferenceFunction;
+ int histogramSize;
+ int idHistogram;
/*
if the image has already a transference
function and color defines to that function
int type;
DECLARE_CLASS(HistogramWidget);
+
//----------------------------------------------------------------------------
// wxWidget macro use declaration for handdling events
//----------------------------------------------------------------------------
SetAutoLayout( TRUE );
SetSizer( sizer );
+//EED 2017-09-16 Migration wxWidgets 2.8 to 3.0
+#if wxMAJOR_VERSION <= 2
SetBestSize(wxSize(325,100));
+#else
+ SetSize(wxSize(325,100));
+#endif
}
//-----------------------------------------------------------------
float MaximumsDialog::getXValue()
# ------------------------------------------------------------------------ */
//----------------------------------------------------------------------------
-#include "mBarRange.h"
+#include <wx/brush.h>
+#include <wx/gdicmn.h>
+#include "mBarRange.h"
//const wxEventType wxEVT_TSBAR = wxNewEventType();
DEFINE_EVENT_TYPE(wxEVT_TSBAR_MOVED)
DEFINE_EVENT_TYPE(wxEVT_SELECTION_END)
-
-
//----------------------------------------------------------------------------
//EVENT TABLE
//----------------------------------------------------------------------------
IMPLEMENT_CLASS(mBarRange, wxScrolledWindow)
+
BEGIN_EVENT_TABLE(mBarRange, wxScrolledWindow)
EVT_PAINT (mBarRange::OnPaint)
EVT_SIZE (mBarRange::OnSize)
//CONSTRUCTOR
//----------------------------------------------------------------------------
+//wxDefaultSize
mBarRange::mBarRange(wxWindow *parent, int w, int h)
-:wxScrolledWindow(parent,-1,wxDefaultPosition,wxDefaultSize,wxTAB_TRAVERSAL)
+:wxScrolledWindow(parent,-1,wxDefaultPosition, wxSize(60,60) ,wxTAB_TRAVERSAL)
{
- acceptedClick = true;
- _bitmap_bar = NULL;
+ acceptedClick = true;
+ _bitmap_bar = NULL;
SetWidth (w);
SetHeight(h);
- _initialPoint = 0;
- trianglesHalfWidth = 5;
-
- wxColour start_Colour;
-
+ _initialPoint = 0;
+ trianglesHalfWidth = 5;
// Setting the default parts colors
- start_Colour = wxColour(0,0,255);
+ start_Colour = wxColour(1,0,255,254);
actual_Colour = wxColour(255,255,202);
end_Colour = wxColour(0,0,255);
bar_Colour = wxColour(255,0,255);
backgroundColor = parent ->GetBackgroundColour();
guideLineColor = wxColour(255,0,0);
-
//actual is in _start and end
//false means that it could be anywhere
_moveActualWithBar = false;
_selectionMoveId = -1;
realX_vertical_line = -1;
activeState = false;
- _actual=0;
- deviceEndMargin = 0;
-
+ _actual = 0;
+ deviceEndMargin = 0;
SetOrientation(true);
setIfWithActualDrawed(true);
-
b_popmenu.Append (cntID_CHANGE_COLOR, _("Change Color"), _("Changes the color of the selected part"));
b_popmenu.Append (cntID_ENABLE_ACTUAL, _("Enable actual in range"), _("Enables/Disables the actual triangle to be or not in range"));
b_popmenu.Append (cntID_MOVABLE_ACTUAL_BAR, _("Move actual-bar simultaneously"), _("Disables the actual triangle to move with the bar"));
-
SetSize(w,h);
}
mBarRange::~mBarRange()
{
}
+
//---------------------------------------------------------------------------
//Draw bar: vertical or Horizontal
//---------------------------------------------------------------------------
{
return ((_start - _min)*(_w-deviceEndMargin))/(_max - _min);
}
+
//----------------------------------------------------------------------------
// param i: value in pixels
//----------------------------------------------------------------------------
_start = _min+((i - deviceStart_x)*( _max - _min))/(_w-deviceEndMargin);
}
+
//----------------------------------------------------------------------------
// _actual of the pixel rectangle
//----------------------------------------------------------------------------
{
return ((_actual - _min)*(_w-deviceEndMargin))/(_max - _min);
}
+
//----------------------------------------------------------------------------
// param i: value in pixels
//----------------------------------------------------------------------------
{
_actual = _min + (i-deviceStart_x)*(_max-_min)/(_w-deviceEndMargin);
}
+
//----------------------------------------------------------------------------
// _end of the pixel rectangle
//----------------------------------------------------------------------------
{
return ((_end - _min)*(_w-deviceEndMargin))/(_max - _min);
}
+
//----------------------------------------------------------------------------
// param i: value in pixels to be converted to real logical value
//----------------------------------------------------------------------------
{
_end = _min + (i-deviceStart_x)*(_max-_min)/(_w-deviceEndMargin);
}
+
//----------------------------------------------------------------------------
// Logical max of the triangle
//----------------------------------------------------------------------------
-
double mBarRange::GetMax()
{
return _max;
int pxEnd = GetPixelEnd();
int pxActual = GetPixelActual();
-
int letterHeight= 9;
int barHeight = 2*letterHeight;
- int tempHeight = _h-(6*letterHeight);
-
+ int tempHeight = _h-(6*letterHeight);
if (_visibleLables)
{
wxMemoryDC temp_dc;
temp_dc.SelectObject( *_bitmap_bar );
-
// Background of this widget
-
-
temp_dc.SetPen(wxPen( backgroundColor ));
temp_dc.SetBrush(wxBrush( backgroundColor ,wxSOLID ));
-
temp_dc.DrawRectangle(0,0,_w+2*trianglesHalfWidth,_h);
-
-
temp_dc.SetPen(wxPen( wxColour(167,165,191) ,1,wxSOLID ));
temp_dc.DrawLine(trianglesHalfWidth+2, 0, _w-deviceEndMargin, 0);
temp_dc.DrawLine(trianglesHalfWidth+2, barHeight, (_w-deviceEndMargin-trianglesHalfWidth-2), barHeight);
temp_dc.SetDeviceOrigin(trianglesHalfWidth+2,0);
-
// Filling the bar
temp_dc.SetBrush(wxBrush( wxColour(104,104,104),wxSOLID ));
temp_dc.SetPen(wxPen( wxColour(104,104,104),1,wxSOLID ));
temp_dc.DrawRectangle( pxStart , 0, pxEnd-pxStart, barHeight);
-
// The Bar
if( _selectionMoveId==4 )
{
temp_dc.SetBrush(wxBrush( wxColour(128,255,0),wxSOLID ));
temp_dc.SetPen(wxPen( wxColour(0,128,0),1,wxSOLID ));
- }
- else
- {
+ } else {
temp_dc.SetBrush(wxBrush( bar_Colour,wxSOLID ));
temp_dc.SetPen(wxPen( wxColour(164,0,164),1,wxSOLID ));
}
{
temp_dc.SetBrush(wxBrush( wxColour(128,255,0),wxSOLID ));
temp_dc.SetPen(wxPen( wxColour(0,128,0),1,wxSOLID ));
- }
- else
- {
+ } else {
temp_dc.SetBrush(wxBrush( start_Colour,wxSOLID ));
temp_dc.SetPen(wxPen( wxColour(0,51,204),1,wxSOLID ));
}
{
temp_dc.SetBrush(wxBrush( wxColour(128,255,0),wxSOLID ));
temp_dc.SetPen(wxPen( wxColour(0,128,0),1,wxSOLID ));
- }
- else
- {
+ } else {
temp_dc.SetBrush(wxBrush( end_Colour,wxSOLID ));
temp_dc.SetPen(wxPen( wxColour(0,0,255),1,wxSOLID ));
}
{
temp_dc.SetBrush(wxBrush( wxColour(128,255,0),wxSOLID ));
temp_dc.SetPen(wxPen( wxColour(0,128,0),1,wxSOLID ));
- }
- else
- {
+ } else {
temp_dc.SetBrush(wxBrush( actual_Colour,wxSOLID ));
temp_dc.SetPen(wxPen( wxColour(205,160,5),1,wxSOLID ));
}
temp_dc.SetFont(font);
temp_dc.SetTextForeground(*wxBLACK);
-
//the **MIN** value, always at the same y level that corresponds to barHeight+1
wxString text_min;
// text_min<< GetMin();
temp_dc.DrawText(text_actual, pxActual-(stringSize.GetWidth()/2),barHeight+letterHeight);
}
}
-
}
//----------------------------------------------------------------------------
wxBitmap *_bitmap_bar;
//the info bitmap device
wxBitmap *_bitmap_info;
+
+
DECLARE_CLASS(BarRange)
+
// any class wishing to process wxWindows events must use this macro
DECLARE_EVENT_TABLE()
};
#ifndef __mBarRange2_h__
#define __mBarRange2_h__
-
#include <wx/wx.h>
#include <wx/textctrl.h>
#include "mBarRange.h"
-
BEGIN_DECLARE_EVENT_TYPES()
DECLARE_EVENT_TYPE(wxEVT_BarRange2_Change,-1)
END_DECLARE_EVENT_TYPES()
-
-
class mBarRange2
: public wxPanel
{
public:
mBarRange2(wxWindow * parent,int width, int height);
~mBarRange2();
- void onTxtCtrl(wxCommandEvent& event);
- void SetMinMaxValue(double,double);
- void SetScalarType(int);
+ void onTxtCtrl(wxCommandEvent& event);
+ void SetMinMaxValue(double,double);
+ void SetScalarType(int);
double GetStartValue();
double GetEndValue();
private:
wxTextCtrl *_textctrlStart;
wxTextCtrl *_textctrlEnd;
void onBarRangeChange(wxCommandEvent& event);
- wxString CleanNumberStr(wxString string);
+ wxString CleanNumberStr(wxString string);
void RefreshTextCntrl();
void createAndSendEvent(WXTYPE theEventType);
DECLARE_EVENT_TABLE()
if (tmp>=1)
{
fmt = wxT("%.f");
- }
- else
- {
+ } else {
tmp=8-tmp;
fmt.Printf(wxT("%%.%df"), tmp >= -1 ? 2 : -tmp);
- }
+ } // if temp
double n = floor( (w.GetPosY() - (double)extend / w.GetScaleY()) / step ) * step ;
{
dc.DrawText( s, orgx+4, GetYTranslated(sizedc,p-ty/2));
tmp=p-ty/2;
- }
- }
+ } // if
+ } // for
dc.GetTextExtent(m_name, &tx, &ty);
dc.DrawText( m_name, orgx-tx-4, GetYTranslated(sizedc,-extend + ty + 4));
// mpWindow
//-----------------------------------------------------------------------------
-IMPLEMENT_DYNAMIC_CLASS(mpWindow, wxScrolledWindow)
+//EED 2017-09-16 Migration wxWidgets 2.8 to 3.0
+#if wxMAJOR_VERSION <= 2
+ IMPLEMENT_DYNAMIC_CLASS(mpWindow, wxScrolledWindow)
+#else
+ wxIMPLEMENT_DYNAMIC_CLASS(mpWindow, wxScrolledWindow);
+#endif
+
BEGIN_EVENT_TABLE(mpWindow, wxScrolledWindow)
EVT_PAINT ( mpWindow::OnPaint)
mpWindow::mpWindow( wxWindow *parent, wxWindowID id, const wxPoint &pos, const wxSize &size, int flag )
: wxScrolledWindow( parent, id, wxDefaultPosition, wxDefaultSize, flag, wxT("wxPlotter") )
{
- m_scaleX = m_scaleY = 1.0;
- m_posX = m_posY = 0;
- m_scrX = m_scrY = 64;
- m_minX = m_minY = 0;
- m_maxX = m_maxY = 0;
- maxScrX = maxScrY = 200;
- minScrX = minScrY = 0;
- m_clickedX = 0;
- m_clickedY = 5000;
- m_lockaspect = FALSE;
- offsetX = offsetY = 0;
- offsetPixelX = offsetPixelY= 0;
- _bitmap_functions=NULL;
-
- real_guideLine_X = -1;
- real_guideLine_Y = -1;
- drawGuides = true;
- type=1;
+ m_scaleX = m_scaleY = 1.0;
+ m_posX = m_posY = 0;
+ m_scrX = m_scrY = 64;
+ m_minX = m_minY = 0;
+ m_maxX = m_maxY = 0;
+ maxScrX = maxScrY = 200;
+ minScrX = minScrY = 0;
+ m_clickedX = 0;
+ m_clickedY = 5000;
+ m_lockaspect = FALSE;
+ offsetX = offsetY = 0;
+ offsetPixelX = offsetPixelY = 0;
+ _bitmap_functions = NULL;
+
+ real_guideLine_X = -1;
+ real_guideLine_Y = -1;
+ drawGuides = true;
+ type = 1;
m_popmenu.Append( mpID_CENTER, _("Center"), _("Center plot view to this position"));
m_popmenu.Append( mpID_FIT, _("Fit"), _("Set plot view to show all items"));
void mpWindow::LockAspect(bool enable)
{
m_lockaspect = enable;
-
m_popmenu.Check(mpID_LOCKASPECT, enable);
-
if (m_lockaspect)
{
double s = (m_scaleX + m_scaleY)/2;
m_scaleX = s;
m_scaleY = s;
}
-
UpdateAll();
}
int flags = 0);
~mpWindow();
+
/** Get reference to context menu of the plot canvas.
@return Pointer to menu. The menu can be modified.
*/
*/
int type;
+
private:
//bitmap of functions
wxBitmap *_bitmap_functions;
+//EED 2017-09-16 Migration wxWidgets 2.8 to 3.0
+#if wxMAJOR_VERSION <= 2
DECLARE_CLASS(mpWindow)
+#else
+ wxDECLARE_DYNAMIC_CLASS(mpWindow);
+#endif
+
DECLARE_EVENT_TABLE()
+
+
};
#endif // _MP_MATHPLOT_H_
pGraphicalFunction:: pGraphicalFunction(wxString name, int flags)
{
SetName(name);
- showPointsF = false;
- validPointRange = 5;
- logicFunction = new pLogicalFunction ();
- fromWindow=false;
- factorZoom=1;
- drawing=false;
- editable=true;
- ifActual=false;
- zoomIn=false;
+ showPointsF = false;
+ validPointRange = 5;
+ logicFunction = new pLogicalFunction ();
+ fromWindow = false;
+ factorZoom = 1;
+ drawing = false;
+ editable = true;
+ ifActual = false;
+ zoomIn = false;
setOffsetX(0);
setOffsetY(0);
- initialDrawingPoint=NULL;
- finalDrawingPoint=NULL;
+ initialDrawingPoint = NULL;
+ finalDrawingPoint = NULL;
//type=1 means that is going to be a piecewise function
- _type=1;
- xKSpline=NULL;
- yKSpline=NULL;
- offsetPixelX=0;
- offsetPixelY=0;
- xTraslation=0;
- mType=DEFAULT;
+ _type = 1;
+ xKSpline = NULL;
+ yKSpline = NULL;
+ offsetPixelX = 0;
+ offsetPixelY = 0;
+ xTraslation = 0;
+ mType = DEFAULT;
}
setEndX(logicFunction->getEndX());
setStartY(logicFunction->getStartY());
setEndY(logicFunction->getEndY());
-
}
/*
//int dy= logicFunction->getMaxY()-logicFunction->getMinY();
int dx= maxShowedX-minShowedX;
int dy= maxShowedY-minShowedY;
-
-
if(dx!=0 && dy!=0)
{
double scaleX=(((float)(screenX-100))/dx)*factorZoom;
setScaleY(scaleY);
logicFunction->setScaleX(scaleX);
logicFunction->setScaleY(scaleY);
-
- }
+ }// if dx dy
}
/*
* Includes a point between two existing points of this function. The new point (x,y) was not defined when the function was created.
bool pGraphicalFunction:: AddNewPoint(int x,int y)
{
bool added= logicFunction -> AddNewPoint ( x, y );
- if(!fromWindow)
- setUp();
- else
+ if(!fromWindow)
{
+ setUp();
+ } else {
logicFunction->setEndPoints();
logicFunction->setStartPoints();
}
bool added=false;
if (logicFunction!=NULL){
added=logicFunction -> AddPoint( aX, aY,order );
- if(!fromWindow)
- setUp();
- else
+ if(!fromWindow)
{
+ setUp();
+ } else {
logicFunction->setEndPoints();
logicFunction->setStartPoints();
} // if fromWindow
{
bool added= logicFunction -> DeletePoint( aX, aY );
if(!fromWindow)
- setUp();
- else
{
+ setUp();
+ } else {
logicFunction->setEndPoints();
logicFunction->setStartPoints();
}
{
bool added=logicFunction -> deletePointAt( index );
if(!fromWindow)
- setUp();
- else
{
+ setUp();
+ } else {
logicFunction->setEndPoints();
logicFunction->setStartPoints();
}
bool pGraphicalFunction::changePoint(wxPoint newCoords, int movingIndexPoint)
{
bool added= (logicFunction -> changePoint( newCoords, movingIndexPoint ));
- if(!fromWindow)
- setUp();
- else
+ if(!fromWindow)
{
+ setUp();
+ } else {
logicFunction->setEndPoints();
logicFunction->setStartPoints();
}
pFunctionPoint* point= new pFunctionPoint(x,y);
bool inLine;
before=getBefore(point);
-
if(before && before->GetNext())
{
next = before->GetNext();
//next = (before->GetNext())->GetNext();
inLine= isInLine((pFunctionPoint*)before->GetData(),(pFunctionPoint*)next->GetData(),point);
- }
- else
+ } else {
inLine=false;
+ }
return inLine;
}
/*
x=(float)point->getRealX();
y=(float)point->getRealY();
-
float d1= (float)sqrt(pow(float(x1-x),2)+ pow(float(y1-y),2));
float d2= (float)sqrt(pow(float(x2-x),2)+ pow(float(y2-y),2));
float d=(float)sqrt(pow(float(x2-x1),2)+ pow(float(y2-y1),2));
{
int xS,yS,x1,x2,y1,y2;
setScales();
- xS=clickedX/_scaleX+_offsetX;
- yS=clickedY/_scaleY+_offsetY;
+ xS = clickedX/_scaleX+_offsetX;
+ yS = clickedY/_scaleY+_offsetY;
//square
- x1=(clickedX-width)/_scaleX+_offsetX;
- x2=(clickedX+width)/_scaleX+_offsetX;
- y1=(clickedY-width)/_scaleY+_offsetY;
- y2=(clickedY+width)/_scaleY+_offsetY;
-
- int numberPoints=getSizePoints();
- pFunctionPoint* point;
- wxNode* p;
+ x1 = (clickedX-width)/_scaleX+_offsetX;
+ x2 = (clickedX+width)/_scaleX+_offsetX;
+ y1 = (clickedY-width)/_scaleY+_offsetY;
+ y2 = (clickedY+width)/_scaleY+_offsetY;
+
+ int numberPoints = getSizePoints();
+ pFunctionPoint* point;
+ wxNode* p;
bool inSquare=false,first=false;
//if the user made a zoom
finalDrawingPoint=point;
}
}
- }
- else
- {
+ } else {
//We extend the range of vision in x and y,20 and 10 respectively
if((_offsetX-20)>=0)
{
_offsetX=_offsetX-20;
- }
- else
+ } else {
_offsetX=0;
+ }
if((_offsetY-10)>=0)
{
_offsetY=_offsetY-10;
- }
- else
+ } else {
_offsetY=0;
+ }
}
}
}
return false;
}
+
+
+
+//EED 2017-09-16 Migration wxWidgets 2.8 to 3.0
+#if wxMAJOR_VERSION <= 2
/**
Get Point list of the funcion
@param return points
logicFunction->GetPoints(points);
//points = realPoints;
}
+#else
+ /**
+ Get Point list of the funcion
+ @param return pointsPtr
+ */
+ virtual wxList* GetPointsPtr()
+ {
+ return logicFunction->GetPointsPtr();
+ }
+#endif
+
+
/**
Get the point where the user
made a click
*/
-
virtual void getMousePoint(int &x,int &y)
{
- x=mousePoint.x;
- y=mousePoint.y;
+ x = mousePoint.x;
+ y = mousePoint.y;
}
/**
//setting image data of the points
points->SetDimensions(xDimension,1,1);
//EED points->SetScalarTypeToUnsignedShort();
+
+//EED 2017-01-01 Migration VTK7
+#if VTK_MAJOR_VERSION <= 5
points->SetScalarTypeToDouble();
points->AllocateScalars();
points->Update();
+#else
+ points->AllocateScalars(VTK_DOUBLE,1);
+#endif
+
}
/*
void pHistogram::setPoints(vtkImageData* imageData)
{
-printf("EED pHistogram::setPoints Trinng new histogram ..\n");
/*
printf("EED pHistogram::setPoints Test: vtkPComputeHistogram2DOutliers\n");
vtkComputeHistogram2DOutliers *vtkhist = vtkComputeHistogram2DOutliers::New();
*/
char* dataImagePointerC = (char*)imageData->GetScalarPointer(0,0,0);
- unsigned char* dataImagePointerUC = (unsigned char*)imageData->GetScalarPointer(0,0,0);
+ unsigned char* dataImagePointerUC = (unsigned char*)imageData->GetScalarPointer(0,0,0);
short* dataImagePointerS = (short*)imageData->GetScalarPointer(0,0,0);
- unsigned short* dataImagePointerUS = (unsigned short*)imageData->GetScalarPointer(0,0,0);
+ unsigned short* dataImagePointerUS = (unsigned short*)imageData->GetScalarPointer(0,0,0);
float* dataImagePointerF = (float*)imageData->GetScalarPointer(0,0,0);
- double* dataImagePointerD = (double*)imageData->GetScalarPointer(0,0,0);
- double* dataHistogramPointer = (double*)points->GetScalarPointer(0,0,0);
+ double* dataImagePointerD = (double*)imageData->GetScalarPointer(0,0,0);
+ double* dataHistogramPointer = (double*)points->GetScalarPointer(0,0,0);
/*
Range of greys
}
*/
+
+//EED 2017-09-16 Migration wxWidgets 2.8 to 3.0
+#if wxMAJOR_VERSION <= 2
/**
Get Point list of the funcion
@param return points
{
points = realPoints;
}
+#else
+ /**
+ Get Point list of the funcion
+ @param return pointsPtr
+ */
+ /*virtual*/
+ wxList* GetPointsPtr()
+ {
+ return &realPoints;
+ }
+#endif
+
+
/*
* validate if the function has that point in a sensible area returning the index where the point was found or -1 if is in not part of the function: define the sensible area is
* x1-validPointRange<x<x1+validPointRange y1-validPointRange<y<y1+validPointRange
text.Clear();
text = _T("minX=");
double realMin_X = actualFunction->getMinX();
+//EED 2017-09-16 Migration wxWidgets 2.8 to 3.0
+#if wxMAJOR_VERSION <= 2
text = text + realMin_X;
+#else
+ text = text + wxString::FromDouble( realMin_X );
+#endif
text = text + _T(" maxX=");
double realMax_X = actualFunction->getMaxX();
+//EED 2017-09-16 Migration wxWidgets 2.8 to 3.0
+#if wxMAJOR_VERSION <= 2
text = text + realMax_X;
+#else
+ text = text + wxString::FromDouble( realMax_X );
+#endif
int minShowed = actualFunction->getMinXShowed();
int maxShowed = actualFunction->getMaxXShowed();
barrange -> setRepresentedValues (realMin_X, realMax_X);
{
SetName(name);
m_flags = flags;
+//EED 2017-09-16 Migration wxWidgets 2.8 to 3.0
+#if wxMAJOR_VERSION <= 2
points.DeleteContents(TRUE);
- offsetX=0;
- offsetY=0;
+#else
+ // ...
+#endif
+ offsetX = 0;
+ offsetY = 0;
}
/*
*/
void pPlotterLayer::drawFunction(wxDC & dc,mpWindow & w, int orgy)
{
-
-
int scrwX,scrwY,offsetpx,offsetpy,maxX,minX,maxY,minY;
- wxPoint* ppoints=NULL;
+ wxPoint* ppoints = NULL;
/*
This is the offset of every point scale to the window
pixel
*/
- offsetpx=getOffsetPixelsXv();
- offsetpy=getOffsetPixelsYv();
-
+ offsetpx = getOffsetPixelsXv();
+ offsetpy = getOffsetPixelsYv();
Rewind();
-
dc.GetSize(&scrwX, &scrwY);
-
//Lines between the points
-
int sizedc = dc.GetSize().GetHeight()-orgy;
-
+//EED 2017-09-16 Migration wxWidgets 2.8 to 3.0
+#if wxMAJOR_VERSION <= 2
GetPoints(points);
-
+#else
+ //...
+#endif
// type of plotter
int type=getmType();
/***********/
//traslation
//int xTraslation=getXTraslation(); //JPRx
+//EED 2017-09-16 Migration wxWidgets 2.8 to 3.0
+#if wxMAJOR_VERSION <= 2
wxNode* node= points.GetFirst();
+#else
+ wxNode* node= GetPointsPtr()->GetFirst();
+#endif
// int i=1;//points.GetCount()+1; //JPRx
int j=2;
/*
/*
Fill the function if it represented an histogram
*/
- ppoints=(wxPoint*)malloc(sizeof(int)*2*(points.GetCount()+2));
+//EED 2017-09-16 Migration wxWidgets 2.8 to 3.0
+#if wxMAJOR_VERSION <= 2
+ ppoints = (wxPoint*)malloc(sizeof(int)*2*(points.GetCount()+2));
+#else
+ ppoints = (wxPoint*)malloc(sizeof(int)*2*(GetPointsPtr()->GetCount()+2));
+#endif
//initialize points
- point.x=-5000;
- point.y=GetYTranslated(sizedc,-5000);
- ppoints[0]=point;
- ppoints[1]=point;
-
+ point.x = -5000;
+ point.y = GetYTranslated(sizedc,-5000);
+ ppoints[0] = point;
+ ppoints[1] = point;
}
-
while (node!=NULL && node->GetNext()!=NULL)
{
pFunctionPoint* pointi=(pFunctionPoint*)node->GetData();
int pyi=(pointi->getRealY()-minY)-offsetY;
int pxj=(pointj->getRealX()-minX)-offsetX;
int pyj=(pointj->getRealY()-minY)-offsetY;
-
-
int cxi=pxi* scaleX + offsetpx; //+ xTraslation;
int cxj=pxj* scaleX + offsetpx; //+ xTraslation;
int cyi=pyi* scaleY+ offsetpy ;
int cyj=pyj* scaleY+ offsetpy ;
//dc.DrawLine(pxi* scaleX + offsetpx,pyi* scaleY+ offsetpy, pxj* scaleX + offsetpx,pyj* scaleY+ offsetpy );
if(type!=2)
+ {
draw(dc,w,pxi* scaleX + offsetpx,pyi* scaleY+ offsetpy, pxj* scaleX + offsetpx,pyj* scaleY+ offsetpy,orgy );
//dc.DrawLine(pxi* scaleX + offsetpx,pyi* scaleY+ offsetpy, pxj* scaleX + offsetpx,pyj* scaleY+ offsetpy );
- else if(type==2)
- {
+ } else if(type==2) {
if(!initializePolygon(ppoints,cxi,cyi,cxj,cyj) && ((cxi<=0 && cxj>=0)||(cxi>=0 && cxj>=0)))
{
point.x=cxj;
ppoints[j]=point;
j++;
- }
- }
-
+ } // if
+ } // if type
node=node->GetNext();
-
}
if(type==2)
{
dc.SetPen(wxPen( wxColour(0,0,0) ,1,wxSOLID ));
//dc.DrawPolygon(vx.size()+2,ppoints,0,0);
dc.DrawPolygon(j+2,ppoints,0,0);
-
- }
-
+ } // if type
}
/**
getDirection(direction);
getSize(sizeP);
//Lines betwen the points
- GetPoints(points);
- wxNode *node=points.GetLast();
- wxNode *node1=points.GetFirst();
+//EED 2017-09-16 Migration wxWidgets 2.8 to 3.0
+#if wxMAJOR_VERSION <= 2
+ GetPoints(points);
+ wxNode *node = points.GetLast();
+ wxNode *node1 = points.GetFirst();
+#else
+ wxNode *node = GetPointsPtr()->GetLast();
+ wxNode *node1 = GetPointsPtr()->GetFirst();
+#endif
/*
GetYTranslated(sizedc,(realY_guide/*-w.getMinScrY()*/-offsetX)*scaleX + offsetpx),
scrwX,
GetYTranslated(sizedc,(realY_guide/*-w.getMinScrY()*/-offsetX)*scaleX + offsetpx));
- }
- }
-
+ } // if realY_guide
+ } // if actual
}
*/
virtual bool GetNextXY(double & x, double & y){return false;}
+//EED 2017-09-16 Migration wxWidgets 2.8 to 3.0
+#if wxMAJOR_VERSION <= 2
/**
Get Point list of the funcion
@param return points
*/
virtual void GetPoints(wxList &points){}
+#else
+ /**
+ Get Point list of the funcion
+ @param return points
+ */
+ virtual wxList* GetPointsPtr(){ }
+#endif
+
/** Layer plot handler.
This implementation will plot the locus in the visible area and
protected:
int m_flags; //!< Holds label alignment
+
+//EED 2017-09-16 Migration wxWidgets 2.8 to 3.0
+#if wxMAJOR_VERSION <= 2
/*
* Points of the function thats is drawing
*/
wxList points;
+#else
+ // use GetPointsPtr()
+#endif
+
/*
* the scale in x, with wich it must draw
*/
//----------------------------------------------------------------------------
// Methods
//----------------------------------------------------------------------------
-pPlotterScaleX::pPlotterScaleX(wxString aName,int flags) {
-
+pPlotterScaleX::pPlotterScaleX(wxString aName,int flags)
+{
SetName(aName);/*
SetFont(*wxSMALL_FONT);
SetPen(*wxGREY_PEN);*/
*/
pGraphicalFunction* pPlotterWindow::getFunction(int index)
{
- wxNode* node=functions.Item(index);
- if(node==NULL){
+ wxNode* node=NULL;
+ if (functions.size()>index)
+ {
+ node=functions.Item(index);
+ } // if
+
+ if(node==NULL)
+ {
return NULL;
- }
+ } // if node
return (pGraphicalFunction*)node->GetData();
}
+
+
/*
move the functions that the user wants to move
and that were set in functionsToMove
@param porcentageMaxX:the percentage that the maxShowed
of the functions have to be move
0<=porcentageMaxX<=1
-
*/
-
void pPlotterWindow::moveFunctions( float porcentageMinX,float porcentageMaxX)
{
//Adding the actual function
*/
wxTextCtrl *m_log;
- wxString text;
+ wxString text;
/*
Functions to be move at the same time
//-------------------------------------------------------------------
vtkBaseData::vtkBaseData()
{
- _z = 0;
- _t = 0;
- _marImageData = 0;
- _interpolate = true;
- _fixAxis2D = false;
- _opacityAxis = 0.5;
- _observable = vtkObject::New();
+ _z = 0;
+ _t = 0;
+ _marImageData = 0;
+ _interpolate = true;
+ _fixAxis2D = false;
+ _opacityAxis = 1.0;
+ _observable = vtkObject::New();
+ _cameraparallelScale = 100.0;
}
//-------------------------------------------------------------------
{
_opacityAxis = value;
}
+
+//-------------------------------------------------------------------
+double vtkBaseData::GetCameraParallelScale()
+{
+ return _cameraparallelScale;
+}
+
+//-------------------------------------------------------------------
+void vtkBaseData::SetCameraParallelScale(double value)
+{
+ _cameraparallelScale=value;
+}
+
+
+
bool GetFixAxis2D();
void SetFixAxis2D(bool value);
double GetOpacityAxis();
- void SetOpacityAxis(double value);
-
+ void SetOpacityAxis(double value);
+ double GetCameraParallelScale();
+ void SetCameraParallelScale(double value);
+
protected:
marImageData *_marImageData;
double _z;
bool _fixAxis2D;
double _opacityAxis;
vtkObject* _observable;
+ double _cameraparallelScale;
private:
};
_shade = false;
_volumerendererdata = VolumeRendererData::New();
+
+#if (VTK_MAJOR_VERSION <= 7)
_volumeMapper = vtkVolumeRayCastMapper::New();
+ _compositeFunction = vtkVolumeRayCastCompositeFunction::New();
+ _compositeFunctionMIP = vtkVolumeRayCastMIPFunction::New();
+#else
+ _volumeMapper = vtkFixedPointVolumeRayCastMapper::New();
+#endif
+
_newvol = vtkVolume::New();
_volumeProperty = vtkVolumeProperty::New();
- _compositeFunction = vtkVolumeRayCastCompositeFunction::New();
- _compositeFunctionMIP = vtkVolumeRayCastMIPFunction::New();
}
//-------------------------------------------------------------------
_tissuePlanes[i]->Delete();
_tissueClipper[i]->Delete();
}
- _outlineData->Delete();
- _mapOutline->Delete();
- _outline->Delete();
+
// Volume
_tfun->Delete();
_ctfun->Delete();
+#if (VTK_MAJOR_VERSION <= 7)
_compositeFunction->Delete();
+#else
+ // ..
+#endif
_volumeMapper->Delete();
_volumeProperty->Delete();
_newvol->Delete();
}
_observerV-> Delete();
}
-//-------------------------------------------------------------------
-vtkActor* vtkClipping3DDataViewer::GetOutlineActor()
-{
- return _outline;
-}
+
//-------------------------------------------------------------------
vtkClipPolyData* vtkClipping3DDataViewer::GetTissueClipper(int id)
{
vtkImageData *imagedata=_vtkmprbasedata->GetImageData();
for (i=0; i< VTKMPRDATA_MAXTISSUE ; i++)
{
+//EED 2017-01-01 Migration VTK7
+#if VTK_MAJOR_VERSION <= 5
_mCubes[i]->SetInput( imagedata );
+#else
+ _mCubes[i]->SetInputData( imagedata );
+#endif
} // for
+//EED 2017-01-01 Migration VTK7
+#if VTK_MAJOR_VERSION <= 5
_volumeMapper->SetInput( imagedata );
+#else
+ _volumeMapper->SetInputData( imagedata );
+#endif
_volumerendererdata->SetImageData( imagedata );
}
{
// Visualisation - original volume
_mCubes[i] = vtkMarchingCubes::New( );
+
+//EED 2017-01-01 Migration VTK7
+#if VTK_MAJOR_VERSION <= 5
_mCubes[i]->SetInput( imagedata );
+#else
+ _mCubes[i]->SetInputData( imagedata );
+#endif
+
_mCubes[i]->SetValue( 0, range[1]*(4+i) / 8 );
// _mCubes[i]->SetValue( 0, 1500 );
_tissueStripper[i] = vtkStripper::New();
+
+//EED 2017-01-01 Migration VTK7
+#if VTK_MAJOR_VERSION <= 5
_tissueStripper[i]->SetInput( _mCubes[i]->GetOutput( ) );
+#else
+ _tissueStripper[i]->SetInputData( _mCubes[i]->GetOutput( ) );
+#endif
+
_tissuePlanes[i] = vtkPlanes::New();
int x1,x2,y1,y2,z1,z2;
imagedata->GetExtent(x1,x2,y1,y2,z1,z2);
- _tissuePlanes[i]->SetBounds (x1,x2,y1,y2,z1,z2);
+ _tissuePlanes[i]->SetBounds(x1,x2,y1,y2,z1,z2);
_tissueClipper[i] = vtkClipPolyData::New();
- _tissueClipper[i]->SetInput( _tissueStripper[i]->GetOutput() );
_tissueClipper[i]->SetClipFunction( _tissuePlanes[i] );
_tissueClipper[i]->InsideOutOn( );
+
+//EED 2017-01-01 Migration VTK7
+#if VTK_MAJOR_VERSION <= 5
+ _tissueClipper[i]->SetInput( _tissueStripper[i]->GetOutput() );
+#else
+ _tissueClipper[i]->SetInputData( _tissueStripper[i]->GetOutput() );
+#endif
+
_tissueMapper[i] = vtkPolyDataMapper::New( );
+
+//EED 2017-01-01 Migration VTK7
+#if VTK_MAJOR_VERSION <= 5
_tissueMapper[i]->SetInput( _tissueClipper[i]->GetOutput() );
+#else
+ _mCubes[i]->Update();
+ _tissueStripper[i]->Update();
+ _tissueClipper[i]->Update();
+ _tissueMapper[i]->SetInputData( _tissueClipper[i]->GetOutput() );
+ _tissueMapper[i]->Update();
+#endif
+
+
_tissueMapper[i]->ScalarVisibilityOff( );
// _tissueMapper[i]->Update();
} // for i
_tissue[i]->GetProperty()->SetSpecular(.3);
_tissue[i]->GetProperty()->SetSpecularPower(20);
_tissue[i]->GetProperty()->SetOpacity(0.5);
- if (i==0) _tissue[i]->GetProperty()->SetColor(0.85, 0.85 , 0.85 );
- if (i==1) _tissue[i]->GetProperty()->SetColor(0, 0 , 1 );
- if (i==2) _tissue[i]->GetProperty()->SetColor(0.85, 0.20 , 0.20 );
- if (i==3) _tissue[i]->GetProperty()->SetColor(0, 1 , 0 );
- }
+ if (i==0) { _tissue[i]->GetProperty()->SetColor(0.85, 0.85 , 0.85 ); }
+ if (i==1) { _tissue[i]->GetProperty()->SetColor(0, 0 , 1 ); }
+ if (i==2) { _tissue[i]->GetProperty()->SetColor(0.85, 0.20 , 0.20 ); }
+ if (i==3) { _tissue[i]->GetProperty()->SetColor(0, 1 , 0 ); }
+ } // for
for (i=0; i< VTKMPRDATA_MAXTISSUE ; i++)
{
_observerS[i] = boxSurfaceObserver::New();
_observerS[i]->SetPlanes( GetTissuePlanes(i) );
_observerS[i]->SetActor( _tissue[i] );
- }
-
+ _observerS[i]->SetFilters( _mCubes[i], _tissueStripper[i] ,_tissueClipper[i] );
+ } // for
}
//-----------------------------------------------------------------------------
// EED 13/03/2011
// _volumeMapper = vtkVolumeRayCastMapper::New();
+
+
+//EED 2017-01-01 Migration VTK7
+#if VTK_MAJOR_VERSION <= 5
_volumeMapper->SetInput( this->GetVtkMPRBaseData()->GetImageData() );
+#else
+ _volumeMapper->SetInputData( this->GetVtkMPRBaseData()->GetImageData() );
+#endif
- _volumeMapper->SetVolumeRayCastFunction(_compositeFunction);
- // _volumeMapper->SetVolumeRayCastFunction(_compositeFunctionMIP);
+#if (VTK_MAJOR_VERSION <= 7)
+ _volumeMapper->SetVolumeRayCastFunction(_compositeFunction);
+ // _volumeMapper->SetVolumeRayCastFunction(_compositeFunctionMIP);
+#else
+ // ..
+#endif
//
_volumeMapper->SetClippingPlanes( _volumePlanes );
_observerV = boxSurfaceObserver::New();
_observerV->SetPlanes( _volumePlanes );
_observerV->SetActor( _newvol );
+
+#if (VTK_MAJOR_VERSION <= 7)
_observerV->SetvtkVolumeRayCastMapper( _volumeMapper );
+#else
+ _observerV->SetvtkFixedPointVolumeRayCastMapper( _volumeMapper );
+#endif
}
//-----------------------------------------------------------------------------
void vtkClipping3DDataViewer::updateVolume()
{
+#if (VTK_MAJOR_VERSION <= 7)
if(_isRayCasting)
{
_volumeMapper->SetVolumeRayCastFunction(_compositeFunction);
_volumerendererdata->changeCompositeMIPFunction(0);
- }
- else if(_isMIP)
- {
+ } else if(_isMIP) {
_volumeMapper->SetVolumeRayCastFunction(_compositeFunctionMIP);
_volumerendererdata->changeCompositeMIPFunction(1);
}
+#else
+ // ... here Composition of MIP
+ printf("EED vtkClipping3DDataViewer::updateVolume ... here Composition or MIP \n");
+#endif
+
if(_interpolation)
{
Configure_Tissue();
Configure_Volume();
Configure_VolumeBox();
- // An outline provides context around the data.
- //
- _outlineData = vtkOutlineFilter::New();
- _outlineData->SetInput((vtkDataSet *) _vtkmprbasedata->GetImageData() );
- _mapOutline = vtkPolyDataMapper::New();
-
-//EED 4 nov 2015 Estelle
-// _mapOutline->SetInput(_outlineData->GetOutput());
-
- _outline = vtkActor::New();
- _outline->SetMapper(_mapOutline);
- _outline->GetProperty()->SetColor(0,0,0);
}
void vtkClipping3DDataViewer::SetIsovalue(int idTissue, int isoValue)
{
_mCubes[idTissue]->SetValue(0, isoValue);
+//EED 2017-01-01 Migration VTK7
+#if VTK_MAJOR_VERSION <= 5
+ // ..
+#else
+ _mCubes[idTissue]->Update();
+ _tissueStripper[idTissue]->Update();
+ _tissueClipper[idTissue]->Update();
+#endif
}
//-------------------------------------------------------------------
double vtkClipping3DDataViewer::GetIsovalue(int idTissue)
return _newvol;
}
//-------------------------------------------------------------------
-vtkVolumeRayCastMapper* vtkClipping3DDataViewer::GetVolumeMapper(){
+#if (VTK_MAJOR_VERSION <= 7)
+ vtkVolumeRayCastMapper* vtkClipping3DDataViewer::GetVolumeMapper()
+#else
+ vtkFixedPointVolumeRayCastMapper* vtkClipping3DDataViewer::GetVolumeMapper()
+#endif
+{
return _volumeMapper;
}
//-------------------------------------------------------------------
vtkDataSetReader *reader = vtkDataSetReader::New();
reader->SetFileName(namefile);
reader->Update();
+
+//EED 2017-01-01 Migration VTK7
+#if VTK_MAJOR_VERSION <= 5
_tissueStripper[3]->SetInput( reader->GetPolyDataOutput() );
+#else
+ _tissueStripper[3]->SetInputData( reader->GetPolyDataOutput() );
+#endif
+
}
void vtkClipping3DDataViewer::setColorTransferFunction(vtkColorTransferFunction* colortable){
#include "vtkStripper.h"
#include "vtkLODActor.h"
#include "vtkMarchingCubes.h"
-#include "vtkVolumeRayCastMapper.h"
+#if (VTK_MAJOR_VERSION <= 7)
+ #include "vtkVolumeRayCastCompositeFunction.h"
+ #include "vtkVolumeRayCastMIPFunction.h"
+ #include "vtkVolumeRayCastMapper.h"
+#else
+ #include <vtkFixedPointVolumeRayCastMapper.h>
+#endif
#include "boxSurfaceObserver.h"
-#include "vtkVolumeRayCastCompositeFunction.h"
#include <vtkPiecewiseFunction.h>
#include "vtkVolumeProperty.h"
#include "vtkPolyDataMapper.h"
#include "vtkOutlineFilter.h"
#include "vtkRenderWindowInteractor.h"
-#include "vtkVolumeRayCastMIPFunction.h"
#include "volumerendererdata.h"
virtual ~vtkClipping3DDataViewer();
// vtkImageActor* GetImageActor(int id);
- vtkActor* GetOutlineActor();
+
+
vtkClipPolyData* GetTissueClipper(int id);
vtkPolyDataMapper* GetTissueMapper(int id);
vtkPlanes* GetTissuePlanes(int id);
double GetIsovalue(int idTissue);
vtkVolume *GetVolumeActor();
- vtkVolumeRayCastMapper *GetVolumeMapper();
+
+#if (VTK_MAJOR_VERSION <= 7)
+ vtkVolumeRayCastMapper *GetVolumeMapper();
+#else
+ vtkFixedPointVolumeRayCastMapper *GetVolumeMapper();
+#endif
+
vtkPlanes *GetVolumePlanes();
void SetVtkMPRBaseData(vtkMPRBaseData *vtkmprbasedata);
private:
- vtkMarchingCubes *_mCubes[ VTKMPRDATA_MAXTISSUE ];
- vtkStripper *_tissueStripper[ VTKMPRDATA_MAXTISSUE ];
- vtkPolyDataMapper *_tissueMapper[ VTKMPRDATA_MAXTISSUE ];
- vtkPlanes *_tissuePlanes[ VTKMPRDATA_MAXTISSUE ];
- vtkClipPolyData *_tissueClipper[ VTKMPRDATA_MAXTISSUE ];
-
- // outline
- vtkOutlineFilter *_outlineData;
- vtkPolyDataMapper *_mapOutline;
- vtkActor *_outline;
+ vtkMarchingCubes *_mCubes[ VTKMPRDATA_MAXTISSUE ];
+ vtkStripper *_tissueStripper[ VTKMPRDATA_MAXTISSUE ];
+ vtkPolyDataMapper *_tissueMapper[ VTKMPRDATA_MAXTISSUE ];
+ vtkPlanes *_tissuePlanes[ VTKMPRDATA_MAXTISSUE ];
+ vtkClipPolyData *_tissueClipper[ VTKMPRDATA_MAXTISSUE ];
/// Volume
- vtkPiecewiseFunction *_tfun;
- vtkColorTransferFunction *_ctfun;
+ vtkPiecewiseFunction *_tfun;
+ vtkColorTransferFunction *_ctfun;
// vtkVolumeRayCastCompositeFunction *_compositeFunction;
- vtkPlanes *_volumePlanes;
- vtkVolumeRayCastMapper *_volumeMapper;
- vtkVolumeProperty *_volumeProperty;
- vtkVolume *_newvol;
- vtkMPRBaseData *_vtkmprbasedata;
- bool _visibleVolume;
- bool _visibleVolumeBox;
- bool _representationType[VTKMPRDATA_MAXTISSUE];
- bool _visibleTissue[VTKMPRDATA_MAXTISSUE];
- vtkActor *_tissue[VTKMPRDATA_MAXTISSUE];
- boxSurfaceObserver *_observerV;
- boxSurfaceObserver *_observerS[VTKMPRDATA_MAXTISSUE];
-
- std::vector<double> greyValuesTransferenceFVector;
- std::vector<double> intensityValuesTransferenceFVector;
- std::vector<double> redColorsOfColorTransferenceFVector;
- std::vector<double> greenColorsOfColorTransferenceFVector;
- std::vector<double> blueColorsOfColorTransferenceFVector;
- std::vector<double> greyValueColorsOfColorTransferenceFVector;
-
+ vtkPlanes *_volumePlanes;
+
+#if (VTK_MAJOR_VERSION <= 7)
+ vtkVolumeRayCastMapper *_volumeMapper;
+#else
+ vtkFixedPointVolumeRayCastMapper *_volumeMapper;
+#endif
+
+
+ vtkVolumeProperty *_volumeProperty;
+ vtkVolume *_newvol;
+ vtkMPRBaseData *_vtkmprbasedata;
+ bool _visibleVolume;
+ bool _visibleVolumeBox;
+ bool _representationType[VTKMPRDATA_MAXTISSUE];
+ bool _visibleTissue[VTKMPRDATA_MAXTISSUE];
+ vtkActor *_tissue[VTKMPRDATA_MAXTISSUE];
+ boxSurfaceObserver *_observerV;
+ boxSurfaceObserver *_observerS[VTKMPRDATA_MAXTISSUE];
+
+ std::vector<double> greyValuesTransferenceFVector;
+ std::vector<double> intensityValuesTransferenceFVector;
+ std::vector<double> redColorsOfColorTransferenceFVector;
+ std::vector<double> greenColorsOfColorTransferenceFVector;
+ std::vector<double> blueColorsOfColorTransferenceFVector;
+ std::vector<double> greyValueColorsOfColorTransferenceFVector;
+
+#if (VTK_MAJOR_VERSION <= 7)
vtkVolumeRayCastCompositeFunction *_compositeFunction;
vtkVolumeRayCastMIPFunction *_compositeFunctionMIP ;
+#else
+ // ..
+#endif
+
bool _isRayCasting;
bool _isMIP;
=========================================================================*/
#include "vtkClosePolyData.h"
-#include "vtkObjectFactory.h"
#include "vtkPolyData.h"
#include "vtkFeatureEdges.h"
#include "vtkStripper.h"
#include "vtkAppendPolyData.h"
#include "vtkCleanPolyData.h"
-vtkCxxRevisionMacro(vtkClosePolyData, "$Revision: 1.3 $");
+
+//EED 2017-01-01 Migration VTK7
+#if VTK_MAJOR_VERSION <= 5
+ vtkCxxRevisionMacro(vtkClosePolyData, "$Revision: 1.3 $");
+#else
+ #include "vtkDataObject.h"
+ #include "vtkInformation.h"
+ #include "vtkDemandDrivenPipeline.h"
+ #include "vtkInformationVector.h"
+#endif
+
vtkStandardNewMacro(vtkClosePolyData);
//----------------------------------------------------------------------------
{
}
+
//----------------------------------------------------------------------------
-// This method is much too long, and has to be broken up!
-// Furthermore we are loosing the normals !!!
-void vtkClosePolyData::Execute()
+
+//EED 2017-01-01 Migration VTK7
+#if VTK_MAJOR_VERSION <= 5
+ // This method is much too long, and has to be broken up!
+ // Furthermore we are loosing the normals !!!
+ void vtkClosePolyData::Execute()
+ {
+ vtkPolyData *input = this->GetInput();
+ vtkPolyData *output = this->GetOutput();
+
+ //#closing the polydata see : close.py for details
+ vtkFeatureEdges *boundary = vtkFeatureEdges::New();
+ boundary->SetInput( input );
+ boundary->BoundaryEdgesOn ();
+ boundary->FeatureEdgesOff ();
+ boundary->NonManifoldEdgesOff ();
+ boundary->ManifoldEdgesOff ();
+ //boundary->ColoringOff ();
+
+ vtkStripper *stripper = vtkStripper::New();
+ stripper->SetInput( boundary->GetOutput() );
+ stripper->Update(); //important
+ boundary->Delete();
+
+ vtkPolyData *pd = vtkPolyData::New();
+ pd->SetPoints ( stripper->GetOutput()->GetPoints() );
+ pd->SetPolys ( stripper->GetOutput()->GetLines() );
+ stripper->Delete();
+
+ //vtkGLUTesselatorTriangleFilter *triangle = vtkGLUTesselatorTriangleFilter::New();
+ vtkTriangleFilter *triangle = vtkTriangleFilter::New();
+ triangle->SetInput( pd );
+ pd->Delete();
+
+ vtkAppendPolyData *append = vtkAppendPolyData::New();
+ append->AddInput( input );
+ append->AddInput( triangle->GetOutput());
+ triangle->Delete();
+ vtkInformation
+ vtkCleanPolyData *clean = vtkCleanPolyData::New();
+ clean->SetInput( append->GetOutput());
+ append->Delete();
+
+ // When all optimizations are complete, this squeeze will be unecessary.
+ // (But it does not seem to cost much.)
+ clean->Update(); //important before ShallowCopy
+ output->ShallowCopy( clean->GetOutput() );
+ clean->Delete();
+ }
+
+#else
+
+int vtkClosePolyData::RequestData( vtkInformation *vtkNotUsed(request), vtkInformationVector **inputVector, vtkInformationVector *outputVector)
{
- vtkPolyData *input = this->GetInput();
- vtkPolyData *output = this->GetOutput();
-
- //#closing the polydata see : close.py for details
- vtkFeatureEdges *boundary = vtkFeatureEdges::New();
- boundary->SetInput( input );
- boundary->BoundaryEdgesOn ();
- boundary->FeatureEdgesOff ();
- boundary->NonManifoldEdgesOff ();
- boundary->ManifoldEdgesOff ();
- //boundary->ColoringOff ();
-
- vtkStripper *stripper = vtkStripper::New();
- stripper->SetInput( boundary->GetOutput() );
- stripper->Update(); //important
- boundary->Delete();
-
- vtkPolyData *pd = vtkPolyData::New();
- pd->SetPoints ( stripper->GetOutput()->GetPoints() );
- pd->SetPolys ( stripper->GetOutput()->GetLines() );
- stripper->Delete();
-
- //vtkGLUTesselatorTriangleFilter *triangle = vtkGLUTesselatorTriangleFilter::New();
- vtkTriangleFilter *triangle = vtkTriangleFilter::New();
- triangle->SetInput( pd );
- pd->Delete();
-
- vtkAppendPolyData *append = vtkAppendPolyData::New();
- append->AddInput( input );
- append->AddInput( triangle->GetOutput());
- triangle->Delete();
-
- vtkCleanPolyData *clean = vtkCleanPolyData::New();
- clean->SetInput( append->GetOutput());
- append->Delete();
-
- // When all optimizations are complete, this squeeze will be unecessary.
- // (But it does not seem to cost much.)
- clean->Update(); //important before ShallowCopy
- output->ShallowCopy( clean->GetOutput() );
- clean->Delete();
+ // get the info objects
+ vtkInformation *inInfo = inputVector[0]->GetInformationObject(0);
+ vtkInformation *outInfo = outputVector->GetInformationObject(0);
+ // get the input and output
+ vtkPolyData *input = vtkPolyData::SafeDownCast( inInfo->Get(vtkDataObject::DATA_OBJECT()));
+ vtkPolyData *output = vtkPolyData::SafeDownCast( outInfo->Get(vtkDataObject::DATA_OBJECT()));
+ //#closing the polydata see : close.py for details
+
+ vtkFeatureEdges *boundary = vtkFeatureEdges::New();
+ boundary->SetInputData( input );
+ boundary->BoundaryEdgesOn ();
+ boundary->FeatureEdgesOff ();
+ boundary->NonManifoldEdgesOff ();
+ boundary->ManifoldEdgesOff ();
+ // boundary->ColoringOff ();
+ boundary->Update();
+
+ vtkStripper *stripper = vtkStripper::New();
+ stripper->SetInputConnection( boundary->GetOutputPort() );
+ stripper->Update(); //important
+
+ vtkPolyData *pd = vtkPolyData::New();
+ pd->SetPoints ( stripper->GetOutput()->GetPoints() );
+ pd->SetPolys ( stripper->GetOutput()->GetLines() );
+ //vtkGLUTesselatorTriangleFilter *triangle = vtkGLUTesselatorTriangleFilter::New();
+
+ vtkTriangleFilter *triangle = vtkTriangleFilter::New();
+ triangle->SetInputData( pd );
+ triangle->Update( );
+
+ vtkAppendPolyData *append = vtkAppendPolyData::New();
+ append->AddInputData( input );
+ append->AddInputConnection( triangle->GetOutputPort() );
+ append->Update();
+
+ vtkCleanPolyData *clean = vtkCleanPolyData::New();
+ clean->SetInputConnection( append->GetOutputPort());
+ // When all optimizations are complete, this squeeze will be unecessary.
+ // (But it does not seem to cost much.)
+ clean->Update(); //important before ShallowCopy
+
+ output->ShallowCopy( clean->GetOutput() );
+
+ append -> Delete();
+ clean -> Delete();
+ boundary -> Delete();
+ stripper -> Delete();
+ pd -> Delete();
+ triangle -> Delete();
+
+ return 1;
}
+#endif
+
//----------------------------------------------------------------------------
void vtkClosePolyData::PrintSelf(ostream& os, vtkIndent indent)
{
#ifndef __vtkClosePolyData_h
#define __vtkClosePolyData_h
+#include "vtkObjectFactory.h"
+
+//EED 2017-01-01 Migration VTK7
+#if VTK_MAJOR_VERSION <= 5
#include "vtkPolyDataToPolyDataFilter.h"
+#else
+#include "vtkPolyDataAlgorithm.h"
+#endif
+
+//EED 2017-01-01 Migration VTK7
+#if VTK_MAJOR_VERSION <= 5
class vtkClosePolyData : public vtkPolyDataToPolyDataFilter
+#else
+class vtkClosePolyData : public vtkPolyDataAlgorithm
+#endif
{
public:
static vtkClosePolyData *New();
+//EED 2017-01-01 Migration VTK7
+#if VTK_MAJOR_VERSION <= 5
vtkTypeRevisionMacro(vtkClosePolyData,vtkPolyDataToPolyDataFilter);
+#else
+ vtkTypeMacro(vtkClosePolyData,vtkPolyDataAlgorithm);
+#endif
void PrintSelf(ostream& os, vtkIndent indent);
protected:
vtkClosePolyData();
~vtkClosePolyData();
+
+//EED 2017-01-01 Migration VTK7
+#if VTK_MAJOR_VERSION <= 5
// Usual data generation method
void Execute();
+#else
+ int RequestData( vtkInformation *vtkNotUsed(request), vtkInformationVector **inputVector, vtkInformationVector *outputVector);
+#endif
+
private:
vtkClosePolyData(const vtkClosePolyData&); // Not implemented.
bool vtkInfoTextImageInteractor::OnMouseMove()
{
int X,Y;
- wxVTKRenderWindowInteractor *wxVTKiren;
+ crea::wxVTKRenderWindowInteractor *wxVTKiren;
wxVTKiren = _vtkInteractorStyleBaseView->GetWxVtk2DBaseView()->GetWxVTKRenderWindowInteractor();
wxVTKiren->GetEventPosition(X,Y);
bool vtkInfoTextImageInteractorPlane2D::OnMouseMove()
{
int X,Y;
- wxVTKRenderWindowInteractor *wxVTKiren;
+ crea::wxVTKRenderWindowInteractor *wxVTKiren;
wxVTKiren = _vtkInteractorStyleBaseView->GetWxVtk2DBaseView()->GetWxVTKRenderWindowInteractor();
wxVTKiren->GetEventPosition(X,Y);
this->_wxvtkmpr3Dview->GetVtkMPR3DDataViewer()->GetVtkMPRBaseData()->SetY(xc(1)/spc[1]);
this->_wxvtkmpr3Dview->GetVtkMPR3DDataViewer()->GetVtkMPRBaseData()->SetZ(xc(2)/spc[2]);
wxCommandEvent newevent1(wxEVT_COMMAND_MENU_SELECTED,12121); // Refresh
+//EED 2017-09-16 Migration wxWidgets 2.8 to 3.0
+#if wxMAJOR_VERSION <= 2
this->_wxvtkmpr3Dview->GetWxvtk3Dbaseview()->GetWxVTKRenderWindowInteractor()->GetParent()->ProcessEvent(newevent1);
+#else
+ this->_wxvtkmpr3Dview->GetWxvtk3Dbaseview()->GetWxVTKRenderWindowInteractor()->GetParent()->ProcessWindowEvent(newevent1);
+#endif
+
ok=true;
}
}
_parent_refresh_waiting = false;
wxCommandEvent newevent1(wxEVT_COMMAND_MENU_SELECTED,12121); // Refresh
//CPR 13/01/2010
+//EED 2017-09-16 Migration wxWidgets 2.8 to 3.0
+#if wxMAJOR_VERSION <= 2
this->_wxvtkbaseview->GetWxVTKRenderWindowInteractor()->GetParent()->ProcessEvent(newevent1);
+#else
+ this->_wxvtkbaseview->GetWxVTKRenderWindowInteractor()->GetParent()->ProcessWindowEvent(newevent1);
+#endif
+
int i;
int size = _lstParentToReport.size();
for(i = 0; i<size; i++)
wxvtkmpr2Dview->MoveY(x,y,z);
wxvtkmpr2Dview->MoveZ(x,y,z);
wxCommandEvent newevent1(wxEVT_COMMAND_MENU_SELECTED,12121); // Refresh
- wxvtkmpr2Dview->GetWxVTKRenderWindowInteractor()->GetParent()->ProcessEvent(newevent1);
wxCommandEvent newevent2(wxEVT_COMMAND_MENU_SELECTED,12122); // Doble click
+
+//EED 2017-09-16 Migration wxWidgets 2.8 to 3.0
+#if wxMAJOR_VERSION <= 2
+ wxvtkmpr2Dview->GetWxVTKRenderWindowInteractor()->GetParent()->ProcessEvent(newevent1);
wxvtkmpr2Dview->GetWxVTKRenderWindowInteractor()->GetParent()->ProcessEvent(newevent2);
+#else
+ wxvtkmpr2Dview->GetWxVTKRenderWindowInteractor()->GetParent()->ProcessWindowEvent(newevent1);
+ wxvtkmpr2Dview->GetWxVTKRenderWindowInteractor()->GetParent()->ProcessWindowEvent(newevent2);
+#endif
+
+
return true;
}
_vtkInteractorStyleBaseView->TransformCoordinate(x,y,z);
wxsphereview->SetXYZtoParent(x,y);
wxCommandEvent newevent(wxEVT_COMMAND_MENU_SELECTED,12121);
+//EED 2017-09-16 Migration wxWidgets 2.8 to 3.0
+#if wxMAJOR_VERSION <= 2
wxsphereview->GetWxVTKRenderWindowInteractor()->GetParent()->ProcessEvent(newevent);
+#else
+ wxsphereview->GetWxVTKRenderWindowInteractor()->GetParent()->ProcessWindowEvent(newevent);
+#endif
+
} else {
wxsphereview->RotationEnd();
}
//-------------------------------------------------------------------
void vtkMPR3DDataViewer::SetImage()
{
- _saggitalColors -> SetInput( _vtkmprbasedata->GetImageData() );
- _axialColors -> SetInput( _vtkmprbasedata->GetImageData() );
- _coronalColors -> SetInput( _vtkmprbasedata->GetImageData() );
- _outlineData -> SetInput((vtkDataSet *) _vtkmprbasedata->GetImageData() );
+//EED 2017-01-01 Migration VTK7
+#if VTK_MAJOR_VERSION <= 5
+ _saggitalColors ->SetInput( _vtkmprbasedata->GetImageData() );
+ _axialColors ->SetInput( _vtkmprbasedata->GetImageData() );
+ _coronalColors ->SetInput( _vtkmprbasedata->GetImageData() );
+ _outlineData ->SetInput((vtkDataSet *) _vtkmprbasedata->GetImageData() );
+#else
+ _saggitalColors ->SetInputData( _vtkmprbasedata->GetImageData() );
+ _axialColors ->SetInputData( _vtkmprbasedata->GetImageData() );
+ _coronalColors ->SetInputData( _vtkmprbasedata->GetImageData() );
+ _outlineData ->SetInputData((vtkDataSet *) _vtkmprbasedata->GetImageData() );
+#endif
}
//-------------------------------------------------------------------
double delta;
if(_vtkmprbasedata->GetImageData())
{
+//EED 2017-01-01 Migration VTK7
+#if VTK_MAJOR_VERSION <= 5
_vtkmprbasedata->GetImageData()->Update();
+#else
+ // ..
+#endif
_vtkmprbasedata->GetImageData()->Modified();
_vtkmprbasedata->GetImageData()->GetScalarRange(range);
delta = range[1]-range[0];
_saggitalColors = vtkImageMapToColors::New();
}
_saggitalColors->RemoveAllInputs();
- _saggitalColors->SetInput( _vtkmprbasedata->GetImageData() );
+
// _saggitalColors->SetLookupTable(_bwLut);
_saggitalColors->SetLookupTable(_ctfun);
+//EED 2017-01-01 Migration VTK7
+#if VTK_MAJOR_VERSION <= 5
+ _saggitalColors->SetInput( _vtkmprbasedata->GetImageData() );
+#else
+ _saggitalColors->SetInputData( _vtkmprbasedata->GetImageData() );
+ _saggitalColors->Update();
+#endif
+
+
if(_saggital==NULL)
{
_saggital = vtkImageActor::New();
+//EED 2017-01-01 Migration VTK7
+#if VTK_MAJOR_VERSION <= 5
_saggital->SetInput(_saggitalColors->GetOutput());
+#else
+ _saggital->SetInputData(_saggitalColors->GetOutput());
+#endif
}
//_saggitalColors->Update();
_axialColors = vtkImageMapToColors::New();
}
_axialColors->RemoveAllInputs();
- _axialColors->SetInput( _vtkmprbasedata->GetImageData() );
// _axialColors->SetLookupTable(_hueLut);
_axialColors->SetLookupTable(_ctfun);
+
+
+//EED 2017-01-01 Migration VTK7
+#if VTK_MAJOR_VERSION <= 5
+ _axialColors->SetInput( _vtkmprbasedata->GetImageData() );
+#else
+ _axialColors->SetInputData( _vtkmprbasedata->GetImageData() );
+ _axialColors->Update();
+#endif
+
if(_axial==NULL)
{
_axial = vtkImageActor::New();
+
+//EED 2017-01-01 Migration VTK7
+#if VTK_MAJOR_VERSION <= 5
_axial->SetInput(_axialColors->GetOutput());
+#else
+ _axial->SetInputData(_axialColors->GetOutput());
+#endif
+
}
//_axialColors->Update();
_coronalColors = vtkImageMapToColors::New();
}
_coronalColors->RemoveAllInputs();
- _coronalColors->SetInput( _vtkmprbasedata->GetImageData() );
// _coronalColors->SetLookupTable(_satLut);
_coronalColors->SetLookupTable(_ctfun);
+
+
+//EED 2017-01-01 Migration VTK7
+#if VTK_MAJOR_VERSION <= 5
+ _coronalColors->SetInput( _vtkmprbasedata->GetImageData() );
+#else
+ _coronalColors->SetInputData( _vtkmprbasedata->GetImageData() );
+ _coronalColors->Update();
+#endif
+
+
if(_coronal==NULL)
{
_coronal = vtkImageActor::New();
+
+//EED 2017-01-01 Migration VTK7
+#if VTK_MAJOR_VERSION <= 5
_coronal->SetInput(_coronalColors->GetOutput());
- }
+#else
+ _coronal->SetInputData(_coronalColors->GetOutput());
+#endif
+
+ } // if _coronal
// An outline provides context around the data.
//
if(_outlineData==NULL)
{
_outlineData = vtkOutlineFilter::New();
- }
+ } // if _outlineData
_outlineData->RemoveAllInputs();
if(_vtkmprbasedata->GetImageData())
{
+//EED 2017-01-01 Migration VTK7
+#if VTK_MAJOR_VERSION <= 5
_outlineData->SetInput((vtkDataSet *) _vtkmprbasedata->GetImageData() );
- }
+#else
+ _outlineData->SetInputData((vtkDataSet *) _vtkmprbasedata->GetImageData() );
+ _outlineData->Update();
+#endif
+ } // if _image
if(_mapOutline==NULL)
{
_mapOutline = vtkPolyDataMapper::New();
+
+//EED 2017-01-01 Migration VTK7
+#if VTK_MAJOR_VERSION <= 5
_mapOutline->SetInput(_outlineData->GetOutput());
+#else
+ _mapOutline->SetInputData(_outlineData->GetOutput());
+#endif
+
}
_mapOutline->Update();
//_mapOutline->RemoveAllInputs();
{
vtkImageData *imagedata = GetVtkmprbasedata()->GetImageData();
SetPSource(_sizeIma);
+
+//EED 2017-01-01 Migration VTK7
+#if VTK_MAJOR_VERSION <= 5
_3Dslices -> SetInput( ( vtkDataSet* )_pSource->GetOutput( ) );
_3Dslices -> SetSource( imagedata );
+#else
+ _3Dslices -> SetInputData( ( vtkDataSet* )_pSource->GetOutput( ) );
+ _3Dslices -> SetSourceData( imagedata );
+#endif
+
_3Dslices -> Update( );
_stPoints -> GetPointData( )->SetScalars( _3Dslices->GetOutput()->GetPointData()->GetScalars() );
_stPoints -> SetDimensions( _sizeIma, _sizeIma, 1 );
+
+//EED 2017-01-01 Migration VTK7
+#if VTK_MAJOR_VERSION <= 5
_stPoints -> SetScalarType( imagedata->GetScalarType() );
_stPoints -> SetScalarTypeToShort();
_stPoints -> Update();
// _change -> SetInput( _stPoints );
// _change -> Update(); //important
_imageViewer2XYZ->GetVtkImageViewer2()->SetInput ( _stPoints );
+#else
+printf("EED Warning! vtkPlane2DView::Extract_One_PlaneVTK VTK 5->7 ???? SetScalarTypeToShort \n");
+printf("EED Warning! vtkPlane2DView::Extract_One_PlaneVTK VTK 5->7 ???? SetScalarTypeToShort \n");
+printf("EED Warning! vtkPlane2DView::Extract_One_PlaneVTK VTK 5->7 ???? SetScalarTypeToShort \n");
+printf("EED Warning! vtkPlane2DView::Extract_One_PlaneVTK VTK 5->7 ???? SetScalarTypeToShort \n");
+printf("EED Warning! vtkPlane2DView::Extract_One_PlaneVTK VTK 5->7 ???? SetScalarTypeToShort \n");
+ vtkInformation* info=_stPoints->GetInformation();
+ vtkDataObject::SetPointDataActiveScalarInfo(info, VTK_SHORT, 1);
+ _imageViewer2XYZ->GetVtkImageViewer2()->SetInputData( _stPoints );
+
+#endif
+
+
// _imageViewer2XYZ->GetVtkImageViewer2()->SetInput ( _change->GetOutput() );
// vtkImageActor *imageActor = _imageViewer2XYZ->GetVtkImageViewer2()->GetImageActor();
}
for ( iWidth=0 ; iWidth<sizeWidth ; iWidth++ )
{
vtkProbeFilter *slice = vtkProbeFilter::New();
+//EED 2017-01-01 Migration VTK7
+#if VTK_MAJOR_VERSION <= 5
slice -> SetInput( ( vtkDataSet* )_pSource->GetOutput( ) );
slice -> SetSource( imagedata );
+#else
+ slice -> SetInputData( ( vtkDataSet* )_pSource->GetOutput( ) );
+ slice -> SetSourceData( imagedata );
+#endif
slice -> Update( );
slicesLST.push_back( slice );
_pSource->Push( sp );
_imageResult = vtkImageData::New();
_imageResult -> SetDimensions(_sizeIma,_sizeIma,1);
_imageResult -> SetSpacing(1,1,1);
- _imageResult -> SetScalarType( imagedata->GetScalarType() );
_imageResult -> SetExtent(0,_sizeIma-1,0,_sizeIma-1,0,0);
+//EED 2017-01-01 Migration VTK7
+#if VTK_MAJOR_VERSION <= 5
+ _imageResult -> SetScalarType( imagedata->GetScalarType() );
_imageResult -> SetWholeExtent(0,_sizeIma-1,0,_sizeIma-1,0,0);
_imageResult -> AllocateScalars();
_imageResult -> Update();
+#else
+ _imageResult -> AllocateScalars(imagedata->GetScalarType(),1);
+#endif
+
}
unsigned short *pTemp;
unsigned short *pResult;
slicesLST[iWidth]->Delete();
}
_imageResult->Modified();
- _imageViewer2XYZ->GetVtkImageViewer2()->SetInput ( _imageResult );
+//EED 2017-01-01 Migration VTK7
+#if VTK_MAJOR_VERSION <= 5
+ _imageViewer2XYZ->GetVtkImageViewer2()->SetInput( _imageResult );
+#else
+ _imageViewer2XYZ->GetVtkImageViewer2()->SetInputData( _imageResult );
+#endif
}
//-------------------------------------------------------------------
_stPoints = vtkStructuredPoints::New( );
_change = vtkImageChangeInformation::New();
- wxVTKRenderWindowInteractor *iren = GetWxVTKRenderWindowInteractor();
+ crea::wxVTKRenderWindowInteractor *iren = GetWxVTKRenderWindowInteractor();
ExtractPlane();
// SetActive(false);
_imageViewer2XYZ -> GetVtkImageViewer2() -> SetupInteractor ( iren );
lines->Delete(); //do not delete lines ??
_lineActor = vtkActor::New();
_lineMapper = vtkPolyDataMapper::New();
+//EED 2017-01-01 Migration VTK7
+#if VTK_MAJOR_VERSION <= 5
_lineMapper->SetInput(_pd);
+#else
+ _lineMapper->SetInputData(_pd);
+#endif
_lineMapper->ImmediateModeRenderingOn();
_lineActor->SetMapper(_lineMapper);
_lineActor->GetProperty()->BackfaceCullingOn();
_planeWidget->GetCenter(p);
_planeWidget->GetNormal(n);
_wxvtkmpr3Dview->GetVtkMPR3DDataViewer()->GetVtkMPRBaseData()->SetNormal(n[0],n[1],n[2]);
+//EED 2017-01-01 Migration VTK7
+#if VTK_MAJOR_VERSION <= 5
+ //..
+#else
+ _planeWidget->GetPolyData(_vtkplane);
+ _probe->Update();
+#endif
+
}
double spc[3];
_planeWidget=planeWidget;
}
+//-------------------------------------------------------------------
+ void vtkmyPWCallback_3DPointWidget::SetVtkPolyData( vtkPolyData *vtkplane)
+{
+ _vtkplane=vtkplane;
+}
+
+//-------------------------------------------------------------------
+void vtkmyPWCallback_3DPointWidget::SetVtkProbeFilter( vtkProbeFilter *probe)
+{
+ _probe=probe;
+}
+
+
+
void SetWxVtkMPR3DView( wxVtkMPR3DView *wxvtkmpr3Dview );
void SetVtkPointWidget( vtkPointWidget *pointWidget );
void SetVtkPlaneWidget( vtkPlaneWidget *planeWidget );
+
+ void SetVtkPolyData( vtkPolyData *vtkplane);
+ void SetVtkProbeFilter( vtkProbeFilter *probe);
+
private:
double _backNormal[3];
vtkPlaneWidget *_planeWidget;
+
vtkPointWidget *_pointWidget;
- wxVtkMPR3DView *_wxvtkmpr3Dview;
+ vtkPolyData *_vtkplane;
+ vtkProbeFilter *_probe;
+
+ wxVtkMPR3DView *_wxvtkmpr3Dview;
};
-
#endif /*VTKMYPWCALLBACK_3DPOINTWIDGET_H_*/
#include "wxMPRWidget.h"
-#include "wxVTKRenderWindowInteractor.h"
+#include "creawxVTKRenderWindowInteractor.h"
#include "UtilVtk3DGeometriSelection.h"
#include "../kernel/marDicomBase.h"
// view 0
_vtkmpr2Dview[0] = new wxVtkMPR2DView(panel,0);
_vtkmpr2Dview[0]->SetVtkBaseData(vtkmprbasedata);
- wxVTKRenderWindowInteractor *iren0 = _vtkmpr2Dview[0]->GetWxVTKRenderWindowInteractor();
+ crea::wxVTKRenderWindowInteractor *iren0 = _vtkmpr2Dview[0]->GetWxVTKRenderWindowInteractor();
// view 1
_vtkmpr2Dview[1] = new wxVtkMPR2DView(panel,1);
_vtkmpr2Dview[1]->SetVtkBaseData(vtkmprbasedata);
- wxVTKRenderWindowInteractor *iren1 = _vtkmpr2Dview[1]->GetWxVTKRenderWindowInteractor();
+ crea::wxVTKRenderWindowInteractor *iren1 = _vtkmpr2Dview[1]->GetWxVTKRenderWindowInteractor();
// view 2
_vtkmpr2Dview[2] = new wxVtkMPR2DView(panel,2);
_vtkmpr2Dview[2]->SetVtkBaseData(vtkmprbasedata);
- wxVTKRenderWindowInteractor *iren2 = _vtkmpr2Dview[2]->GetWxVTKRenderWindowInteractor();
+ crea::wxVTKRenderWindowInteractor *iren2 = _vtkmpr2Dview[2]->GetWxVTKRenderWindowInteractor();
// view 3
wxNotebook *notebook = new wxNotebook( panel, -1 );
// EED
// _wxsphereview = new wxSphereView( notebook , vtkmprbasedata, vtkmprbasedata->GetImageData());
_wxsphereview = new wxSphereView( notebook , vtkmprbasedata );
- wxVTKRenderWindowInteractor *iren3B = _wxsphereview->GetWxVTKRenderWindowInteractor();
+ crea::wxVTKRenderWindowInteractor *iren3B = _wxsphereview->GetWxVTKRenderWindowInteractor();
notebook->AddPage( iren3B, _T("Sphere") );
// view 3.2
_wxvtkclipping3Dview->SetVtkClipping3DDataViewer(vtkclipping3Ddataviewer);
- wxWindow *window3D = _wxvtk3Dbaseview_MPRClipping3D->GetWxVTKRenderWindowInteractor();
-
+ wxWindow *window3D = _wxvtk3Dbaseview_MPRClipping3D->GetWxVTKRenderWindowInteractor();
wxPanel *panelControl = new wxPanel(panelMPR3D,-1);
wxPanel *controlPanelMPR3D = _wxvtkmpr3Dview->CreateControlPanel(panelControl, false);
wxPanel *controlPanelClipping3D = _wxvtkclipping3Dview->CreateSurfControlPanel(panelControl);
-
-
-
// wxBoxSizer *sizerCtrol = new wxBoxSizer(wxVERTICAL);
wxFlexGridSizer *sizerCtrol = new wxFlexGridSizer(1);
sizerCtrol->Add(controlPanelMPR3D , 1, wxALL|wxEXPAND, 2);
sizerCtrol->Add(controlPanelClipping3D , 1, wxALL|wxEXPAND, 2);
-
panelControl->SetAutoLayout(true);
panelControl->SetSizer(sizerCtrol);
panelControl->SetSize(400,150);
//RaC Nov2012 Correctly resize internal panels with the window resize event
panelMPR3D->SetSashGravity(0.5);
panelMPR3D -> SplitHorizontally( panelControl,window3D,200 );
-
notebook->AddPage( panelMPR3D, _T("MPR 3D - Clipping") );
-
-
Connect(notebook->GetId() , wxEVT_COMMAND_NOTEBOOK_PAGE_CHANGED , (wxObjectEventFunction) &wxMPRWidget::OnPageBChanged );
-
wxBoxSizer *sizerV = new wxBoxSizer(wxVERTICAL);
wxBoxSizer *sizerH1= new wxBoxSizer(wxHORIZONTAL);
wxBoxSizer *sizerH2= new wxBoxSizer(wxHORIZONTAL);
if (_vtkmprbasedata!=NULL)
{
_vtkmprbasedata->Configure();
- x=_vtkmprbasedata -> GetMaxPositionX()/2;
- y=_vtkmprbasedata -> GetMaxPositionY()/2;
- z=_vtkmprbasedata -> GetMaxPositionZ()/2;
+ x = _vtkmprbasedata->GetMaxPositionX()/2;
+ y = _vtkmprbasedata->GetMaxPositionY()/2;
+ z = _vtkmprbasedata->GetMaxPositionZ()/2;
_vtkmprbasedata->SetX( x );
_vtkmprbasedata->SetY( y );
_vtkmprbasedata->SetZ( z );
}
- if(_vtkmpr2Dview[0]!=NULL) {_vtkmpr2Dview[0] -> Configure();}
- if(_vtkmpr2Dview[1]!=NULL) {_vtkmpr2Dview[1] -> Configure();}
- if(_vtkmpr2Dview[2]!=NULL) {_vtkmpr2Dview[2] -> Configure();}
+ if(_vtkmpr2Dview[0]!=NULL) { _vtkmpr2Dview[0]->Configure(); }
+ if(_vtkmpr2Dview[1]!=NULL) { _vtkmpr2Dview[1]->Configure(); }
+ if(_vtkmpr2Dview[2]!=NULL) { _vtkmpr2Dview[2]->Configure(); }
+ if (_vtkmpr2Dview_B[0]!=NULL) { _vtkmpr2Dview_B[0]->Configure(); }
+ if (_vtkmpr2Dview_B[1]!=NULL) { _vtkmpr2Dview_B[1]->Configure(); }
+ if (_vtkmpr2Dview_B[2]!=NULL) { _vtkmpr2Dview_B[2]->Configure(); }
- if (_vtkmpr2Dview_B[0]!=NULL) { _vtkmpr2Dview_B[0] -> Configure(); }
- if (_vtkmpr2Dview_B[1]!=NULL) { _vtkmpr2Dview_B[1] -> Configure(); }
- if (_vtkmpr2Dview_B[2]!=NULL) { _vtkmpr2Dview_B[2] -> Configure(); }
+ if (_vtkplane2Dview!=NULL) { _vtkplane2Dview->Configure(); }
+ if (_widgetMesure!=NULL) { _widgetMesure->ConfigureA(_vtkplane2Dview); }
+ if (_widgetMesure!=NULL) { _widgetMesure->SetActiveLink(true); }
+ if (_wxsphereview!=NULL) { _wxsphereview->Configure(); }
+ if (_wxvtk3Dbaseview_MPRClipping3D!=NULL){_wxvtk3Dbaseview_MPRClipping3D->Configure();}
+ if (_wxvtkmpr3Dview!=NULL) { _wxvtkmpr3Dview->Configure(); }
+ if (_wxvtkclipping3Dview!=NULL) { _wxvtkclipping3Dview->Configure(); }
-
-
- if (_vtkplane2Dview!=NULL){_vtkplane2Dview -> Configure();}
- if (_widgetMesure!=NULL){_widgetMesure -> ConfigureA(_vtkplane2Dview);}
- if (_widgetMesure!=NULL){_widgetMesure -> SetActiveLink(true);}
- if (_wxsphereview!=NULL){_wxsphereview -> Configure();}
-
- if (_wxvtk3Dbaseview_MPRClipping3D!=NULL){_wxvtk3Dbaseview_MPRClipping3D -> Configure();}
- if (_wxvtkmpr3Dview!=NULL){
- _wxvtkmpr3Dview -> Configure();
- }
- if (_wxvtkclipping3Dview!=NULL){_wxvtkclipping3Dview -> Configure();}
-
- if (_vtkplane2Dview_B!=NULL){ _vtkplane2Dview_B -> Configure(); }
- if (_widgetMesure_B!=NULL){ _widgetMesure_B -> ConfigureA( _vtkplane2Dview_B ); }
- if (_widgetMesure_B!=NULL){ _widgetMesure_B -> SetActiveLink(true); }
+ if (_vtkplane2Dview_B!=NULL) { _vtkplane2Dview_B->Configure(); }
+ if (_widgetMesure_B!=NULL) { _widgetMesure_B->ConfigureA( _vtkplane2Dview_B ); }
+ if (_widgetMesure_B!=NULL) { _widgetMesure_B->SetActiveLink(true); }
//EEDx3
// double spc[3];
void wxMPRWidget2::OnRefreshView(wxCommandEvent & event) // Virtual
{
wxCommandEvent newevent1(wxEVT_COMMAND_MENU_SELECTED,12121); // Refresh
+//EED 2017-09-16 Migration wxWidgets 2.8 to 3.0
+#if wxMAJOR_VERSION <= 2
this->GetParent()->ProcessEvent(newevent1);
+#else
+ this->GetParent()->ProcessWindowEvent(newevent1);
+#endif
+
}
vtkImageData* img = reader->GetOutput();
vtkImageCast* cast = vtkImageCast::New();
+//EED 2017-01-01 Migration VTK7
+#if VTK_MAJOR_VERSION <= 5
cast->SetInput(img);
+#else
+ cast->SetInputData(img);
+#endif
+
cast->SetOutputScalarTypeToUnsignedShort();
cast->Update();
//reader->Delete();
wxMaracasMultipleVolumeRendererManagerData::wxMaracasMultipleVolumeRendererManagerData(vtkImageData* vol, std::string dataname){
- _vol = vol;
- _dataname = dataname;
-
- _tfun = vtkPiecewiseFunction::New();
- _ctfun = vtkColorTransferFunction::New();
+ _vol = vol;
+ _dataname = dataname;
+ _tfun = vtkPiecewiseFunction::New();
+ _ctfun = vtkColorTransferFunction::New();
+ _volumePlanes = vtkPlanes::New();
- _volumePlanes = vtkPlanes::New();
- _compositeFunction = vtkVolumeRayCastCompositeFunction::New();
- _MIPFunction = vtkVolumeRayCastMIPFunction::New();
- _volumeMapper = vtkVolumeRayCastMapper::New();
+#if (VTK_MAJOR_VERSION <= 7)
+ _compositeFunction = vtkVolumeRayCastCompositeFunction::New();
+ _MIPFunction = vtkVolumeRayCastMIPFunction::New();
+ _volumeMapper = vtkVolumeRayCastMapper::New();
_volumeMapper->SetVolumeRayCastFunction(_compositeFunction);
+#else
+ _volumeMapper = vtkFixedPointVolumeRayCastMapper::New();
+#endif
+
_volumeMapper->SetClippingPlanes( _volumePlanes );
_volumeMapper->AutoAdjustSampleDistancesOn();
_volumeProperty = vtkVolumeProperty::New();
_newvol = vtkVolume::New();
_newvol->SetMapper(_volumeMapper );
_newvol->SetProperty(_volumeProperty );
+
+//EED 2017-01-01 Migration VTK7
+#if VTK_MAJOR_VERSION <= 5
_volumeMapper->SetInput( _vol );
+#else
+ _volumeMapper->SetInputData( _vol );
+#endif
+
_volumeMapper->Update();
_newvol->Update();
}
_tfun->Delete();
_ctfun->Delete();
_volumePlanes->Delete();
+
+
+#if (VTK_MAJOR_VERSION <= 7)
_compositeFunction->Delete();
+#else
+ // ..
+#endif
+
_volumeMapper->Delete();
+
_volumeProperty->Delete();
_newvol->Delete();
/**
** Check if the variables are setted correctly
**/
-void wxMaracasMultipleVolumeRendererManagerData::checkInvariant()throw (char *){
- if(!_compositeFunction){
+void wxMaracasMultipleVolumeRendererManagerData::checkInvariant()throw (char *)
+{
+
+
+#if (VTK_MAJOR_VERSION <= 7)
+ if(!_compositeFunction)
+ {
throw "No composite function initialized";
}
- if(!_MIPFunction){
+ if(!_MIPFunction)
+ {
throw "No MIP function initialized";
}
- if(!_volumeMapper){
+#else
+ // ..
+#endif
+ if(!_volumeMapper)
+ {
throw "No volume mapper initialized";
}
}
_dataname = dataname;
}
-void wxMaracasMultipleVolumeRendererManagerData::changeCompositeMIPFunction(int function) throw (char *){
- checkInvariant();
- if(function == 0){
+void wxMaracasMultipleVolumeRendererManagerData::changeCompositeMIPFunction(int function) throw (char *)
+{
+ checkInvariant();
+#if (VTK_MAJOR_VERSION <= 7)
+ if(function == 0)
+ {
_volumeMapper->SetVolumeRayCastFunction(_compositeFunction);
}else{
_volumeMapper->SetVolumeRayCastFunction(_MIPFunction);
}
-
+#else
+ printf("EED wxMaracasMultipleVolumeRendererManagerData::changeCompositeMIPFunction Composite MIP ..... ??");
+#endif
}
#ifndef wxMaracasMultipleVolumeRendererManagerData_H_
#define wxMaracasMultipleVolumeRendererManagerData_H_
-#include <vtkVolumeRayCastCompositeFunction.h>
#include <vtkPlanes.h>
-#include <vtkVolumeRayCastMapper.h>
#include <vtkVolumeProperty.h>
#include <vtkVolume.h>
#include <vtkPiecewiseFunction.h>
#include <vtkImageData.h>
#include <vtkProp3D.h>
#include <vtkRenderer.h>
-#include <vtkVolumeRayCastMIPFunction.h>
+
+
+#if (VTK_MAJOR_VERSION <= 7)
+ #include <vtkVolumeRayCastCompositeFunction.h>
+ #include <vtkVolumeRayCastMIPFunction.h>
+ #include <vtkVolumeRayCastMapper.h>
+#else
+ #include <vtkFixedPointVolumeRayCastMapper.h>
+#endif
+
#include <vector>
*/
int _id;
- vtkVolumeRayCastCompositeFunction *_compositeFunction;
+
+
vtkPlanes *_volumePlanes;
- vtkVolumeRayCastMapper *_volumeMapper;
vtkVolumeProperty *_volumeProperty;
vtkVolume *_newvol;
- vtkPiecewiseFunction* _tfun;
- vtkColorTransferFunction* _ctfun;
- vtkVolumeRayCastMIPFunction* _MIPFunction;
+ vtkPiecewiseFunction *_tfun;
+ vtkColorTransferFunction *_ctfun;
+
+#if (VTK_MAJOR_VERSION <= 7)
+ vtkVolumeRayCastMIPFunction *_MIPFunction;
+ vtkVolumeRayCastCompositeFunction *_compositeFunction;
+ vtkVolumeRayCastMapper *_volumeMapper;
+#else
+ vtkFixedPointVolumeRayCastMapper *_volumeMapper;
+#endif
+
};
//iconfil+= "/OpenImage.png";
//wxBitmap* bitmap0 = new wxBitmap(wxString(iconfil.c_str(),wxConvUTF8), wxBITMAP_TYPE_PNG);
wxBitmap bitmap0(OpenImage_xpm);
+//EED 2017-09-16 Migration wxWidgets 2.8 to 3.0
+#if wxMAJOR_VERSION <= 2
this->AddTool(1, wxString(_T("test")),bitmap0, NULL, wxITEM_NORMAL, wxString(_T("Open File")));
+#else
+ this->AddTool(1, wxString(_T("test")),bitmap0, wxString(_T("Open File")), wxITEM_NORMAL );
+#endif
/*iconfil+= "/Open.png";
wxBitmap* bitmap2 = new wxBitmap(wxString(iconfil.c_str(),wxConvUTF8), wxBITMAP_TYPE_PNG);
if(addremove)
{
wxtabs->GetPage(id)->Enable();
-
bool valueX = ((wxVtkMPR3DViewCntrlPanel*) controlPanelMPR3D)->GetVisibleX();
bool valueY = ((wxVtkMPR3DViewCntrlPanel*) controlPanelMPR3D)->GetVisibleY();
bool valueZ = ((wxVtkMPR3DViewCntrlPanel*) controlPanelMPR3D)->GetVisibleZ();
bool valueXYZ = ((wxVtkMPR3DViewCntrlPanel*) controlPanelMPR3D)->GetVisibleXYZ();
bool valuePlane = ((wxVtkMPR3DViewCntrlPanel*) controlPanelMPR3D)->GetVisiblePlane();
-
mwxvtkmpr3Dview->VisibleImageActor( 0, valueX );
mwxvtkmpr3Dview->VisibleImageActor( 1, valueY );
mwxvtkmpr3Dview->VisibleImageActor( 2, valueZ );
mwxvtkmpr3Dview->VisiblePointWidget(valueXYZ);
mwxvtkmpr3Dview->VisiblePlaneWidget(valuePlane);
mwxvtkmpr3Dview->showOutlineActor(true);
-
mwxvtkmpr3Dview->Refresh();
-
-
- }
- else
- {
+ } else {
wxtabs->GetPage(id)->Disable();
-
mwxvtkmpr3Dview->VisiblePointWidget(false);
mwxvtkmpr3Dview->VisiblePlaneWidget(false);
mwxvtkmpr3Dview->VisibleImageActor(0, false );
mwxvtkmpr3Dview->VisibleImageActor(2, false );
mwxvtkmpr3Dview->showOutlineActor(false);
mwxvtkmpr3Dview->Refresh();
-
wxCommandEvent newevent1(wxEVT_COMMAND_MENU_SELECTED,12121); // Refresh
+//EED 2017-09-16 Migration wxWidgets 2.8 to 3.0
+#if wxMAJOR_VERSION <= 2
mwxvtkmpr3Dview->GetWxvtk3Dbaseview()->GetWxVTKRenderWindowInteractor()->GetParent()->ProcessEvent(newevent1);
- }
+#else
+ mwxvtkmpr3Dview->GetWxvtk3Dbaseview()->GetWxVTKRenderWindowInteractor()->GetParent()->ProcessWindowEvent(newevent1);
+#endif
+ } // if
}
}*/
}
+
void wxMaracasRenderTabbedPanel::OnRefreshView(wxCommandEvent & event)
{
printf("CPR wxMaracasRenderTabbedPanel::OnRefreshView \n");
mwxvtkmpr3Dview->RefreshView();
-
wxCommandEvent newevent1(wxEVT_COMMAND_MENU_SELECTED,12121); // Refresh
+//EED 2017-09-16 Migration wxWidgets 2.8 to 3.0
+#if wxMAJOR_VERSION <= 2
mwxvtkmpr3Dview->GetWxvtk3Dbaseview()->GetWxVTKRenderWindowInteractor()->GetParent()->ProcessEvent(newevent1);
+#else
+ mwxvtkmpr3Dview->GetWxvtk3Dbaseview()->GetWxVTKRenderWindowInteractor()->GetParent()->ProcessWindowEvent(newevent1);
+#endif
}
/**
//iconfil+= "/OpenImage.png";
//wxBitmap* bitmap0 = new wxBitmap(wxString(iconfil.c_str(),wxConvUTF8), wxBITMAP_TYPE_PNG);
wxBitmap bitmap0(OpenImage_xpm);
+//EED 2017-09-16 Migration wxWidgets 2.8 to 3.0
+#if wxMAJOR_VERSION <= 2
this->AddTool(1, wxString(_T("test")),bitmap0, NULL, wxITEM_NORMAL, wxString(_T("Open File")));
+#else
+ this->AddTool(1, wxString(_T("test")),bitmap0, wxString(_T("Open File")), wxITEM_NORMAL );
+#endif
+
+
this->Realize();
wxPanelCuttingImageData::wxPanelCuttingImageData (wxWindow *parent)
: wxPanel( parent, -1)
{
- _imageData=NULL;
- _histogrammeVector=NULL;
- _wxvtk3Dbaseview=NULL;
- _wxvtkbaseView=NULL;
- CreateInterface();
+ _imageData = NULL;
+ _histogrammeVector = NULL;
+ _wxvtk3Dbaseview = NULL;
+ _wxvtkbaseView = NULL;
+ CreateInterface() ;
CreateModel();
Create3DViewObjects();
}
_vtksphere->SetThetaResolution (20);
_vtksphere->SetPhiResolution (20);
_sphereMapper = vtkPolyDataMapper::New();
+//EED 2017-01-01 Migration VTK7
+#if VTK_MAJOR_VERSION <= 5
_sphereMapper->SetInput( _vtksphere->GetOutput() );
+#else
+ _sphereMapper->SetInputData( _vtksphere->GetOutput() );
+#endif
_sphereActor = vtkActor::New();
_sphereActor->SetMapper(_sphereMapper);
_sphereActor->SetOrigin(0, 0, 0);
_vtkcube->SetYLength (1);
_vtkcube->SetZLength (1);
_cubeMapper = vtkPolyDataMapper::New();
+//EED 2017-01-01 Migration VTK7
+#if VTK_MAJOR_VERSION <= 5
_cubeMapper->SetInput( _vtkcube->GetOutput() );
+#else
+ _cubeMapper->SetInputData( _vtkcube->GetOutput() );
+#endif
_cubeActor = vtkActor::New();
_cubeActor->SetMapper(_cubeMapper);
_cubeActor->SetOrigin(0, 0, 0);
_vtkcylinder = vtkCylinderSource::New();
_vtkcylinder->SetResolution(20);
_cylinderMapper = vtkPolyDataMapper::New();
+
+//EED 2017-01-01 Migration VTK7
+#if VTK_MAJOR_VERSION <= 5
_cylinderMapper->SetInput( _vtkcylinder->GetOutput() );
+#else
+ _cylinderMapper->SetInputData( _vtkcylinder->GetOutput() );
+#endif
+
_cylinderActor = vtkActor::New();
_cylinderActor->SetMapper(_cylinderMapper);
_cylinderActor->SetOrigin(0, 0, 0);
} else {
_imageData->GetScalarRange(rangeA);
}
+//EED 2017-01-01 Migration VTK7
+#if VTK_MAJOR_VERSION <= 5
_xyplot->RemoveAllInputs();
+#else
+ _xyplot->RemoveAllDataSetInputConnections();
+#endif
/*
if ( _histogrammeVector!=NULL )
{
*/
_histogrammeVector = vtkImageData::New();
_histogrammeVector -> SetDimensions ( (int)(rangeA[1]),1,1 );
+//EED 2017-01-01 Migration VTK7
+#if VTK_MAJOR_VERSION <= 5
_histogrammeVector -> SetScalarTypeToUnsignedShort();
_histogrammeVector -> AllocateScalars();
_histogrammeVector -> Update();
+#else
+ _histogrammeVector -> AllocateScalars(VTK_UNSIGNED_SHORT,1);
+#endif
unsigned short *p_vol = (unsigned short*)_histogrammeVector->GetScalarPointer(0,0,0);
int i,size = (int) (rangeA[1]);
}
_xyplot->SetXRange(0, rangeA[1]);
_xyplot->SetYRange(0, 10);
+
+
+//EED 2017-01-01 Migration VTK7
+#if VTK_MAJOR_VERSION <= 5
_xyplot->AddInput( _histogrammeVector );
+#else
+ _xyplot->AddDataSetInput( _histogrammeVector );
+#endif
+
}
//-------------------------------------------------------------------
_typeFig = new wxChoice(this,-1);
- _opacityFig = new wxSlider(this,-1,100,0,100, wxDefaultPosition, wxSize(200,45), wxSL_HORIZONTAL | wxSL_LABELS);
+ _opacityFig = new wxSlider(this,-1,100,0,100, wxDefaultPosition, wxDefaultSize, wxSL_HORIZONTAL | wxSL_LABELS);
- _scaleX = new wxSlider(this,-1,6,0,500 , wxDefaultPosition, wxSize(200,45), wxSL_HORIZONTAL | wxSL_LABELS);
- _scaleY = new wxSlider(this,-1,20,0,500 , wxDefaultPosition, wxSize(200,45), wxSL_HORIZONTAL | wxSL_LABELS);
- _scaleZ = new wxSlider(this,-1,7,0,500 , wxDefaultPosition, wxSize(200,45), wxSL_HORIZONTAL | wxSL_LABELS);
+ _scaleX = new wxSlider(this,-1,6,0,500 , wxDefaultPosition, wxDefaultSize, wxSL_HORIZONTAL | wxSL_LABELS);
+ _scaleY = new wxSlider(this,-1,20,0,500 , wxDefaultPosition, wxDefaultSize, wxSL_HORIZONTAL | wxSL_LABELS);
+ _scaleZ = new wxSlider(this,-1,7,0,500 , wxDefaultPosition, wxDefaultSize, wxSL_HORIZONTAL | wxSL_LABELS);
- _rotationX = new wxSlider(this,-1,0,-360,360, wxDefaultPosition, wxSize(200,45), wxSL_HORIZONTAL | wxSL_LABELS);
- _rotationY = new wxSlider(this,-1,0,-360,360, wxDefaultPosition, wxSize(200,45), wxSL_HORIZONTAL | wxSL_LABELS);
- _rotationZ = new wxSlider(this,-1,0,-360,360, wxDefaultPosition, wxSize(200,45), wxSL_HORIZONTAL | wxSL_LABELS);
+ _rotationX = new wxSlider(this,-1,0,-360,360, wxDefaultPosition, wxDefaultSize, wxSL_HORIZONTAL | wxSL_LABELS);
+ _rotationY = new wxSlider(this,-1,0,-360,360, wxDefaultPosition, wxDefaultSize, wxSL_HORIZONTAL | wxSL_LABELS);
+ _rotationZ = new wxSlider(this,-1,0,-360,360, wxDefaultPosition, wxDefaultSize, wxSL_HORIZONTAL | wxSL_LABELS);
_volIntern = new wxRadioButton(this,-1, _T("Volume intern " ));
_volExtern = new wxRadioButton(this,-1, _T("Volume extern " ));
_histogrammeAccumulated = new wxCheckBox(this,-1,_T("Histogramme accumulated"));
- _isoValue = new wxSlider(this,-1, 200, 0,2000, wxDefaultPosition, wxSize(200,45), wxSL_HORIZONTAL | wxSL_LABELS);
- _valueBeforeIsoValue = new wxSlider(this,-1,-1,-1,2000, wxDefaultPosition, wxSize(200,45), wxSL_HORIZONTAL | wxSL_LABELS);
- _valueAfterIsoValue = new wxSlider(this,-1,-1,-1,2000, wxDefaultPosition, wxSize(200,45), wxSL_HORIZONTAL | wxSL_LABELS);
+ _isoValue = new wxSlider(this,-1, 200, 0,2000, wxDefaultPosition,wxDefaultSize, wxSL_HORIZONTAL | wxSL_LABELS);
+ _valueBeforeIsoValue = new wxSlider(this,-1,-1,-1,2000, wxDefaultPosition, wxDefaultSize, wxSL_HORIZONTAL | wxSL_LABELS);
+ _valueAfterIsoValue = new wxSlider(this,-1,-1,-1,2000, wxDefaultPosition, wxDefaultSize, wxSL_HORIZONTAL | wxSL_LABELS);
wxButton *btnExtract = new wxButton(this, -1,_T("Extract"));
}
}
double range[2];
+
+//EED 2017-01-01 Migration VTK7
+#if VTK_MAJOR_VERSION <= 5
_histogrammeVector->Update();
+#else
+ _histogrammeVector->Modified();
+#endif
+
_histogrammeVector->GetScalarRange(range);
_xyplot->SetYRange( 0 , range[1] );
_xyplot->SetXRange( min , max );
// _wxvtkbaseView->RefreshView();
wxCommandEvent newevent1(wxEVT_COMMAND_MENU_SELECTED,12121); // Refresh
+//EED 2017-09-16 Migration wxWidgets 2.8 to 3.0
+#if wxMAJOR_VERSION <= 2
_wxvtkbaseView->GetWxVTKRenderWindowInteractor()->GetParent()->ProcessEvent(newevent1);
+#else
+ _wxvtkbaseView->GetWxVTKRenderWindowInteractor()->GetParent()->ProcessWindowEvent(newevent1);
+#endif
}
wxPanel *panel = new wxPanel(parent,-1);
- _opacity_Vol = new wxSlider( panel, -1, 40, 0, 100 , wxDefaultPosition, wxSize(200,40), wxSL_HORIZONTAL | wxSL_LABELS );
+ _opacity_Vol = new wxSlider( panel, -1, 40, 0, 100 , wxDefaultPosition, wxDefaultSize, wxSL_HORIZONTAL | wxSL_LABELS );
_opacity_Vol ->SetSize(250,20);
/*SIL
- _sl_maxSize = new wxSlider( panel, -1, 300 , 0, 2000 , wxDefaultPosition, wxSize(200,40), wxSL_HORIZONTAL | wxSL_AUTOTICKS | wxSL_LABELS );
- _sl_minSize = new wxSlider( panel, -1, 200 , 0, 2000 , wxDefaultPosition, wxSize(200,40), wxSL_HORIZONTAL | wxSL_AUTOTICKS | wxSL_LABELS );
+ _sl_maxSize = new wxSlider( panel, -1, 300 , 0, 2000 , wxDefaultPosition, wxDefaultSize, wxSL_HORIZONTAL | wxSL_AUTOTICKS | wxSL_LABELS );
+ _sl_minSize = new wxSlider( panel, -1, 200 , 0, 2000 , wxDefaultPosition, wxDefaultSize, wxSL_HORIZONTAL | wxSL_AUTOTICKS | wxSL_LABELS );
- _sl_minSizeSpin = new wxSlider(panel , -1,5,1,10,wxDefaultPosition , wxSize(25,45), wxSL_VERTICAL | wxSL_AUTOTICKS |wxSL_LEFT );
+ _sl_minSizeSpin = new wxSlider(panel , -1,5,1,10,wxDefaultPosition , wxDefaultSize, wxSL_VERTICAL | wxSL_AUTOTICKS |wxSL_LEFT );
_sl_minSizeSpin->SetRange(1,8);
_sl_minSizeSpin->SetValue(5);
- _sl_maxSizeSpin = new wxSlider(panel , -1,5,1,10,wxDefaultPosition , wxSize(25,45), wxSL_VERTICAL | wxSL_AUTOTICKS |wxSL_LEFT );
+ _sl_maxSizeSpin = new wxSlider(panel , -1,5,1,10,wxDefaultPosition , wxDefaultSize, wxSL_VERTICAL | wxSL_AUTOTICKS |wxSL_LEFT );
_sl_maxSizeSpin->SetRange(1,8);
_sl_maxSizeSpin->SetValue(5);
*/
- _sl_RangeSizeSpin = new wxSlider(panel , -1,5,1,10,wxDefaultPosition , wxSize(25,45), wxSL_VERTICAL | wxSL_AUTOTICKS |wxSL_LEFT );
+ _sl_RangeSizeSpin = new wxSlider(panel , -1,5,1,10,wxDefaultPosition ,wxDefaultSize, wxSL_VERTICAL | wxSL_AUTOTICKS |wxSL_LEFT );
_sl_RangeSizeSpin->SetRange(1,8);
_sl_RangeSizeSpin->SetValue(5);
//_thresh->ThresholdBetween(_sl_minSize->GetValue(), _range[1]);
//SIL//
_cast = vtkImageCast::New();
+
+//EED 2017-01-01 Migration VTK7
+#if VTK_MAJOR_VERSION <= 5
_cast->SetInput(_thresh->GetOutput());
+#else
+ _cast->SetInputData(_thresh->GetOutput());
+#endif
+
_cast->SetOutputScalarTypeToUnsignedChar();
_connect = vtkImageSeedConnectivity::New();
+//EED 2017-01-01 Migration VTK7
+#if VTK_MAJOR_VERSION <= 5
_connect->SetInput(_cast->GetOutput());
+#else
+ _connect->SetInputData(_cast->GetOutput());
+#endif
_connect->SetInputConnectValue(255);
_connect->SetOutputConnectedValue(255);
_connect->SetOutputUnconnectedValue(0);
cast3 = vtkImageCast::New();
+//EED 2017-01-01 Migration VTK7
+#if VTK_MAJOR_VERSION <= 5
cast3->SetInput(_connect->GetOutput());
+#else
+ cast3->SetInputData(_connect->GetOutput());
+#endif
cast3->SetOutputScalarTypeToUnsignedShort();
_thresh2 = vtkImageThreshold::New();
//SIL//_thresh2->ThresholdBetween(_sl_minSize->GetValue(), _sl_maxSize->GetValue());
cast2 = vtkImageCast::New();
+//EED 2017-01-01 Migration VTK7
+#if VTK_MAJOR_VERSION <= 5
cast2->SetInput(_thresh2->GetOutput());
+#else
+ cast2->SetInputData(_thresh2->GetOutput());
+#endif
cast2->SetOutputScalarTypeToUnsignedChar();
_connect2 = vtkImageSeedConnectivity::New();
+//EED 2017-01-01 Migration VTK7
+#if VTK_MAJOR_VERSION <= 5
_connect2->SetInput(cast2->GetOutput());
+#else
+ _connect2->SetInputData(cast2->GetOutput());
+#endif
_connect2->SetInputConnectValue(255);
_connect2->SetOutputConnectedValue(255);
_connect2->SetOutputUnconnectedValue(0);
cast4 = vtkImageCast::New();
+//EED 2017-01-01 Migration VTK7
+#if VTK_MAJOR_VERSION <= 5
cast4->SetInput(_connect2->GetOutput());
+#else
+ cast4->SetInputData(_connect2->GetOutput());
+#endif
cast4->SetOutputScalarTypeToUnsignedShort();
}
_thresh->RemoveAllInputs();
+//EED 2017-01-01 Migration VTK7
+#if VTK_MAJOR_VERSION <= 5
_thresh->SetInput(_imagedata);
+#else
+ _thresh->SetInputData(_imagedata);
+#endif
_thresh->ThresholdBetween(sl_barrange_segmentation->GetStart(), sl_barrange_segmentation->GetEnd());
_thresh->Update();
//cast3->Update();
//SIL//
_thresh2->RemoveAllInputs();
+
+//EED 2017-01-01 Migration VTK7
+#if VTK_MAJOR_VERSION <= 5
_thresh2->SetInput(_imagedata);
+#else
+ _thresh2->SetInputData(_imagedata);
+#endif
+
_thresh2->ThresholdBetween(sl_barrange_segmentation->GetStart(), sl_barrange_segmentation->GetEnd());
_thresh2->Update();
cast2->Update();
puntoactualprov[1] = y;
puntoactualprov[2] = z;
+//EED 2017-01-01 Migration VTK7
+#if VTK_MAJOR_VERSION <= 5
_imagedata->UpdateInformation();
_imagedata->SetUpdateExtent(_imagedata->GetWholeExtent());
_imagedata->Update();
+#else
+ // ..
+#endif
_imagedata->GetSpacing(espprin);
_imagedata->GetExtent(extprin);
// Visualisation - result volume
_2_isoMC6 = vtkMarchingCubes::New();
+//EED 2017-01-01 Migration VTK7
+#if VTK_MAJOR_VERSION <= 5
_2_isoMC6->SetInput(cast4->GetOutput());
+#else
+ _2_isoMC6->SetInputData(cast4->GetOutput());
+#endif
_2_isoMC6->SetValue(0, 128);
_2_isoMC6->Update();
_2_isoMapperMC6 = vtkPolyDataMapper::New();
+
+//EED 2017-01-01 Migration VTK7
+#if VTK_MAJOR_VERSION <= 5
_2_isoMapperMC6->SetInput(_2_isoMC6->GetOutput());
+#else
+ _2_isoMapperMC6->SetInputData(_2_isoMC6->GetOutput());
+#endif
+
+
_2_isoMapperMC6->ScalarVisibilityOff();
_2_isoMapperMC6->ImmediateModeRenderingOn();
{
vtkMetaImageWriter *writer= vtkMetaImageWriter::New();
writer->SetFileName( dialog.GetPath().mb_str(wxConvUTF8) );
+//EED 2017-01-01 Migration VTK7
+#if VTK_MAJOR_VERSION <= 5
writer->SetInput(cast4->GetOutput());
+#else
+ writer->SetInputData(cast4->GetOutput());
+#endif
writer->Write();
writer->Delete();
}
vtkSTLReader *imgReader= vtkSTLReader::New();
imgReader->SetFileName( dialog.GetPath().mb_str(wxConvUTF8) );
_loadSTLMapper = vtkPolyDataMapper::New();
+//EED 2017-01-01 Migration VTK7
+#if VTK_MAJOR_VERSION <= 5
_loadSTLMapper->SetInput(imgReader->GetOutput());
+#else
+ _loadSTLMapper->SetInputData(imgReader->GetOutput());
+#endif
_loadActorSTL = vtkActor::New();
_loadActorSTL->SetMapper(_loadSTLMapper);
_loadActorSTL->GetProperty()->SetColor( 1, 0, 0);
stlInterna = vtkPolyData::New();
dsm1 = vtkPolyDataMapper ::New();
- dsm1->SetInput (stlInterna);
+//EED 2017-01-01 Migration VTK7
+#if VTK_MAJOR_VERSION <= 5
+ dsm1->SetInput(stlInterna);
+#else
+ dsm1->SetInputData(stlInterna);
+#endif
dsm1->ScalarVisibilityOff();
actorInternal = vtkActor::New();
actorInternal->GetProperty()->SetColor (0,1,0);
dsm2 = vtkPolyDataMapper ::New();
- dsm2->SetInput (stlExterna);
+
+//EED 2017-01-01 Migration VTK7
+#if VTK_MAJOR_VERSION <= 5
+ dsm2->SetInput(stlExterna);
+#else
+ dsm2->SetInputData(stlExterna);
+#endif
+
dsm2->ScalarVisibilityOff();
actorExternal= vtkActor::New();
// wxDirDialog dialog( this, "Choose a directory...", ( !dirSTL.IsEmpty( ) )?dirSTL: wxGetHomeDir( ) );
+
+
+//EED 2017-09-16 Migration wxWidgets 2.8 to 3.0
+#if wxMAJOR_VERSION <= 2
wxFileDialog dialog( this, _T("Choose a directory..."), dirSTL , _T(""), _T("*.*"), wxSAVE );
+#else
+ wxFileDialog dialog( this, _T("Choose a directory..."), dirSTL , _T(""), _T("*.*"), wxFD_SAVE );
+#endif
if( dialog.ShowModal( ) == wxID_OK )
// 1.1. Se hace un filtro triangular puesto que el stl writer solo recibe poligonos triangulares.
- vtkTriangleFilter *filtro = vtkTriangleFilter::New();
+ vtkClosePolyData *cpd = vtkClosePolyData::New();
+ vtkTriangleFilter *filtro = vtkTriangleFilter::New();
+ vtkPolyDataConnectivityFilter *pdcf = vtkPolyDataConnectivityFilter::New();
+
+ // 1.2 se escribe a disco el archivo stl de la superficie interna
+//EED 2017-01-01 Migration VTK7
+#if VTK_MAJOR_VERSION <= 5
filtro->SetInput(stlInterna);
- vtkPolyDataConnectivityFilter *pdcf = vtkPolyDataConnectivityFilter::New();
pdcf->SetInput( filtro->GetOutput() );
- vtkClosePolyData *cpd = vtkClosePolyData::New();
cpd->SetInput( pdcf->GetOutput() );
-
- // 1.2 se escribe a disco el archivo stl de la superficie interna
cpd->Update();
+#else
+ filtro->SetInputData(stlInterna);
+ pdcf->SetInputData( filtro->GetOutput() );
+ cpd->SetInputData( pdcf->GetOutput() );
+#endif
vtkSTLWriter *writerI = vtkSTLWriter::New();
+//EED 2017-01-01 Migration VTK7
+#if VTK_MAJOR_VERSION <= 5
writerI->SetInput( cpd->GetOutput() );
+#else
+ writerI->SetInputData( cpd->GetOutput() );
+#endif
// prefix = fileprefix;
filename=prefix+"_internal.stl";
writerI->SetFileName(filename.c_str());
writerI->Delete();
// 1.3 se escribe a disco el archivo stl de la superficie externa
+//EED 2017-01-01 Migration VTK7
+#if VTK_MAJOR_VERSION <= 5
filtro->SetInput(stlExterna);
+#else
+ filtro->SetInputData(stlExterna);
+#endif
cpd->Update();
vtkSTLWriter *writerE = vtkSTLWriter::New();
+//EED 2017-01-01 Migration VTK7
+#if VTK_MAJOR_VERSION <= 5
writerE->SetInput( cpd->GetOutput() );
+#else
+ writerE->SetInputData( cpd->GetOutput() );
+#endif
// prefix = fileprefix;
filename=prefix+"_external.stl";
writerE->SetFileName( filename.c_str() );
#include <vtkImageSeedConnectivity.h>
#include <vtkImageCast.h>
-#include "wxVTKRenderWindowInteractor.h"
+#include "creawxVTKRenderWindowInteractor.h"
//#include "wxSurfaceWidget.h"
#include "wxVtkBaseView.h"
_imageSphere = vtkImageData::New();
_imageSphere->SetDimensions (150,150,500);
+//EED 2017-01-01 Migration VTK7
+#if VTK_MAJOR_VERSION <= 5
//EED
// _imageSphere->SetScalarTypeToUnsignedShort();
_imageSphere->SetScalarType( _imageDataOriginal->GetScalarType() );
-
_imageSphere->AllocateScalars();
_imageSphere->Update();
+#else
+ _imageSphere->AllocateScalars(_imageDataOriginal->GetScalarType(),1);
+#endif
+
+
//EED ???? vtkBaseData no esta compartido con los otros objetos .. PLOP
// vtkBaseData *vtkbasedata = new vtkBaseData();
void wxSphereView::RefreshView()
{
//EED
- _imageViewer2XYZ->GetVtkImageViewer2()->SetInput ( _imageSphere );
+//EED 2017-01-01 Migration VTK7
+#if VTK_MAJOR_VERSION <= 5
+ _imageViewer2XYZ->GetVtkImageViewer2()->SetInput( _imageSphere );
+#else
+ _imageViewer2XYZ->GetVtkImageViewer2()->SetInputData( _imageSphere );
+#endif
DefineImageSphere();
// UpdateColorWindowLevel();
// wxVtk2DBaseView::Refresh();
}
}
_imageSphere->Modified();
+//EED 2017-01-01 Migration VTK7
+#if VTK_MAJOR_VERSION <= 5
_imageSphere->Update();
+#else
+ // ..
+#endif
}
//----------------------------------------------------------------------------
+++ /dev/null
-/*# ---------------------------------------------------------------------
-#
-# Copyright (c) CREATIS (Centre de Recherche en Acquisition et Traitement de l'Image
-# pour la Sant�)
-# Authors : Eduardo Davila, Frederic Cervenansky, Claire Mouton
-# Previous Authors : Laurent Guigues, Jean-Pierre Roux
-# CreaTools website : www.creatis.insa-lyon.fr/site/fr/creatools_accueil
-#
-# This software is governed by the CeCILL-B license under French law and
-# abiding by the rules of distribution of free software. You can use,
-# modify and/ or redistribute the software under the terms of the CeCILL-B
-# license as circulated by CEA, CNRS and INRIA at the following URL
-# http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.html
-# or in the file LICENSE.txt.
-#
-# As a counterpart to the access to the source code and rights to copy,
-# modify and redistribute granted by the license, users are provided only
-# with a limited warranty and the software's author, the holder of the
-# economic rights, and the successive licensors have only limited
-# liability.
-#
-# The fact that you are presently reading this means that you have had
-# knowledge of the CeCILL-B license and that you accept its terms.
-# ------------------------------------------------------------------------ */
-
-/*=========================================================================
-
- Program: Visualization Toolkit
- Module: $RCSfile: wxVTKRenderWindowInteractor.cxx,v $
- Language: C++
- Date: $Date: 2012/11/15 14:14:35 $
- Version: $Revision: 1.7 $
-
- Copyright (c) 1993-2002 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.
-
-=========================================================================*/
-
-#include <assert.h>
-
-#include "wxVTKRenderWindowInteractor.h"
-
-//This is needed for vtk 3.1 :
-#ifndef VTK_MAJOR_VERSION
-# include "vtkVersion.h"
-#endif
-
-#if VTK_MAJOR_VERSION > 4 || (VTK_MAJOR_VERSION == 4 && VTK_MINOR_VERSION > 0)
-# include "vtkCommand.h"
-#else
-# include "vtkInteractorStyle.h"
-#endif
-#include "vtkDebugLeaks.h"
-
-#ifdef __WXMAC__
-#include "vtkCarbonRenderWindow.h"
-#endif
-
-//Keep this for compatibilty reason, this was introduced in wxGTK 2.4.0
-#if (!wxCHECK_VERSION(2, 4, 0))
-wxWindow* wxGetTopLevelParent(wxWindow *win)
-{
- while ( win && !win->IsTopLevel() )
- win = win->GetParent();
- return win;
-}
-#endif
-
-// To access objc calls on cocoa
-#ifdef __WXCOCOA__
-#ifdef VTK_USE_COCOA
-#import <Cocoa/Cocoa.h>
-// This trick is no longer need in VTK CVS, should get rid of that:
-#define id Id
-#else
-#error Build mismatch you need both wxWidgets and VTK to be configure against Cocoa to work
-#endif //VTK_USE_COCOA
-#endif //__WXCOCOA__
-
-#ifdef __WXGTK__
-# include <gdk/gdkx.h> // GDK_WINDOW_XWINDOW is found here in wxWidgets 2.8.0
-# include "gdk/gdkprivate.h"
-#if wxCHECK_VERSION(2, 8, 0)
-#ifdef __WXGTK20__
-#include <wx/gtk/win_gtk.h>
-#else
-#include <wx/gtk1/win_gtk.h>
-#endif
-#else
-#include <wx/gtk/win_gtk.h>
-#endif
-#define GetXWindow(wxwin) (wxwin)->m_wxwindow ? \
- GDK_WINDOW_XWINDOW(GTK_PIZZA((wxwin)->m_wxwindow)->bin_window) : \
- GDK_WINDOW_XWINDOW((wxwin)->m_widget->window)
-#endif
-
-#ifdef __WXX11__
-#include "wx/x11/privx.h"
-#define GetXWindow(wxwin) ((Window)(wxwin)->GetHandle())
-#endif
-
-
-//For more info on this class please go to:
-//http://wxvtk.sf.net
-//This hack is for some buggy wxGTK version:
-#if wxCHECK_VERSION(2, 3, 2) && !wxCHECK_VERSION(2, 4, 1) && defined(__WXGTK__)
-# define WX_USE_X_CAPTURE 0
-#else
-# define WX_USE_X_CAPTURE 1
-#endif
-
-#define ID_wxVTKRenderWindowInteractor_TIMER 1001
-
-#if defined(__WXGTK__) && defined(USE_WXGLCANVAS)
-IMPLEMENT_DYNAMIC_CLASS(wxVTKRenderWindowInteractor, wxGLCanvas)
-#else
-IMPLEMENT_DYNAMIC_CLASS(wxVTKRenderWindowInteractor, wxWindow)
-#endif //__WXGTK__
-
-//---------------------------------------------------------------------------
-#if defined(__WXGTK__) && defined(USE_WXGLCANVAS)
-BEGIN_EVENT_TABLE(wxVTKRenderWindowInteractor, wxGLCanvas)
-#else
-BEGIN_EVENT_TABLE(wxVTKRenderWindowInteractor, wxWindow)
-#endif //__WXGTK__
- //refresh window by doing a Render
- EVT_PAINT (wxVTKRenderWindowInteractor::OnPaint)
- EVT_ERASE_BACKGROUND(wxVTKRenderWindowInteractor::OnEraseBackground)
- EVT_MOTION (wxVTKRenderWindowInteractor::OnMotion)
-
- //Bind the events to the event converters
- EVT_LEFT_DOWN (wxVTKRenderWindowInteractor::OnButtonDown)
- EVT_MIDDLE_DOWN (wxVTKRenderWindowInteractor::OnButtonDown)
- EVT_RIGHT_DOWN (wxVTKRenderWindowInteractor::OnButtonDown)
- EVT_LEFT_UP (wxVTKRenderWindowInteractor::OnButtonUp)
- EVT_MIDDLE_UP (wxVTKRenderWindowInteractor::OnButtonUp)
- EVT_RIGHT_UP (wxVTKRenderWindowInteractor::OnButtonUp)
-#if !(VTK_MAJOR_VERSION == 3 && VTK_MINOR_VERSION == 1)
- EVT_ENTER_WINDOW(wxVTKRenderWindowInteractor::OnEnter)
- EVT_LEAVE_WINDOW(wxVTKRenderWindowInteractor::OnLeave)
- EVT_MOUSEWHEEL (wxVTKRenderWindowInteractor::OnMouseWheel)
- EVT_KEY_DOWN (wxVTKRenderWindowInteractor::OnKeyDown)
- EVT_KEY_UP (wxVTKRenderWindowInteractor::OnKeyUp)
- EVT_CHAR (wxVTKRenderWindowInteractor::OnChar)
-#endif
- EVT_TIMER (ID_wxVTKRenderWindowInteractor_TIMER, wxVTKRenderWindowInteractor::OnTimer)
- EVT_SIZE (wxVTKRenderWindowInteractor::OnSize)
-END_EVENT_TABLE()
-
-vtkCxxRevisionMacro(wxVTKRenderWindowInteractor, "$Revision: 1.7 $")
-vtkInstantiatorNewMacro(wxVTKRenderWindowInteractor)
-
-//---------------------------------------------------------------------------
-#if defined(__WXGTK__) && defined(USE_WXGLCANVAS)
-#if (wxCHECK_VERSION(2, 8, 0))
-wxVTKRenderWindowInteractor::wxVTKRenderWindowInteractor() : wxGLCanvas(0, -1, wxDefaultPosition), vtkRenderWindowInteractor()
-#else
-wxVTKRenderWindowInteractor::wxVTKRenderWindowInteractor() : wxGLCanvas(), vtkRenderWindowInteractor()
-#endif
-#else
-wxVTKRenderWindowInteractor::wxVTKRenderWindowInteractor() : wxWindow(), vtkRenderWindowInteractor()
-#endif //__WXGTK__
- , timer(this, ID_wxVTKRenderWindowInteractor_TIMER)
- , ActiveButton(wxEVT_NULL)
- , RenderAllowed(0)
- , Stereo(0)
- , Handle(0)
- , Created(true)
- , RenderWhenDisabled(1)
- , UseCaptureMouse(0)
-{
-#ifdef VTK_DEBUG_LEAKS
- vtkDebugLeaks::ConstructClass("wxVTKRenderWindowInteractor");
-#endif
- this->RenderWindow = NULL;
- this->SetRenderWindow(vtkRenderWindow::New());
- this->RenderWindow->Delete();
-}
-//---------------------------------------------------------------------------
-wxVTKRenderWindowInteractor::wxVTKRenderWindowInteractor(wxWindow *parent,
- wxWindowID id,
- const wxPoint &pos,
- const wxSize &size,
- long style,
- const wxString &name)
-#if defined(__WXGTK__) && defined(USE_WXGLCANVAS)
- : wxGLCanvas(parent, id, pos, size, style, name), vtkRenderWindowInteractor()
-#else
- : wxWindow(parent, id, pos, size, style, name), vtkRenderWindowInteractor()
-#endif //__WXGTK__
- , timer(this, ID_wxVTKRenderWindowInteractor_TIMER)
- , ActiveButton(wxEVT_NULL)
- , RenderAllowed(0)
- , Stereo(0)
- , Handle(0)
- , Created(true)
- , RenderWhenDisabled(1)
- , UseCaptureMouse(0)
-{
-#ifdef VTK_DEBUG_LEAKS
- vtkDebugLeaks::ConstructClass("wxVTKRenderWindowInteractor");
-#endif
- this->RenderWindow = NULL;
- this->SetRenderWindow(vtkRenderWindow::New());
- this->RenderWindow->Delete();
-#ifdef __WXMAC__
- // On Mac (Carbon) we don't get notified of the initial window size with an EVT_SIZE event,
- // so we update the size information of the interactor/renderwindow here
- this->UpdateSize(size.x, size.y);
-#endif
-}
-//---------------------------------------------------------------------------
-wxVTKRenderWindowInteractor::~wxVTKRenderWindowInteractor()
-{
- SetRenderWindow(NULL);
- SetInteractorStyle(NULL);
-}
-//---------------------------------------------------------------------------
-wxVTKRenderWindowInteractor * wxVTKRenderWindowInteractor::New()
-{
- // we don't make use of the objectfactory, because we're not registered
- return new wxVTKRenderWindowInteractor;
-}
-//---------------------------------------------------------------------------
-void wxVTKRenderWindowInteractor::Initialize()
-{
- int *size = RenderWindow->GetSize();
- // enable everything and start rendering
- Enable();
- //RenderWindow->Start();
-
- // set the size in the render window interactor
- Size[0] = size[0];
- Size[1] = size[1];
-
- // this is initialized
- Initialized = 1;
-}
-//---------------------------------------------------------------------------
-void wxVTKRenderWindowInteractor::Enable()
-{
- // if already enabled then done
- if (Enabled)
- return;
-
- // that's it
- Enabled = 1;
-#if defined(__WXGTK__) && defined(USE_WXGLCANVAS)
- SetCurrent();
-#endif
- Modified();
-}
-//---------------------------------------------------------------------------
-bool wxVTKRenderWindowInteractor::Enable(bool enable)
-{
-#if defined(__WXGTK__) && defined(USE_WXGLCANVAS)
- return wxGLCanvas::Enable(enable);
-#else
- return wxWindow::Enable(enable);
-#endif
-}
-//---------------------------------------------------------------------------
-void wxVTKRenderWindowInteractor::Disable()
-{
- // if already disabled then done
- if (!Enabled)
- return;
-
- // that's it (we can't remove the event handler like it should be...)
- Enabled = 0;
- Modified();
-}
-//---------------------------------------------------------------------------
-void wxVTKRenderWindowInteractor::Start()
-{
- // the interactor cannot control the event loop
- vtkErrorMacro( << "wxVTKRenderWindowInteractor::Start() "
- "interactor cannot control event loop.");
-}
-//---------------------------------------------------------------------------
-void wxVTKRenderWindowInteractor::UpdateSize(int x, int y)
-{
- if( RenderWindow )
- {
- // if the size changed tell render window
- if ( x != Size[0] || y != Size[1] )
- {
- // adjust our (vtkRenderWindowInteractor size)
- Size[0] = x;
- Size[1] = y;
- // and our RenderWindow's size
- RenderWindow->SetSize(x, y);
- }
- }
-}
-//---------------------------------------------------------------------------
-int wxVTKRenderWindowInteractor::CreateTimer(int WXUNUSED(timertype))
-{
- // it's a one shot timer
- if (!timer.Start(10, TRUE))
- assert(false);
-
- return 1;
-
-}
-//---------------------------------------------------------------------------
-int wxVTKRenderWindowInteractor::DestroyTimer()
-{
- // do nothing
- return 1;
-}
-//---------------------------------------------------------------------------
-void wxVTKRenderWindowInteractor::OnTimer(wxTimerEvent& WXUNUSED(event))
-{
- if (!Enabled)
- return;
-
-#if VTK_MAJOR_VERSION > 4 || (VTK_MAJOR_VERSION == 4 && VTK_MINOR_VERSION > 0)
- // new style
- InvokeEvent(vtkCommand::TimerEvent, NULL);
-#else
- // old style
- InteractorStyle->OnTimer();
-#endif
-}
-
-//---------------------------------------------------------------------------
-// NOTE on implementation:
-// Bad luck you ended up in the only tricky place of this code.
-// A few note, wxWidgets still refuse to provide such convenient method
-// so I have to maintain it myself, eventhough this is completely integrated
-// in wxPython...
-// Anyway if this happen to break for you then compare to a recent version of wxPython
-// and look for the function long wxPyGetWinHandle(wxWindow* win)
-// in wxPython/src/helpers.cpp
-long wxVTKRenderWindowInteractor::GetHandleHack()
-{
- //helper function to hide the MSW vs GTK stuff
- long handle_tmp = 0;
-
-// __WXMSW__ is for Win32
-//__WXMAC__ stands for using Carbon C-headers, using either the CarbonLib/CFM or the native Mach-O builds (which then also use the latest features available)
-// __WXGTK__ is for both gtk 1.2.x and gtk 2.x
-#if defined(__WXMSW__) || defined(__WXMAC__)
- handle_tmp = (long)this->GetHandle();
-#endif //__WXMSW__
-
-//__WXCOCOA__ stands for using the objective-c Cocoa API
-#ifdef __WXCOCOA__
- // Here is how to find the NSWindow
- wxTopLevelWindow* toplevel = dynamic_cast<wxTopLevelWindow*>(
- wxGetTopLevelParent( this ) );
- if (toplevel != NULL )
- {
- handle_tmp = (long)toplevel->GetNSWindow();
- }
- // The NSView will be deducted from
- // [(NSWindow*)Handle contentView]
- // if only I knew how to write that in c++
-#endif //__WXCOCOA__
-
- // Find and return the actual X-Window.
-#if defined(__WXGTK__) || defined(__WXX11__)
- return (long)GetXWindow(this);
-#endif
-
-//#ifdef __WXMOTIF__
-// handle_tmp = (long)this->GetXWindow();
-//#endif
-
- return handle_tmp;
-}
-//---------------------------------------------------------------------------
-void wxVTKRenderWindowInteractor::OnPaint(wxPaintEvent& WXUNUSED(event))
-{
- //must always be here
- wxPaintDC pDC(this);
-
- //do it here rather than in the cstor: this is safer.
- if(!Handle)
- {
- Handle = GetHandleHack();
- RenderWindow->SetWindowId(reinterpret_cast<void *>(Handle));
-#ifdef __WXMSW__
- RenderWindow->SetParentId(reinterpret_cast<void *>(this->GetParent()->GetHWND()));
-#endif //__WXMSW__
- }
- // get vtk to render to the wxWindows
- Render();
-#ifdef __WXMAC__
- // This solves a problem with repainting after a window resize
- // See also: http://sourceforge.net/mailarchive/forum.php?thread_id=31690967&forum_id=41789
- vtkCarbonRenderWindow* rwin = vtkCarbonRenderWindow::SafeDownCast(RenderWindow);
- if( rwin )
- {
- rwin->UpdateGLRegion();
- }
-#endif
-}
-//---------------------------------------------------------------------------
-void wxVTKRenderWindowInteractor::OnEraseBackground(wxEraseEvent &event)
-{
- //turn off background erase to reduce flickering on MSW
- event.Skip(false);
-}
-//---------------------------------------------------------------------------
-void wxVTKRenderWindowInteractor::OnSize(wxSizeEvent& WXUNUSED(event))
-{
- int w, h;
- GetClientSize(&w, &h);
- UpdateSize(w, h);
-
- if (!Enabled)
- {
- return;
- }
-
-#if VTK_MAJOR_VERSION > 4 || (VTK_MAJOR_VERSION == 4 && VTK_MINOR_VERSION > 0)
- InvokeEvent(vtkCommand::ConfigureEvent, NULL);
-#endif
- //this will check for Handle
- //Render();
-}
-//---------------------------------------------------------------------------
-void wxVTKRenderWindowInteractor::OnMotion(wxMouseEvent &event)
-{
- if (!Enabled)
- {
- return;
- }
-#if VTK_MAJOR_VERSION > 4 || (VTK_MAJOR_VERSION == 4 && VTK_MINOR_VERSION > 0)
- SetEventInformationFlipY(event.GetX(), event.GetY(),
- event.ControlDown(), event.ShiftDown(), '\0', 0, NULL);
-
- InvokeEvent(vtkCommand::MouseMoveEvent, NULL);
-#else
- InteractorStyle->OnMouseMove(event.ControlDown(), event.ShiftDown(),
- event.GetX(), Size[1] - event.GetY() - 1);
-#endif
-}
-//---------------------------------------------------------------------------
-#if !(VTK_MAJOR_VERSION == 3 && VTK_MINOR_VERSION == 1)
-void wxVTKRenderWindowInteractor::OnEnter(wxMouseEvent &event)
-{
- if (!Enabled)
- {
- return;
- }
-
-#if VTK_MAJOR_VERSION > 4 || (VTK_MAJOR_VERSION == 4 && VTK_MINOR_VERSION > 0)
- // new style
- SetEventInformationFlipY(event.GetX(), event.GetY(),
- event.ControlDown(), event.ShiftDown(), '\0', 0, NULL);
-
- InvokeEvent(vtkCommand::EnterEvent, NULL);
-#else
- // old style
- InteractorStyle->OnEnter(event.ControlDown(), event.ShiftDown(),
- event.GetX(), Size[1] - event.GetY() - 1);
-#endif
-}
-//---------------------------------------------------------------------------
-void wxVTKRenderWindowInteractor::OnLeave(wxMouseEvent &event)
-{
- if (!Enabled)
- {
- return;
- }
-
-#if VTK_MAJOR_VERSION > 4 || (VTK_MAJOR_VERSION == 4 && VTK_MINOR_VERSION > 0)
- // new style
- SetEventInformationFlipY(event.GetX(), event.GetY(),
- event.ControlDown(), event.ShiftDown(), '\0', 0, NULL);
-
- InvokeEvent(vtkCommand::LeaveEvent, NULL);
-#else
- // old style
- InteractorStyle->OnLeave(event.ControlDown(), event.ShiftDown(),
- event.GetX(), Size[1] - event.GetY() - 1);
-#endif
-}
-//---------------------------------------------------------------------------
-void wxVTKRenderWindowInteractor::OnKeyDown(wxKeyEvent &event)
-{
- if (!Enabled)
- {
- return;
- }
-
-#if VTK_MAJOR_VERSION > 4 || (VTK_MAJOR_VERSION == 4 && VTK_MINOR_VERSION > 0)
- // new style
- int keycode = event.GetKeyCode();
- char key = '\0';
- if (((unsigned int)keycode) < 256)
- {
- // TODO: Unicode in non-Unicode mode ??
- key = (char)keycode;
- }
-
- // we don't get a valid mouse position inside the key event on every platform
- // so we retrieve the mouse position explicitly and pass it along
- wxPoint mousePos = ScreenToClient(wxGetMousePosition());
- SetEventInformationFlipY(mousePos.x, mousePos.y,
- event.ControlDown(), event.ShiftDown(), key, 0, NULL);
- InvokeEvent(vtkCommand::KeyPressEvent, NULL);
-#else
- InteractorStyle->OnKeyDown(event.ControlDown(), event.ShiftDown(),
- event.GetKeyCode(), 1);
-#endif
- event.Skip();
-}
-//---------------------------------------------------------------------------
-void wxVTKRenderWindowInteractor::OnKeyUp(wxKeyEvent &event)
-{
- if (!Enabled)
- {
- return;
- }
-
-#if VTK_MAJOR_VERSION > 4 || (VTK_MAJOR_VERSION == 4 && VTK_MINOR_VERSION > 0)
- // new style
- int keycode = event.GetKeyCode();
- char key = '\0';
- if (((unsigned int)keycode) < 256)
- {
- // TODO: Unicode in non-Unicode mode ??
- key = (char)keycode;
- }
-
- // we don't get a valid mouse position inside the key event on every platform
- // so we retrieve the mouse position explicitly and pass it along
- wxPoint mousePos = ScreenToClient(wxGetMousePosition());
- SetEventInformationFlipY(mousePos.x, mousePos.y,
- event.ControlDown(), event.ShiftDown(), key, 0, NULL);
- InvokeEvent(vtkCommand::KeyReleaseEvent, NULL);
-#else
- InteractorStyle->OnKeyUp(event.ControlDown(), event.ShiftDown(),
- event.GetKeyCode(), 1);
-#endif
- event.Skip();
-}
-#endif //!(VTK_MAJOR_VERSION == 3 && VTK_MINOR_VERSION == 1)
- //---------------------------------------------------------------------------
-void wxVTKRenderWindowInteractor::OnChar(wxKeyEvent &event)
-{
- if (!Enabled)
- {
- return;
- }
-
-#if VTK_MAJOR_VERSION > 4 || (VTK_MAJOR_VERSION == 4 && VTK_MINOR_VERSION > 0)
- // new style
- int keycode = event.GetKeyCode();
- char key = '\0';
- if (((unsigned int)keycode) < 256)
- {
- // TODO: Unicode in non-Unicode mode ??
- key = (char)keycode;
- }
-
- // we don't get a valid mouse position inside the key event on every platform
- // so we retrieve the mouse position explicitly and pass it along
- wxPoint mousePos = ScreenToClient(wxGetMousePosition());
- SetEventInformationFlipY(mousePos.x, mousePos.y,
- event.ControlDown(), event.ShiftDown(), key, 0, NULL);
- InvokeEvent(vtkCommand::CharEvent, NULL);
-#endif
- event.Skip();
-}
-//---------------------------------------------------------------------------
-void wxVTKRenderWindowInteractor::OnButtonDown(wxMouseEvent &event)
-{
- if (!Enabled || (ActiveButton != wxEVT_NULL))
- {
- return;
- }
- ActiveButton = event.GetEventType();
-
- // On Mac (Carbon) and Windows we don't automatically get the focus when
- // you click inside the window
- // we therefore set the focus explicitly
- // Apparently we need that on linux (GTK) too:
- this->SetFocus();
-
-#if VTK_MAJOR_VERSION > 4 || (VTK_MAJOR_VERSION == 4 && VTK_MINOR_VERSION > 0)
- SetEventInformationFlipY(event.GetX(), event.GetY(),
- event.ControlDown(), event.ShiftDown(), '\0', 0, NULL);
-#endif
-
- if(event.RightDown())
- {
-#if VTK_MAJOR_VERSION > 4 || (VTK_MAJOR_VERSION == 4 && VTK_MINOR_VERSION > 0)
- // new style
- InvokeEvent(vtkCommand::RightButtonPressEvent, NULL);
-#else
- // old style
- InteractorStyle->OnRightButtonDown(event.ControlDown(), event.ShiftDown(),
- event.GetX(), Size[1] - event.GetY() - 1);
-#endif
- }
- else if(event.LeftDown())
- {
-#if VTK_MAJOR_VERSION > 4 || (VTK_MAJOR_VERSION == 4 && VTK_MINOR_VERSION > 0)
- // new style
- InvokeEvent(vtkCommand::LeftButtonPressEvent, NULL);
-#else
- // old style
- InteractorStyle->OnLeftButtonDown(event.ControlDown(), event.ShiftDown(),
- event.GetX(), Size[1] - event.GetY() - 1);
-#endif
- }
- else if(event.MiddleDown())
- {
-#if VTK_MAJOR_VERSION > 4 || (VTK_MAJOR_VERSION == 4 && VTK_MINOR_VERSION > 0)
- // new style
- InvokeEvent(vtkCommand::MiddleButtonPressEvent, NULL);
-#else
- // old style
- InteractorStyle->OnMiddleButtonDown(event.ControlDown(), event.ShiftDown(),
- event.GetX(), Size[1] - event.GetY() - 1);
-#endif
- }
- //save the button and capture mouse until the button is released
- //Only if :
- //1. it is possible (WX_USE_X_CAPTURE)
- //2. user decided to.
- if ((ActiveButton != wxEVT_NULL) && WX_USE_X_CAPTURE && UseCaptureMouse)
- {
- CaptureMouse();
- }
-}
-//---------------------------------------------------------------------------
-void wxVTKRenderWindowInteractor::OnButtonUp(wxMouseEvent &event)
-{
- //EVT_xxx_DOWN == EVT_xxx_UP - 1
- //This is only needed if two mouse buttons are pressed at the same time.
- //In wxWindows 2.4 and later: better use of wxMOUSE_BTN_RIGHT or
- //wxEVT_COMMAND_RIGHT_CLICK
- if (!Enabled || (ActiveButton != (event.GetEventType()-1)))
- {
- return;
- }
-
-#if VTK_MAJOR_VERSION > 4 || (VTK_MAJOR_VERSION == 4 && VTK_MINOR_VERSION > 0)
- SetEventInformationFlipY(event.GetX(), event.GetY(),
- event.ControlDown(), event.ShiftDown(), '\0', 0, NULL);
-#endif
-
- if(ActiveButton == wxEVT_RIGHT_DOWN)
- {
-#if VTK_MAJOR_VERSION > 4 || (VTK_MAJOR_VERSION == 4 && VTK_MINOR_VERSION > 0)
- // new style
- InvokeEvent(vtkCommand::RightButtonReleaseEvent, NULL);
-#else
- // old style
- InteractorStyle->OnRightButtonUp(event.ControlDown(), event.ShiftDown(),
- event.GetX(), Size[1] - event.GetY() - 1);
-#endif
- }
- else if(ActiveButton == wxEVT_LEFT_DOWN)
- {
-#if VTK_MAJOR_VERSION > 4 || (VTK_MAJOR_VERSION == 4 && VTK_MINOR_VERSION > 0)
- // new style
- InvokeEvent(vtkCommand::LeftButtonReleaseEvent, NULL);
-#else
- // old style
- InteractorStyle->OnLeftButtonUp(event.ControlDown(), event.ShiftDown(),
- event.GetX(), Size[1] - event.GetY() - 1);
-#endif
- }
- else if(ActiveButton == wxEVT_MIDDLE_DOWN)
- {
-#if VTK_MAJOR_VERSION > 4 || (VTK_MAJOR_VERSION == 4 && VTK_MINOR_VERSION > 0)
- // new style
- InvokeEvent(vtkCommand::MiddleButtonReleaseEvent, NULL);
-#else
- // old style
- InteractorStyle->OnMiddleButtonUp(event.ControlDown(), event.ShiftDown(),
- event.GetX(), Size[1] - event.GetY() - 1);
-#endif
- }
- //if the ActiveButton is realeased, then release mouse capture
- if ((ActiveButton != wxEVT_NULL) && WX_USE_X_CAPTURE && UseCaptureMouse)
- {
- ReleaseMouse();
- }
- ActiveButton = wxEVT_NULL;
-}
-//---------------------------------------------------------------------------
-void wxVTKRenderWindowInteractor::OnMouseWheel(wxMouseEvent& event)
-{
-// Mouse wheel was only added after VTK 4.4 (I think...)
-#if VTK_MAJOR_VERSION > 4 || (VTK_MAJOR_VERSION == 4 && VTK_MINOR_VERSION > 2)
- // new style
- //Set vtk event information ... The numebr of wheel rotations is stored in
- //the x varible. y varible is zero
- SetEventInformationFlipY(event.GetWheelRotation() / event.GetWheelDelta(), 0,
- event.ControlDown(), event.ShiftDown(), '\0', 0, NULL);
- if(event.GetWheelRotation() > 0)
- {
- //Send event to VTK
- InvokeEvent(vtkCommand::MouseWheelForwardEvent, NULL);
- }
- else
- {
- //Send event to VTK
- InvokeEvent(vtkCommand::MouseWheelBackwardEvent, NULL);
- }
-#endif
-
-}
-
-//---------------------------------------------------------------------------
-void wxVTKRenderWindowInteractor::Render()
-{
- RenderAllowed = 1;
- if (!RenderWhenDisabled)
- {
- //the user doesn't want us to render when the toplevel frame
- //is disabled - first find the top level parent
- wxWindow *topParent = wxGetTopLevelParent(this);
- if (topParent)
- {
- //if it exists, check whether it's enabled
- //if it's not enabeld, RenderAllowed will be false
- RenderAllowed = topParent->IsEnabled();
- }
- }
-
- if (RenderAllowed)
- {
- if(Handle && (Handle == GetHandleHack()) )
- {
- RenderWindow->Render();
- }
-#if VTK_MAJOR_VERSION > 4 || (VTK_MAJOR_VERSION == 4 && VTK_MINOR_VERSION > 2)
- else if(GetHandleHack())
- {
- //this means the user has reparented us; let's adapt to the
- //new situation by doing the WindowRemap dance
- //store the new situation
- Handle = GetHandleHack();
- RenderWindow->SetNextWindowId(reinterpret_cast<void *>(Handle));
- RenderWindow->WindowRemap();
- RenderWindow->Render();
- }
-#endif
- }
-}
-//---------------------------------------------------------------------------
-void wxVTKRenderWindowInteractor::SetRenderWhenDisabled(int newValue)
-{
- //Change value of __RenderWhenDisabled ivar.
- //If __RenderWhenDisabled is false (the default), this widget will not
- //call Render() on the RenderWindow if the top level frame (i.e. the
- //containing frame) has been disabled.
-
- //This prevents recursive rendering during wxSafeYield() calls.
- //wxSafeYield() can be called during the ProgressMethod() callback of
- //a VTK object to have progress bars and other GUI elements updated -
- //it does this by disabling all windows (disallowing user-input to
- //prevent re-entrancy of code) and then handling all outstanding
- //GUI events.
-
- //However, this often triggers an OnPaint() method for wxVTKRWIs,
- //resulting in a Render(), resulting in Update() being called whilst
- //still in progress.
-
- RenderWhenDisabled = (bool)newValue;
-}
-//---------------------------------------------------------------------------
-//
-// Set the variable that indicates that we want a stereo capable window
-// be created. This method can only be called before a window is realized.
-//
-void wxVTKRenderWindowInteractor::SetStereo(int capable)
-{
- if (Stereo != capable)
- {
- Stereo = capable;
- RenderWindow->StereoCapableWindowOn();
- RenderWindow->SetStereoTypeToCrystalEyes();
- Modified();
- }
-}
-
-//---------------------------------------------------------------------------
-//
-//
-void wxVTKRenderWindowInteractor::PrintSelf(ostream& os, vtkIndent indent)
-{
- this->Superclass::PrintSelf(os, indent);
-}
-
+++ /dev/null
-/*# ---------------------------------------------------------------------
-#
-# Copyright (c) CREATIS (Centre de Recherche en Acquisition et Traitement de l'Image
-# pour la Sant�)
-# Authors : Eduardo Davila, Frederic Cervenansky, Claire Mouton
-# Previous Authors : Laurent Guigues, Jean-Pierre Roux
-# CreaTools website : www.creatis.insa-lyon.fr/site/fr/creatools_accueil
-#
-# This software is governed by the CeCILL-B license under French law and
-# abiding by the rules of distribution of free software. You can use,
-# modify and/ or redistribute the software under the terms of the CeCILL-B
-# license as circulated by CEA, CNRS and INRIA at the following URL
-# http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.html
-# or in the file LICENSE.txt.
-#
-# As a counterpart to the access to the source code and rights to copy,
-# modify and redistribute granted by the license, users are provided only
-# with a limited warranty and the software's author, the holder of the
-# economic rights, and the successive licensors have only limited
-# liability.
-#
-# The fact that you are presently reading this means that you have had
-# knowledge of the CeCILL-B license and that you accept its terms.
-# ------------------------------------------------------------------------ */
-
-/*=========================================================================
-
- Program: Visualization Toolkit
- Module: $RCSfile: wxVTKRenderWindowInteractor.h,v $
- Language: C++
- Date: $Date: 2012/11/15 14:14:35 $
- Version: $Revision: 1.5 $
-
- Copyright (c) 1993-2002 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.
-
-=========================================================================*/
-
-// .NAME wxVTKRenderWindowInteractor - class to enable VTK to render to
-// and interact with wxWindow.
-// .SECTION Description
-// wxVTKRenderWindowInteractor provide a VTK widget for wxWindow. This class
-// was completely rewrote to have the 'Look & Feel' of the python version:
-// wxVTKRenderWindowInteractor.py
-// .SECTION Caveats
-// - There is a know bug that prevent this class to works for more info see
-// WX_USE_X_CAPTURE. This bug only affect wxGTK from 2.3.2 to wxGTK 2.4.0.
-// - Furthermore this class is tempated over either wxWindows or wxGLCanvas,
-// in wxWindows 2.3.1 and earlier, the wxGLCanvas had scroll bars, you can avoid
-// this effect by playing with WX_BASE_CLASS at your risk (you might end up with
-// lot of flickering.)
-// - This class might not be easily readable as it tried to work with VTK 3.2
-// and 4.x. This class doesn't support reparenting with VTK 4.2 and earlier.
-// .SECTION see also
-// wxVTKRenderWindowInteractor.py wxVTKRenderWindow.py
-
-#ifndef _wxVTKRenderWindowInteractor_h_
-#define _wxVTKRenderWindowInteractor_h_
-
-// For compilers that support precompilation, includes "wx/wx.h".
-#include "wx/wxprec.h"
-
-#ifdef __BORLANDC__
-# pragma hdrstop
-#endif
-
-#ifndef WX_PRECOMP
-#include <wx/wx.h>
-#endif
-
-#include <wx/timer.h>
-#include <wx/dcclient.h>
-
-// vtk includes
-#include "vtkRenderWindowInteractor.h"
-#include "vtkRenderWindow.h"
-
-// Apparently since wxGTK 2.8.0 one can finally use wxWindow (just as in any
-// other port):
-// MM: tested on 2008/04/08: experienced some heavy flickering with wx-widget 2.6.0
-// using a wxWindow instead of wxGLCanvas fixed the symptoms
-//#if (!wxCHECK_VERSION(2, 6, 0))
-#if (!wxCHECK_VERSION(2, 8, 0))
-#define USE_WXGLCANVAS
-#endif
-
-#if defined(__WXGTK__) && defined(USE_WXGLCANVAS)
-# if wxUSE_GLCANVAS
-# include <wx/glcanvas.h>
-# else
-# error "problem of wxGLCanvas, you need to build wxWidgets with opengl"
-# endif //wxUSE_GLCANVAS
-#endif //__WXGTK__
-
-// Motif version (renamed into wxX11 for wxWindow 2.4 and newer)
-#if defined(__WXMOTIF__)
-# error This GUI is not supported by wxVTKRenderWindowInteractor for now
-#endif
-
-// wx forward declarations
-class wxPaintEvent;
-class wxMouseEvent;
-class wxTimerEvent;
-class wxKeyEvent;
-class wxSizeEvent;
-
-#if defined(__WXGTK__) && defined(USE_WXGLCANVAS)
-class wxVTKRenderWindowInteractor : public wxGLCanvas, public vtkRenderWindowInteractor
-#else
-class wxVTKRenderWindowInteractor : public wxWindow, public vtkRenderWindowInteractor
-#endif //__WXGTK__
-{
- DECLARE_DYNAMIC_CLASS(wxVTKRenderWindowInteractor)
-
- public:
- //constructors
- wxVTKRenderWindowInteractor();
-
- wxVTKRenderWindowInteractor(wxWindow *parent,
- wxWindowID id,
- const wxPoint &pos = wxDefaultPosition,
- const wxSize &size = wxDefaultSize,
- long style = wxWANTS_CHARS | wxNO_FULL_REPAINT_ON_RESIZE,
- const wxString &name = wxPanelNameStr);
- vtkTypeRevisionMacro(wxVTKRenderWindowInteractor,vtkRenderWindowInteractor);
- static wxVTKRenderWindowInteractor * New();
- void PrintSelf(ostream& os, vtkIndent indent);
-
- //destructor
- ~wxVTKRenderWindowInteractor();
-
- // vtkRenderWindowInteractor overrides
- void Initialize();
- void Enable();
- bool Enable(bool enable);
- void Disable();
- void Start();
- void UpdateSize(int x, int y);
- int CreateTimer(int timertype);
- int DestroyTimer();
- void TerminateApp() {};
-
- // event handlers
- void OnPaint(wxPaintEvent &event);
- void OnEraseBackground (wxEraseEvent& event);
- void OnMotion(wxMouseEvent &event);
-
- void OnButtonDown(wxMouseEvent &event);
- void OnButtonUp(wxMouseEvent &event);
-#if !(VTK_MAJOR_VERSION == 3 && VTK_MINOR_VERSION == 1)
- void OnEnter(wxMouseEvent &event);
- void OnLeave(wxMouseEvent &event);
- void OnKeyDown(wxKeyEvent &event);
- void OnKeyUp(wxKeyEvent &event);
- void OnChar(wxKeyEvent &event);
-#endif
- void OnTimer(wxTimerEvent &event);
- void OnSize(wxSizeEvent &event);
- void OnMouseWheel(wxMouseEvent& event);
-
- void Render();
- void SetRenderWhenDisabled(int newValue);
-
- // Description:
- // Prescribe that the window be created in a stereo-capable mode. This
- // method must be called before the window is realized. Default if off.
- vtkGetMacro(Stereo,int);
- vtkBooleanMacro(Stereo,int);
- virtual void SetStereo(int capable);
-
- // Description:
- // As CaptureMouse could be a problem sometimes on a window box
- // This method allow to set or not the CaptureMouse.
- // This method actually will works only if WX_USE_X_CAPTURE was set to 1
- vtkSetMacro(UseCaptureMouse,int);
- vtkBooleanMacro(UseCaptureMouse,int);
-
- protected:
- wxTimer timer;
- int ActiveButton;
- int RenderAllowed;
- long GetHandleHack();
- int Stereo;
-
- private:
- long Handle;
- bool Created;
- int RenderWhenDisabled;
- int UseCaptureMouse;
-
- DECLARE_EVENT_TABLE()
-};
-
-#endif //_wxVTKRenderWindowInteractor_h_
#define _wxVTKRenderWindowInteractorEditContour_h_
-#include <wxVTKRenderWindowInteractor.h>
+#include <creawxVTKRenderWindowInteractor.h>
#include <vtkCommand.h>
#include <vtkImageData.h>
if (event == vtkCommand::ResetWindowLevelEvent)
{
+
+
+//EED 2017-01-01 Migration VTK7
+#if VTK_MAJOR_VERSION <= 5
this->IV->GetInput()->UpdateInformation();
this->IV->GetInput()->SetUpdateExtent
(this->IV->GetInput()->GetWholeExtent());
this->IV->GetInput()->Update();
+#else
+ //..
+#endif
+
double *range = this->IV->GetInput()->GetScalarRange();
this->IV->SetColorWindow(range[1] - range[0]);
this->IV->SetColorLevel(0.5 * (range[1] + range[0]));
double InitialLevel;
};
-class wxVTKRenderWindowInteractor;
+//class crea::wxVTKRenderWindowInteractor;
class vtkInteractorStyle2DMaracas : public vtkInteractorStyleImage{
public:
-class wxVTKRenderWindowInteractorEditContour : public wxVTKRenderWindowInteractor {
+class wxVTKRenderWindowInteractorEditContour : public crea::wxVTKRenderWindowInteractor {
public:
//class wxVtkBaseView;
#include "wxVtkBaseView.h"
-#include "wxVTKRenderWindowInteractor.h"
+#include "creawxVTKRenderWindowInteractor.h"
-class creaMaracasVisu_EXPORT wxVTKRenderWindowInteractorPlus : public wxVTKRenderWindowInteractor
+class creaMaracasVisu_EXPORT wxVTKRenderWindowInteractorPlus : public crea::wxVTKRenderWindowInteractor
{
public:
wxVTKRenderWindowInteractorPlus(wxWindow *parent ,wxVtkBaseView *_wxvtkbaseview);
double spx = 0,spy = 0,spz = 0;
int x1 = 1,x2 = 1,y1 = 1,y2 = 1,z1 = 1,z2 = 1;
wxVtkBaseView::Configure();
- wxVTKRenderWindowInteractor *iren = GetWxVTKRenderWindowInteractor();
+ crea::wxVTKRenderWindowInteractor *iren = GetWxVTKRenderWindowInteractor();
vtkImageData *imageData = GetVtkBaseData()->GetImageData();
if(imageData)
{
+//EED 2017-01-01 Migration VTK7
+#if VTK_MAJOR_VERSION <= 5
imageData->UpdateInformation();
imageData->SetUpdateExtent( imageData->GetWholeExtent());
imageData->Update();
_imageViewer2XYZ->GetVtkImageViewer2()->SetInput(imageData );
+#else
+ _imageViewer2XYZ->GetVtkImageViewer2()->SetInputData(imageData );
+#endif
imageData->GetSpacing (spx,spy,spz);
imageData->GetExtent (x1,x2,y1,y2,z1,z2);
}
void wxVtk2DBaseView::SetImageToVtkViewer(vtkImageData *imageData)
{
int ext[6];
- imageData->Update();
- imageData->GetWholeExtent(ext);
if (_imageViewer2XYZ!=NULL)
{
+//EED 2017-01-01 Migration VTK7
+#if VTK_MAJOR_VERSION <= 5
+ imageData->Update();
+ imageData->GetWholeExtent(ext);
_imageViewer2XYZ->SetExtentDimension( ext[0],ext[1],ext[2],ext[3],ext[4],ext[5] );
_imageViewer2XYZ->GetVtkImageViewer2()->SetInput( imageData );
+#else
+ imageData->GetExtent(ext);
+ _imageViewer2XYZ->SetExtentDimension( ext[0],ext[1],ext[2],ext[3],ext[4],ext[5] );
+ _imageViewer2XYZ->GetVtkImageViewer2()->SetInputData( imageData );
+#endif
} // if _imageViewer2XYZ
GetRenderer()->GetActiveCamera()->SetClippingRange(0.01, 1000000);
if (_imageViewer2XYZ==NULL)
{
_imageViewer2XYZ = new vtkImageViewer2_XYZ();
- wxVTKRenderWindowInteractor *iren = GetWxVTKRenderWindowInteractor();
+ crea::wxVTKRenderWindowInteractor *iren = GetWxVTKRenderWindowInteractor();
_imageViewer2XYZ -> GetVtkImageViewer2()->SetupInteractor ( iren );
//////////////
vtkImageData *imageData = GetVtkBaseData()->GetMarImageData()->GetImageData();
if (imageData!=NULL)
{
+
+//EED 2017-01-01 Migration VTK7
+#if VTK_MAJOR_VERSION <= 5
imageData->UpdateInformation();
imageData->SetUpdateExtent( imageData->GetWholeExtent());
imageData->Update();
+#else
+ //...
+#endif
+
if (okimage==true){
imageData->GetSpacing (spx,spy,spz);
imageData->GetExtent (x1,x2,y1,y2,z1,z2);
camera->SetClippingRange( 0.01 , 1000000 );
camera->ComputeViewPlaneNormal();
- camera->SetParallelScale( spx*(x2-x1)/3.0 );
+
+ double cameraparallelScale=spx*(x2-x1)/3.0;
+ camera->SetParallelScale( cameraparallelScale );
+ GetVtkBaseData()->SetCameraParallelScale( cameraparallelScale );
// text information over the graphic window
if(_vtkIinfoTextImage == NULL){
//EED 24oct2010
//EED 02nov2012
-// vtkImageViewer2 *vtkimageviewer2 = _imageViewer2XYZ->GetVtkImageViewer2();
-
vtkImageMapToWindowLevelColors* imagemaptowindowlevel = _imageViewer2XYZ->GetVtkImageViewer2()->GetWindowLevel();
imagemaptowindowlevel->SetWindow( GetVtkBaseData()->GetColorWindow() );
imagemaptowindowlevel->SetLevel( GetVtkBaseData()->GetColorLevel() );
-
-// EED Borrame
-// vtkimageviewer2->SetColorWindow( GetVtkBaseData()->GetColorWindow() );
-// vtkimageviewer2->SetColorLevel( GetVtkBaseData()->GetColorLevel() );
_imageViewer2XYZ->GetVtkImageViewer2()->GetWindowLevel()->Modified();
}
+//-------------------------------------------------------------------
+void wxVtk2DBaseView::UpdateCameraParallelScale()
+{
+ vtkCamera *camera =_imageViewer2XYZ->GetVtkImageViewer2()->GetRenderer()->GetActiveCamera();
+ camera->SetParallelScale( GetVtkBaseData()->GetCameraParallelScale() );
+}
+
//-------------------------------------------------------------------
void wxVtk2DBaseView::Refresh()
{
imageactor->SetInterpolate( GetVtkBaseData()->GetInterpolate() );
//EED 01nov2012
UpdateColorWindowLevel();
+ UpdateCameraParallelScale();
wxVtkBaseView::Refresh();
}
void wxVtk2DBaseView::SetInteractorStyleImage(vtkInteractorStyleBaseView *interactorstylebaseview)
{
SetInteractorStyleBaseView(interactorstylebaseview);
- wxVTKRenderWindowInteractor *iren = GetWxVTKRenderWindowInteractor();
+ crea::wxVTKRenderWindowInteractor *iren = GetWxVTKRenderWindowInteractor();
interactorstylebaseview->SetInteractor ( iren );
iren->SetInteractorStyle(interactorstylebaseview);
interactorstylebaseview->SetwxVtkBaseView(this);
//EED 01nov2012
void UpdateColorWindowLevel();
+ //EED 05juin2019
+ void UpdateCameraParallelScale();
+
private:
vtkInfoTextImage *_vtkIinfoTextImage;
vtkInfoTextImageInteractor *_vtkIinfoTextImageInteractor;
//wxVtkBaseView::Configure();
_aRenderer = vtkRenderer::New();
_renWin = vtkRenderWindow::New();
+
+ int supportopengl=_renWin->SupportsOpenGL();
+ printf("EED wxVtk3DBaseView::Configure >>>>> vtkRenderWindow SupportsOpenGL %d\n", supportopengl );
+ printf("EED wxVtk3DBaseView::Configure >>>>> vtkRenderWindow IsDirect %d\n", _renWin->IsDirect() );
+ if (supportopengl==0)
+ {
+#if defined(_WIN32)
+ printf(" OpenGL 3 not detected.\n Try to install opengl drivers or use de opengl-mesa version.\n Copy from <ProgramsFiles>\\CreaTools\\crea_TPdlls-4.0.0\\bin\\opengl-mesa\n the file: opengl32.dll\n to <ProgramsFiles>\\CreaTools\\CreaTools-3.0.0\\bin \n");
+#else
+ printf(" OpenGL 3 not detected.\n Try to install opengl drivers or use de opengl-mesa version.\n");
+#endif
+ exit(0);
+ }
+
_renWin->AddRenderer(_aRenderer);
_aRenderer->GradientBackgroundOn();
GetCamera()->Roll(180);
GetCamera()->Yaw(180+30);
GetCamera()->Pitch(-22);
+
}
}
wxVtkBaseView::wxVtkBaseView(wxWindow *parent)
{
_parent = parent;
- _iren = (wxVTKRenderWindowInteractor*)new wxVTKRenderWindowInteractorPlus(_parent,this);
+ _iren = (crea::wxVTKRenderWindowInteractor*)new wxVTKRenderWindowInteractorPlus(_parent,this);
// _iren->UseCaptureMouseOn();
// _iren = new wxVTKRenderWindowInteractor(_parent,-1);
_interactorStyle = NULL;
//_iren=NULL;
}
//-------------------------------------------------------------------
-wxVTKRenderWindowInteractor* wxVtkBaseView::GetWxVTKRenderWindowInteractor() throw (char*)
+crea::wxVTKRenderWindowInteractor* wxVtkBaseView::GetWxVTKRenderWindowInteractor() throw (char*)
{
- if(_iren==NULL){
- throw "wxVtkBaseView::GetWxVTKRenderWindowInteractor() _iren wxVTKRenderWindowInteractorPlus =NULL";
+ if(_iren==NULL)
+ {
+ throw "wxVtkBaseView::GetWxVTKRenderWindowInteractor() _iren cwxVTKRenderWindowInteractorPlus =NULL";
}
return _iren;
}
#include <vector>
#include "marTypes.h"
-#include "wxVTKRenderWindowInteractor.h"
+#include "creawxVTKRenderWindowInteractor.h"
//#include "include/vtkImageViewer2_XYZ.h"
/* JCP 14/05/09
wxVtkBaseView( );
wxVtkBaseView( wxWindow *parent );
virtual ~wxVtkBaseView();
- wxVTKRenderWindowInteractor *GetWxVTKRenderWindowInteractor() throw (char*);
+ crea::wxVTKRenderWindowInteractor *GetWxVTKRenderWindowInteractor() throw (char*);
virtual void Configure();
virtual void Refresh();
virtual void RefreshView();
void SetVtkBaseData(vtkBaseData *vtkbasedata);
private:
- wxWindow *_parent;
- wxVTKRenderWindowInteractor *_iren;
+ wxWindow *_parent;
+ crea::wxVTKRenderWindowInteractor *_iren;
/**
* JCP 04/05/09
- * vtkInteractorStyleImage *_interactorStyle;
+ * vtkInteractorStyleImage *_interactorStyle;
*/
- vtkInteractorStyleImage *_interactorStyle;
+ vtkInteractorStyleImage *_interactorStyle;
// EED Nov 15 2014
- vtkBaseData *_vtkbasedata;
+ vtkBaseData *_vtkbasedata;
protected:
_wxvtk3Dbaseview->Configure();
// Actors are added to the renderer.
- _wxvtk3Dbaseview->GetRenderer()->AddActor( _vtkclipping3Ddataviewer->GetOutlineActor() );
_boxWidgetS1 = vtkBoxWidget::New();
_boxWidgetS1->SetInteractor( _wxvtk3Dbaseview->GetWxVTKRenderWindowInteractor() );
_boxWidgetS1->SetPlaceFactor(1.25);
-
-
vtkStripper *stripper=_vtkclipping3Ddataviewer->GetTissueStripper(0);
vtkPolyData *polydata= stripper->GetOutput();
-
+//EED 2017-01-01 Migration VTK7
+#if VTK_MAJOR_VERSION <= 5
_boxWidgetS1->SetInput( polydata );
+#else
+ stripper->Update();
+ _boxWidgetS1->SetInputData( polydata );
+#endif
//EED 2016-08-19
//_boxWidgetS1->PlaceWidget();
_boxWidgetVolume = vtkBoxWidget::New();
_boxWidgetVolume->SetInteractor( _wxvtk3Dbaseview->GetWxVTKRenderWindowInteractor() );
_boxWidgetVolume->SetPlaceFactor(1.25);
+
+//EED 2017-01-01 Migration VTK7
+#if VTK_MAJOR_VERSION <= 5
_boxWidgetVolume->SetInput( this->GetVtkClipping3DDataViewer()->GetVtkMPRBaseData()->GetImageData() );
+#else
+ _boxWidgetVolume->SetInputData( this->GetVtkClipping3DDataViewer()->GetVtkMPRBaseData()->GetImageData() );
+#endif
+
_boxWidgetVolume->PlaceWidget();
_boxWidgetVolume->AddObserver( vtkCommand::InteractionEvent, _vtkclipping3Ddataviewer->GetObserverV() );
_boxWidgetVolume->HandlesOn ();
_vtkclipping3Ddataviewer->SetRenderer(this->GetWxvtk3Dbaseview()->GetRenderer());
_vtkclipping3Ddataviewer->SetInteractor(this->GetWxvtk3Dbaseview()->GetWxVTKRenderWindowInteractor());
}
+
//-------------------------------------------------------------------
void wxVtkClipping3DView::SetVtkClipping3DDataViewer(vtkClipping3DDataViewer *vtkclipping3Ddataviewer)
{
_color = new wxButton(panel,-1,_T(""));
_visible = new wxCheckBox(panel,-1,_T("Vis"));
- _opacity = new wxSlider(panel,-1,50,0,100, wxDefaultPosition, wxSize(100,40), wxSL_HORIZONTAL | wxSL_LABELS);
+//EED _opacity = new wxSlider(panel,-1,50,0,100, wxDefaultPosition, wxDefaultSize, wxSL_HORIZONTAL | wxSL_LABELS);
+ _opacity = new wxSlider(panel,-1,50,0,100, wxDefaultPosition, wxSize(300,110), wxSL_HORIZONTAL | wxSL_LABELS);
wxStaticText *isoValueTitle = new wxStaticText(panel,-1,_T("isoValue"));
- _isoValue = new wxSlider(panel,-1,2000,110,2000, wxDefaultPosition, wxSize(300,40), wxSL_HORIZONTAL | wxSL_AUTOTICKS | wxSL_LABELS);
+//EED _isoValue = new wxSlider(panel,-1,2000,110,2000, wxDefaultPosition, wxDefaultSize, wxSL_HORIZONTAL | wxSL_AUTOTICKS | wxSL_LABELS);
+ _isoValue = new wxSlider(panel,-1,2000,110,2000, wxDefaultPosition, wxSize(300,110), wxSL_HORIZONTAL | wxSL_AUTOTICKS | wxSL_LABELS);
_wireFrameRep = new wxRadioButton(panel,-1,_T("WireFrame"), wxDefaultPosition, wxDefaultSize, wxRB_GROUP);
_surfaceRep = new wxRadioButton(panel,-1,_T("Surface"));
_isoValue->SetRange( (int)(range[1]*0.1) , (int)(range[1]) );
_isoValue->SetValue( (int)(wxvtkclipping3Dview->GetVtkClipping3DDataViewer()->GetIsovalue(0)) );
+//EED 2017-09-16 Migration wxWidgets 2.8 to 3.0
+#if wxMAJOR_VERSION <= 2
_isoValue->SetTickFreq(25,0);
+#else
+ // ..
+#endif
- _isoValueSpin = new wxSlider(panel , -1,5,1,10,wxDefaultPosition , wxSize(25,45), wxSL_VERTICAL | wxSL_AUTOTICKS |wxSL_LEFT );
+ _isoValueSpin = new wxSlider(panel , -1,5,1,10,wxDefaultPosition , wxDefaultSize, wxSL_VERTICAL | wxSL_AUTOTICKS |wxSL_LEFT );
_isoValueSpin->SetRange(1,8);
_isoValueSpin->SetValue(5);
Connect(_isoValueSpin->GetId() , wxEVT_COMMAND_SLIDER_UPDATED , (wxObjectEventFunction) &wxVtkClipping3DViewCntrlPanel::OnIsoValueSpin );
_wxvtkclipping3Dview->Refresh();
wxCommandEvent newevent1(wxEVT_COMMAND_MENU_SELECTED,12121); // Refresh
+//EED 2017-09-16 Migration wxWidgets 2.8 to 3.0
+#if wxMAJOR_VERSION <= 2
_wxvtkclipping3Dview->GetWxvtk3Dbaseview()->GetWxVTKRenderWindowInteractor()->GetParent()->ProcessEvent(newevent1);
+#else
+ _wxvtkclipping3Dview->GetWxvtk3Dbaseview()->GetWxVTKRenderWindowInteractor()->GetParent()->ProcessWindowEvent(newevent1);
+#endif
- }
+ } // if idTissue
}
//-------------------------------------------------------------------
_wxvtkclipping3Dview->Refresh();
wxCommandEvent newevent1(wxEVT_COMMAND_MENU_SELECTED,12121); // Refresh
+
+//EED 2017-09-16 Migration wxWidgets 2.8 to 3.0
+#if wxMAJOR_VERSION <= 2
_wxvtkclipping3Dview->GetWxvtk3Dbaseview()->GetWxVTKRenderWindowInteractor()->GetParent()->ProcessEvent(newevent1);
+#else
+ _wxvtkclipping3Dview->GetWxvtk3Dbaseview()->GetWxVTKRenderWindowInteractor()->GetParent()->ProcessWindowEvent(newevent1);
+#endif
+
}
//-------------------------------------------------------------------
void wxVtkClipping3DViewCntrlPanel::OnVisibleBoxSurface(wxCommandEvent& event)
float b=dlgColour.GetColourData().GetColour().Blue()/255;
tmpActor->GetProperty()->SetColor( r , g , b );
_color->SetBackgroundColour(dlgColour.GetColourData().GetColour());
-
_wxvtkclipping3Dview->Refresh();
-
wxCommandEvent newevent1(wxEVT_COMMAND_MENU_SELECTED,12121); // Refresh
+//EED 2017-09-16 Migration wxWidgets 2.8 to 3.0
+#if wxMAJOR_VERSION <= 2
_wxvtkclipping3Dview->GetWxvtk3Dbaseview()->GetWxVTKRenderWindowInteractor()->GetParent()->ProcessEvent(newevent1);
- }
- }
+#else
+ _wxvtkclipping3Dview->GetWxvtk3Dbaseview()->GetWxVTKRenderWindowInteractor()->GetParent()->ProcessWindowEvent(newevent1);
+#endif
+ } // if ShowModal
+ } // if idTissue
}
+
//-------------------------------------------------------------------
void wxVtkClipping3DViewCntrlPanel::OnVisibleSurface(wxCommandEvent& event)
{
if (idTissue!=-1)
{
_wxvtkclipping3Dview->VisibleActor(idTissue, _visible->GetValue());
-
_wxvtkclipping3Dview->Refresh();
-
wxCommandEvent newevent1(wxEVT_COMMAND_MENU_SELECTED,12121); // Refresh
+//EED 2017-09-16 Migration wxWidgets 2.8 to 3.0
+#if wxMAJOR_VERSION <= 2
_wxvtkclipping3Dview->GetWxvtk3Dbaseview()->GetWxVTKRenderWindowInteractor()->GetParent()->ProcessEvent(newevent1);
- }
+#else
+ _wxvtkclipping3Dview->GetWxvtk3Dbaseview()->GetWxVTKRenderWindowInteractor()->GetParent()->ProcessWindowEvent(newevent1);
+#endif
+ } // if idTissue
}
//-------------------------------------------------------------------
void wxVtkClipping3DViewCntrlPanel::OnOpacity(wxScrollEvent& event)
tmpActor = _wxvtkclipping3Dview->GetVtkClipping3DDataViewer()->GetTissueActor(idTissue);
float opacity=_opacity->GetValue();
tmpActor->GetProperty()->SetOpacity( opacity/100 );
-
_wxvtkclipping3Dview->Refresh();
-
wxCommandEvent newevent1(wxEVT_COMMAND_MENU_SELECTED,12121); // Refresh
+//EED 2017-09-16 Migration wxWidgets 2.8 to 3.0
+#if wxMAJOR_VERSION <= 2
_wxvtkclipping3Dview->GetWxvtk3Dbaseview()->GetWxVTKRenderWindowInteractor()->GetParent()->ProcessEvent(newevent1);
- }
+#else
+ _wxvtkclipping3Dview->GetWxvtk3Dbaseview()->GetWxVTKRenderWindowInteractor()->GetParent()->ProcessWindowEvent(newevent1);
+#endif
+ } // if idTissue
}
//----------------------------------------------------------------------------
_wxvtkclipping3Dview->Refresh();
wxCommandEvent newevent1(wxEVT_COMMAND_MENU_SELECTED,12121); // Refresh
+
+//EED 2017-09-16 Migration wxWidgets 2.8 to 3.0
+#if wxMAJOR_VERSION <= 2
_wxvtkclipping3Dview->GetWxvtk3Dbaseview()->GetWxVTKRenderWindowInteractor()->GetParent()->ProcessEvent(newevent1);
- }
+#else
+ _wxvtkclipping3Dview->GetWxvtk3Dbaseview()->GetWxVTKRenderWindowInteractor()->GetParent()->ProcessWindowEvent(newevent1);
+#endif
+
+ } // if idTissue
}
//-------------------------------------------------------------------
wxString dirSTL = wxGetHomeDir( ) ;
+//EED 2017-09-16 Migration wxWidgets 2.8 to 3.0
+#if wxMAJOR_VERSION <= 2
wxFileDialog dialog( this, _T("Choose a directory..."), dirSTL , _T(""), _T("*.*"), wxSAVE );
+#else
+ wxFileDialog dialog( this, _T("Choose a directory..."), dirSTL , _T(""), _T("*.*"), wxFD_SAVE );
+#endif
if( dialog.ShowModal( ) == wxID_OK )
{
vtkTriangleFilter *filtro = vtkTriangleFilter::New();
- filtro->SetInput( this->_wxvtkclipping3Dview->GetVtkClipping3DDataViewer()->GetTissueClipper(idTissue)->GetOutput() );
vtkPolyDataConnectivityFilter *pdcf = vtkPolyDataConnectivityFilter::New();
- pdcf->SetInput( filtro->GetOutput() );
vtkClosePolyData *cpd = vtkClosePolyData::New();
+
+
+//EED 2017-01-01 Migration VTK7
+#if VTK_MAJOR_VERSION <= 5
+ filtro->SetInput( this->_wxvtkclipping3Dview->GetVtkClipping3DDataViewer()->GetTissueClipper(idTissue)->GetOutput() );
+ pdcf->SetInput( filtro->GetOutput() );
cpd->SetInput( pdcf->GetOutput() );
+#else
+ filtro->SetInputConnection( this->_wxvtkclipping3Dview->GetVtkClipping3DDataViewer()->GetTissueClipper(idTissue)->GetOutputPort() );
+ pdcf->SetInputConnection( filtro->GetOutputPort() );
+ cpd->SetInputConnection( pdcf->GetOutputPort() );
+#endif
- // 1.2 se escribe a disco el archivo stl de la superficie interna
+ // 1.2 Write the stl file
cpd->Update();
vtkSTLWriter *writer = vtkSTLWriter::New();
+
+//EED 2017-01-01 Migration VTK7
+#if VTK_MAJOR_VERSION <= 5
writer->SetInput( cpd->GetOutput() );
- filename =prefix;
+#else
+ writer->SetInputConnection( cpd->GetOutputPort() );
+#endif
+
writer->SetFileName(filename.c_str());
writer->SetFileTypeToASCII();
writer->Write();
writer->Delete();
-
filtro->Delete();
cpd->Delete();
pdcf->Delete();
//-------------------------------------------------------------------
void wxVtkClipping3DViewCntrlPanel::OnBtnSaveRawVolume(wxCommandEvent& event)
{
+//EED 2017-09-16 Migration wxWidgets 2.8 to 3.0
+#if wxMAJOR_VERSION <= 2
wxFileDialog dialog(this, _T("Choose a file"), _T(""), _T(""), _T("*.maracas"), wxSAVE );
+#else
+ wxFileDialog dialog(this, _T("Choose a file"), _T(""), _T(""), _T("*.maracas"), wxFD_SAVE );
+#endif
if (dialog.ShowModal() == wxID_OK)
{
std::string directory = (const char*) (dialog.GetDirectory().mb_str() );
//_wxvtkclipping3Dview->GetVtkClipping3DDataViewer()->ReadVolumeFunctions();
_wxvtkclipping3Dview->Refresh();
wxCommandEvent newevent1(wxEVT_COMMAND_MENU_SELECTED,12121); // Refresh
+
+//EED 2017-09-16 Migration wxWidgets 2.8 to 3.0
+#if wxMAJOR_VERSION <= 2
_wxvtkclipping3Dview->GetWxvtk3Dbaseview()->GetWxVTKRenderWindowInteractor()->GetParent()->ProcessEvent(newevent1);
+#else
+ _wxvtkclipping3Dview->GetWxvtk3Dbaseview()->GetWxVTKRenderWindowInteractor()->GetParent()->ProcessWindowEvent(newevent1);
+#endif
+
+
/*
volumeMapper->Update();
size=greyctf->size();
for(i=0;i<size;i++)
{
- double grey2=(*greyctf)[i];
- double red =(*rctf)[i];
- double green =(*gctf)[i];
- double blue = (*bctf)[i];
+ double grey2 = (*greyctf)[i];
+ double red = (*rctf)[i];
+ double green = (*gctf)[i];
+ double blue = (*bctf)[i];
ctfun->AddRGBPoint(grey2,red,green,blue);
}
//_wxvtkclipping3Dview->GetVtkClipping3DDataViewer()->ReadVolumeFunctions();
_wxvtkclipping3Dview->Refresh();
wxCommandEvent newevent1(wxEVT_COMMAND_MENU_SELECTED,12121); // Refresh
+//EED 2017-09-16 Migration wxWidgets 2.8 to 3.0
+#if wxMAJOR_VERSION <= 2
_wxvtkclipping3Dview->GetWxvtk3Dbaseview()->GetWxVTKRenderWindowInteractor()->GetParent()->ProcessEvent(newevent1);
+#else
+ _wxvtkclipping3Dview->GetWxvtk3Dbaseview()->GetWxVTKRenderWindowInteractor()->GetParent()->ProcessWindowEvent(newevent1);
+#endif
/*
volumeMapper->Update();
//-------------------------------------------------------------------
void wxVtkClipping3DViewCntrlPanel::OnBtnMeshVTKLoad(wxCommandEvent& event)
{
+//EED 2017-09-16 Migration wxWidgets 2.8 to 3.0
+#if wxMAJOR_VERSION <= 2
wxFileDialog dialog(this, _T("Choose a file"), _T("c:/Maracas_configuration"),_T(""), _T("*.vtk"), wxOPEN);
if (dialog.ShowModal() == wxID_OK)
{
_wxvtkclipping3Dview->Refresh();
wxCommandEvent newevent1(wxEVT_COMMAND_MENU_SELECTED,12121); // Refresh
_wxvtkclipping3Dview->GetWxvtk3Dbaseview()->GetWxVTKRenderWindowInteractor()->GetParent()->ProcessEvent(newevent1);
- }
+ } // if
+#else
+ wxFileDialog dialog(this, _T("Choose a file"), _T("c:/Maracas_configuration"),_T(""), _T("*.vtk"), wxFD_OPEN);
+ if (dialog.ShowModal() == wxID_OK)
+ {
+ _wxvtkclipping3Dview->GetVtkClipping3DDataViewer()->ReadMeshVTK( dialog.GetPath().char_str() );
+ _wxvtkclipping3Dview->Refresh();
+ wxCommandEvent newevent1(wxEVT_COMMAND_MENU_SELECTED,12121); // Refresh
+ _wxvtkclipping3Dview->GetWxvtk3Dbaseview()->GetWxVTKRenderWindowInteractor()->GetParent()->ProcessWindowEvent(newevent1);
+
+ } // if
+#endif
+
}
sizerH2->Add(ckInterpolation, 1, wxALL|wxEXPAND, 0 );
sizerH2->Add(ckShade, 1, wxALL|wxEXPAND, 0 );
-
sizer->Add( sizerH0 , 1, wxALL|wxEXPAND, 2);
sizer->Add( sizerH1 , 1, wxALL|wxEXPAND, 2);
sizer->Add( sizerH2 , 1, wxALL|wxEXPAND, 2);
wxCommandEvent newevent1(wxEVT_COMMAND_MENU_SELECTED,12121); // Refresh
+//EED 2017-09-16 Migration wxWidgets 2.8 to 3.0
+#if wxMAJOR_VERSION <= 2
_wxvtkclipping3Dview->GetWxvtk3Dbaseview()->GetWxVTKRenderWindowInteractor()->GetParent()->ProcessEvent(newevent1);
+#else
+ _wxvtkclipping3Dview->GetWxvtk3Dbaseview()->GetWxVTKRenderWindowInteractor()->GetParent()->ProcessWindowEvent(newevent1);
+#endif
}
//-------------------------------------------------------------------
_wxvtkclipping3Dview->Refresh();
wxCommandEvent newevent1(wxEVT_COMMAND_MENU_SELECTED,12121); // Refresh
+//EED 2017-09-16 Migration wxWidgets 2.8 to 3.0
+#if wxMAJOR_VERSION <= 2
_wxvtkclipping3Dview->GetWxvtk3Dbaseview()->GetWxVTKRenderWindowInteractor()->GetParent()->ProcessEvent(newevent1);
+#else
+ _wxvtkclipping3Dview->GetWxvtk3Dbaseview()->GetWxVTKRenderWindowInteractor()->GetParent()->ProcessWindowEvent(newevent1);
+#endif
}
_wxvtkclipping3Dview->Refresh();
wxCommandEvent newevent1(wxEVT_COMMAND_MENU_SELECTED,12121); // Refresh
+//EED 2017-09-16 Migration wxWidgets 2.8 to 3.0
+#if wxMAJOR_VERSION <= 2
_wxvtkclipping3Dview->GetWxvtk3Dbaseview()->GetWxVTKRenderWindowInteractor()->GetParent()->ProcessEvent(newevent1);
-
+#else
+ _wxvtkclipping3Dview->GetWxvtk3Dbaseview()->GetWxVTKRenderWindowInteractor()->GetParent()->ProcessWindowEvent(newevent1);
+#endif
/*
volumeMapper->Update();
newvol->Update();
//_wxvtkclipping3Dview->GetVtkClipping3DDataViewer()->ReadVolumeFunctions();
wxCommandEvent newevent1(wxEVT_COMMAND_MENU_SELECTED,12121); // Refresh
+//EED 2017-09-16 Migration wxWidgets 2.8 to 3.0
+#if wxMAJOR_VERSION <= 2
_wxvtkclipping3Dview->GetWxvtk3Dbaseview()->GetWxVTKRenderWindowInteractor()->GetParent()->ProcessEvent(newevent1);
-
+#else
+ _wxvtkclipping3Dview->GetWxvtk3Dbaseview()->GetWxVTKRenderWindowInteractor()->GetParent()->ProcessWindowEvent(newevent1);
+#endif
_wxvtkclipping3Dview->Refresh();
/*
hDlg->Destroy();
}
-void wxVtkClipping3DViewVolCntrlPanel::OnRayCastingActive(wxCommandEvent& event){
+void wxVtkClipping3DViewVolCntrlPanel::OnRayCastingActive(wxCommandEvent& event)
+{
//If Ray Casting is active, others options are disabled. Only RayCasting is true
_wxvtkclipping3Dview->SetRayCasting(true);
_wxvtkclipping3Dview->SetMIPActive(false);
-
wxCommandEvent newevent1(wxEVT_COMMAND_MENU_SELECTED,12121); // Refresh
-
+//EED 2017-09-16 Migration wxWidgets 2.8 to 3.0
+#if wxMAJOR_VERSION <= 2
_wxvtkclipping3Dview->GetWxvtk3Dbaseview()->GetWxVTKRenderWindowInteractor()->GetParent()->ProcessEvent(newevent1);
+#else
+ _wxvtkclipping3Dview->GetWxvtk3Dbaseview()->GetWxVTKRenderWindowInteractor()->GetParent()->ProcessWindowEvent(newevent1);
+#endif
_wxvtkclipping3Dview->Refresh();
}
-void wxVtkClipping3DViewVolCntrlPanel::OnMIPActive(wxCommandEvent& event){
+void wxVtkClipping3DViewVolCntrlPanel::OnMIPActive(wxCommandEvent& event)
+{
//If MIP is active, others options are disabled. Only MIP is true
_wxvtkclipping3Dview->SetMIPActive(true);
_wxvtkclipping3Dview->SetRayCasting(false);
-
wxCommandEvent newevent1(wxEVT_COMMAND_MENU_SELECTED,12121); // Refresh
+//EED 2017-09-16 Migration wxWidgets 2.8 to 3.0
+#if wxMAJOR_VERSION <= 2
_wxvtkclipping3Dview->GetWxvtk3Dbaseview()->GetWxVTKRenderWindowInteractor()->GetParent()->ProcessEvent(newevent1);
-
+#else
+ _wxvtkclipping3Dview->GetWxvtk3Dbaseview()->GetWxVTKRenderWindowInteractor()->GetParent()->ProcessWindowEvent(newevent1);
+#endif
_wxvtkclipping3Dview->Refresh();
}
-
-void wxVtkClipping3DViewVolCntrlPanel::OnInterpolationActive(wxCommandEvent& event){
+void wxVtkClipping3DViewVolCntrlPanel::OnInterpolationActive(wxCommandEvent& event)
+{
_wxvtkclipping3Dview->SetInterpolation(event.IsChecked());
-
wxCommandEvent newevent1(wxEVT_COMMAND_MENU_SELECTED,12121); // Refresh
+//EED 2017-09-16 Migration wxWidgets 2.8 to 3.0
+#if wxMAJOR_VERSION <= 2
_wxvtkclipping3Dview->GetWxvtk3Dbaseview()->GetWxVTKRenderWindowInteractor()->GetParent()->ProcessEvent(newevent1);
+#else
+ _wxvtkclipping3Dview->GetWxvtk3Dbaseview()->GetWxVTKRenderWindowInteractor()->GetParent()->ProcessWindowEvent(newevent1);
+#endif
_wxvtkclipping3Dview->Refresh();
}
-void wxVtkClipping3DViewVolCntrlPanel::OnShadeActive(wxCommandEvent& event){
+void wxVtkClipping3DViewVolCntrlPanel::OnShadeActive(wxCommandEvent& event)
+{
_wxvtkclipping3Dview->SetShade(event.IsChecked());
-
wxCommandEvent newevent1(wxEVT_COMMAND_MENU_SELECTED,12121); // Refresh
+//EED 2017-09-16 Migration wxWidgets 2.8 to 3.0
+#if wxMAJOR_VERSION <= 2
_wxvtkclipping3Dview->GetWxvtk3Dbaseview()->GetWxVTKRenderWindowInteractor()->GetParent()->ProcessEvent(newevent1);
+#else
+ _wxvtkclipping3Dview->GetWxvtk3Dbaseview()->GetWxVTKRenderWindowInteractor()->GetParent()->ProcessWindowEvent(newevent1);
+#endif
_wxvtkclipping3Dview->Refresh();
}
//-------------------------------------------------------------------
wxVtkMPR2DView::~wxVtkMPR2DView()
{
- if (_ptsA!=NULL) { _ptsA -> Delete(); }
- if (_lineAActor!=NULL) { _lineAActor -> Delete(); }
- if (_lineAMapper!=NULL) { _lineAMapper -> Delete(); }
- if (_pdA!=NULL) { _pdA -> Delete(); }
- if (_ptsB!=NULL) { _ptsB -> Delete(); }
- if (_lineBActor!=NULL) { _lineBActor -> Delete(); }
- if (_lineBMapper!=NULL) { _lineBMapper -> Delete(); }
- if (_pdB!=NULL) { _pdB -> Delete(); }
+ if (_ptsA!=NULL) { _ptsA->Delete(); }
+ if (_lineAActor!=NULL) { _lineAActor->Delete(); }
+ if (_lineAMapper!=NULL) { _lineAMapper->Delete(); }
+ if (_pdA!=NULL) { _pdA->Delete(); }
+ if (_ptsB!=NULL) { _ptsB->Delete(); }
+ if (_lineBActor!=NULL) { _lineBActor->Delete(); }
+ if (_lineBMapper!=NULL) { _lineBMapper->Delete(); }
+ if (_pdB!=NULL) { _pdB->Delete(); }
}
//-------------------------------------------------------------------
vtkMPRBaseData *wxVtkMPR2DView::GetVtkmprbasedata()
_ptsA->SetPoint(1, 1000 , 1000 , 1000 );
_pdA = vtkPolyData::New();
_lineAMapper = vtkPolyDataMapper::New();
+
+//EED 2017-01-01 Migration VTK7
+#if VTK_MAJOR_VERSION <= 5
_lineAMapper->SetInput(_pdA);
+#else
+ _lineAMapper->SetInputData(_pdA);
+#endif
+
_lineAMapper->ImmediateModeRenderingOn();
_lineAActor->SetMapper(_lineAMapper);
}
_pdB->SetPoints( _ptsB );
_pdB->SetLines( linesB );
linesB->Delete(); //do not delete lines ??
+
+//EED 2017-01-01 Migration VTK7
+#if VTK_MAJOR_VERSION <= 5
_lineBMapper->SetInput(_pdB);
+#else
+ _lineBMapper->SetInputData(_pdB);
+#endif
+
_lineBMapper->ImmediateModeRenderingOn();
if(_imageViewer2XYZ)
{
focalpoint[0] = x;
focalpoint[1] = y;
} // if back
+
+//EED 2017-01-01 Migration VTK7
+#if VTK_MAJOR_VERSION <= 5
+ // ..
+#else
+ _ptsA->Modified();
+ _ptsB->Modified();
+#endif
+
if (fixAxis2D == true)
{
GetRenderer()->GetActiveCamera()->SetPosition(position);
imageactor->SetInterpolate( GetVtkBaseData()->GetInterpolate() );
//EED 01nov2012
UpdateColorWindowLevel();
+//EED 05juin2019
+ UpdateCameraParallelScale();
wxVtkBaseView::Refresh();
}
}
int _backX;
int _backY;
int _backZ;
+
bool _backFixAxis2D;
double _backOpacityAxis;
+
bool _visibleAxis;
int _direction;
vtkPoints *_ptsA;
vtkImageData *imageData = GetVtkMPR3DDataViewer()->GetVtkMPRBaseData()->GetImageData();
_wxvtk3Dbaseview->Configure();
_wxvtkmpr3DviewCntrlPanel->UpdateControlPanel();
-//EED 27 Mai 2009
-// _wxvtk3Dbaseview->GetRenderer()->Clear();
// Actors are added to the renderer.
vtkActor* _outlineActor = _vtkmpr3Ddataviewer->GetOutlineActor();
_wxvtk3Dbaseview->GetRenderer()->AddActor( _outlineActor );
-// _wxvtk3Dbaseview->GetRenderer()->AddActor( _vtkmpr3Ddataviewer->GetImageActor(0) ); // _saggital
-// _wxvtk3Dbaseview->GetRenderer()->AddActor( _vtkmpr3Ddataviewer->GetImageActor(1) ); // _axial
-// _wxvtk3Dbaseview->GetRenderer()->AddActor( _vtkmpr3Ddataviewer->GetImageActor(2) ); // _coronal
- // vtkPointWidget
- //if(_myCallback!=NULL){
- //_myCallback->Delete();
- //}
+
vtkmyPWCallback_3DPointWidget *_myCallback = vtkmyPWCallback_3DPointWidget::New();
_myCallback->SetWxVtkMPR3DView(this);
if(imageData){
{
_pointWidget = vtkPointWidget::New();
}
+//EED 2017-01-01 Migration VTK7
+#if VTK_MAJOR_VERSION <= 5
_pointWidget->SetInput( imageData );
+#else
+ _pointWidget->SetInputData( imageData );
+#endif
_myCallback->SetVtkPointWidget(_pointWidget);
_pointWidget->SetInteractor( GetWxvtk3Dbaseview()->GetWxVTKRenderWindowInteractor() );
_pointWidget->AllOff();
{
_planeWidget = vtkPlaneWidget::New();
}
+//EED 2017-01-01 Migration VTK7
+#if VTK_MAJOR_VERSION <= 5
_planeWidget->SetInput( imageData );
+#else
+ _planeWidget->SetInputData( imageData );
+#endif
+
_myCallback->SetVtkPlaneWidget(_planeWidget);
_planeWidget->NormalToXAxisOn();
_planeWidget->SetResolution(50);
int pz=(dim[2]/2);
int dd=20;
_planeWidget->PlaceWidget( px-dd , px+dd , py-dd , py+dd , pz-dd , pz+dd );
- if(_vtkplane==NULL){
- _vtkplane = vtkPolyData::New();
- _probe = vtkProbeFilter::New();
+ if(_vtkplane==NULL)
+ {
+ _vtkplane = vtkPolyData::New();
+ _probe = vtkProbeFilter::New();
+ _contourMapper = vtkPolyDataMapper::New();
+
+//EED 2017-01-01 Migration VTK7
+#if VTK_MAJOR_VERSION <= 5
_probe->SetInput(_vtkplane);
- _contourMapper = vtkPolyDataMapper::New();
_contourMapper->SetInput( _probe->GetPolyDataOutput() );
+#else
+ _myCallback->SetVtkPolyData(_vtkplane);
+ _myCallback->SetVtkProbeFilter(_probe);
+ _planeWidget->GetPolyData(_vtkplane);
+ _probe->SetInputData(_vtkplane);
+ _probe->SetSourceData(imageData);
+// _probe->Update();
+ _contourMapper->SetInputData( _probe->GetPolyDataOutput() );
+#endif
+
_contourPlaneActor = vtkActor::New();
_contourPlaneActor->SetMapper(_contourMapper);
_contourPlaneActor->VisibilityOff();
_wxvtk3Dbaseview->GetRenderer()->AddActor( _contourPlaneActor );
}
_planeWidget->GetPolyData(_vtkplane);
+
+//EED 2017-01-01 Migration VTK7
+#if VTK_MAJOR_VERSION <= 5
_probe->SetSource( imageData );
+#else
+ _probe->SetSourceData( imageData );
+#endif
_contourMapper->SetScalarRange( imageData->GetScalarRange() );
ConfigureFreePlanes();
}
{
vtkImageData *imageData = GetVtkMPR3DDataViewer()->GetVtkMPRBaseData()->GetImageData();
// Orthogonal planes B&W
+//EED 2017-01-01 Migration VTK7
+#if VTK_MAJOR_VERSION <= 5
_planeWidgetX->SetInput( imageData );
_planeWidgetY->SetInput( imageData );
_planeWidgetZ->SetInput( imageData );
// -- Plane widget
_probe->SetSource( imageData );
+#else
+ _planeWidgetX->SetInputData( imageData );
+ _planeWidgetY->SetInputData( imageData );
+ _planeWidgetZ->SetInputData( imageData );
+ // -- Plane widget
+ _probe->SetSourceData( imageData );
+#endif
+
_vtkmpr3Ddataviewer->SetImage();
}
double xSpacing = 0, ySpacing = 0, zSpacing = 0;
if(image)
{
+
+//EED 2017-01-01 Migration VTK7
+#if VTK_MAJOR_VERSION <= 5
planeWidget->SetInput( image );
+#else
+ planeWidget->SetInputData( image );
+#endif
image->GetExtent(xMin, xMax, yMin, yMax, zMin, zMax);
image->GetSpacing(xSpacing, ySpacing, zSpacing);
}
if(_pointWidget)
{
+//EED 2017-01-01 Migration VTK7
+#if VTK_MAJOR_VERSION <= 5
_pointWidget->SetInput( image );
+#else
+ _pointWidget->SetInputData( image );
+#endif
_pointWidget->PlaceWidget();
_pointWidget->SetPosition( x,y,z );
_planeWidget->SetCenter( x,y,z );
_planeWidget->UpdatePlacement();
_planeWidget->GetPolyData(_vtkplane);
+//EED 2017-01-01 Migration VTK7
+#if VTK_MAJOR_VERSION <= 5
+ // ..
+#else
+ _probe->Update();
+#endif
}
if (_wxvtkmpr3DviewCntrlPanel!=NULL)
// step 5 Refresh
_wxvtk3Dbaseview->GetRenderer()->GetRenderWindow()->Render();
- }
+ } // if visible
_vtkmpr3Ddataviewer->SetVisiblePosition(idPosition,visible);
- }
+ } // if visible
}
_pointWidget->On();
} else {
_pointWidget->Off();
- }
- }
+ } // visible
+ } // _pointWidget
}
//-------------------------------------------------------------------
} else {
_planeWidget->Off();
- _contourPlaneActor->VisibilityOff();
- }
- }
+ _contourPlaneActor->VisibilityOff();
+ } // if visible
+ _wxvtk3Dbaseview->GetRenderer()->GetRenderWindow()->Render();
+ } // _planeWidget
}
//CPR: Method added 30 Nov 2009
_wxvtk3Dbaseview->GetRenderer()->AddActor( _outlineActor );
} else {
_wxvtk3Dbaseview->GetRenderer()->RemoveActor( _outlineActor );
- }
+ } // value
}
//-------------------------------------------------------------------
double spc[3];
vtkimagedata->GetSpacing(spc);
+//EED 2017-01-01 Migration VTK7
+#if VTK_MAJOR_VERSION <= 5
vtkimagedata->Update();
+#else
+ // ..
+#endif
double p[3], n[3];
pSource->Update( );
vtkProbeFilter* slices = vtkProbeFilter::New();
+
+//EED 2017-01-01 Migration VTK7
+#if VTK_MAJOR_VERSION <= 5
slices->SetInput( ( vtkDataSet* )pSource->GetOutput( ) );
slices->SetSource( vtkimagedata );
slices->Update( );
pSource->Delete( );
+#else
+ slices->SetInputData( ( vtkDataSet* )pSource->GetOutput( ) );
+ slices->SetSourceData( vtkimagedata );
+#endif
vtkStructuredPoints *stPoints = vtkStructuredPoints::New();
stPoints -> GetPointData( )->SetScalars( slices->GetOutput()->GetPointData()->GetScalars() );
stPoints -> SetDimensions( sizeIma, sizeIma, 1 );
+
+//EED 2017-01-01 Migration VTK7
+#if VTK_MAJOR_VERSION <= 5
stPoints -> SetScalarType( vtkimagedata->GetScalarType() );
stPoints -> SetScalarTypeToShort();
stPoints -> Update();
+#else
+ vtkInformation* info=stPoints->GetInformation();
+ vtkDataObject::SetPointDataActiveScalarInfo(info, VTK_SHORT, 1);
+#endif
+
+
vtkImageChangeInformation *change = vtkImageChangeInformation ::New();
+//EED 2017-01-01 Migration VTK7
+#if VTK_MAJOR_VERSION <= 5
change -> SetInput( stPoints );
+#else
+ change -> SetInputData( stPoints );
+#endif
change -> Update(); //important
double _range[2];
vtkMetaImageWriter *writer = vtkMetaImageWriter::New( );
+//EED 2017-01-01 Migration VTK7
+#if VTK_MAJOR_VERSION <= 5
writer->SetInput( stPoints );
+#else
+ writer->SetInputData( stPoints );
+#endif
writer->SetFileName( "C:/Users/Images/temp_EED/image.mhd" );
writer->SetFileDimensionality( 2 );
writer->Write( );
vtkDataSetMapper *_3DSliceMapper = vtkDataSetMapper::New( );
+
+//EED 2017-01-01 Migration VTK7
+#if VTK_MAJOR_VERSION <= 5
_3DSliceMapper->SetInput(change->GetOutput( ) );
+#else
+ _3DSliceMapper->SetInputData(change->GetOutput( ) );
+#endif
+
_3DSliceMapper->SetLookupTable( _bwlookup );
_3DSliceMapper->SetScalarRange( _range );
_3DSliceMapper->ImmediateModeRenderingOn( );
vtkCutter* sliceCutter = vtkCutter::New();
vtkImageData *vtkimagedata = this->GetVtkMPR3DDataViewer()->GetVtkMPRBaseData()->GetImageData();
+//EED 2017-01-01 Migration VTK7
+#if VTK_MAJOR_VERSION <= 5
sliceCutter->SetInput( vtkimagedata );
+#else
+ sliceCutter->SetInputData( vtkimagedata );
+#endif
sliceCutter->SetCutFunction( slicePlane );
//EED
// vtkLookupTable *lut = BuildHueWeightBaseMap();
vtkPolyDataMapper *slice = vtkPolyDataMapper::New();
- slice->SetInput( sliceCutter->GetOutput() );
+//EED 2017-01-01 Migration VTK7
+#if VTK_MAJOR_VERSION <= 5
+ slice->SetInput( sliceCutter->GetOutput() );
+#else
+ slice->SetInputData( sliceCutter->GetOutput() );
+#endif
double range[2];
// EED
// slice->Update();
// sliceActor->SetMapper( slice );
vtkPolyDataMapper *contourMapper = vtkPolyDataMapper::New();
+
+//EED 2017-01-01 Migration VTK7
+#if VTK_MAJOR_VERSION <= 5
contourMapper->SetInput( sliceCutter->GetOutput() );
+#else
+ contourMapper->SetInputData( sliceCutter->GetOutput() );
+#endif
+
contourMapper->SetScalarRange( range );
// contourMapper->SetLookupTable( lut );
//EED 27/05/2013
// void ResetCamera(int *ext=NULL,double* spc=NULL);
void setColorTransferFunction(vtkColorTransferFunction* colortable);
+
//Free planes
//-------------------------------------------------------------------
void ConfigureFreePlanes();
void SetFreePlanesOrtho();
void SetColorWindow(double colorWindow);
void SetColorLevel(double colorLevel);
+
private:
wxVtk3DBaseView *_wxvtk3Dbaseview;
vtkMPR3DDataViewer *_vtkmpr3Ddataviewer;
vtkPolyDataMapper *_contourMapper;
//Free planes
- vtkImagePlaneWidget *_planeWidgetX;
- vtkImagePlaneWidget *_planeWidgetY;
- vtkImagePlaneWidget *_planeWidgetZ;
+ vtkImagePlaneWidget *_planeWidgetX;
+ vtkImagePlaneWidget *_planeWidgetY;
+ vtkImagePlaneWidget *_planeWidgetZ;
-
protected:
};
//CPR: Modified 30 Nov 2009
/*
wxCheckBox *ckBoxX = new wxCheckBox(panel,-1,_T("X "));
- _positionX = new wxSlider(panel,-1,maxX/2,0,maxX, wxDefaultPosition, wxSize(150,40), wxSL_HORIZONTAL | wxSL_LABELS);
+ _positionX = new wxSlider(panel,-1,maxX/2,0,maxX, wxDefaultPosition, wxDefaultSize, wxSL_HORIZONTAL | wxSL_LABELS);
wxCheckBox *ckBoxY = new wxCheckBox(panel,-1,_T("Y "));
- _positionY = new wxSlider(panel,-1,maxY/2,0,maxY, wxDefaultPosition, wxSize(150,40), wxSL_HORIZONTAL | wxSL_LABELS);
+ _positionY = new wxSlider(panel,-1,maxY/2,0,maxY, wxDefaultPosition, wxDefaultSize, wxSL_HORIZONTAL | wxSL_LABELS);
wxCheckBox *ckBoxZ = new wxCheckBox(panel,-1,_T("Z "));
- _positionZ = new wxSlider(panel,-1,maxZ/2,0,maxZ, wxDefaultPosition, wxSize(150,40), wxSL_HORIZONTAL | wxSL_LABELS);
+ _positionZ = new wxSlider(panel,-1,maxZ/2,0,maxZ, wxDefaultPosition, wxDefaultSize, wxSL_HORIZONTAL | wxSL_LABELS);
wxButton *btnColorTable = new wxButton (panel, -1, _T("Edit Color Table") );
*/
_ckBoxX = new wxCheckBox(panel,-1,_T("X "));
- _positionX = new wxSlider(panel,-1,0,0,1, wxDefaultPosition, wxSize(300,40), wxSL_HORIZONTAL | wxSL_LABELS);
+ _positionX = new wxSlider(panel,-1,0,0,1, wxDefaultPosition, wxDefaultSize, wxSL_HORIZONTAL | wxSL_LABELS);
_ckBoxY = new wxCheckBox(panel,-1,_T("Y "));
- _positionY = new wxSlider(panel,-1,0,0,1, wxDefaultPosition, wxSize(300,40), wxSL_HORIZONTAL | wxSL_LABELS);
+ _positionY = new wxSlider(panel,-1,0,0,1, wxDefaultPosition, wxDefaultSize, wxSL_HORIZONTAL | wxSL_LABELS);
_ckBoxZ = new wxCheckBox(panel,-1,_T("Z "));
- _positionZ = new wxSlider(panel,-1,0,0,1, wxDefaultPosition, wxSize(300,40), wxSL_HORIZONTAL | wxSL_LABELS);
+ _positionZ = new wxSlider(panel,-1,0,0,1, wxDefaultPosition, wxDefaultSize, wxSL_HORIZONTAL | wxSL_LABELS);
_ckBoxXYZ = new wxCheckBox(panel,-1,_T("3D Axis "));
_ckBoxFixAxis2D = new wxCheckBox(panel,-1,_T("2D Fix Axis"));
- _opacityAxis = new wxSlider(panel,-1,50,0,100, wxDefaultPosition, wxSize(100,40), wxSL_HORIZONTAL | wxSL_LABELS);
+ _opacityAxis = new wxSlider(panel,-1,100,0,100, wxDefaultPosition, wxDefaultSize, wxSL_HORIZONTAL | wxSL_LABELS);
_ckBoxPlane = new wxCheckBox(panel,-1,_T("Plane"));
////EED 05Nov2012 _ckBox_BW_Color_Plane = new wxCheckBox(panel,-1,_T("GL/Color"));
// wxBoxSizer *sizerH4 = new wxBoxSizer(wxHORIZONTAL);
//CPR: If-else statements added 30 Nov 2009
+ wxFlexGridSizer *sizerV1;
wxFlexGridSizer *sizerH4;
wxFlexGridSizer *sizerH4a;
wxFlexGridSizer *sizerH5;
{
sizer = new wxFlexGridSizer(4);
sizerH4 = new wxFlexGridSizer(3);
+
sizerH4a = new wxFlexGridSizer(3);
sizerH4->Add( new wxStaticText(panel, -1,_T(" ")) ,1, wxALL|wxEXPAND , 0);
sizerH6->Add( _ckBoxOutline , 1, wxALL|wxEXPAND , 0);
sizerH6->Add( _ckBoxBackGroundBlack , 1, wxALL|wxEXPAND , 0);
-
- sizer->Add( sizerH4 , 1, wxALL|wxGROW, 2);
+ sizer->Add( sizerH4, 1, wxALL|wxGROW, 2);
sizer->Add( sizerH5, 1, wxALL|wxEXPAND,2);
sizer->Add( sizerH6, 1, wxALL|wxEXPAND,2);
-
-
+
} else {
sizer = new wxFlexGridSizer(1);
// sizerH5->Add( ckBoxZ , 1, wxALL|wxEXPAND, 0);
- panel->SetSize(400,50);
+ panel->ClearBackground();
+// panel->SetSize(400,50);
+ sizer->FitInside(panel);
panel->SetAutoLayout(true);
panel->SetSizer(sizer);
panel->Layout();
wxCommandEvent newevent1(wxEVT_COMMAND_MENU_SELECTED,12121); // Refresh
try{
+//EED 2017-09-16 Migration wxWidgets 2.8 to 3.0
+#if wxMAJOR_VERSION <= 2
_wxvtkmpr3Dview->GetWxvtk3Dbaseview()->GetWxVTKRenderWindowInteractor()->GetParent()->ProcessEvent(newevent1);
+#else
+ _wxvtkmpr3Dview->GetWxvtk3Dbaseview()->GetWxVTKRenderWindowInteractor()->GetParent()->ProcessWindowEvent(newevent1);
+#endif
}catch(char* e){
std::cout<<e<<std::endl;
}
_wxvtkmpr3Dview->Refresh();
wxCommandEvent newevent1(wxEVT_COMMAND_MENU_SELECTED,12121); // Refresh
+//EED 2017-09-16 Migration wxWidgets 2.8 to 3.0
+#if wxMAJOR_VERSION <= 2
_wxvtkmpr3Dview->GetWxvtk3Dbaseview()->GetWxVTKRenderWindowInteractor()->GetParent()->ProcessEvent(newevent1);
-
+#else
+ _wxvtkmpr3Dview->GetWxvtk3Dbaseview()->GetWxVTKRenderWindowInteractor()->GetParent()->ProcessWindowEvent(newevent1);
+#endif
}
//-------------------------------------------------------------------
void wxVtkMPR3DViewCntrlPanel::OnVisibleAxisZ(wxCommandEvent& event)
{
_wxvtkmpr3Dview->VisibleImageActor(2, event.IsChecked() );
_wxvtkmpr3Dview->Refresh();
-
wxCommandEvent newevent1(wxEVT_COMMAND_MENU_SELECTED,12121); // Refresh
+//EED 2017-09-16 Migration wxWidgets 2.8 to 3.0
+#if wxMAJOR_VERSION <= 2
_wxvtkmpr3Dview->GetWxvtk3Dbaseview()->GetWxVTKRenderWindowInteractor()->GetParent()->ProcessEvent(newevent1);
+#else
+ _wxvtkmpr3Dview->GetWxvtk3Dbaseview()->GetWxVTKRenderWindowInteractor()->GetParent()->ProcessWindowEvent(newevent1);
+#endif
}
//-------------------------------------------------------------------
void wxVtkMPR3DViewCntrlPanel::OnVisiblePlane(wxCommandEvent& event)
{
_wxvtkmpr3Dview->VisiblePlaneWidget(event.IsChecked());
-
}
//-------------------------------------------------------------------
_wxvtkmpr3Dview->RefreshView();
wxCommandEvent newevent1(wxEVT_COMMAND_MENU_SELECTED,12121); // Refresh
+//EED 2017-09-16 Migration wxWidgets 2.8 to 3.0
+#if wxMAJOR_VERSION <= 2
_wxvtkmpr3Dview->GetWxvtk3Dbaseview()->GetWxVTKRenderWindowInteractor()->GetParent()->ProcessEvent(newevent1);
+#else
+ _wxvtkmpr3Dview->GetWxvtk3Dbaseview()->GetWxVTKRenderWindowInteractor()->GetParent()->ProcessWindowEvent(newevent1);
+#endif
}
//-------------------------------------------------------------------
void wxVtkMPR3DViewCntrlPanel::OnPositionY(wxScrollEvent& event)
_wxvtkmpr3Dview->GetVtkMPR3DDataViewer()->GetVtkMPRBaseData()->SetY( _positionY->GetValue() );
_wxvtkmpr3Dview->RefreshView();
wxCommandEvent newevent1(wxEVT_COMMAND_MENU_SELECTED,12121); // Refresh
+//EED 2017-09-16 Migration wxWidgets 2.8 to 3.0
+#if wxMAJOR_VERSION <= 2
_wxvtkmpr3Dview->GetWxvtk3Dbaseview()->GetWxVTKRenderWindowInteractor()->GetParent()->ProcessEvent(newevent1);
+#else
+ _wxvtkmpr3Dview->GetWxvtk3Dbaseview()->GetWxVTKRenderWindowInteractor()->GetParent()->ProcessWindowEvent(newevent1);
+#endif
}
//-------------------------------------------------------------------
void wxVtkMPR3DViewCntrlPanel::OnPositionZ(wxScrollEvent& event)
_wxvtkmpr3Dview->GetVtkMPR3DDataViewer()->GetVtkMPRBaseData()->SetZ( _positionZ->GetValue() );
_wxvtkmpr3Dview->RefreshView();
wxCommandEvent newevent1(wxEVT_COMMAND_MENU_SELECTED,12121); // Refresh
+//EED 2017-09-16 Migration wxWidgets 2.8 to 3.0
+#if wxMAJOR_VERSION <= 2
_wxvtkmpr3Dview->GetWxvtk3Dbaseview()->GetWxVTKRenderWindowInteractor()->GetParent()->ProcessEvent(newevent1);
+#else
+ _wxvtkmpr3Dview->GetWxvtk3Dbaseview()->GetWxVTKRenderWindowInteractor()->GetParent()->ProcessWindowEvent(newevent1);
+#endif
}
_wxvtkmpr3Dview->Refresh();
wxCommandEvent newevent1(wxEVT_COMMAND_MENU_SELECTED,12121); // Refresh
+//EED 2017-09-16 Migration wxWidgets 2.8 to 3.0
+#if wxMAJOR_VERSION <= 2
_wxvtkmpr3Dview->GetWxvtk3Dbaseview()->GetWxVTKRenderWindowInteractor()->GetParent()->ProcessEvent(newevent1);
+#else
+ _wxvtkmpr3Dview->GetWxvtk3Dbaseview()->GetWxVTKRenderWindowInteractor()->GetParent()->ProcessWindowEvent(newevent1);
+#endif
}
//-------------------------------------------------------------------
_wxvtkmpr3Dview->Refresh();
wxCommandEvent newevent1(wxEVT_COMMAND_MENU_SELECTED,12121); // Refresh
+//EED 2017-09-16 Migration wxWidgets 2.8 to 3.0
+#if wxMAJOR_VERSION <= 2
_wxvtkmpr3Dview->GetWxvtk3Dbaseview()->GetWxVTKRenderWindowInteractor()->GetParent()->ProcessEvent(newevent1);
+#else
+ _wxvtkmpr3Dview->GetWxvtk3Dbaseview()->GetWxVTKRenderWindowInteractor()->GetParent()->ProcessWindowEvent(newevent1);
+#endif
}
//-------------------------------------------------------------------
_wxvtkmpr3Dview->Refresh();
wxCommandEvent newevent1(wxEVT_COMMAND_MENU_SELECTED,12121); // Refresh
+//EED 2017-09-16 Migration wxWidgets 2.8 to 3.0
+#if wxMAJOR_VERSION <= 2
_wxvtkmpr3Dview->GetWxvtk3Dbaseview()->GetWxVTKRenderWindowInteractor()->GetParent()->ProcessEvent(newevent1);
+#else
+ _wxvtkmpr3Dview->GetWxvtk3Dbaseview()->GetWxVTKRenderWindowInteractor()->GetParent()->ProcessWindowEvent(newevent1);
+#endif
}
//-------------------------------------------------------------------
{
_wxvtkmpr3Dview->GetVtkMPR3DDataViewer()->GetVtkMPRBaseData()->SetInterpolate( _ckBoxInterpolate->GetValue() );
_wxvtkmpr3Dview->Refresh();
- wxCommandEvent newevent1(wxEVT_COMMAND_MENU_SELECTED,12121); // Refresh
+ wxCommandEvent newevent1(wxEVT_COMMAND_MENU_SELECTED,12121); // Refresh
+//EED 2017-09-16 Migration wxWidgets 2.8 to 3.0
+#if wxMAJOR_VERSION <= 2
_wxvtkmpr3Dview->GetWxvtk3Dbaseview()->GetWxVTKRenderWindowInteractor()->GetParent()->ProcessEvent(newevent1);
+#else
+ _wxvtkmpr3Dview->GetWxvtk3Dbaseview()->GetWxVTKRenderWindowInteractor()->GetParent()->ProcessWindowEvent(newevent1);
+#endif
}
//-------------------------------------------------------------------
_wxvtkmpr3Dview->GetVtkMPR3DDataViewer()->GetVtkMPRBaseData()->SetFixAxis2D( _ckBoxFixAxis2D->GetValue() );
_wxvtkmpr3Dview->Refresh();
wxCommandEvent newevent1(wxEVT_COMMAND_MENU_SELECTED,12121); // Refresh
+//EED 2017-09-16 Migration wxWidgets 2.8 to 3.0
+#if wxMAJOR_VERSION <= 2
_wxvtkmpr3Dview->GetWxvtk3Dbaseview()->GetWxVTKRenderWindowInteractor()->GetParent()->ProcessEvent(newevent1);
+#else
+ _wxvtkmpr3Dview->GetWxvtk3Dbaseview()->GetWxVTKRenderWindowInteractor()->GetParent()->ProcessWindowEvent(newevent1);
+#endif
}
//-------------------------------------------------------------------
_wxvtkmpr3Dview->GetVtkMPR3DDataViewer()->GetVtkMPRBaseData()->SetOpacityAxis( _opacityAxis->GetValue()/100.0 );
_wxvtkmpr3Dview->Refresh();
wxCommandEvent newevent1(wxEVT_COMMAND_MENU_SELECTED,12121); // Refresh
+//EED 2017-09-16 Migration wxWidgets 2.8 to 3.0
+#if wxMAJOR_VERSION <= 2
_wxvtkmpr3Dview->GetWxvtk3Dbaseview()->GetWxVTKRenderWindowInteractor()->GetParent()->ProcessEvent(newevent1);
+#else
+ _wxvtkmpr3Dview->GetWxvtk3Dbaseview()->GetWxVTKRenderWindowInteractor()->GetParent()->ProcessWindowEvent(newevent1);
+#endif
}
lines->Delete(); //do not delete lines ??
_circle1Actor = vtkActor::New();
_circle1Mapper = vtkPolyDataMapper::New();
+
+//EED 2017-01-01 Migration VTK7
+#if VTK_MAJOR_VERSION <= 5
_circle1Mapper->SetInput(_pdCircle1);
+#else
+ _circle1Mapper->SetInputData(_pdCircle1);
+#endif
_circle1Mapper->ImmediateModeRenderingOn();
_circle1Actor->SetMapper(_circle1Mapper);
_circle1Actor->GetProperty()->BackfaceCullingOn();
lines->Delete(); //do not delete lines ??
_circle2Actor = vtkActor::New();
_circle2Mapper = vtkPolyDataMapper::New();
+//EED 2017-01-01 Migration VTK7
+#if VTK_MAJOR_VERSION <= 5
_circle2Mapper->SetInput(_pdCircle2);
+#else
+ _circle2Mapper->SetInputData(_pdCircle2);
+#endif
_circle2Mapper->ImmediateModeRenderingOn();
_circle2Actor->SetMapper(_circle2Mapper);
_circle2Actor->GetProperty()->BackfaceCullingOn();
lines->Delete(); //do not delete lines ??
_lineRef1Actor = vtkActor::New();
_lineRef1Mapper = vtkPolyDataMapper::New();
+
+//EED 2017-01-01 Migration VTK7
+#if VTK_MAJOR_VERSION <= 5
_lineRef1Mapper->SetInput(_pdLineRef1);
+#else
+ _lineRef1Mapper->SetInputData(_pdLineRef1);
+#endif
+
_lineRef1Mapper->ImmediateModeRenderingOn();
_lineRef1Actor->SetMapper(_lineRef1Mapper);
_lineRef1Actor->GetProperty()->BackfaceCullingOn();
lines->Delete(); //do not delete lines ??
_lineRef2Actor = vtkActor::New();
_lineRef2Mapper = vtkPolyDataMapper::New();
+
+//EED 2017-01-01 Migration VTK7
+#if VTK_MAJOR_VERSION <= 5
_lineRef2Mapper->SetInput(_pdLineRef2);
+#else
+ _lineRef2Mapper->SetInputData(_pdLineRef2);
+#endif
+
_lineRef2Mapper->ImmediateModeRenderingOn();
_lineRef2Actor->SetMapper(_lineRef2Mapper);
_lineRef2Actor->GetProperty()->BackfaceCullingOn();
:PlanesOperations(){
_vtkarrow = vtkArrowSource::New();
_arrowMapper = vtkPolyDataMapper::New();
- _arrowActor = vtkActor::New();
+ _arrowActor = vtkActor::New();
_vtkarrow->SetTipResolution(30);
_vtkarrow->SetShaftResolution( 30 );
+
+//EED 2017-01-01 Migration VTK7
+#if VTK_MAJOR_VERSION <= 5
_arrowMapper->SetInput( _vtkarrow->GetOutput() );
+#else
+ _arrowMapper->SetInputData( _vtkarrow->GetOutput() );
+#endif
+
_arrowActor->SetMapper(_arrowMapper);
- _radio = radio;
- _colour = colour;
- _opacity = opacity;
-
- p0 = new double[3];
- p0[0] = 0;
- p0[1] = 0;
- p0[2] = 0;
- p1 = new double[3];
- p1[0] = 0;
- p1[1] = 0;
- p1[2] = 0;
- p2 = new double[3];
- p2[0] = 1;
- p2[1] = 1;
- p2[2] = 1;
- _dir = new double[3];
- _dir[0] = 0;
- _dir[1] = 0;
- _dir[2] = 0;
+ _radio = radio;
+ _colour = colour;
+ _opacity = opacity;
+
+ p0 = new double[3];
+ p0[0] = 0;
+ p0[1] = 0;
+ p0[2] = 0;
+ p1 = new double[3];
+ p1[0] = 0;
+ p1[1] = 0;
+ p1[2] = 0;
+ p2 = new double[3];
+ p2[0] = 1;
+ p2[1] = 1;
+ p2[2] = 1;
+ _dir = new double[3];
+ _dir[0] = 0;
+ _dir[1] = 0;
+ _dir[2] = 0;
}
void marRAW2Files::FlipY(vtkImageData *imagedata)
{
vtkImageData *vtkimagedata = imagedata;
+//EED 2017-01-01 Migration VTK7
+#if VTK_MAJOR_VERSION <= 5
vtkimagedata->Update();
+#else
+ //...
+#endif
int dim[3];
vtkimagedata->GetDimensions(dim);
unsigned short tmp;
}
}
}
+//EED 2017-01-01 Migration VTK7
+#if VTK_MAJOR_VERSION <= 5
vtkimagedata->Update();
+#else
+ vtkimagedata->Modified();
+#endif
}
// -------------------------------------------------------------------------
// Crop
vtkExtractVOI *crop = vtkExtractVOI::New();
+
+//EED 2017-01-01 Migration VTK7
+#if VTK_MAJOR_VERSION <= 5
crop->SetInput( imagedata );
+#else
+ crop->SetInputData( imagedata );
+#endif
crop->SetVOI( voi );
crop->Update();
vtkImageChangeInformation* change = vtkImageChangeInformation::New();
+//EED 2017-01-01 Migration VTK7
+#if VTK_MAJOR_VERSION <= 5
change->SetInput( crop->GetOutput() );
+#else
+ change->SetInputData( crop->GetOutput() );
+#endif
// change->SetExtentTranslation( -ext[0], -ext[2], -ext[4] );
std::string nameMW = filename+".mhd";
vtkMetaImageWriter *writer = vtkMetaImageWriter::New( );
+
+//EED 2017-01-01 Migration VTK7
+#if VTK_MAJOR_VERSION <= 5
writer->SetInput( change->GetOutput() );
+#else
+ writer->SetInputData( change->GetOutput() );
+#endif
+
writer->SetFileName( nameMW.c_str() );
writer->SetFileDimensionality( 3 );
writer->Write( );
reset( );
vtkExtractVOI *crop = vtkExtractVOI::New();
+//EED 2017-01-01 Migration VTK7
+#if VTK_MAJOR_VERSION <= 5
crop->SetInput( vol->castVtk( ) );
+#else
+ crop->SetInputData( vol->castVtk( ) );
+#endif
crop->SetVOI( voi );
//crop->SetSampleRate( getParameters( )->getVoxelSize( ), getParameters( )->getVoxelSize( ), getParameters( )->getVoxelSize( ));
// RescalaIntercept = 0;
vtkImageShiftScale *scale = vtkImageShiftScale::New();
+//EED 2017-01-01 Migration VTK7
+#if VTK_MAJOR_VERSION <= 5
scale->SetInput( crop->GetOutput( ) );
+#else
+ scale->SetInputData( crop->GetOutput( ) );
+#endif
scale->SetScale(RescalaSlope);
scale->SetShift(0);
scale->SetOutputScalarTypeToShort();
scale->Update();
vtkImageShiftScale *shift = vtkImageShiftScale::New();
+//EED 2017-01-01 Migration VTK7
+#if VTK_MAJOR_VERSION <= 5
shift->SetInput( scale->GetOutput( ) );
+#else
+ shift->SetInputData( scale->GetOutput( ) );
+#endif
shift->SetScale(1);
shift->SetShift(RescalaIntercept);
shift->SetOutputScalarTypeToShort();
vtkImageThreshold *threshold = vtkImageThreshold::New();
+//EED 2017-01-01 Migration VTK7
+#if VTK_MAJOR_VERSION <= 5
threshold->SetInput( shift->GetOutput( ) );
+#else
+ threshold->SetInputData( shift->GetOutput( ) );
+#endif
threshold->ThresholdByUpper (-10000);
threshold->ThresholdByLower (-1);
threshold->SetInValue(0);
threshold->SetOutputScalarTypeToUnsignedShort();
vtkImageResample* ir = vtkImageResample::New( );
+//EED 2017-01-01 Migration VTK7
+#if VTK_MAJOR_VERSION <= 5
ir->SetInput( threshold->GetOutput( ) );
+#else
+ ir->SetInputData( threshold->GetOutput( ) );
+#endif
ir->SetDimensionality( 3 );
double voxelSize= getParameters( )->getVoxelSize( );
ir->SetAxisOutputSpacing( 0, voxelSize );
* Before we were using kgfoCrop which assume extent start at 0,0,0
*/
vtkImageChangeInformation* change = vtkImageChangeInformation::New();
+//EED 2017-01-01 Migration VTK7
+#if VTK_MAJOR_VERSION <= 5
change->SetInput( ir->GetOutput() );
+#else
+ change->SetInputData( ir->GetOutput() );
+#endif
+
change->SetExtentTranslation( -ext[0], -ext[2], -ext[4] );
change->SetOutputSpacing ( voxelSize , voxelSize , voxelSize );
change->Update(); //important
int i, s;
try
{
+ char tmp[500];
is.read( ( char* )_boolValues, e_bool_cont * sizeof( bool ) );
is.read( ( char* )_intValues, e_int_cont * sizeof( int ) );
is.read( ( char* )_doubleValues, e_double_cont * sizeof( double ) );
{
is.read( ( char* )&s, sizeof( int ) );
_stringValues[ i ].resize( s );
+//EED 2017-09-16 Migration wxWidgets 2.8 to 3.0
+#if wxMAJOR_VERSION <= 2
is.read( ( char* )_stringValues[ i ].c_str( ), s * sizeof( char ) );
+#else
+ is.read( tmp , s * sizeof( char ) );
+ _stringValues[ i ]=wxString(tmp);
+#endif
} // rof
return( true );
}
for( i = 0; i < e_string_cont; i++, j += 2 ) {
ret.Add( wxString( StringParamNames[ i ], wxConvUTF8) );
+//EED 2017-09-16 Migration wxWidgets 2.8 to 3.0
+#if wxMAJOR_VERSION <= 2
ret.Add( wxString( _stringValues[ i ].c_str( ), wxConvUTF8 ) );
+#else
+ ret.Add( wxString( _stringValues[ i ] ) );
+#endif
} // rof
#ifdef KGFO_USE_VTK
- vtkCharArray* carray;
- vtkDoubleArray* darray;
- vtkFloatArray* farray;
- vtkIntArray* iarray;
- vtkShortArray* sarray;
- vtkUnsignedCharArray* ucarray;
- vtkUnsignedIntArray* uiarray;
- vtkUnsignedShortArray* usarray;
+ vtkCharArray *carray;
+ vtkDoubleArray *darray;
+ vtkFloatArray *farray;
+ vtkIntArray *iarray;
+ vtkShortArray *sarray;
+ vtkUnsignedCharArray *ucarray;
+ vtkUnsignedIntArray *uiarray;
+ vtkUnsignedShortArray *usarray;
size = _dims[ CX ] * _dims[ CY ] * _dims[ CZ ];
_vtk->SetDimensions( _dims[ CX ], _dims[ CY ], _dims[ CZ ] );
_vtk->SetSpacing( _sizes[ CX ], _sizes[ CY ], _sizes[ CZ ] );
+ if (_type==CHAR)
+ {
+ carray = vtkCharArray::New( );
+ carray->SetArray( ( char* )( _raw ), size, 1 );
+//EED 2017-01-01 Migration VTK7
+#if VTK_MAJOR_VERSION <= 5
+ carray->SetNumberOfComponents( 1 );
+ _vtk->SetScalarType( VTK_CHAR );
+#else
+ vtkInformation* infoC=_vtk->GetInformation();
+ vtkDataObject::SetPointDataActiveScalarInfo(infoC, VTK_CHAR, 1);
+#endif
+ _vtk->GetPointData( )->SetScalars( carray );
+ carray->Delete( );
+ }
+
+ if (_type==UCHAR)
+ {
+ ucarray = vtkUnsignedCharArray::New( );
+ ucarray->SetArray( ( uint8_t* )( _raw ), size, 1 );
+//EED 2017-01-01 Migration VTK7
+#if VTK_MAJOR_VERSION <= 5
+ ucarray->SetNumberOfComponents( 1 );
+ _vtk->SetScalarType( VTK_UNSIGNED_CHAR );
+#else
+ vtkInformation* infoUC=_vtk->GetInformation();
+ vtkDataObject::SetPointDataActiveScalarInfo(infoUC, VTK_UNSIGNED_CHAR, 1);
+#endif
+ _vtk->GetPointData( )->SetScalars( ucarray );
+ ucarray->Delete( );
+ }
+
+
+
+
+
+ if (_type==SHORT)
+ {
+ sarray = vtkShortArray::New( );
+ sarray->SetArray( ( int16_t* )( _raw ), size, 1 );
+//EED 2017-01-01 Migration VTK7
+#if VTK_MAJOR_VERSION <= 5
+ sarray->SetNumberOfComponents( 1 );
+ _vtk->SetScalarType( VTK_SHORT );
+#else
+ vtkInformation* infoS=_vtk->GetInformation();
+ vtkDataObject::SetPointDataActiveScalarInfo(infoS, VTK_SHORT, 1);
+#endif
+ _vtk->GetPointData( )->SetScalars( sarray );
+ sarray->Delete( );
+}
+
+ if (_type==INT)
+ {
+ iarray = vtkIntArray::New( );
+ iarray->SetArray( ( int32_t* )( _raw ), size, 1 );
+//EED 2017-01-01 Migration VTK7
+#if VTK_MAJOR_VERSION <= 5
+ iarray->SetNumberOfComponents( 1 );
+ _vtk->SetScalarType( VTK_INT );
+#else
+ vtkInformation* infoI=_vtk->GetInformation();
+ vtkDataObject::SetPointDataActiveScalarInfo(infoI, VTK_INT, 1);
+#endif
+ _vtk->GetPointData( )->SetScalars( iarray );
+ iarray->Delete( );
+ }
+
+
+ if (_type==USHORT)
+ {
+ usarray = vtkUnsignedShortArray::New( );
+ usarray->SetArray( ( uint16_t* )( _raw ), size, 1 );
+//EED 2017-01-01 Migration VTK7
+#if VTK_MAJOR_VERSION <= 5
+ usarray->SetNumberOfComponents( 1 );
+ _vtk->SetScalarType( VTK_UNSIGNED_SHORT );
+#else
+ vtkInformation* infoUS=_vtk->GetInformation();
+ vtkDataObject::SetPointDataActiveScalarInfo(infoUS, VTK_UNSIGNED_SHORT, 1);
+#endif
+ _vtk->GetPointData( )->SetScalars( usarray );
+ usarray->Delete( );
+ }
+
+
+ if (_type==UINT)
+ {
+ uiarray = vtkUnsignedIntArray::New( );
+ uiarray->SetArray( ( uint32_t* )( _raw ), size, 1 );
+//EED 2017-01-01 Migration VTK7
+#if VTK_MAJOR_VERSION <= 5
+ uiarray->SetNumberOfComponents( 1 );
+ _vtk->SetScalarType( VTK_UNSIGNED_INT );
+#else
+ vtkInformation* infoUI=_vtk->GetInformation();
+ vtkDataObject::SetPointDataActiveScalarInfo(infoUI, VTK_UNSIGNED_INT, 1);
+#endif
+ _vtk->GetPointData( )->SetScalars( uiarray );
+ uiarray->Delete( );
+ }
+
+
+ if (_type==FLOAT)
+ {
+ farray = vtkFloatArray::New( );
+ farray->SetArray( ( float* )( _raw ), size, 1 );
+//EED 2017-01-01 Migration VTK7
+#if VTK_MAJOR_VERSION <= 5
+ farray->SetNumberOfComponents( 1 );
+ _vtk->SetScalarType( VTK_FLOAT );
+#else
+ vtkInformation* infoF=_vtk->GetInformation();
+ vtkDataObject::SetPointDataActiveScalarInfo(infoF, VTK_FLOAT, 1);
+#endif
+ _vtk->GetPointData( )->SetScalars( farray );
+ farray->Delete( );
+ }
+
+
+ if (_type==DOUBLE)
+ {
+ darray = vtkDoubleArray::New( );
+ darray->SetArray( ( double* )( _raw ), size, 1 );
+//EED 2017-01-01 Migration VTK7
+#if VTK_MAJOR_VERSION <= 5
+ darray->SetNumberOfComponents( 1 );
+ _vtk->SetScalarType( VTK_DOUBLE );
+#else
+ vtkInformation* infoD=_vtk->GetInformation();
+ vtkDataObject::SetPointDataActiveScalarInfo(infoD, VTK_DOUBLE, 1);
+#endif
+
+
+ _vtk->GetPointData( )->SetScalars( darray );
+ darray->Delete( );
+ }
+
+
+
+
+
+
+/*
switch( _type ) {
case CHAR:
carray = vtkCharArray::New( );
- carray->SetNumberOfComponents( 1 );
carray->SetArray( ( char* )( _raw ), size, 1 );
+
+//EED 2017-01-01 Migration VTK7
+//#if VTK_MAJOR_VERSION <= 5
+ carray->SetNumberOfComponents( 1 );
_vtk->SetScalarType( VTK_CHAR );
+#else
+ vtkInformation* infoC=_vtk->GetInformation();
+ vtkDataObject::SetPointDataActiveScalarInfo(infoC, VTK_CHAR, 1);
+#endif
+
_vtk->GetPointData( )->SetScalars( carray );
carray->Delete( );
break;
case UCHAR:
ucarray = vtkUnsignedCharArray::New( );
- ucarray->SetNumberOfComponents( 1 );
ucarray->SetArray( ( uint8_t* )( _raw ), size, 1 );
+//EED 2017-01-01 Migration VTK7
+#if VTK_MAJOR_VERSION <= 5
+ ucarray->SetNumberOfComponents( 1 );
_vtk->SetScalarType( VTK_UNSIGNED_CHAR );
+#else
+ vtkInformation* infoUC=_vtk->GetInformation();
+ vtkDataObject::SetPointDataActiveScalarInfo(infoUC, VTK_UNSIGNED_CHAR, 1);
+#endif
_vtk->GetPointData( )->SetScalars( ucarray );
ucarray->Delete( );
break;
case SHORT:
sarray = vtkShortArray::New( );
- sarray->SetNumberOfComponents( 1 );
sarray->SetArray( ( int16_t* )( _raw ), size, 1 );
+//EED 2017-01-01 Migration VTK7
+#if VTK_MAJOR_VERSION <= 5
+ sarray->SetNumberOfComponents( 1 );
_vtk->SetScalarType( VTK_SHORT );
+#else
+ vtkInformation* infoS=_vtk->GetInformation();
+ vtkDataObject::SetPointDataActiveScalarInfo(infoS, VTK_SHORT, 1);
+#endif
_vtk->GetPointData( )->SetScalars( sarray );
sarray->Delete( );
break;
case INT:
iarray = vtkIntArray::New( );
- iarray->SetNumberOfComponents( 1 );
iarray->SetArray( ( int32_t* )( _raw ), size, 1 );
+//EED 2017-01-01 Migration VTK7
+#if VTK_MAJOR_VERSION <= 5
+ iarray->SetNumberOfComponents( 1 );
_vtk->SetScalarType( VTK_INT );
+#else
+ vtkInformation* infoI=_vtk->GetInformation();
+ vtkDataObject::SetPointDataActiveScalarInfo(infoI, VTK_INT, 1);
+#endif
_vtk->GetPointData( )->SetScalars( iarray );
iarray->Delete( );
break;
case USHORT:
usarray = vtkUnsignedShortArray::New( );
- usarray->SetNumberOfComponents( 1 );
usarray->SetArray( ( uint16_t* )( _raw ), size, 1 );
+//EED 2017-01-01 Migration VTK7
+#if VTK_MAJOR_VERSION <= 5
+ usarray->SetNumberOfComponents( 1 );
_vtk->SetScalarType( VTK_UNSIGNED_SHORT );
+#else
+ vtkInformation* infoUS=_vtk->GetInformation();
+ vtkDataObject::SetPointDataActiveScalarInfo(infoUS, VTK_UNSIGNED_SHORT, 1);
+#endif
_vtk->GetPointData( )->SetScalars( usarray );
usarray->Delete( );
break;
case UINT:
uiarray = vtkUnsignedIntArray::New( );
- uiarray->SetNumberOfComponents( 1 );
uiarray->SetArray( ( uint32_t* )( _raw ), size, 1 );
+//EED 2017-01-01 Migration VTK7
+#if VTK_MAJOR_VERSION <= 5
+ uiarray->SetNumberOfComponents( 1 );
_vtk->SetScalarType( VTK_UNSIGNED_INT );
+#else
+ vtkInformation* infoUI=_vtk->GetInformation();
+ vtkDataObject::SetPointDataActiveScalarInfo(infoUI, VTK_UNSIGNED_INT, 1);
+#endif
_vtk->GetPointData( )->SetScalars( uiarray );
uiarray->Delete( );
break;
case FLOAT:
farray = vtkFloatArray::New( );
- farray->SetNumberOfComponents( 1 );
farray->SetArray( ( float* )( _raw ), size, 1 );
+//EED 2017-01-01 Migration VTK7
+#if VTK_MAJOR_VERSION <= 5
+ farray->SetNumberOfComponents( 1 );
_vtk->SetScalarType( VTK_FLOAT );
+#else
+ vtkInformation* infoF=_vtk->GetInformation();
+ vtkDataObject::SetPointDataActiveScalarInfo(infoF, VTK_FLOAT, 1);
+#endif
_vtk->GetPointData( )->SetScalars( farray );
farray->Delete( );
break;
case DOUBLE:
darray = vtkDoubleArray::New( );
- darray->SetNumberOfComponents( 1 );
darray->SetArray( ( double* )( _raw ), size, 1 );
+//EED 2017-01-01 Migration VTK7
+#if VTK_MAJOR_VERSION <= 5
+ darray->SetNumberOfComponents( 1 );
_vtk->SetScalarType( VTK_DOUBLE );
+#else
+ vtkInformation* infoD=_vtk->GetInformation();
+ vtkDataObject::SetPointDataActiveScalarInfo(infoD, VTK_DOUBLE, 1);
+#endif
+
+
_vtk->GetPointData( )->SetScalars( darray );
darray->Delete( );
break;
} // fswitch
-
+*/
+
} // fi
#endif // KGFO_USE_VTK
// 1. CALCULATING THE INNER SURFACE
// ------------------------------------------------------------------------
vtkImageGaussianSmooth *gaussFilter = vtkImageGaussianSmooth::New();
+//EED 2017-01-01 Migration VTK7
+#if VTK_MAJOR_VERSION <= 5
gaussFilter->SetInput(volume);
+#else
+ gaussFilter->SetInputData(volume);
+#endif
gaussFilter->SetDimensionality(3);
gaussFilter->SetStandardDeviation(sigmaLevel);
vtkMarchingCubes *cubesFilter = vtkMarchingCubes::New();
+//EED 2017-01-01 Migration VTK7
+#if VTK_MAJOR_VERSION <= 5
cubesFilter->SetInput(gaussFilter->GetOutput());
+#else
+ cubesFilter->SetInputData(gaussFilter->GetOutput());
+#endif
cubesFilter->SetValue(0,marchingCubesLevel);
cubesFilter->ComputeGradientsOn ();
cubesFilter->ComputeScalarsOn ();
// Unir puntos duplicados y remover primitivas degeneradas
vtkCleanPolyData *cleanFilter = vtkCleanPolyData::New();
- cleanFilter->SetInput ( cubesFilter->GetOutput() );
+//EED 2017-01-01 Migration VTK7
+#if VTK_MAJOR_VERSION <= 5
+ cleanFilter->SetInput( cubesFilter->GetOutput() );
+#else
+ cleanFilter->SetInputData( cubesFilter->GetOutput() );
+#endif
// crea poligonos triangulares
vtkTriangleFilter *triangleFilter = vtkTriangleFilter::New();
+//EED 2017-01-01 Migration VTK7
+#if VTK_MAJOR_VERSION <= 5
triangleFilter->SetInput( cleanFilter->GetOutput() );
+#else
+ triangleFilter->SetInputData( cleanFilter->GetOutput() );
+#endif
triangleFilter->Update();
innerSurface->DeepCopy(triangleFilter->GetOutput());
// 2. CALCULATING THE OUTER SURFACE
// ------------------------------------------------------------------------
vtkImageContinuousDilate3D *dilateFilter = vtkImageContinuousDilate3D ::New();
- dilateFilter->SetInput (volume);
+//EED 2017-01-01 Migration VTK7
+#if VTK_MAJOR_VERSION <= 5
+ dilateFilter->SetInput(volume);
+#else
+ dilateFilter->SetInputData(volume);
+#endif
dilateFilter->SetKernelSize (3, 3, 3);
+//EED 2017-01-01 Migration VTK7
+#if VTK_MAJOR_VERSION <= 5
gaussFilter->SetInput( dilateFilter->GetOutput());
+#else
+ gaussFilter->SetInputData( dilateFilter->GetOutput());
+#endif
triangleFilter->Update();
outerSurface->DeepCopy(triangleFilter->GetOutput());