Create a contour

CreateNewROI = "Add Region Of Interest"; //This creates a blank contour with no slices

Name contour

RoiList.Current.Name = "SomeName";

Choose contour's associated dataset

//(RoiList.Current.VolumeName = Dataset Name)
RoiList.Current.VolumeName = VolumeList.#"#1".Name; //where the index # corresponds to the dataset index (0=primary, 1=secondary #1, etc)

Contour display

RoiList.Current.Display2dWithMeshCheck = "Both";//Supports other options like "Contour", "Colorwash", "Poly", "Mesh", "Off"

Contour color

RoiList.Current.Color = "blue"; //Supports generic Pinnacle colors like "red", "green", "yellow", "purple", "skyblue", etc

Clean contour

RoiList.Current.CurveMinArea = "100"; //Minimum curve area
RoiList.Current.CurveOverlapMinimum = "88"; //Minimum curve overlap
RoiList.Current.Clean = "Rescan"; //Scan for nonconforming curves
RoiList.Current.CleanAndDelete = "Delete Curves"; //Delete non-conforming curves

Destroy contour


ROI Expansion/Contraction/Rings

Open ROI Expand/Contract Window (not necessary for other actions)

WindowList .RoiExpandWindow .Create = "ROI Expansion/Contraction...";

Clear all previous selections

  • This command should be run before any expansion/contraction/ring action to remove previous selections
RoiList.#"*".ResetRoiExpandState="Clear All";

Select Source

Avoid Interior

Avoid Exterior

Use constant thickness padding(1=yes, 0=no)

RoiExpandControl .UseConstantPadding = "1";
RoiExpandControl .UseConstantPadding = "0";

Thickness of padding

  • Constant thickness
//Thickness of constant padding (cm)
RoiExpandControl .ConstantPadding = " 1";
  • Variable thickness
//Direction of expansion/contraction (in cm)

RoiExpandControl .NegXPadding = "1";

RoiExpandControl .PosXPadding = "2";

RoiExpandControl .NegYPadding = "3";

RoiExpandControl .PosYPadding = "4";

RoiExpandControl .NegZPadding = " 5";

RoiExpandControl .PosZPadding = "6";

Create new ROI for expansion/contraction

RoiExpandControl .CreateNewTarget = "1";
//Name of target
RoiExpandControl .TargetRoiName = "SomeContourName";

Replace an existing ROI

RoiExpandControl .TargetRoi = "SomeOtherContourName";
RoiExpandControl .CreateNewTarget = "0";

Expand the source ROI

RoiExpandControl .Expand = "1";
RoiExpandControl .DoExpand = "Expand";

Contract the source ROI

RoiExpandControl .Expand = "0";
RoiExpandControl .DoExpand = "Contract";


Set max and min autocontour thresholds

RoiList.Current.AutoLower = "200";
RoiList.Current.AutoUpper = "4096";

Set the boundary box

RoiList.Current.ApplyBoundingBox = 1;

//These can be used or commented out. They aren't necessary to perform the autocontour
RoiList.Current.BoundingBox.DisplayXOrigin = "-60";
RoiList .Current.BoundingBox.DisplayYOrigin = TrialList.Current.CouchRemovalYCoordinate;//Only contours above the couch removal line, 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 autocontour

RoiList.Current.AutoContourROI = "Current Region Of Interest";

Contour coordinates

X direction (i.e. Sagittal Orientation)

RoiList.Current.BinaryVolume.XMin;//First CT slice containing contour in X coordinate. 
RoiList.Current.BinaryVolume.XMax;//Last CT slice containing contour in X coordinate.

Y direction (i.e. Coronal Orientation)

The Y coordinate is different from the others in that instead of providing the CT slice number, the variable contains a value equal to the #CT slices - Slice Number. In most, and maybe all, cases there are 512 slices in the CT in the Y direction. So, to find the slice number, simply subtract the number provided by Pinnacle from 512.

RoiList.Current.BinaryVolume.YMin;// "# of CT Slices-First CT" slice containing contour in Y direction

Z direction (i.e. Transverse Orientation)

RoiList.Current.BinaryVolume.ZMin;//First CT slice containing contour in Z coordinate.


Set current window view to first CT slice containing the current contour.

ViewWindowList.Current.UserSliceNumber = RoiList.Current.BinaryVolume.ZMin;
Unless otherwise stated, the content of this page is licensed under Creative Commons Attribution-ShareAlike 3.0 License