SIVIC API  0.9.26
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
Public Types | Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes | Friends | List of all members
svkPlotGridView Class Reference

#include <svkPlotGridView.h>

Inheritance diagram for svkPlotGridView:
svkDataView

Public Types

enum  ActorType {
  VOL_SELECTION = 0, OVERLAY_IMAGE, OVERLAY_TEXT, PLOT_GRID,
  PLOT_LINES, DETAILED_PLOT, RULER, SAT_BANDS,
  SAT_BANDS_OUTLINE, LAST_PROP = SAT_BANDS_OUTLINE
}
 Enum represents objects in the scene. More...
 
enum  RendererType { PRIMARY = 0, LAST_RENDERER = PRIMARY }
 Enum represents renderers in the window. More...
 
enum  ColorSchema { LIGHT_ON_DARK = 0, DARK_ON_LIGHT }
 Enum represents different color schemes. Used for printing. More...
 
enum  DataInputs { MR4D, MET, ADDITIONAL_MR4D }
 Enum represent the data inputs. More...
 
enum  WindowLevelRanges { FREQUENCY = 0, AMPLITUDE }
 Enum represents different color schemes. Used for printing. More...
 

Public Member Functions

 vtkTypeMacro (svkPlotGridView, svkDataView)
 
 svkPlotGridView ()
 Constructor. More...
 
 ~svkPlotGridView ()
 Destructor. More...
 
virtual void SetInput (svkImageData *data, int index)
 
virtual void AddReferenceInput (svkImageData *data)
 
virtual void RemoveInput (int index)
 
virtual void SetSlice (int slice)
 
virtual void SetTlcBrc (int tlcBrc[2])
 
virtual void SetTlcBrc (int tlcID, int brcID)
 
virtual void SetWindowLevelRange (double lower, double upper, int index)
 
virtual void GetWindowLevelRange (double &lower, double &upper, int index)
 
virtual void SetOverlayWLRange (double *range)
 
virtual double * GetOverlayWLRange ()
 
void SetComponent (svkPlotLine::PlotComponent component, int plotIndex=-1)
 
void SetActiveComponent (svkPlotLine::PlotComponent component)
 
svkPlotLine::PlotComponent GetActiveComponent ()
 
virtual void SetVolumeIndex (int index, int volumeIndex=0, int plotIndex=-1)
 
virtual int GetVolumeIndex (int volumeIndex=0)
 
virtual int * GetVolumeIndexArray ()
 
void SetPlotUnits (svkSpecPoint::UnitType plotUnitType)
 
virtual void SetRWInteractor (vtkRenderWindowInteractor *rwi)
 
virtual void SetPlotColor (int plotIndex, double *rgb)
 
virtual double * GetPlotColor (int plotIndex)
 
virtual void SetPlotLineWidth (float width)
 
virtual void SetPlotVisibility (int plotIndex, bool visible)
 
virtual bool GetPlotVisibility (int plotIndex)
 
virtual int GetNumberOfReferencePlots ()
 
virtual void SetActivePlotIndex (int plotIndex)
 
virtual svkImageDataGetActivePlot ()
 
virtual int GetActivePlotIndex ()
 
virtual void Refresh ()
 Method is called when data object is Modified. More...
 
void GeneratePlotGridActor ()
 
void GenerateClippingPlanes ()
 
virtual void SetOrientation (svkDcmHeader::Orientation orientation)
 
virtual void AlignCamera ()
 Resets the camera to look at the new selection. More...
 
svk4DImageDataGetActiveInput ()
 
void SetOverlayTextDigits (int digits)
 
string GetScientificFormat (int digits)
 
string GetDecimalFormat (int digits)
 
void TurnPropOn (int propIndex)
 
void TurnPropOff (int propIndex)
 
void HideView ()
 
void ShowView ()
 
void AlignCameraOff ()
 
void AlignCameraOn ()
 
void SetActiveOverlayVolume (int volume)
 
void SetOverlayThreshold (double threshold)
 
- Public Member Functions inherited from svkDataView
 vtkTypeMacro (svkDataView, vtkObject)
 
 svkDataView ()
 Constructor. More...
 
 ~svkDataView ()
 Destructor. More...
 
virtual svkImageDataGetInput (int index=0)
 
virtual void SetController (svkDataViewController *controller)
 
virtual svkDataViewControllerGetController ()
 
virtual int GetSlice ()
 
virtual void SetPropState (int propIndex, bool visible)
 
virtual bool IsPropOn (int propIndex)
 
virtual void SetRendererState (int rendererIndex, bool visible)
 
virtual void TurnRendererOn (int rendererIndex)
 
virtual void TurnRendererOff (int rendererIndex)
 
virtual bool IsRendererOn (int rendererIndex)
 
virtual void SetVisibility (int actorIndex, bool visible)
 Is it in the views current displayed FOV? More...
 
virtual vtkRenderer * GetRenderer (int index)
 
virtual void SetRenderer (int index, vtkRenderer *ren)
 
virtual vtkProp * GetProp (int index)
 
virtual void SetProp (int index, vtkProp *prop)
 
virtual svkDcmHeader::Orientation GetOrientation ()
 
void ValidationOff ()
 

Static Public Member Functions

static svkPlotGridViewNew ()
 
- Static Public Member Functions inherited from svkDataView
static void ClipMapperToTlcBrc (svkImageData *data, vtkAbstractMapper *mapper, int tlcBrc[2], double clip_tolerance_row, double clip_tolerance_column, double clip_tolerance_slice)
 
static void GetClippingIndexFromTlcBrc (svkImageData *data, int indexRange[2][3], int tlcBrc[2])
 
static void GetClippingPlanes (vtkPlaneCollection *planes, svkImageData *data, int *tlcBrc, double clip_tolerance_row, double clip_tolerance_column, double clip_tolerance_slice)
 
static bool IsTlcBrcWithinData (svkImageData *data, int tlcBrc[2])
 
static bool IsTlcBrcWithinData (svkImageData *data, int tlcID, int brcID)
 
static void ResetTlcBrcForNewOrientation (svkImageData *data, svkDcmHeader::Orientation orientation, int tlcBrc[2], int &slice)
 

Protected Member Functions

void CreateMetaboliteOverlay (svkImageData *data)
 
void UpdateMetaboliteText (int *tlcBrc)
 
void UpdateMetaboliteImage (int *tlcBrc)
 
void UpdateMetaboliteTextDisplacement ()
 
void UpdateDetailedPlot (int *tlcBrc)
 
void UpdateDetailedPlotOverlay (int tlc)
 
void SetSelection (double *selectionArea, bool isWorldCords=0)
 
int * HighlightSelectionVoxels ()
 
void SetColorSchema (int colorSchema)
 
string GetDataCompatibility (svkImageData *data, int targetIndex)
 
void SetOverlayOpacity (double opacity)
 
void SetLUT (svkLookupTable::svkLookupTableType type)
 
- Protected Member Functions inherited from svkDataView
virtual void UpdateProps ()
 
void ObserveData (svkImageData *data)
 

Protected Attributes

vector< svkPlotLineGrid * > plotGrids
 
vector< svkImageClip * > metClippers
 
vector< vtkActor2D * > overlayTextActors
 
double referencePlotColors [10][3]
 
- Protected Attributes inherited from svkDataView
vector< vtkRenderer * > renCollection
 
vector< vtkProp * > propCollection
 
vtkRenderWindowInteractor * rwi
 
vector< svkImageData * > dataVector
 
svkDataViewControllercontroller
 
vtkCallbackCommand * dataModifiedCallback
 
svkDcmHeader::Orientation orientation
 
int tlcBrc [2]
 the top left, bottom right corners of the current view More...
 
int slice
 
vector< bool > isPropOn
 
vector< bool > isRendererOn
 
vector< bool > isPropVisible
 
bool isValidationOn
 

Friends

class svkPlotGridViewController
 

Additional Inherited Members

- Static Protected Member Functions inherited from svkDataView
static void UpdateView (vtkObject *subject, unsigned long eid, void *thisObject, void *callData)
 

Detailed Description

A concrete implementation of svkDataView. Its puropose is to visualize 4D data plots in a rectangular grid.

Member Enumeration Documentation

enum ActorType

Enum represents objects in the scene.

Enumerator
VOL_SELECTION 
OVERLAY_IMAGE 
OVERLAY_TEXT 
PLOT_GRID 
PLOT_LINES 
DETAILED_PLOT 
RULER 
SAT_BANDS 
SAT_BANDS_OUTLINE 
LAST_PROP 

Enum represents different color schemes. Used for printing.

Enumerator
LIGHT_ON_DARK 
DARK_ON_LIGHT 
enum DataInputs

Enum represent the data inputs.

Enumerator
MR4D 
MET 
ADDITIONAL_MR4D 

Enum represents renderers in the window.

Enumerator
PRIMARY 
LAST_RENDERER 

Enum represents different color schemes. Used for printing.

Enumerator
FREQUENCY 
AMPLITUDE 

Constructor & Destructor Documentation

Member Function Documentation

void AddReferenceInput ( svkImageData data)
virtual
void AlignCamera ( )
virtual
void AlignCameraOff ( )

Turn off this behavior to prevent auto alignment of camera during slice changes, etc.

void AlignCameraOn ( )

Turn on (on by default) this behavior to prevent auto alignment of camera during slice changes, etc.

void CreateMetaboliteOverlay ( svkImageData data)
protected
void GenerateClippingPlanes ( )

Generates the clipping planes for the mMMapper. This is how the boundries set are enforced, after the data is scaled, it is clipped so that data outside the plot range is simply not shown.

References svkDataView::ClipMapperToTlcBrc(), svkDataView::dataVector, svkDataView::GetProp(), svkPlotGridView::MR4D, svkPlotGridView::PLOT_GRID, svkPlotGridView::plotGrids, and svkDataView::tlcBrc.

Referenced by svkPlotGridView::SetSlice(), and svkPlotGridView::SetTlcBrc().

void GeneratePlotGridActor ( )
svkPlotLine::PlotComponent GetActiveComponent ( )

Gets the component of the active plot.

References svkPlotGridView::plotGrids.

svk4DImageData * GetActiveInput ( )

Returns the active input dataset.

Returns

References svkPlotGridView::plotGrids.

Referenced by svkPlotGridView::ShowView().

svkImageData * GetActivePlot ( )
virtual

Returns the svkImageData object of the active plot.

Returns

References svkDataView::dataVector.

Referenced by svkPlotGridView::SetActivePlotIndex().

int GetActivePlotIndex ( )
virtual

Gets the index of the plot that is currently active.

Returns
string GetDataCompatibility ( svkImageData data,
int  targetIndex 
)
protected

Check to make sure a given dataset is comptabile with the currently loaded data sets.

Parameters
datathe prospective data.
targetIndexthe index in which the data is trying to be placed.
Returns
resultInfo returns an empty string if the dataset is compatible, otherwise an explaination of why the dataset is not compatible is returned.

References svkPlotGridView::ADDITIONAL_MR4D, svkDataValidator::AreCellDataArrayStructureSame(), svkDataValidator::AreDataCompatible(), svkDataValidator::AreDataGeometriesSame(), svkDataView::dataVector, svkDataValidator::INVALID_DATA_ORIENTATION, svkDataValidator::IsInvalid(), svkDataView::isValidationOn, svkPlotGridView::MET, svkPlotGridView::MR4D, svkDataValidator::New(), and svkDataValidator::resultInfo.

Referenced by svkPlotGridView::SetInput().

string GetDecimalFormat ( int  digits)

Creates a printf style string for formatting the overlay text. Takes the number of digits after the decimal as input.

References svkTypeUtils::IntToString().

Referenced by svkPlotGridView::SetOverlayTextDigits().

int GetNumberOfReferencePlots ( )
virtual
double * GetOverlayWLRange ( )
virtual

Method gets the window level range for the overlay.

double * GetPlotColor ( int  plotIndex)
virtual

Sets the color for the given plot index.

References svkPlotGridView::plotGrids.

bool GetPlotVisibility ( int  plotIndex)
virtual

Returns if the requested plot is visible, otherwise returns false.

Parameters
plotIndex
Returns

References svkPlotGridView::plotGrids.

string GetScientificFormat ( int  digits)

Creates a printf style string for formatting the overlay text. Takes the number of significant digits as input.

References svkTypeUtils::IntToString().

Referenced by svkPlotGridView::SetOverlayTextDigits().

int GetVolumeIndex ( int  volumeIndex = 0)
virtual

Getter for the index of current volume.

Parameters
volumeIndex
Returns
int * GetVolumeIndexArray ( )
virtual

Getter for the index of current volume.

Parameters
volumeIndex
Returns
void GetWindowLevelRange ( double &  lower,
double &  upper,
int  index 
)
virtual
void HideView ( )
int * HighlightSelectionVoxels ( )
protected

Method highlights voxels within the selection box

Returns
tlcBrc the cell id's of the desired top left, bottom right corners

References svkDataView::dataVector, svkPlotGridView::MR4D, svkDataView::orientation, svkPlotGridView::SetTlcBrc(), svkDataView::slice, and svkDataView::tlcBrc.

Referenced by svkPlotGridView::SetInput().

static svkPlotGridView* New ( )
static
void Refresh ( )
virtual
void RemoveInput ( int  index)
virtual

Removes a data input and the associated actors. Currently only implemented for overlay.

Reimplemented from svkDataView.

References svkDataView::GetProp(), svkDataView::GetRenderer(), svkPlotGridView::MET, svkImageActor::New(), svkPlotGridView::OVERLAY_IMAGE, svkPlotGridView::OVERLAY_TEXT, svkPlotGridView::PRIMARY, and svkDataView::SetProp().

void SetActiveComponent ( svkPlotLine::PlotComponent  component)

Sets the component of the active plot.

References svkPlotGridView::SetComponent().

void SetActiveOverlayVolume ( int  volume)
void SetActivePlotIndex ( int  index)
virtual
void SetColorSchema ( int  colorSchema)
protected

Sets the color schema. Currently we only support one light-on-dark and one dark-on-light. Used for making a printable version.

Parameters
colorSchemathe color scheme you want, options are svkPlotGriView::LIGHT_ON_DARK or svkPlotGridView::DARK_ON_LIGHT

References svkPlotGridView::DARK_ON_LIGHT, svkDataView::GetProp(), svkDataView::GetRenderer(), svkPlotGridView::LIGHT_ON_DARK, svkPlotGridView::OVERLAY_TEXT, svkPlotGridView::plotGrids, svkPlotGridView::PRIMARY, svkDetailedPlotDirector::SetBackgroundColor(), and svkDetailedPlotDirector::SetPlotColor().

void SetComponent ( svkPlotLine::PlotComponent  component,
int  plotIndex = -1 
)
void SetInput ( svkImageData data,
int  index 
)
virtual

Set input data and initialize default range values. Also, should call ObserveData. Does some compatibility checking based on what is currently loaded.

Parameters
datathe candidate data for input
indexthe index in which to set the data

Implements svkDataView.

References svkPlotGridView::ADDITIONAL_MR4D, svkPlotGridView::AlignCamera(), svkPlotGridView::CreateMetaboliteOverlay(), svkDataView::dataVector, svkPlotGridView::DETAILED_PLOT, svkPlotGridView::GeneratePlotGridActor(), svkPlotGridView::GetDataCompatibility(), svkImageData::GetDcmHeader(), svkImageData::GetFirstSlice(), svkImageData::GetLastSlice(), svkDataView::GetProp(), svkDataView::GetRenderer(), svkSatBandSet::GetSatBandsActor(), svkDcmHeader::GetStringValue(), svkMrsTopoGenerator::GetTopoActorCollection(), svkPlotGridView::HighlightSelectionVoxels(), svkPlotGridView::MET, svkPlotGridView::MR4D, svkMrsTopoGenerator::New(), svkPlotLineGrid::New(), svkDataView::ObserveData(), svkDataView::orientation, svkPlotGridView::PLOT_GRID, svkPlotGridView::PLOT_LINES, svkPlotGridView::plotGrids, svkSpecPoint::PPM, svkPlotGridView::PRIMARY, svkPlotGridView::referencePlotColors, svkPlotGridView::Refresh(), svkPlotGridView::RULER, svkPlotGridView::SAT_BANDS, svkPlotGridView::SAT_BANDS_OUTLINE, svkSatBandSet::SetClipSlice(), svkSatBandSet::SetInput(), svkPlotGridView::SetOrientation(), svkDataView::SetProp(), svkPlotGridView::SetSlice(), svkPlotGridView::SetTlcBrc(), svkDataView::slice, svkDataView::tlcBrc, svkPlotGridView::TurnPropOff(), svkPlotGridView::TurnPropOn(), svkPlotGridView::UpdateDetailedPlot(), svk4DImageData::VOL_SELECTION, and svkPlotGridView::VOL_SELECTION.

Referenced by svkPlotGridView::AddReferenceInput().

void SetLUT ( svkLookupTable::svkLookupTableType  type)
protected
void SetOrientation ( svkDcmHeader::Orientation  orientation)
virtual
void SetOverlayOpacity ( double  opacity)
protected

Sets the opacity of the image overlay.

Parameters
opacitythe new opacity you wish the image overlay to have.

References svkDataView::dataVector, svkDataView::GetProp(), svkPlotGridView::MET, svkPlotGridView::OVERLAY_IMAGE, and svkDetailedPlotDirector::SetBackgroundOpacity().

Referenced by svkPlotGridView::CreateMetaboliteOverlay().

void SetOverlayTextDigits ( int  digits)
void SetOverlayThreshold ( double  threshold)

Sets the threshold of the image overlay.

Parameters
thresholdthe new threshold you wish the image overlay to have.

References svkDataView::GetProp(), svkPlotGridView::OVERLAY_IMAGE, svkLookupTable::SetAlphaThreshold(), svkDataView::tlcBrc, and svkPlotGridView::UpdateDetailedPlotOverlay().

void SetOverlayWLRange ( double *  range)
virtual
void SetPlotColor ( int  plotIndex,
double *  rgb 
)
virtual
void SetPlotLineWidth ( float  width)
virtual
void SetPlotUnits ( svkSpecPoint::UnitType  plotUnitType)
void SetPlotVisibility ( int  plotIndex,
bool  visible 
)
virtual

Show or hide the given plot by index.

Parameters
index
visible

References svkPlotGridView::plotGrids, svkPlotGridView::Refresh(), svkDataView::tlcBrc, and svkPlotGridView::UpdateDetailedPlot().

void SetRWInteractor ( vtkRenderWindowInteractor *  rwi)
virtual

Sets the interactor, and attach a renderer it its window. NOTE: This will remove any/all renderers that may have been in the renderWindow.

TODO: AddRenderer can throw an error if the RenderWindow has not been initialized, either add a check or re-implement.

Parameters
rwithe vtkRendererWindowInteractor you wish to associate with the view

Reimplemented from svkDataView.

References svkDataView::GetRenderer(), svkPlotGridView::PRIMARY, svkDataView::rwi, and svkDataView::TurnRendererOn().

void SetSelection ( double *  selectionArea,
bool  isWorldCords = 0 
)
protected

Sets desired the current selection in Display (pixels) coordinates and highlights the intersected voxels.

Parameters
selectionAreathe area you wish to select voxels within [xmin, xmax, ymin, ymax]

References svkDataView::dataVector, svkDataView::GetRenderer(), svkVoxelTaggingUtils::IsImageVoxelTagData(), svkPlotGridView::MET, svkPlotGridView::MR4D, svkDataView::orientation, svkPlotGridView::PRIMARY, svkDataView::rwi, svkPlotGridView::SetTlcBrc(), svkDataView::slice, and svkVoxelTaggingUtils::ToggleVoxelTag().

void SetSlice ( int  slice)
virtual
void SetTlcBrc ( int  tlcBrc[2])
virtual
void SetTlcBrc ( int  tlcID,
int  brcID 
)
virtual
void SetVolumeIndex ( int  index,
int  volumeIndex = 0,
int  plotIndex = -1 
)
virtual

Set the index for the given volume dimension index.

Parameters
indexthe index of the volume
volumeIndexthe index of the volume dimension
plotIndexthe index of the plot line you wish to modify

References svkPlotGridView::plotGrids, svkPlotGridView::Refresh(), svkDataView::rwi, svkDataView::tlcBrc, and svkPlotGridView::UpdateDetailedPlot().

void SetWindowLevelRange ( double  lower,
double  upper,
int  index 
)
virtual

SetWindowLevel for plot view; index 0 is frequency, index 1 is intensity. NOTE: Method assumes that frequency ranges are in integers (points).

Parameters
lowerthe lower limit
upperthe upper limit
indexwhich dimension you wish to change, frequency or magnitude

Reimplemented from svkDataView.

References svkPlotGridView::AMPLITUDE, svkPlotGridView::FREQUENCY, svkPlotGridView::plotGrids, svkPlotGridView::Refresh(), svkDetailedPlotDirector::SetIndexRange(), svkDetailedPlotDirector::SetYRange(), and svkDataView::tlcBrc.

void ShowView ( )
void TurnPropOff ( int  propIndex)
virtual
void TurnPropOn ( int  propIndex)
virtual
void UpdateDetailedPlot ( int *  tlcBrc)
protected
void UpdateDetailedPlotOverlay ( int  tlcID)
protected
void UpdateMetaboliteImage ( int *  tlcBrc)
protected

Updates the visible metabolite values depending on the selection

Parameters
tlcBrcpoints to a legth two int vector, the first index being the top left corner and the second being the bottom right.

References svkDataView::dataVector, svkDataView::GetProp(), svkPlotGridView::MR4D, svkDataView::orientation, svkPlotGridView::OVERLAY_IMAGE, and svkDataView::slice.

Referenced by svkPlotGridView::SetSlice(), and svkPlotGridView::SetTlcBrc().

void UpdateMetaboliteText ( int *  tlcBrc)
protected

Updates the visible metabolite values depending on the selection

Parameters
tlcBrcpoints to a legth two int vector, the first index being the top left corner and the second being the bottom right.

References svkDataView::dataVector, svkPlotGridView::metClippers, and svkPlotGridView::MR4D.

Referenced by svkPlotGridView::CreateMetaboliteOverlay(), svkPlotGridView::SetSlice(), and svkPlotGridView::SetTlcBrc().

void UpdateMetaboliteTextDisplacement ( )
protected

The actor that represents the text values of the metabolite overlays will, by default, render the text at the center of each voxel. We want the text to show up in the top left corner of each voxel. To do this we will apply a transform to the actor to translate it.

References svkDcmHeader::AXIAL, svkDcmHeader::CORONAL, svkDataView::dataVector, svkDataView::GetProp(), svkVoxelTaggingUtils::IsImageVoxelTagData(), svkPlotGridView::MET, svkDataView::orientation, svkPlotGridView::OVERLAY_TEXT, and svkDcmHeader::SAGITTAL.

Referenced by svkPlotGridView::CreateMetaboliteOverlay(), and svkPlotGridView::SetOrientation().

vtkTypeMacro ( svkPlotGridView  ,
svkDataView   
)

Friends And Related Function Documentation

friend class svkPlotGridViewController
friend

Member Data Documentation

vector<svkImageClip*> metClippers
protected
vector<vtkActor2D*> overlayTextActors
protected
vector<svkPlotLineGrid*> plotGrids
protected
double referencePlotColors[10][3]
protected

The documentation for this class was generated from the following files: