Pinnacle : ViewWindowList
Description
ViewWindowList controls the windows displayed and allows a script to interact with and change what is displayed for the user.
Interact with ViewWindows
Identify ViewWindow
InfoMessage = ViewWindowList.Current.Index; //Index of currently selected window
InfoMessage = ViewWindowList.Current.Name; //Name of currently selected window
Identify previously active window
InfoMessage = ViewWindowList.Last.Name; //Name of last window that was current
InfoMessage = ViewWindowList.Last.Index; //Index of last window that was current
Make a specific window active
ViewWindowList.#"#0".MakeCurrent = ""; //Make window at index 0 the current window
ViewWindowList.#"VW 2".MakeCurrent =""; //Make window named "VW 2" the current window
Make previous window active
ViewWindowList.MakePreviousCurrent = ""; //Make the window current at previous index (e.g. if index #"#1", will make #"#0" current)
Make next window active
ViewWindowList.MakeNextCurrent = ""; //Make the window current at the next index (e.g. if #"#1", will make #"#2" current)
Render DRR in ViewWindow
ViewWindowList.Current.Enter3dMode="";
ViewWindowList.Current.BEV=TrialList.Current.BeamList.Current.Name;
ViewWindowList.Current.ImageType = "Bone -- Fast";
ViewWindowList.Current.Render = "Render r" //need to count spaces
View Manipulation
Set window to CT slice number
ViewWindowList.Current.UserSliceNumber = SomeSliceNumber; //Ex 1
ViewWindowList.Current.UserSliceNumber = RoiList.Current.BinaryVolume.ZMin; //Set window view to first CT slice containing the current ROI.
Pan
The values for pan must be calculated based on image dimensions and point coordinates.
These values come from the .header file.
right = ((x_dim / 2) – ((point_x – x_start) / x_pixdim)) * x_pixdim
up = ((y_dim / 2) – ((point_y – y_start) / y_pixdim)) * y_pixdim [1]
ViewWindowList.Current.PanLeft
ViewWindowList.Current.PanRight
ViewWindowList.Current.PanUp
ViewWindowList.Current.PanDown
Set slice to current POI
ViewWindowList.Current.SetSliceToCurrentPoi = "";
Zoom
Reset Zoom Settings
ViewWindowList.Current.ZoomToWindow = "";
ViewWindowList.Current.Zoom = 2; //zoom in
ViewWindowList.Current.Zoom = 0.25; //zoom out