From: trillos Date: Fri, 16 Oct 2009 14:33:49 +0000 (+0000) Subject: Recalage 2D script X-Git-Tag: CREATOOLS.2-0-3~42 X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=commitdiff_plain;h=ab4dca2f78f873a313c8ec8a142ec7b6c4c2ded2;p=creaRigidRegistration.git Recalage 2D script --- diff --git a/PackRecalage/bbs/appli/Recalage2D.bbs b/PackRecalage/bbs/appli/Recalage2D.bbs new file mode 100644 index 0000000..45ba02a --- /dev/null +++ b/PackRecalage/bbs/appli/Recalage2D.bbs @@ -0,0 +1,370 @@ +load wx +load std +load vtk +load wxvtk +load creaMaracasVisu + +load PackRecalage + +new FileSelector imageSelector1 + set imageSelector1.Wildcard "*.mhd" +new FileSelector imageSelector2 + set imageSelector2.Wildcard "*.mhd" + +new MetaImageReader image + connect imageSelector1.Out image.In + +new MetaImageReader image2 + connect imageSelector2.Out image2.In + +#Viewer containing image 1 + +new LayoutLine v1Layout +new ViewerNV viewer1 + connect image.Out viewer1.In + set viewer1.nTypeView "0" + connect viewer1.Widget v1Layout.Widget1 + +#Viewer containing image 2 + +new LayoutLine v2Layout +new ViewerNV viewer2 + connect image2.Out viewer2.In + set viewer2.nTypeView "0" + connect viewer2.Widget v2Layout.Widget1 + +#LayoutSplit were the images will be + +new LayoutSplit initialImages + set initialImages.Proportion "50" + set initialImages.Orientation H + connect v1Layout.Widget initialImages.Widget1 + connect v2Layout.Widget initialImages.Widget2 + +#Layout line that will contain the buttons + +new LayoutLine buttonsLayout + set buttonsLayout.Orientation V + +#Slider were the angle will be entered + +new Slider slider + set slider.Title "Angle" + set slider.In 0 + set slider.Min -180 + set slider.Max 180 + set slider.ReactiveOnTrack "1" + connect slider.Widget buttonsLayout.Widget1 + +#Slider were the xScale will be entered + +new Slider sliderX + set sliderX.Title "% Scale in X" + set sliderX.In 100 + set sliderX.Min 10 + set sliderX.Max 500 + set sliderX.ReactiveOnTrack "1" + connect sliderX.Widget buttonsLayout.Widget2 + +#Slider were the yScale will be entered + +new Slider sliderY + set sliderY.Title "% Scale in Y" + set sliderY.In 100 + set sliderY.Min 10 + set sliderY.Max 500 + 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 + connect viewer2.Point transform.CenterPoint + connect slider.Out transform.Angle + connect sliderX.Out transform.ScaleX + connect sliderY.Out transform.ScaleY + +new ReSlicerBox reslice1 + connect viewer1.Point reslice1.Origin + connect transform.Out reslice1.Transform + connect imgslice2.Out reslice1.In + +#Convolution Filter for both of the Images + +new ImageConvolution convol1 + connect imgslice1.Out convol1.In +new ImageConvolution convol2 + connect reslice1.Out convol2.In + +# 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 slider for Convolution Factor + +new Slider sdrF + set sdrF.ReactiveOnTrack 1 + set sdrF.Max "100" + set sdrF.Min "0" + set sdrF.In "50" + set sdrF.Title "Convolution Factor" + + connect sdrF.Out convol1.Factor + connect sdrF.Out convol2.Factor + +#Create CheckBox for Convolution Filter On/Off + +new CheckBox checkF + set checkF.In "True" + + connect checkF.Out convol1.On + connect checkF.Out convol2.On + +new MultipleInputs multF + connect sdrF.BoxChange multF.In1 + connect checkF.BoxChange multF.In2 + + connect multF.BoxChange convol1.BoxExecute + connect multF.BoxChange convol2.BoxExecute + + +#Create Sliders for WinLevel and ColorLevel + +new Slider colorLevel + set colorLevel.Min "0" + set colorLevel.Max "99" + set colorLevel.In "50" + set colorLevel.ReactiveOnTrack true + set colorLevel.Title "Color Level" + +new Slider windowLevel + set windowLevel.Min "0" + set windowLevel.Max "99" + set windowLevel.In "50" + set windowLevel.ReactiveOnTrack true + set windowLevel.Title "Window Level" + +# Connection to viewers + + connect colorLevel.Out viewer1.ColorLevel + connect colorLevel.Out viewer2.ColorLevel + + connect windowLevel.Out viewer1.WindowLevel + connect windowLevel.Out viewer2.WindowLevel + +new MultipleInputs multLevels + connect colorLevel.BoxChange multLevels.In1 + connect windowLevel.BoxChange multLevels.In2 + + connect multLevels.BoxChange viewer1.BoxExecute + connect multLevels.BoxChange viewer2.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 + +////////////////////Checkboard///////////////////////// +# Create the visulization box for checkerBoard +new CheckBoardBox cbb + connect convol1.Out cbb.In1 + connect convol2.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 viewer & layout for Checkerboard +new LayoutSplit checkerBoard +new LayoutLine ly +new ViewerNV viewerCH + set viewerCH.nTypeView "0" + set checkerBoard.Proportion 80 + +#Connecting levels + + connect colorLevel.Out viewerCH.ColorLevel + connect windowLevel.Out viewerCH.WindowLevel + +# Graphical pipeline for CheckBoard + 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 + + connect viewerCH.Widget checkerBoard.Widget1 + connect ly.Widget checkerBoard.Widget2 +/////////////end of Checkboard//////////////////// + + +//////////////Transparency/////////////////////////// +#Image Transparency view + +new TransparencyV2 trans + connect convol1.Out trans.In1 + connect convol2.Out trans.In2 + +new Slider sdrP + set sdrP.Max "100" + set sdrP.Min "0" + set sdrP.In "50" + set sdrP.ReactiveOnTrack true + + connect sdrP.Out trans.Percent + +new ViewerNV transView + connect trans.Out transView.In + set transView.nTypeView "0" + +new LayoutSplit transparency + connect transView.Widget transparency.Widget1 + connect sdrP.Widget transparency.Widget2 + set transparency.Proportion 80 + + connect colorLevel.Out transView.ColorLevel + connect windowLevel.Out transView.WindowLevel +///////////////////end of Transparency//////////////// + + +/////////////////Image Switcher////////////////////// + +new ImageSwitcherBox switch + connect convol1.Out switch.In1 + connect convol2.Out switch.In2 + +new Slider sdrT + set sdrT.Max "1000" + set sdrT.Min "0" + set sdrT.In "500" + +connect sdrT.Out switch.Time + +new Viewer2D viewerSwitch + connect switch.Out viewerSwitch.In + + connect sdrT.BoxChange switch.BoxExecute + connect switch.BoxChange viewerSwitch.BoxExecute + +new LayoutLine switcher + connect viewerSwitch.Widget switcher.Widget1 + connect switch.Widget switcher.Widget2 + connect sdrT.Widget switcher.Widget3 + +//////////////end of Image Switch/////////////////// + +#Multiple inputs for managing the interaction + +new MultipleInputs mult + connect slider.BoxChange mult.In1 + connect sliderX.BoxChange mult.In2 + connect sliderY.BoxChange mult.In3 + connect viewer1.BoxChange mult.In4 + connect viewer2.BoxChange mult.In5 + +new MultipleInputs mult2 + connect multF.BoxChange mult2.In1 + connect mult.BoxChange mult2.In2 + +# Execution pipeline for checkboard + +new MultipleInputs mult3 + connect ly.BoxChange mult3.In1 + connect mult2.BoxChange mult3.In2 + connect imgslice1.BoxChange mult3.In3 + connect imgslice2.BoxChange mult3.In4 + connect multLevels.BoxChange mult3.In5 + + connect mult3.BoxChange cbb.BoxExecute + connect cbb.BoxChange viewerCH.BoxExecute + +#Execution pipeline for Transparency + +new MultipleInputs mult4 + connect mult2.BoxChange mult4.In1 + connect sdrP.BoxChange mult4.In2 + + connect mult4.BoxChange trans.BoxExecute + connect trans.BoxChange transView.BoxExecute + +/////////////////////////////////////////////////////////////// + +#Layout for the tabs + +new LayoutTab tabs + connect checkerBoard.Widget tabs.Widget1 + connect transparency.Widget tabs.Widget2 + connect switcher.Widget tabs.Widget3 + +#Layout where the images and the buttons will be displayed + +new LayoutLine tools + connect sdrZ.Widget tools.Widget1 + connect colorLevel.Widget tools.Widget2 + connect windowLevel.Widget tools.Widget3 + connect saveBut.Widget tools.Widget5 + +new LayoutSplit convolTools + set convolTools.Orientation H + set convolTools.Proportion "80" + connect sdrF.Widget convolTools.Widget1 + connect checkF.Widget convolTools.Widget2 + + connect convolTools.Widget tools.Widget4 + +new LayoutSplit window1 + set window1.WinWidth "600" + set window1.Proportion "80" + set window1.Orientation V + connect initialImages.Widget window1.Widget1 + connect buttonsLayout.Widget window1.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 window2.Widget main.Widget2 + +exec main +