From 5c1d82df7d12e76cf8c9330a3248be594bab9b27 Mon Sep 17 00:00:00 2001 From: trillos Date: Wed, 18 Nov 2009 09:59:45 +0000 Subject: [PATCH 1/1] Added PlaneReorientation (Muller project) Updated Recalage2D and Recalage3D --- PackRecalage/bbs/appli/ExampleRecalage.bbs | 28 +++-- PackRecalage/bbs/appli/PlaneReorientation.bbs | 119 ++++++++++++++++++ PackRecalage/bbs/appli/Recalage2D.bbs | 37 ++++-- 3 files changed, 163 insertions(+), 21 deletions(-) create mode 100644 PackRecalage/bbs/appli/PlaneReorientation.bbs diff --git a/PackRecalage/bbs/appli/ExampleRecalage.bbs b/PackRecalage/bbs/appli/ExampleRecalage.bbs index 7e5cd3e..463371c 100644 --- a/PackRecalage/bbs/appli/ExampleRecalage.bbs +++ b/PackRecalage/bbs/appli/ExampleRecalage.bbs @@ -1,4 +1,4 @@ -description "Example of posbile Recalage implementation" +description "Example of posible Recalage implementation" author "jn.trillos44@uniandes.edu.co" category "demo" @@ -30,7 +30,7 @@ new MetaImageReader reader2 new ViewerNV viewer connect reader.Out viewer.In - set viewer.nTypeView "5 1 2 0" + set viewer.nTypeView "5" new ShowNPoints showNpoints connect reader.Out showNpoints.Image @@ -43,7 +43,7 @@ new ShowNPoints showNpoints new ViewerNV viewer2 connect reader2.Out viewer2.In - set viewer2.nTypeView "5 1 2 0" + set viewer2.nTypeView "5" new ShowNPoints showNpoints2 connect reader2.Out showNpoints2.Image @@ -71,23 +71,29 @@ new CalculateVectorBox vector1 ////////////////////////////////////////////////// new Transform2DBox transform - connect vector1.Origin transform.CenterPoint - connect vector1.OutAngle transform.Angle - connect vector1.OutScaleX transform.ScaleX - connect vector1.OutScaleY transform.ScaleY - connect vector1.OutScaleZ transform.ScaleZ - connect vector1.TransformAxis transform.Axis + //connect vector1.Origin transform.CenterPoint + + set transform.CenterPoint "0,0,0" + + //connect vector1.OutAngle transform.Angle + //connect vector1.OutScaleX transform.ScaleX + //connect vector1.OutScaleY transform.ScaleY + //connect vector1.OutScaleZ transform.ScaleZ + //connect vector1.TransformAxis transform.Axis //set transform.3D false new ReSlicerBox reslice1 - connect vector1.OriginReslicer reslice1.Origin +// connect vector1.OriginReslicer reslice1.Origin + + set reslice1.Origin "0,0,0" + connect transform.Out reslice1.Transform connect reader2.Out reslice1.In //ViewerNV and ComandButton for the result image new ViewerNV viewer3 - set viewer3.nTypeView "5 1 2 0" + set viewer3.nTypeView "5" connect reslice1.Out viewer3.In new CommandButton butExec diff --git a/PackRecalage/bbs/appli/PlaneReorientation.bbs b/PackRecalage/bbs/appli/PlaneReorientation.bbs new file mode 100644 index 0000000..cfc472d --- /dev/null +++ b/PackRecalage/bbs/appli/PlaneReorientation.bbs @@ -0,0 +1,119 @@ +description "Image Reorientation by choosing a plane" +author "jn.trillos44@uniandes.edu.co" +category "demo" + +load vtk +include wxvtk +load std +load itk +include vtk +include wx +load itkvtk +load creaMaracasVisu +load PackRecalage + +//File Readers + +# Here loads hola.mhd +# ------------------- +/* +include vtk/boxes/bbLoadHola +new LoadHola reader +*/ + +//////////////////////////////////// +/* + For using load file dialog +*/ +/////////////////////////////////// +/* +new FileSelector openFileDialog + set openFileDialog.Wildcard "(*.mhd)|*.mhd" +new MetaImageReader reader + connect openFileDialog.Out reader.In +*/ +//////////////////////////////////// +/* +For using Gimmick +*/ +/////////////////////////////////// + +load creaImageIO +new Gimmick reader + + +//Show NPoints and ViewerNV for choosing the reorientation plane + +new ViewerNV viewer + connect reader.Out viewer.In + set viewer.nTypeView "5 1 2 0" + +new ShowNPoints showNpoints + connect reader.Out showNpoints.Image + connect viewer.Renderer1 showNpoints.Renderer + connect viewer.Point showNpoints.In + connect viewer.BoxChange showNpoints.BoxExecute + set showNpoints.Radio 10 + +//Sliders + +//Reorientation class +new PlaneNormalBox normal + connect showNpoints.lstPointsX normal.InX + connect showNpoints.lstPointsY normal.InY + connect showNpoints.lstPointsZ normal.InZ + connect viewer.Point normal.CenterPoint + +//Reslicer + +new ReSlicerBox reSlicer + connect normal.Out reSlicer.Transform + connect reader.Out reSlicer.In + //set reSlicer.Origin "0,0,0" + connect viewer.Point reSlicer.Origin + set reSlicer.Centered true + set reSlicer.Interpolate true + + connect normal.BoxChange reSlicer.BoxExecute + +//Button for activating the second window + +new CommandButton but + set but.Label "Reorientation" + connect but.BoxChange normal.BoxExecute + +//Second Window + +new ViewerNV viewer2 + connect reSlicer.Out viewer2.In + set viewer2.nTypeView "5 1 2 0" + +new ShowNPoints showNpoints2 + connect reSlicer.Out showNpoints2.Image + connect viewer2.Renderer1 showNpoints2.Renderer + connect viewer2.Point showNpoints2.In + connect viewer2.BoxChange showNpoints2.BoxExecute + set showNpoints.Radio 10 + +//Layouts +new LayoutSplit controls + set controls.Orientation V + set controls.Proportion 80 + connect showNpoints.Widget controls.Widget1 + connect but.Widget controls.Widget2 + +new LayoutSplit windowResult + set windowResult.Orientation H + set windowResult.Proportion 20 + connect showNpoints2.Widget windowResult.Widget1 + connect viewer2.Widget windowResult.Widget2 + + connect reSlicer.BoxChange windowResult.BoxExecute + +new LayoutSplit main + set main.Orientation H + set main.Proportion 20 + connect controls.Widget main.Widget1 + connect viewer.Widget main.Widget2 + +exec main \ No newline at end of file diff --git a/PackRecalage/bbs/appli/Recalage2D.bbs b/PackRecalage/bbs/appli/Recalage2D.bbs index 28ef695..eb4817a 100644 --- a/PackRecalage/bbs/appli/Recalage2D.bbs +++ b/PackRecalage/bbs/appli/Recalage2D.bbs @@ -6,8 +6,14 @@ load creaMaracasVisu load PackRecalage -//include PackRecalage/boxes/checkerView +//include PackRecalage/boxes/checkerView.bbs +//Uncomment the image readers you need + +///////////////////////////////////////////////// +// File Selector +//////////////////////////////////////////////// +/* new FileSelector imageSelector1 set imageSelector1.Wildcard "*.mhd" new FileSelector imageSelector2 @@ -18,6 +24,24 @@ new MetaImageReader image new MetaImageReader image2 connect imageSelector2.Out image2.In +*/ + +/////////////////////////////////////////////// +// Gimmick +////////////////////////////////////////////// + +include creaImageIO + +new Gimmick image +new Gimmick image2 + + +# Create the slicers + +new SliceImage imgslice1 +new SliceImage imgslice2 + connect image.Out imgslice1.In + connect image2.Out imgslice2.In #Viewer containing image 1 @@ -78,13 +102,6 @@ new Slider sliderY set sliderY.ReactiveOnTrack "1" connect sliderY.Widget buttonsLayout.Widget3 -# Create the reslicers - -new SliceImage imgslice1 -new SliceImage imgslice2 - connect image.Out imgslice1.In - connect image2.Out imgslice2.In - #Box were the transformation will be made new Transform2DBox transform @@ -232,7 +249,7 @@ new ViewerNV viewerCH connect sdr.Out cbb.Cols connect sdr2.Out cbb.Rows connect cbb.Out viewerCH.In - + connect sdr.Widget ly.Widget2 connect sdr2.Widget ly.Widget3 @@ -252,7 +269,7 @@ new checkerView checkerboard //////////////Transparency/////////////////////////// #Image Transparency view -new TransparencyV2 trans +new TransparencyBox trans connect convol1.Out trans.In1 connect convol2.Out trans.In2 -- 2.46.2