本文整理汇总了C++中image::Pointer::GetStatistics方法的典型用法代码示例。如果您正苦于以下问题:C++ Pointer::GetStatistics方法的具体用法?C++ Pointer::GetStatistics怎么用?C++ Pointer::GetStatistics使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类image::Pointer
的用法示例。
在下文中一共展示了Pointer::GetStatistics方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: layer
void mitk::BinaryThresholdTool::SetupPreviewNode()
{
if (m_NodeForThresholding.IsNotNull())
{
Image::Pointer image = dynamic_cast<Image*>(m_NodeForThresholding->GetData());
Image::Pointer originalImage = dynamic_cast<Image*> (m_OriginalImageNode->GetData());
if (image.IsNotNull())
{
mitk::Image* workingimage = dynamic_cast<mitk::Image*>(m_ToolManager->GetWorkingData(0)->GetData());
if (workingimage)
{
m_ThresholdFeedbackNode->SetData(workingimage->Clone());
//Let's paint the feedback node green...
mitk::LabelSetImage::Pointer previewImage = dynamic_cast<mitk::LabelSetImage*> (m_ThresholdFeedbackNode->GetData());
itk::RGBPixel<float> pixel;
pixel[0] = 0.0f;
pixel[1] = 1.0f;
pixel[2] = 0.0f;
previewImage->GetActiveLabel()->SetColor(pixel);
previewImage->GetActiveLabelSet()->UpdateLookupTable(previewImage->GetActiveLabel()->GetValue());
}
else
m_ThresholdFeedbackNode->SetData(mitk::Image::New());
int layer(50);
m_NodeForThresholding->GetIntProperty("layer", layer);
m_ThresholdFeedbackNode->SetIntProperty("layer", layer + 1);
if (DataStorage* ds = m_ToolManager->GetDataStorage())
{
if (!ds->Exists(m_ThresholdFeedbackNode))
ds->Add(m_ThresholdFeedbackNode, m_OriginalImageNode);
}
if (image.GetPointer() == originalImage.GetPointer())
{
Image::StatisticsHolderPointer statistics = originalImage->GetStatistics();
m_SensibleMinimumThresholdValue = static_cast<double>(statistics->GetScalarValueMin());
m_SensibleMaximumThresholdValue = static_cast<double>(statistics->GetScalarValueMax());
}
if ((originalImage->GetPixelType().GetPixelType() == itk::ImageIOBase::SCALAR)
&& (originalImage->GetPixelType().GetComponentType() == itk::ImageIOBase::FLOAT || originalImage->GetPixelType().GetComponentType() == itk::ImageIOBase::DOUBLE))
m_IsFloatImage = true;
else
m_IsFloatImage = false;
m_CurrentThresholdValue = (m_SensibleMaximumThresholdValue + m_SensibleMinimumThresholdValue) / 2.0;
IntervalBordersChanged.Send(m_SensibleMinimumThresholdValue, m_SensibleMaximumThresholdValue, m_IsFloatImage);
ThresholdingValueChanged.Send(m_CurrentThresholdValue);
}
}
}