From bd79966de4ad9bd5e2991c37c281ab8d1e49161f Mon Sep 17 00:00:00 2001 From: trillos Date: Wed, 7 Oct 2009 15:43:46 +0000 Subject: [PATCH] Made Recalage for Fabian's demo. --- .../bbs/appli/ViewerMerge2DInteractive.bbs | 278 +++++++++++++++++- .../src/bbPackRecalageTransform2DBox.h | 2 +- 2 files changed, 265 insertions(+), 15 deletions(-) diff --git a/PackRecalage/bbs/appli/ViewerMerge2DInteractive.bbs b/PackRecalage/bbs/appli/ViewerMerge2DInteractive.bbs index 74a6da9..1769742 100644 --- a/PackRecalage/bbs/appli/ViewerMerge2DInteractive.bbs +++ b/PackRecalage/bbs/appli/ViewerMerge2DInteractive.bbs @@ -3,11 +3,20 @@ load std load vtk load wxvtk load creaMaracasVisu +load PackVisuImages +//load creaImageIO load PackRecalage -include vtk/boxes/bbLoadHola -new LoadHola image +//include vtk/boxes/bbLoadHola +//new LoadHola image + +new MetaImageReader image + set image.In "C:\Documents and Settings\trillos\Bureau\Nicolas\Stage\CreaRecalage\PackRecalage\data\ImagesFabienRecalage\adc-j0.mhd" + + +#new Gimmick image +#new Gimmick image2 #Viewer containing image 1 @@ -97,12 +106,175 @@ new Viewer2D viewer2d connect reslice1.Out viewer2d.In set viewer2d.Slice "1" -new ViewerNV viewer3 - connect reslice1.Out viewer3.In - set viewer3.nTypeView "6" - set viewer3.WinWidth "600" +#new ViewerNV viewer3 + #connect reslice1.Out viewer3.In + #set viewer3.nTypeView "5" + #set viewer3.WinWidth "600" + +# Create the reslicers + +new SliceImage imgslice1 +new SliceImage imgslice2 + connect image.Out imgslice1.In + connect reslice1.Out imgslice2.In + +# Create the visulization box +new CheckBoardBox cbb + connect imgslice1.Out cbb.In1 + connect imgslice2.Out cbb.In2 + +# Create the slider1 +new Slider sdr + set sdr.ReactiveOnTrack 1 + set sdr.Max 50 + set sdr.In 14 + +# Create the slider2 +new Slider sdr2 + set sdr2.ReactiveOnTrack 1 + set sdr2.Max 50 + set sdr2.In 14 + +# Create the ZSlider for the slices + +new Slider sdrZ + set sdrZ.ReactiveOnTrack 1 + set sdrZ.Max 50 + set sdrZ.Title "Z for slice" + +connect sdrZ.Out imgslice1.Z +connect sdrZ.Out imgslice2.Z +connect sdrZ.BoxChange imgslice1.BoxExecute +connect sdrZ.BoxChange imgslice2.BoxExecute + +# Create viewer & layout +new LayoutSplit checkerBoard +new LayoutLine ly +new Viewer2D viewerCH + set checkerBoard.Proportion 80 + +# Graphical pipeline + connect sdr.Out cbb.Cols + connect sdr2.Out cbb.Rows + connect cbb.Out viewerCH.In + + #connect sdrZ.Widget ly.Widget1 + connect sdr.Widget ly.Widget2 + connect sdr2.Widget ly.Widget3 + + connect viewerCH.Widget checkerBoard.Widget1 + connect ly.Widget checkerBoard.Widget2 + +# Create Surface View + +new SurfaceCreator surf + set surf.Color1 RED + set surf.Color2 BLUE + + connect imgslice1.Out surf.Image1 + connect imgslice2.Out surf.Image2 + +new Slider sdrSurf1 + set sdrSurf1.Min -500 + set sdrSurf1.Max 500 + set sdrSurf1.In 100 + +new Slider sdrSurf2 + set sdrSurf2.Min -500 + set sdrSurf2.Max 500 + set sdrSurf2.In 300 + + connect sdrSurf1.Out surf.Height1 + connect sdrSurf2.Out surf.Height2 + +# Create Surface Layouts + +new LayoutSplit surface +new LayoutLine lySurf +new Viewer3D viewerSurf + set surface.Proportion 80 + connect sdrSurf1.Widget lySurf.Widget1 + connect sdrSurf2.Widget lySurf.Widget2 + connect viewerSurf.Renderer surf.Renderer + #connect lySurf.BoxChange viewerSurf.BoxExecute + + connect surf.Out1 viewerSurf.In1 + connect surf.Out2 viewerSurf.In2 + + connect viewerSurf.Widget surface.Widget1 + connect lySurf.Widget surface.Widget2 + +#Create Substraction View + +new ImageSubstraction imageSub + connect imgslice1.Out imageSub.In1 + connect imgslice2.Out imageSub.In2 + +new Slider sdrSub1 + set sdrSub1.In 51 + set sdrSub1.Max 255 + set sdrSub1.Min 0 + set sdrSub1.Title "Upper Zero Level" + +new Slider sdrSub2 + set sdrSub2.In 49 + set sdrSub2.Max 255 + set sdrSub2.Min 0 + set sdrSub2.Title "Lower Zero Level" + + connect sdrSub1.Out imageSub.In3 + connect sdrSub2.Out imageSub.In4 + +new ColourSelectorButton colorU +new ColourSelectorButton colorM +new ColourSelectorButton colorL + + set colorU.WinTitle "Upper Level Colour" + set colorM.WinTitle "Middle Level Colour" + set colorL.WinTitle "Lower Level Colour" + + set colorU.In "0" + set colorM.In "50,50,50" + set colorL.In "1" + + connect colorU.Out imageSub.InU + connect colorM.Out imageSub.InM + connect colorL.Out imageSub.InL + +#Create substraction layout + +new Viewer2D subView + connect imageSub.Out subView.In + +new LayoutSplit substraction +new LayoutLine lySub + connect sdrSub1.Widget lySub.Widget1 + connect sdrSub2.Widget lySub.Widget2 +new LayoutLine lySubColor + + set lySubColor.Orientation H + connect colorU.Widget lySubColor.Widget1 + connect colorM.Widget lySubColor.Widget2 + connect colorL.Widget lySubColor.Widget3 + + connect lySubColor.Widget lySub.Widget3 + + set substraction.Proportion "70" + + connect subView.Widget substraction.Widget1 + connect lySub.Widget substraction.Widget2 + +# Create the transparency box +new Transparency tb + connect imgslice1.Out tb.Image1 + connect imgslice2.Out tb.Image2 + +# Create viewer and add actors +new Viewer3D transparency + connect tb.Actor1 transparency.In1 + connect tb.Actor2 transparency.In2 #Multiple inputs for managing the interaction @@ -112,14 +284,68 @@ new MultipleInputs mult connect sliderY.BoxChange mult.In3 connect viewer1.BoxChange mult.In4 connect viewer2.BoxChange mult.In5 - connect mult.BoxChange viewer3.BoxExecute - connect mult.BoxChange viewer2d.BoxExecute + #connect mult.BoxChange viewer3.BoxExecute + #connect mult.BoxChange viewer2d.BoxExecute + + +# Execution pipeline for checkboard + +new MultipleInputs mult2 + connect ly.BoxChange mult2.In1 + connect mult.BoxChange mult2.In2 + connect imgslice1.BoxChange mult2.In3 + connect imgslice2.BoxChange mult2.In4 + +connect mult2.BoxChange cbb.BoxExecute +connect cbb.BoxChange viewerCH.BoxExecute + +# Execution pipeline for Surface + +new MultipleInputs mult3 + connect mult2.BoxChange mult3.In1 + connect sdrSurf1.BoxChange mult3.In2 + connect sdrSurf2.BoxChange mult3.In3 + + connect mult3.BoxChange surf.BoxExecute + connect surf.BoxChange viewerSurf.BoxExecute + +#Execution pipeline for Substraction + +new MultipleInputs mult4 + connect sdrSub1.BoxChange mult4.In1 + connect sdrSub2.BoxChange mult4.In2 + connect mult2.BoxChange mult4.In3 + +new MultipleInputs mult5 + connect mult4.BoxChange mult5.In1 + connect colorU.BoxChange mult5.In2 + connect colorM.BoxChange mult5.In3 + connect colorL.BoxChange mult5.In4 + + connect mult5.BoxChange imageSub.BoxExecute + connect imageSub.BoxChange substraction.BoxExecute + +#Execution pipeline for Transparency + +connect mult2.BoxChange tb.BoxExecute +connect tb.BoxChange transparency.BoxExecute + +# Button for saving + +new CommandButton saveBut + set saveBut.Label "Save Image" + +new FileSelector fileSave + set fileSave.OpenSave "Save" + set fileSave.Wildcard "*.mhd" + +new MetaImageWriter writSave + connect reslice1.Out writSave.In + connect fileSave.Out writSave.Filename + + connect saveBut.BoxChange fileSave.BoxExecute + connect fileSave.BoxChange writSave.BoxExecute -#new CommandButton botonfinal - #set botonfinal.Label "Set Information" - #connect botonfinal.Widget buttonsLayout.Widget4 - #connect botonfinal.BoxChange viewer3.BoxExecute - #Layout were the images and the buttones will be displayed new LayoutSplit window1 @@ -129,11 +355,35 @@ new LayoutSplit window1 connect initialImages.Widget window1.Widget1 connect buttonsLayout.Widget window1.Widget2 +#new LayoutSplit checkBoard + #set window1.WinWidth "600" + #set window1.Proportion "80" + #set window1.Orientation V + #connect viewer3.Widget checkBoard.Widget1 + #connect checkView.Widget checkBoard.Widget1 + +new LayoutTab tabs + connect checkerBoard.Widget tabs.Widget1 + connect surface.Widget tabs.Widget2 + connect substraction.Widget tabs.Widget3 + connect transparency.Widget tabs.Widget4 + +new LayoutLine tools + connect sdrZ.Widget tools.Widget1 + connect saveBut.Widget tools.Widget2 + +new LayoutSplit window2 + connect tabs.Widget window2.Widget1 + connect tools.Widget window2.Widget2 + set window2.Proportion "90" + new LayoutSplit main set main.WinWidth "1200" set main.Proportion "50" set main.Orientation H connect window1.Widget main.Widget1 - connect viewer3.Widget main.Widget2 + connect window2.Widget main.Widget2 +#exec image +#exec image2 exec main \ No newline at end of file diff --git a/PackRecalage/src/bbPackRecalageTransform2DBox.h b/PackRecalage/src/bbPackRecalageTransform2DBox.h index 14d7faa..997ea76 100644 --- a/PackRecalage/src/bbPackRecalageTransform2DBox.h +++ b/PackRecalage/src/bbPackRecalageTransform2DBox.h @@ -5,7 +5,7 @@ #include "iostream" #include "vtkLinearTransform.h" -#include "sourceTransformer.h" +#include "Transformer.h" namespace bbPackRecalage { -- 2.47.1