本文整理汇总了C++中VoxelDataContainer::renameCellData方法的典型用法代码示例。如果您正苦于以下问题:C++ VoxelDataContainer::renameCellData方法的具体用法?C++ VoxelDataContainer::renameCellData怎么用?C++ VoxelDataContainer::renameCellData使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类VoxelDataContainer
的用法示例。
在下文中一共展示了VoxelDataContainer::renameCellData方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: dataCheck
// -----------------------------------------------------------------------------
//
// -----------------------------------------------------------------------------
void Threshold::dataCheck(bool preflight, size_t voxels, size_t fields, size_t ensembles)
{
setErrorCondition(0);
std::stringstream ss;
VoxelDataContainer* m = getVoxelDataContainer();
if(m_SelectedCellArrayName.empty() == true)
{
setErrorCondition(-11000);
ss << "An array from the Voxel Data Container must be selected.";
addErrorMessage(getHumanLabel(),ss.str(),getErrorCondition());
}
else
{
m_RawImageDataArrayName=m_SelectedCellArrayName;
GET_PREREQ_DATA(m, DREAM3D, CellData, RawImageData, ss, -300, ImageProcessing::DefaultPixelType, ImageProcessing::DefaultArrayType, voxels, 1)
if(m_OverwriteArray)
{
}
else
{
CREATE_NON_PREREQ_DATA(m, DREAM3D, CellData, ProcessedImageData, ss, ImageProcessing::DefaultPixelType, ImageProcessing::DefaultArrayType, 0, voxels, 1)
m->renameCellData(m_ProcessedImageDataArrayName, m_NewCellArrayName);
}
}
}
示例2: execute
//.........这里部分代码省略.........
thresholdFilter->Update();
}
}
else if(m_Method==12)//manual
{
//threshold
BinaryThresholdImageFilterType::Pointer thresholdFilter = BinaryThresholdImageFilterType::New();
thresholdFilter->SetInput(inputImage);
thresholdFilter->SetLowerThreshold(m_ManualParameter);
thresholdFilter->SetUpperThreshold(255);
thresholdFilter->SetInsideValue(255);
thresholdFilter->SetOutsideValue(0);
thresholdFilter->GetOutput()->GetPixelContainer()->SetImportPointer(m_ProcessedImageData, totalPoints, false);
thresholdFilter->Update();
}
/*
else if(m_Method==13)//robust automatic
{
typedef itk::GradientMagnitudeImageFilter<ImageProcessing::DefaultImageType, ImageProcessing::DefaultImageType> GradientMagnitudeType;
typedef itk::GradientMagnitudeImageFilter<ImageProcessing::DefaultSliceType, ImageProcessing::DefaultSliceType> GradientMagnitudeType2D;
typedef itk::itkRobustAutomaticThresholdCalculator<ImageProcessing::DefaultImageType,ImageProcessing::DefaultImageType> SelectionType;
typedef itk::itkRobustAutomaticThresholdCalculator<ImageProcessing::DefaultSliceType,ImageProcessing::DefaultSliceType> SelectionType2D;
if(m_slice)
{
//wrap output buffer as image
ImageProcessing::DefaultImageType::Pointer outputImage=ITKUtilities::Dream3DtoITK(m, m_ProcessedImageData);
//loop over slices
for(int i=0; i<dims[2]; i++)
{
//get slice
ImageProcessing::DefaultSliceType::Pointer slice = ITKUtilities::ExtractSlice<ImageProcessing::DefaultPixelType>(inputImage, ImageProcessing::ZSlice, i);
//find gradient
GradientMagnitudeType2D::Pointer gradientFilter = GradientMagnitudeType2D::New();
gradientFilter->setInput(slice);
gradientFilter->Update();
//calculate thershold
SelectionType2D::Pointer calculatorFilter = SelectionType2D::New();
calculatorFilter->SetInput(slice);
calculatorFilter->SetGradientImage(gradientFilter->GetOutput());
calculatorFilter->SetPow(m_ManualParameter);
calculatorFilter->Update();
const uint8_t thresholdValue = calculatorFilter->GetOutput();
//threshold
BinaryThresholdImageFilterType::Pointer thresholdFilter = BinaryThresholdImageFilterType::New();
thresholdFilter->SetInput(inputImage);
thresholdFilter->SetLowerThreshold(thresholdValue);
thresholdFilter->SetUpperThreshold(255);
thresholdFilter->SetInsideValue(255);
thresholdFilter->SetOutsideValue(0);
thresholdFilter->Update();
//copy back into volume
ITKUtilities::SetSlice<ImageProcessing::DefaultPixelType>(outputImage, thresholdFilter->GetOutput(), ImageProcessing::ZSlice, i);
}
}
else
{
//find gradient
GradientMagnitudeType::Pointer gradientFilter = GradientMagnitudeType::New();
gradientFilter->setInput(inputImage);
gradientFilter->Update();
//calculate threshold
SelectionType::Pointer calculatorFilter = SelectionType::New();
calculatorFilter->SetInput(inputImage);
calculatorFilter->SetGradientImage(gradientFilter->GetOutput());
calculatorFilter->SetPow(m_ManualParameter);
calculatorFilter->Update();
const uint8_t thresholdValue = calculatorFilter->GetOutput();
//threshold
BinaryThresholdImageFilterType::Pointer thresholdFilter = BinaryThresholdImageFilterType::New();
thresholdFilter->SetInput(inputImage);
thresholdFilter->SetLowerThreshold(thresholdValue);
thresholdFilter->SetUpperThreshold(255);
thresholdFilter->SetInsideValue(255);
thresholdFilter->SetOutsideValue(0);
thresholdFilter->GetOutput()->GetPixelContainer()->SetImportPointer(m_ProcessedImageData, totalPoints, false);
thresholdFilter->Update();
}
}
*/
//array name changing/cleanup
if(m_OverwriteArray)
{
m->removeCellData(m_SelectedCellArrayName);
bool check = m->renameCellData(m_ProcessedImageDataArrayName, m_SelectedCellArrayName);
}
/* Let the GUI know we are done with this filter */
notifyStatusMessage("Complete");
}