/3.0 (Extension.1 Name: "Filters" Dependencies: "$AVBIN/avdlog.dll\n$AVEXT/spatial.avx\n" FirstRootClassName: "PMenu" Roots: 2 Roots: 11 Roots: 21 Roots: 22 Roots: 23 Roots: 24 Roots: 25 Roots: 26 Roots: 27 Roots: 28 Roots: 29 Roots: 30 Roots: 31 Roots: 32 Roots: 33 Roots: 34 Roots: 35 Version: 30 About: "A large selection of convolution kernal filters for grids. Requires Spatial Analyst." UnloadScript: 36 InstallScript: 37 UninstallScript: 38 ExtVersion: 1 ) (PMenu.2 Child: 3 Child: 4 Child: 5 Child: 6 Child: 7 Child: 8 Child: 9 Child: 10 Label: "Convolution Filters" ) (Choice.3 Label: "Low Frequency" Click: "filters.LowFreq" Shortcut: "Keys.None" ) (Choice.4 Label: "High Frequency" Click: "filters.HighFreq" Shortcut: "Keys.None" ) (Choice.5 Label: "Emboss" Click: "filters.Emboss" Shortcut: "Keys.None" ) (Choice.6 Label: "Compass Gradient" Click: "filters.Compass" Shortcut: "Keys.None" ) (Choice.7 Label: "Edge Detect" Click: "filters.Edge" Shortcut: "Keys.None" ) (Choice.8 Label: "Laplacian" Click: "filters.Laplacian" Shortcut: "Keys.None" ) (Choice.9 Label: "Lines" Click: "filters.Line" Shortcut: "Keys.None" ) (Choice.10 Label: "Non-Linear Edge Detect" Click: "filters.NonLin" Shortcut: "Keys.None" ) (AVDLog.11 Name: "filter.diagstatus" X: 60 Y: 52 W: 345 H: 192 ConstrainedControlNames: 12 Constraints: 13 Server: 14 ControlPanel: 15 Title: "Status" EscapeEnabled: 1 Resizable: 1 AlwaysOnTop: 1 HasTitleBar: 1 DefaultButton: 20 ) (AVStr.12 S: "close" ) (Numb.13 N: 85.00000000000000 ) (Nil.14 ) (CPanel.15 Child: 16 Child: 17 ResBox: 18 ResBox: 19 Listening: 1 ) (TextBox.16 InternalName: "MsgWindow" Listening: 1 Text: "Filter Connection Open\nProcessing with Edge Detect Diagonal 1 Filter\nProcessing completed successfully.\n" Constraints: 0x55 VerticalScroll: 1 NextControl: 14 ) (LButn.17 InternalName: "close" Help: "Close Status Dialog//Closes the Status Dialog" Label: "Close" Click: "filters.CloseDiag" ) (RectD.18 Left: 11.00000000000000 Top: 151.00000000000000 Right: 338.00000000000000 Bottom: 9.00000000000000 ) (RectD.19 Left: 260.00000000000000 Top: 184.00000000000000 Right: 312.00000000000000 Bottom: 159.00000000000000 ) (Nil.20 ) (Script.21 Name: "filters.clearstatus" SourceCode: "' Name: filters.clearstatus\n'\n' Author: Kenneth R. McVay\n' Date: Fri Sep 18 18:00:00 1998\n' Revised by: \n' Revision Date: \n' Revisions: \n' -------------------------------------------------------------------\n' Description: \n' Requires: \n' Runs: \n' Run by: \n' Self: \n' Returns: \n' -------------------------------------------------------------------\n\nDEBUG = true\nDEBUGNOT = false\n\n\nav.clearworkingstatus" ) (Script.22 Name: "filters.CloseDiag" SourceCode: "' Name: filters.CloseDiag\n'\n' Author: Kenneth R. McVay\n' Date: Fri Sep 18 18:00:19 1998\n' Revised by: \n' Revision Date: \n' Revisions: \n' -------------------------------------------------------------------\n' Description: \n' Requires: \n' Runs: \n' Run by: \n' Self: \n' Returns: \n' -------------------------------------------------------------------\n\nDEBUG = true\nDEBUGNOT = false\n\n\nav.FindDialog(\"filter.diagstatus\").Close" ) (Script.23 Name: "filters.Compass" SourceCode: "' Name: filters.Compass\n'\n' Author: Kenneth R. McVay\n' Date: Fri Sep 18 18:00:34 1998\n' Revised by: \n' Revision Date: \n' Revisions: \n' -------------------------------------------------------------------\n' Description: \n' Requires: \n' Runs: \n' Run by: \n' Self: \n' Returns: \n' -------------------------------------------------------------------\n\nDEBUG = true\nDEBUGNOT = false\n\n\n\nlstFlt = {\"North\",\"NE\",\"East\",\"SE\",\"South\",\"SW\",\"West\",\"NW\"}\n\ntheType = msgBox.ListAsString(lstFlt,\"Choose the filter type.\",\"Compass G radient Filters\")\nif (theType = nil) then\n exit\nend\n\nif (theType = \"North\") then\n av.Run(\"filters.DoFilter\",13)\nelseif (theType = \"NE\") then\n av.Run(\"filters.DoFilter\",14)\nelseif (theType = \"East\") then\n av.Run(\"filters.DoFilter\",15)\nelseif (theType = \"SE\") then\n av.Run(\"filters.DoFilter\",15)\nelseif (theType = \"South\") then\n av.Run(\"filters.DoFilter\",17)\nelseif (theType = \"SW\") then\n av.Run(\"filters.DoFilter\",18)\nelseif (theType = \"West\") then\n av.Run(\"filters.DoFilter\",19)\nelseif (theType = \"NW\") t hen\n av.Run(\"filters.DoFilter\",20)\nend" ) (Script.24 Name: "filters.DoFilter" SourceCode: "' Name: filters.DoFilter\n'\n' Author: Kenneth R. McVay\n' Date: Fri Sep 18 18:00:43 1998\n' Revised by: \n' Revision Date: \n' Revisions: \n' -------------------------------------------------------------------\n' Description: \n' Requires: \n' Runs: \n' Run by: \n' Self: \n' Returns: \n' -------------------------------------------------------------------\n\nDEBUG = true\nDEBUGNOT = false\n\n\n\ntheGrids = av.GetActiveDoc.GetActiveThemes\nif (theGrids.Count > 1) then\n msgBox.Error(\"There are multiple themes active.\"+ NL +\n \"Please make only one Grid Theme active and try again.\",\"ERROR\")\n exit\nend\n\nif (theGrids.Count < 1) then\n msgBox.Error(\"There are no Themes active.\" + NL +\n \"Please make the Interger Grid to filter active\" + NL +\n \"and try again\",\"ERROR\")\n exit\nend\n\nuseGrid = theGrids.Get(0)\nif (useGrid.Is(Gtheme).Not) then\n msgBox.Error(\"The active theme is not of the Grid Class.\"+ NL +\n \"Please make an integer Grid theme active and try again\",\"ERROR\")\n exit\nend\n \nif (useGrid.GetGrid.IsInteger.Not) then\n msgBox.Error(\"The active Grid is a Floating Point type.\" + NL +\n \"This extension will only processs Integer Grid themes.\"+ NL +\n \"To process this Grid Theme you will need to ReClassify it\" + NL +\n \"and try again\",\"ERROR\")\n exit\nend\n\nmyDLL = DLL.Make(\"$AVBIN\\filters.dll\".asFileName)\ndofilter = DLLProc.Make(myDLL, \"FilterGrid\", #DLLPROC_TYPE_INT32,\n {#DLLPROC_TYPE_STR , #DLLPROC_TYPE_STR,#DLLPROC_TYPE_INT32}) \n \n \nnewGrdName = av.GetProject.MakeFileName(\"fltGrd\",\"\")\nnewGrdName = SourceManager.PutDataSet (Grid,\"Enter the new Grid Name\",newGrdName,false)\nif (newGrdName = nil) then\n exit\nend\n\nresult = dofilter.Call({useGrid.GetSrcName.GetDataSource, newGrdName.asString,Self})\n\ntheDiag = av.FindDialog(\"filter.diagstatus\")\ntheMsg = theDiag.FindByName(\"MsgWindow\")\nif (result = 1) then\n theMsg.SetText(theMsg.GetText + \"A Grid exist with the name \" + useGrid.GetSrcName.GetDataSource + NL +\n \"it will not be overwritten.\" + NL+\n \"Please choose a filename that does not exist and try again.\" + NL +\n \"Processing Halted!!\" + NL)\nelseif (result = 2) then\n theMsg.SetText(theMsg.GetText + \"A problem occured opening input Grid \" + useGrid.GetSrcName.GetDataSource + NL+\n \"Processing Halted!!\" + NL)\nelseif (result = 3) then\n theMsg.SetText(theMsg.GetText + \"Could not read the bounding box of the input Grid.\" + NL +\n \"Processing Halted!!\" + NL)\nelseif (result = 4) then\n theMsg.SetText(theMsg.GetText + \"A problem occured creating the output grid.\" + NL +\n \"Processing Halted!!\" + NL)\nelseif (result = 5) then\n theMsg.SetText(theMsg.GetText + \"Could not set the window.\" + NL +\n \"Processing Halted!!\" + NL)\nelseif (result = 6) then\n theMsg.SetText(theMsg.GetText + \"Could not allocate a buffer\" + NL +\n \"Processing Halted!!\" + NL)\nelseif (result = 9) then\n theMsg.SetText (theMsg.GetText + \"Processing completed successfully.\" + NL)\n if (msgBox.YesNo(\"Add Grid to a view?\", \"Convolution Filters\",true)) then\n lstView = {}\n for each d in av.GetProject.GetDocs\n if (d.Is(View)) then\n lstView.Add(d)\n end\n end\n lstView.Add(\"\")\n addToView = MsgBox.ListAsString(lstView,\"Add Grid to:\",\"Convolution Fiters\")\n if (addToView = nil) then\n exit\n end\n if (addToView = \"\") then\n addToView = View.Make\n addToView.GetWin. Open\n end\n theSrcName = Grid.MakeSrcName(newGrdName.asString)\n newGrid = Grid.Make(theSrcName)\n newGTheme = GTheme.Make(newGrid)\n addToView.AddTheme(newGTheme)\n addToView.GetWin.Activate\n end\nend\n \ntheDiag.FindByName(\"close\").SetEnabled(true)\n\n \nmyDLL = nil\ndofilter = nil\nav.purgeobjects" ) (Script.25 Name: "filters.Edge" SourceCode: "' Name: filters.Edge\n'\n' Author: Kenneth R. McVay\n' Date: Fri Sep 18 18:00:55 1998\n' Revised by: \n' Revision Date: \n' Revisions: \n' -------------------------------------------------------------------\n' Description: \n' Requires: \n' Runs: \n' Run by: \n' Self: \n' Returns: \n' -------------------------------------------------------------------\n\nDEBUG = true\nDEBUGNOT = false\n\n\n\nlstFlt = {\"Vertical\",\"Horizontal\",\"Diagonal 1\",\"Diagonal 2\"}\n\ntheType = msgBox.ListAsString(lstFlt,\"Choose the filter type.\",\"Edge Detect Filters\")\nif (theType = nil) then\n exit\nend\n\nif (theType = \"Vertical\") then\n av.Run(\"filters.DoFilter\",21)\nelseif (theType = \"Horizontal\") then\n av.Run(\"filters.DoFilter\",22)\nelseif (theType = \"Diagonal 1\") then\n av.Run(\"filters.DoFilter\",23)\nelseif (theType = \"Diagonal 2\") then\n av.Run(\"filters.DoFilter\",24)\nend" ) (Script.26 Name: "filters.Emboss" SourceCode: "' Name: filters.Emboss\n'\n' Author: Kenneth R. McVay\n' Date: Fri Sep 18 18:01:10 1998\n' Revised by: \n' Revision Date: \n' Revisions: \n' -------------------------------------------------------------------\n' Description: \n' Requires: \n' Runs: \n' Run by: \n' Self: \n' Returns: \n' -------------------------------------------------------------------\n\nDEBUG = true\nDEBUGNOT = false\n\n\n\nlstFlt = {\"East\",\"NW\",\"West\",\"North\",\"South\",\"WN\",\"SE\",\"ES\"}\n\ntheType = msgBox.ListAsString(lstFlt,\"Choose the filter type.\",\"Emboss Fil ters\")\nif (theType = nil) then\n exit\nend\n\nif (theType = \"East\") then\n av.Run(\"filters.DoFilter\",5)\nelseif (theType = \"NW\") then\n av.Run(\"filters.DoFilter\",6)\nelseif (theType = \"West\") then\n av.Run(\"filters.DoFilter\",7)\nelseif (theType = \"North\") then\n av.Run(\"filters.DoFilter\",8)\nelseif (theType = \"South\") then\n av.Run(\"filters.DoFilter\",9)\nelseif (theType = \"WN\") then\n av.Run(\"filters.DoFilter\",10)\nelseif (theType = \"SE\") then\n av.Run(\"filters.DoFilter\",11)\nelseif (theType = \"ES\") then\n av.Run(\"fi lters.DoFilter\",12)\nend" ) (Script.27 Name: "filters.fltmsg" SourceCode: "' Name: filters.fltmsg\n'\n' Author: Kenneth R. McVay\n' Date: Fri Sep 18 18:01:20 1998\n' Revised by: \n' Revision Date: \n' Revisions: \n' -------------------------------------------------------------------\n' Description: \n' Requires: \n' Runs: \n' Run by: \n' Self: \n' Returns: \n' -------------------------------------------------------------------\n\nDEBUG = true\nDEBUGNOT = false\n\n\n\nthediag = av.finddialog(\"filter.diagstatus\")\nmsgStatus = thediag.FindByName(\"MsgWindow\")\n\nmsgStatus.SetText(msgStatus.GetText + Self + N L)" ) (Script.28 Name: "filters.HighFreq" SourceCode: "' Name: filters.HighFreq\n'\n' Author: Kenneth R. McVay\n' Date: Fri Sep 18 18:01:28 1998\n' Revised by: \n' Revision Date: \n' Revisions: \n' -------------------------------------------------------------------\n' Description: \n' Requires: \n' Runs: \n' Run by: \n' Self: \n' Returns: \n' -------------------------------------------------------------------\n\nDEBUG = true\nDEBUGNOT = false\n\n\n\nlstFlt = {\"HighFreq Filter 1\",\"HighFreq Filter 2\"}\n\ntheType = msgBox.ListAsString(lstFlt,\"Choose the filter type.\",\"High Frequency Fil ters\")\nif (theType = nil) then\n exit\nend\n\nif (theType = \"HighFreq Filter 1\") then\n av.Run(\"filters.DoFilter\",3)\nelse\n av.Run(\"filters.DoFilter\",4)\nend" ) (Script.29 Name: "filters.Laplacian" SourceCode: "' Name: filters.Laplacian\n'\n' Author: Kenneth R. McVay\n' Date: Fri Sep 18 18:01:35 1998\n' Revised by: \n' Revision Date: \n' Revisions: \n' -------------------------------------------------------------------\n' Description: \n' Requires: \n' Runs: \n' Run by: \n' Self: \n' Returns: \n' -------------------------------------------------------------------\n\nDEBUG = true\nDEBUGNOT = false\n\n\n\nlstFlt = {\"Laplacian 1\",\"Laplacian 2\",\"Laplacian 3\",\"Laplacian Subtract\",\"Laplacian Add Back\"}\n\ntheType = msgBox.ListAsString(lstFlt, \"Choose the filter type.\",\"Laplacian Filters\")\nif (theType = nil) then\n exit\nend\n\nif (theType = \"Laplacian 1\") then\n av.Run(\"filters.DoFilter\",25)\nelseif (theType = \"Laplacian 2\") then\n av.Run(\"filters.DoFilter\",26)\nelseif (theType = \"Laplacian 3\") then\n av.Run(\"filters.DoFilter\",27)\nelseif (theType = \"Laplacian Subtract\") then\n av.Run(\"filters.DoFilter\",28)\nelseif (theType = \"Laplacian Add Back\") then\n av.Run(\"filters.DoFilter\",29)\nend\n" ) (Script.30 Name: "filters.Line" SourceCode: "' Name: filters.Line\n'\n' Author: Kenneth R. McVay\n' Date: Fri Sep 18 18:01:45 1998\n' Revised by: \n' Revision Date: \n' Revisions: \n' -------------------------------------------------------------------\n' Description: \n' Requires: \n' Runs: \n' Run by: \n' Self: \n' Returns: \n' -------------------------------------------------------------------\n\nDEBUG = true\nDEBUGNOT = false\n\n\n\nlstFlt = {\"E-W\",\"NE-SW\",\"N-S\",\"NW-SE\"}\n\ntheType = msgBox.ListAsString(lstFlt,\"Choose the filter type.\",\"Laplacian Filters\")\nif (theType = nil) then\n exit\nend\n\nif (theType = \"E-W\") then\n av.Run(\"filters.DoFilter\",30)\nelseif (theType = \"NE-SW\") then\n av.Run(\"filters.DoFilter\",31)\nelseif (theType = \"N-S\") then\n av.Run(\"filters.DoFilter\",32)\nelseif (theType = \"NW-SE\") then\n av.Run(\"filters.DoFilter\",33)\nend\n" ) (Script.31 Name: "filters.LowFreq" SourceCode: "' Name: filters.LowFreq\n'\n' Author: Kenneth R. McVay\n' Date: Fri Sep 18 18:01:54 1998\n' Revised by: \n' Revision Date: \n' Revisions: \n' -------------------------------------------------------------------\n' Description: \n' Requires: \n' Runs: \n' Run by: \n' Self: \n' Returns: \n' -------------------------------------------------------------------\n\nDEBUG = true\nDEBUGNOT = false\n\n\n\nlstFlt = {\"LowFreq Filter 1\",\"LowFreq Filter 2\"}\n\ntheType = msgBox.ListAsString(lstFlt,\"Choose the filter type.\",\"Low Frequency Filters \")\nif (theType = nil) then\n exit\nend\n\nif (theType = \"LowFreq Filter 1\") then\n av.Run(\"filters.DoFilter\",1)\nelse\n av.Run(\"filters.DoFilter\",2)\nend" ) (Script.32 Name: "filters.NonLin" SourceCode: "' Name: filters.NonLin\n'\n' Author: Kenneth R. McVay\n' Date: Fri Sep 18 18:02:00 1998\n' Revised by: \n' Revision Date: \n' Revisions: \n' -------------------------------------------------------------------\n' Description: \n' Requires: \n' Runs: \n' Run by: \n' Self: \n' Returns: \n' -------------------------------------------------------------------\n\nDEBUG = true\nDEBUGNOT = false\n\n\n\nlstFlt = {\"Sobel\",\"Robert's\"}\n\ntheType = msgBox.ListAsString(lstFlt,\"Choose the filter type.\",\"Non-Linear Edge Detect Filters\")\nif (theT ype = nil) then\n exit\nend\n\nif (theType = \"Sobel\") then\n av.Run(\"filters.DoFilter\",34)\nelse\n av.Run(\"filters.DoFilter\",35)\nend" ) (Script.33 Name: "filters.OpenStatus" SourceCode: "' Name: filters.OpenStatus\n'\n' Author: Kenneth R. McVay\n' Date: Fri Sep 18 18:02:07 1998\n' Revised by: \n' Revision Date: \n' Revisions: \n' -------------------------------------------------------------------\n' Description: \n' Requires: \n' Runs: \n' Run by: \n' Self: \n' Returns: \n' -------------------------------------------------------------------\n\nDEBUG = true\nDEBUGNOT = false\n\n\n\nthediag = av.finddialog(\"filter.diagstatus\")\nthediag.Open\nmsgStatus = thediag.FindByName(\"MsgWindow\")\n\nmsgStatus.SetText(Self + NL)\n \nsystem.ReFreshWindows" ) (Script.34 Name: "filters.setstatus" SourceCode: "' Name: filters.setstatus\n'\n' Author: Kenneth R. McVay\n' Date: Fri Sep 18 18:02:16 1998\n' Revised by: \n' Revision Date: \n' Revisions: \n' -------------------------------------------------------------------\n' Description: \n' Requires: \n' Runs: \n' Run by: \n' Self: \n' Returns: \n' -------------------------------------------------------------------\n\nDEBUG = true\nDEBUGNOT = false\n\n\n\nav.setworkingstatus" ) (Script.35 Name: "filters.stopbtn" SourceCode: "' Name: filters.stopbtn\n'\n' Author: Kenneth R. McVay\n' Date: Fri Sep 18 18:02:25 1998\n' Revised by: \n' Revision Date: \n' Revisions: \n' -------------------------------------------------------------------\n' Description: \n' Requires: \n' Runs: \n' Run by: \n' Self: \n' Returns: \n' -------------------------------------------------------------------\n\nDEBUG = true\nDEBUGNOT = false\n\n\n\nav.showstopbutton" ) (Script.36 Name: "Unload.filters" SourceCode: "' Name: Unload\n'\n' Author: Kenneth R. McVay\n' Date: Fri Sep 18 17:49:16 1998\n' Revised by: \n' Revision Date: \n' Revisions: \n' -------------------------------------------------------------------\n' Description: \n' Requires: \n' Runs: \n' Run by: \n' Self: \n' Returns: \n' -------------------------------------------------------------------\n\nDEBUG = true\nDEBUGNOT = false\n\nDialog.DetachFromExtension(self)" ) (Script.37 Name: "Install.Filters" SourceCode: "' Name: Install.Filters\n'\n' Author: Kenneth R. McVay\n' Date: Fri Sep 18 18:02:35 1998\n' Revised by: \n' Revision Date: \n' Revisions: \n' -------------------------------------------------------------------\n' Description: \n' Requires: \n' Runs: \n' Run by: \n' Self: \n' Returns: \n' -------------------------------------------------------------------\n\nDEBUG = true\nDEBUGNOT = false\n\n\nif (av.GetProject = nil)\n then\n return nil\nend\n\nif (Extension.Find(\"Spatial Analyst\") = nil) then\n Extension.Open(\"$AVEXT\\spatial.a vx\".asFileName)\nend\n\namenuBar = av.GetProject.FindGUI(\"View\").GetMenuBar\namenuBar.Add(Self.Get(0),4)" ) (Script.38 Name: "Uninstall.Filters" SourceCode: "' Name: Uninstall.Filters\n'\n' Author: Kenneth R. McVay\n' Date: Fri Sep 18 18:02:55 1998\n' Revised by: \n' Revision Date: \n' Revisions: \n' -------------------------------------------------------------------\n' Description: \n' Requires: \n' Runs: \n' Run by: \n' Self: \n' Returns: \n' -------------------------------------------------------------------\n\nDEBUG = true\nDEBUGNOT = false\n\n\n\namenubar = av.getproject.FindGUI(\"View\").GetMenuBar\namenubar.Remove(Self.Get(0))" )