Skip to content

Commit

Permalink
Refs #7091. Adding threshold parameter for top percentile.
Browse files Browse the repository at this point in the history
  • Loading branch information
Michael Reuter committed May 28, 2013
1 parent 3190544 commit 9c528e4
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,17 @@
number_of_elements="1"
default_values="1000">
</IntVectorProperty>
<IntVectorProperty
name="Top Percentile"
command="SetTopPercentile"
number_of_elements="1"
default_values="5">
<IntRangeDomain name="range" min="1" max="100" />
<Documentation>
The set the viewing limit to the top percentile of the denses boxes.
</Documentation>
</IntVectorProperty>
</SourceProxy>
</ProxyGroup>
<!-- End SplatterPlot -->
</ServerManagerConfiguration>
</ServerManagerConfiguration>
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,22 @@ void vtkSplatterPlot::SetNumberOfPoints(int nPoints)
}
}

/**
* Set the threshold for the top percentile of most dense boxes to view
* @param topPercentile : the limit on the percentile of boxes to show
*/
void vtkSplatterPlot::SetTopPercentile(int topPercentile)
{
if (topPercentile > 0)
{
if (m_topPercentile != topPercentile)
{
m_topPercentile = topPercentile;
this->Modified();
}
}
}


int vtkSplatterPlot::RequestData(vtkInformation *, vtkInformationVector **, vtkInformationVector *outputVector)
{
Expand All @@ -64,7 +80,8 @@ int vtkSplatterPlot::RequestData(vtkInformation *, vtkInformationVector **, vtkI
Workspace_sptr result=AnalysisDataService::Instance().retrieve(wsName);

std::string scalarName = "signal";
vtkSplatterPlotFactory vtkGridFactory(ThresholdRange_scptr(new NoThresholdRange), scalarName, m_numberPoints);
vtkSplatterPlotFactory vtkGridFactory(ThresholdRange_scptr(new NoThresholdRange), scalarName, m_numberPoints,
static_cast<double>(m_topPercentile));
vtkGridFactory.initialize(result);

FilterUpdateProgressAction<vtkSplatterPlot> drawUpdateProgress(this, "Drawing...");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ class VTK_EXPORT vtkSplatterPlot : public vtkUnstructuredGridAlgorithm
vtkTypeMacro(vtkSplatterPlot, vtkUnstructuredGridAlgorithm);
void PrintSelf(ostream& os, vtkIndent indent);
void SetNumberOfPoints(int nPoints);
void SetTopPercentile(int topPercentile);
void updateAlgorithmProgress(double progress, const std::string& message);
protected:

Expand All @@ -21,5 +22,6 @@ class VTK_EXPORT vtkSplatterPlot : public vtkUnstructuredGridAlgorithm
vtkSplatterPlot(const vtkSplatterPlot&);
void operator = (const vtkSplatterPlot&);
size_t m_numberPoints;
int m_topPercentile;
};
#endif

0 comments on commit 9c528e4

Please sign in to comment.