/////////////////////////////////////////////////////////////////////////////////// //FindExt.Script //This script will add an external contour to a selected dataset //based on the index # specified in the variable "Store.StringAt.Dataset" //Created by Benjamin Pollard, MS, DABR (TPSWiki.com, benjpollard@gmail.com, 2018) /////////////////////////////////////////////////////////////////////////////////// //Select the dataset index # that you wish to contour (Primary = 0, secondary #1=1, etc) //You can also instead use a specific name to select the dataset. Store.StringAt.Dataset=VolumeList.#"#1".Name; //If the contour already exists, then delete it. RoiList.Current="Ext2"; Store.StringAt.Ext2ROICheck = RoiList.Current.Name; IF.RoiList.Current.Name.STRINGEQUALTO.#"#Ext2".THEN={ RoiList.#"Ext2".Destroy=1; }; //Create and name ROI to be used for autocontour CreateNewROI = "Add Region Of Interest"; RoiList.Current.Name = "Ext2"; //Set the new ROI to the dataset specified by the index number above. RoiList.Current.VolumeName=Store.StringAt.Dataset; //Set max and min autocontour thresholds RoiList.Current.AutoLower = "200"; RoiList.Current.AutoUpper = "4096"; //Unnecessary, but you may set the autocontour bounding box location RoiList.Current.ApplyBoundingBox = 1; //RoiList.Current.BoundingBox.DisplayXOrigin = "-60"; RoiList .Current.BoundingBox.DisplayYOrigin = TrialList.Current.CouchRemovalYCoordinate;//This can be a number too. //RoiList.Current.BoundingBox.DisplayZOrigin = "0"; //RoiList.Current.BoundingBox.Size.X = "128"; //RoiList.Current.BoundingBox.Size.Y = "128"; //RoiList.Current.BoundingBox.Size.Z = "38.0999"; //Perform the autocontour RoiList.Current.AutoContourROI = "Current Region Of Interest"; //Clean ROI example RoiList.Current.CurveMinArea = "100"; RoiList.Current.CurveOverlapMinimum = "88"; RoiList.Current.Clean = "Rescan"; RoiList.Current.CleanAndDelete = "Delete Curves"; //Reassign contour to primary dataset - This method requires manually clicking on a pop-up. //There may be ways to get around this like copying/growing the //RoiList .Current .VolumeName = VolumeList.#"#0".Name; //Display external contour RoiList.Current.Display2dWithMeshCheck = "Both"; RoiList.Current.Color = "blue"; //Clear variable(s) Store.FreeAt.Dataset=""; Root.Store.StringAt.Test="hello"; Root.Store.FreeAt.Test ="";