本文整理汇总了C++中imagegeom::Pointer类的典型用法代码示例。如果您正苦于以下问题:C++ Pointer类的具体用法?C++ Pointer怎么用?C++ Pointer使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了Pointer类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: dataCheck
// -----------------------------------------------------------------------------
//
// -----------------------------------------------------------------------------
void AvizoUniformCoordinateWriter::dataCheck()
{
setErrorCondition(0);
DataContainer::Pointer dc = getDataContainerArray()->getPrereqDataContainer<AbstractFilter>(this, getFeatureIdsArrayPath().getDataContainerName(), false);
if (getErrorCondition() < 0 || NULL == dc.get()) {
return;
}
ImageGeom::Pointer image = dc->getPrereqGeometry<ImageGeom, AbstractFilter>(this);
if (getErrorCondition() < 0 || NULL == image.get()) {
return;
}
if(m_OutputFile.isEmpty() == true)
{
QString ss = QObject::tr("The output file must be set before executing this filter.");
setErrorCondition(-1);
notifyErrorMessage(getHumanLabel(), ss, getErrorCondition());
}
if(m_WriteFeatureIds == true)
{
QVector<size_t> dims(1, 1);
m_FeatureIdsPtr = getDataContainerArray()->getPrereqArrayFromPath<DataArray<int32_t>, AbstractFilter>(this, getFeatureIdsArrayPath(), dims); /* Assigns the shared_ptr<> to an instance variable that is a weak_ptr<> */
if( NULL != m_FeatureIdsPtr.lock().get() ) /* Validate the Weak Pointer wraps a non-NULL pointer to a DataArray<T> object */
{
m_FeatureIds = m_FeatureIdsPtr.lock()->getPointer(0); /* Now assign the raw pointer to data from the DataArray<T> object */
}
}
}
示例2: execute
// -----------------------------------------------------------------------------
//
// -----------------------------------------------------------------------------
void ScaleVolume::execute()
{
setErrorCondition(0);
dataCheck();
if(getErrorCondition() < 0) { return; }
if (m_ApplyToVoxelVolume == true)
{
DataContainer::Pointer m = getDataContainerArray()->getDataContainer(getDataContainerName());
ImageGeom::Pointer image = m->getGeometryAs<ImageGeom>();
float resolution[3] = { 0.0f, 0.0f, 0.0f };
image->getResolution(resolution);
resolution[0] *= m_ScaleFactor.x;
resolution[1] *= m_ScaleFactor.y;
resolution[2] *= m_ScaleFactor.z;
image->setResolution(resolution);
}
if (m_ApplyToSurfaceMesh == true)
{
updateSurfaceMesh();
}
notifyStatusMessage(getHumanLabel(), "Complete");
}
示例3: execute
// -----------------------------------------------------------------------------
//
// -----------------------------------------------------------------------------
void RequiredZThickness::execute()
{
setErrorCondition(0);
dataCheck();
if(getErrorCondition() < 0) { return; }
DataContainer::Pointer dataContainer = getDataContainerArray()->getPrereqDataContainer<AbstractFilter>(this, getDataContainerSelection());
if (getErrorCondition() < 0) { return; }
ImageGeom::Pointer image = dataContainer->getGeometryAs<ImageGeom>();
size_t dims[3] = { 0, 0, 0 };
image->getDimensions(dims);
if (dims[2] < getNumZVoxels())
{
QString str;
QTextStream ss(&str);
ss << "Number of Z Voxels does not meet required value during execution of the filter. \n";
ss << " Required Z Voxels: " << m_NumZVoxels << "\n";
ss << " Current Z Voxels: " << dims[2];
setErrorCondition(-7788);
notifyErrorMessage(getHumanLabel(), str, getErrorCondition());
bool needMoreData = true;
emit decisionMade(needMoreData);
}
notifyStatusMessage(getHumanLabel(), "Complete");
}
示例4: dataCheck
// -----------------------------------------------------------------------------
//
// -----------------------------------------------------------------------------
void AlignSections::dataCheck()
{
setErrorCondition(0);
DataArrayPath tempPath;
ImageGeom::Pointer image = getDataContainerArray()->getPrereqGeometryFromDataContainer<ImageGeom, AbstractFilter>(this, getDataContainerName());
if(getErrorCondition() < 0) { return; }
if (image->getXPoints() <= 1 || image->getYPoints() <= 1 || image->getZPoints() <= 1)
{
QString ss = QObject::tr("The Image Geometry is not 3D and cannot be run through this filter. The dimensions are (%1,%2,%3)").arg(image->getXPoints()).arg(image->getYPoints()).arg(image->getZPoints());
setErrorCondition(-3010);
notifyErrorMessage(getHumanLabel(), ss, getErrorCondition());
}
tempPath.update(getDataContainerName(), getCellAttributeMatrixName(), "");
getDataContainerArray()->getPrereqAttributeMatrixFromPath<AbstractFilter>(this, tempPath, -301);
if (true == m_WriteAlignmentShifts && m_AlignmentShiftFileName.isEmpty() == true)
{
QString ss = QObject::tr("The alignment shift file name is empty");
setErrorCondition(-1);
notifyErrorMessage(getHumanLabel(), ss, getErrorCondition());
}
}
示例5: dataCheck
// -----------------------------------------------------------------------------
//
// -----------------------------------------------------------------------------
void FindMaxima::dataCheck()
{
setErrorCondition(0);
DataArrayPath tempPath;
//check for required arrays
QVector<size_t> compDims(1, 1);
m_SelectedCellArrayPtr = TemplateHelpers::GetPrereqArrayFromPath<AbstractFilter>()(this, getSelectedCellArrayPath(), compDims);
if(NULL != m_SelectedCellArrayPtr.lock().get())
{
m_SelectedCellArray = m_SelectedCellArrayPtr.lock().get();
}
if(getErrorCondition() < 0) { return; }
ImageGeom::Pointer image = getDataContainerArray()->getDataContainer(getSelectedCellArrayPath().getDataContainerName())->getPrereqGeometry<ImageGeom, AbstractFilter>(this);
if(getErrorCondition() < 0 || NULL == image.get()) { return; }
//configured created name / location
tempPath.update(getSelectedCellArrayPath().getDataContainerName(), getSelectedCellArrayPath().getAttributeMatrixName(), getNewCellArrayName() );
DataContainer::Pointer dataContiner = getDataContainerArray()->getPrereqDataContainer<AbstractFilter>(this, getSelectedCellArrayPath().getDataContainerName() );
AttributeMatrix::Pointer attrMatrix = dataContiner->getPrereqAttributeMatrix<AbstractFilter>(this, getSelectedCellArrayPath().getAttributeMatrixName(), 80000);
IDataArray::Pointer redArrayptr = attrMatrix->getPrereqIDataArray<IDataArray, AbstractFilter>(this, getSelectedCellArrayPath().getDataArrayName(), 80000);
//create new boolean array
tempPath.update(getSelectedCellArrayPath().getDataContainerName(), getSelectedCellArrayPath().getAttributeMatrixName(), getNewCellArrayName() );
m_NewCellArrayPtr = getDataContainerArray()->createNonPrereqArrayFromPath<DataArray<bool>, AbstractFilter, bool>(this, tempPath, 0, compDims); /* Assigns the shared_ptr<> to an instance variable that is a weak_ptr<> */
if( NULL != m_NewCellArrayPtr.lock().get() ) /* Validate the Weak Pointer wraps a non-NULL pointer to a DataArray<T> object */
{ m_NewCellArray = m_NewCellArrayPtr.lock()->getPointer(0); } /* Now assign the raw pointer to data from the DataArray<T> object */
}
示例6: getCurrentVolumeDataContainerResolutions
// -----------------------------------------------------------------------------
//
// -----------------------------------------------------------------------------
FloatVec3_t CropImageGeometry::getCurrentVolumeDataContainerResolutions()
{
DataContainer::Pointer m = getDataContainerArray()->getDataContainer(getCellAttributeMatrixPath().getDataContainerName());
FloatVec3_t data;
if (NULL != m)
{
ImageGeom::Pointer image = m->getGeometryAs<ImageGeom>();
if (image.get() != NULL)
{
data.x = image->getXRes();
data.y = image->getYRes();
data.z = image->getZRes();
}
else
{
data.x = 0;
data.y = 0;
data.z = 0;
}
}
else
{
data.x = 0;
data.y = 0;
data.z = 0;
}
return data;
}
示例7: dataCheck
// -----------------------------------------------------------------------------
//
// -----------------------------------------------------------------------------
void AlignSectionsFeatureCentroid::dataCheck()
{
setErrorCondition(0);
// Set the DataContainerName and AttributematrixName for the Parent Class (AlignSections) to Use.
// These are checked for validity in the Parent Class dataCheck
setDataContainerName(m_GoodVoxelsArrayPath.getDataContainerName());
setCellAttributeMatrixName(m_GoodVoxelsArrayPath.getAttributeMatrixName());
AlignSections::dataCheck();
if(getErrorCondition() < 0) { return; }
ImageGeom::Pointer image = getDataContainerArray()->getPrereqGeometryFromDataContainer<ImageGeom, AbstractFilter>(this, m_GoodVoxelsArrayPath.getDataContainerName());
if(getErrorCondition() < 0) { return; }
if (m_ReferenceSlice > image->getZPoints())
{
QString ss = QObject::tr("The Image Geometry extent (%1) is smaller than the supplied reference slice (%2)").arg(image->getZPoints()).arg(m_ReferenceSlice);
setErrorCondition(-5556);
notifyErrorMessage(getHumanLabel(), ss, getErrorCondition());
}
QVector<size_t> cDims(1, 1);
m_GoodVoxelsPtr = getDataContainerArray()->getPrereqArrayFromPath<DataArray<bool>, AbstractFilter>(this, getGoodVoxelsArrayPath(), cDims); /* Assigns the shared_ptr<> to an instance variable that is a weak_ptr<> */
if( NULL != m_GoodVoxelsPtr.lock().get() ) /* Validate the Weak Pointer wraps a non-NULL pointer to a DataArray<T> object */
{ m_GoodVoxels = m_GoodVoxelsPtr.lock()->getPointer(0); } /* Now assign the raw pointer to data from the DataArray<T> object */
if(getErrorCondition() < 0) { return; }
}
示例8: dataCheck
// -----------------------------------------------------------------------------
//
// -----------------------------------------------------------------------------
void GrayToRGB::dataCheck()
{
setErrorCondition(0);
DataArrayPath tempPath;
//check for required arrays
QVector<size_t> compDims(1, 1);
m_RedPtr = TemplateHelpers::GetPrereqArrayFromPath<AbstractFilter>()(this, getRedArrayPath(), compDims);
if(NULL != m_RedPtr.lock().get())
{
m_Red = m_RedPtr.lock().get();
}
m_GreenPtr = TemplateHelpers::GetPrereqArrayFromPath<AbstractFilter>()(this, getGreenArrayPath(), compDims);
if(NULL != m_GreenPtr.lock().get())
{
m_Green = m_GreenPtr.lock().get();
}
m_BluePtr = TemplateHelpers::GetPrereqArrayFromPath<AbstractFilter>()(this, getBlueArrayPath(), compDims);
if(NULL != m_BluePtr.lock().get())
{
m_Blue = m_BluePtr.lock().get();
}
//configured created name / location
tempPath.update(getRedArrayPath().getDataContainerName(), getRedArrayPath().getAttributeMatrixName(), getNewCellArrayName() );
DataContainer::Pointer redDC = getDataContainerArray()->getPrereqDataContainer<AbstractFilter>(this, getRedArrayPath().getDataContainerName() );
if(getErrorCondition() < 0) {
return;
}
AttributeMatrix::Pointer redAM = redDC->getPrereqAttributeMatrix<AbstractFilter>(this, getRedArrayPath().getAttributeMatrixName(), 80000);
if(getErrorCondition() < 0) {
return;
}
IDataArray::Pointer redArrayptr = redAM->getPrereqIDataArray<IDataArray, AbstractFilter>(this, getRedArrayPath().getDataArrayName(), 80000);
if(getErrorCondition() < 0) {
return;
}
ImageGeom::Pointer image = redDC->getPrereqGeometry<ImageGeom, AbstractFilter>(this);
if(getErrorCondition() < 0 || NULL == image.get()) {
return;
}
//create new array of same type
compDims[0] = 3;
m_NewCellArrayPtr = TemplateHelpers::CreateNonPrereqArrayFromArrayType()(this, tempPath, compDims, redArrayptr);
if( NULL != m_NewCellArrayPtr.lock().get() )
{
m_NewCellArray = m_NewCellArrayPtr.lock()->getVoidPointer(0);
}
}
示例9: dataCheck
// -----------------------------------------------------------------------------
//
// -----------------------------------------------------------------------------
void FindEllipsoidError::dataCheck()
{
DataArrayPath tempPath;
setErrorCondition(0);
QVector<size_t> dims(1, 1);
m_FeatureIdsPtr = getDataContainerArray()->getPrereqArrayFromPath<DataArray<int32_t>, AbstractFilter>(this, getFeatureIdsArrayPath(), dims); /* Assigns the shared_ptr<> to an instance variable that is a weak_ptr<> */
if( NULL != m_FeatureIdsPtr.lock().get() ) /* Validate the Weak Pointer wraps a non-NULL pointer to a DataArray<T> object */
{ m_FeatureIds = m_FeatureIdsPtr.lock()->getPointer(0); } /* Now assign the raw pointer to data from the DataArray<T> object */
if(getErrorCondition() < 0) { return; }
ImageGeom::Pointer image = getDataContainerArray()->getDataContainer(getFeatureIdsArrayPath().getDataContainerName())->getPrereqGeometry<ImageGeom, AbstractFilter>(this);
if(getErrorCondition() < 0 || NULL == image.get()) { return; }
dims[0] = 3;
m_CentroidsPtr = getDataContainerArray()->getPrereqArrayFromPath<DataArray<float>, AbstractFilter>(this, getCentroidsArrayPath(), dims); /* Assigns the shared_ptr<> to an instance variable that is a weak_ptr<> */
if( NULL != m_CentroidsPtr.lock().get() ) /* Validate the Weak Pointer wraps a non-NULL pointer to a DataArray<T> object */
{ m_Centroids = m_CentroidsPtr.lock()->getPointer(0); } /* Now assign the raw pointer to data from the DataArray<T> object */
dims[0] = 3;
m_AxisEulerAnglesPtr = getDataContainerArray()->getPrereqArrayFromPath<DataArray<float>, AbstractFilter>(this, getAxisEulerAnglesArrayPath(), dims);
if( NULL != m_AxisEulerAnglesPtr.lock().get() ) /* Validate the Weak Pointer wraps a non-NULL pointer to a DataArray<T> object */
{ m_AxisEulerAngles = m_AxisEulerAnglesPtr.lock()->getPointer(0); } /* Now assign the raw pointer to data from the DataArray<T> object */
dims[0] = 3;
m_AxisLengthsPtr = getDataContainerArray()->getPrereqArrayFromPath<DataArray<float>, AbstractFilter>(this, getAxisLengthsArrayPath(), dims);
if( NULL != m_AxisLengthsPtr.lock().get() ) /* Validate the Weak Pointer wraps a non-NULL pointer to a DataArray<T> object */
{ m_AxisLengths = m_AxisLengthsPtr.lock()->getPointer(0); } /* Now assign the raw pointer to data from the DataArray<T> object */
dims[0] = 1;
m_NumCellsPtr = getDataContainerArray()->getPrereqArrayFromPath<DataArray<int32_t>, AbstractFilter>(this, getNumCellsArrayPath(), dims);
if( NULL != m_NumCellsPtr.lock().get() ) /* Validate the Weak Pointer wraps a non-NULL pointer to a DataArray<T> object */
{ m_NumCells = m_NumCellsPtr.lock()->getPointer(0); } /* Now assign the raw pointer to data from the DataArray<T> object */
if (m_WriteIdealEllipseFeatureIds == true)
{
dims[0] = 1;
tempPath.update(m_FeatureIdsArrayPath.getDataContainerName(), m_FeatureIdsArrayPath.getAttributeMatrixName(), getIdealFeatureIdsArrayName() );
m_IdealFeatureIdsPtr = getDataContainerArray()->createNonPrereqArrayFromPath<DataArray<int32_t>, AbstractFilter, int32_t>(this, tempPath, 0, dims); /* Assigns the shared_ptr<> to an instance variable that is a weak_ptr<> */
if( NULL != m_IdealFeatureIdsPtr.lock().get() ) /* Validate the Weak Pointer wraps a non-NULL pointer to a DataArray<T> object */
{ m_IdealFeatureIds = m_IdealFeatureIdsPtr.lock()->getPointer(0); } /* Now assign the raw pointer to data from the DataArray<T> object */
}
dims[0] = 1;
tempPath.update(m_NumCellsArrayPath.getDataContainerName(), m_NumCellsArrayPath.getAttributeMatrixName(), getEllipsoidErrorArrayName() );
m_EllipsoidErrorPtr = getDataContainerArray()->createNonPrereqArrayFromPath<DataArray<float>, AbstractFilter, float>(this, tempPath, 0, dims); /* Assigns the shared_ptr<> to an instance variable that is a weak_ptr<> */
if( NULL != m_EllipsoidErrorPtr.lock().get() ) /* Validate the Weak Pointer wraps a non-NULL pointer to a DataArray<T> object */
{ m_EllipsoidError = m_EllipsoidErrorPtr.lock()->getPointer(0); } /* Now assign the raw pointer to data from the DataArray<T> object */
}
示例10: dataCheck
// -----------------------------------------------------------------------------
//
// -----------------------------------------------------------------------------
void RGBToGray::dataCheck()
{
setErrorCondition(0);
DataArrayPath tempPath = getSelectedCellArrayArrayPath();
//check for required arrays
QVector<size_t> compDims(1, 3);
m_SelectedCellArrayPtr = TemplateHelpers::GetPrereqArrayFromPath<AbstractFilter>()(this, tempPath, compDims);
if(NULL != m_SelectedCellArrayPtr.lock().get())
{
m_SelectedCellArray = m_SelectedCellArrayPtr.lock().get();
}
else // Something went wrong because that should have worked. Bail out now.
{
return;
}
#if 0
//get type
QString typeName = getDataContainerArray()->getDataContainer(getSelectedCellArrayArrayPath().getDataContainerName())->getAttributeMatrix(getSelectedCellArrayArrayPath().getAttributeMatrixName())->getAttributeArray(getSelectedCellArrayArrayPath().getDataArrayName())->getTypeAsString();;
int type = TemplateUtilities::getTypeFromTypeName(typeName);
//create new array of same type
dims[0] = 1;
TEMPLATE_CREATE_NONPREREQ_ARRAY(NewCellArray, tempPath, dims, type);
#endif
DataContainer::Pointer dc = getDataContainerArray()->getPrereqDataContainer<AbstractFilter>(this, getSelectedCellArrayArrayPath().getDataContainerName() );
if(getErrorCondition() < 0) { return; }
AttributeMatrix::Pointer am = dc->getPrereqAttributeMatrix<AbstractFilter>(this, getSelectedCellArrayArrayPath().getAttributeMatrixName(), 80000);
if(getErrorCondition() < 0) { return; }
IDataArray::Pointer data = am->getPrereqIDataArray<IDataArray, AbstractFilter>(this, getSelectedCellArrayArrayPath().getDataArrayName(), 80000);
if(getErrorCondition() < 0) { return; }
ImageGeom::Pointer image = dc->getPrereqGeometry<ImageGeom, AbstractFilter>(this);
if(getErrorCondition() < 0 || NULL == image.get()) { return; }
compDims[0] = 1;
//configured created name / location
tempPath.setDataArrayName(getNewCellArrayName());
m_NewCellArrayPtr = TemplateHelpers::CreateNonPrereqArrayFromArrayType()(this, tempPath, compDims, data);
if( NULL != m_NewCellArrayPtr.lock().get() )
{
m_NewCellArray = m_NewCellArrayPtr.lock()->getVoidPointer(0);
}
}
示例11: dataCheck
// -----------------------------------------------------------------------------
//
// -----------------------------------------------------------------------------
void SetOriginResolutionImageGeom::dataCheck()
{
setErrorCondition(0);
ImageGeom::Pointer image = getDataContainerArray()->getPrereqGeometryFromDataContainer<ImageGeom, AbstractFilter>(this, getDataContainerName());
if(getErrorCondition() < 0)
{
return;
}
if(getChangeOrigin())
{
image->setOrigin(m_Origin.x, m_Origin.y, m_Origin.z);
}
if(getChangeResolution())
{
image->setResolution(m_Resolution.x, m_Resolution.y, m_Resolution.z);
}
}
示例12: dataCheck
// -----------------------------------------------------------------------------
//
// -----------------------------------------------------------------------------
void RequiredZThickness::dataCheck()
{
setErrorCondition(0);
if(getErrorCondition() < 0) { return; }
DataContainer::Pointer dataContainer = getDataContainerArray()->getPrereqDataContainer<AbstractFilter>(this, getDataContainerSelection());
if (getErrorCondition() < 0) { return; }
ImageGeom::Pointer image = dataContainer->getGeometryAs<ImageGeom>();
if( NULL == image.get() )
{
setErrorCondition(-7789);
notifyErrorMessage(getHumanLabel(), "Missing Image Geometry in the selected DataContainer", getErrorCondition());
return;
}
size_t dims[3] = { 0, 0, 0 };
image->getDimensions(dims);
if (dims[2] < getNumZVoxels() && m_PreflightCheck)
{
setErrorCondition(-7787);
QString str;
QTextStream ss(&str);
ss << "Number of Z Voxels does not meet required value during preflight of the filter. \n";
ss << " Required Z Voxels: " << m_NumZVoxels << "\n";
ss << " Current Z Voxels: " << dims[2];
notifyErrorMessage(getHumanLabel(), str, getErrorCondition());
}
else if (dims[2] < getNumZVoxels() && !m_PreflightCheck)
{
QString str;
QTextStream ss(&str);
ss << "Number of Z Voxels does not meet required value during preflight but will be checked during pipeline execution.\n";
ss << " Required Z Voxels: " << m_NumZVoxels << "\n";
ss << " Current Z Voxels: " << dims[2];
notifyWarningMessage(getHumanLabel(), str, getErrorCondition());
}
}
示例13: dataCheck
// -----------------------------------------------------------------------------
//
// -----------------------------------------------------------------------------
void Watershed::dataCheck()
{
setErrorCondition(0);
DataArrayPath tempPath;
QVector<size_t> dims(1, 1);
m_SelectedCellArrayPtr = getDataContainerArray()->getPrereqArrayFromPath<DataArray<ImageProcessing::DefaultPixelType>, AbstractFilter>(this, getSelectedCellArrayPath(), dims); /* Assigns the shared_ptr<> to an instance variable that is a weak_ptr<> */
if( NULL != m_SelectedCellArrayPtr.lock().get() ) /* Validate the Weak Pointer wraps a non-NULL pointer to a DataArray<T> object */
{ m_SelectedCellArray = m_SelectedCellArrayPtr.lock()->getPointer(0); } /* Now assign the raw pointer to data from the DataArray<T> object */
if(getErrorCondition() < 0) { return; }
ImageGeom::Pointer image = getDataContainerArray()->getDataContainer(getSelectedCellArrayPath().getDataContainerName())->getPrereqGeometry<ImageGeom, AbstractFilter>(this);
if(getErrorCondition() < 0 || NULL == image.get()) { return; }
tempPath.update(getSelectedCellArrayPath().getDataContainerName(), getSelectedCellArrayPath().getAttributeMatrixName(), getFeatureIdsArrayName() );
m_FeatureIdsPtr = getDataContainerArray()->createNonPrereqArrayFromPath<DataArray<int32_t>, AbstractFilter, int32_t>(this, tempPath, 0, dims); /* Assigns the shared_ptr<> to an instance variable that is a weak_ptr<> */
if( NULL != m_FeatureIdsPtr.lock().get() ) /* Validate the Weak Pointer wraps a non-NULL pointer to a DataArray<T> object */
{ m_FeatureIds = m_FeatureIdsPtr.lock()->getPointer(0); } /* Now assign the raw pointer to data from the DataArray<T> object */
}
示例14: dataCheck
// -----------------------------------------------------------------------------
//
// -----------------------------------------------------------------------------
void SineParamsSegmentFeatures::dataCheck()
{
DataArrayPath tempPath;
setErrorCondition(0);
//Set the DataContainerName for the Parent Class (SegmentFeatures) to Use
setDataContainerName(m_SineParamsArrayPath.getDataContainerName());
SegmentFeatures::dataCheck();
if(getErrorCondition() < 0) { return; }
DataContainer::Pointer m = getDataContainerArray()->getPrereqDataContainer<AbstractFilter>(this, getDataContainerName(), false);
if(getErrorCondition() < 0 || NULL == m) { return; }
QVector<size_t> tDims(1, 0);
AttributeMatrix::Pointer cellFeatureAttrMat = m->createNonPrereqAttributeMatrix<AbstractFilter>(this, getCellFeatureAttributeMatrixName(), tDims, DREAM3D::AttributeMatrixType::CellFeature);
if(getErrorCondition() < 0 || NULL == cellFeatureAttrMat.get()) { return; }
ImageGeom::Pointer image = m->getPrereqGeometry<ImageGeom, AbstractFilter>(this);
if(getErrorCondition() < 0 || NULL == image.get()) { return; }
QVector<size_t> dims(1, 3);
m_SineParamsPtr = getDataContainerArray()->getPrereqArrayFromPath<DataArray<float>, AbstractFilter>(this, getSineParamsArrayPath(), dims);
if( NULL != m_SineParamsPtr.lock().get() ) /* Validate the Weak Pointer wraps a non-NULL pointer to a DataArray<T> object */
{ m_SineParams = m_SineParamsPtr.lock()->getPointer(0); } /* Now assign the raw pointer to data from the DataArray<T> object */
dims[0] = 1;
tempPath.update(getDataContainerName(), m_SineParamsArrayPath.getAttributeMatrixName(), getFeatureIdsArrayName() );
m_FeatureIdsPtr = getDataContainerArray()->createNonPrereqArrayFromPath<DataArray<int32_t>, AbstractFilter, int32_t>(this, tempPath, 0, dims); /* Assigns the shared_ptr<> to an instance variable that is a weak_ptr<> */
if( NULL != m_FeatureIdsPtr.lock().get() ) /* Validate the Weak Pointer wraps a non-NULL pointer to a DataArray<T> object */
{ m_FeatureIds = m_FeatureIdsPtr.lock()->getPointer(0); } /* Now assign the raw pointer to data from the DataArray<T> object */
if(m_UseGoodVoxels == true)
{
m_GoodVoxelsPtr = getDataContainerArray()->getPrereqArrayFromPath<DataArray<bool>, AbstractFilter>(this, getGoodVoxelsArrayPath(), dims); /* Assigns the shared_ptr<> to an instance variable that is a weak_ptr<> */
if( NULL != m_GoodVoxelsPtr.lock().get() ) /* Validate the Weak Pointer wraps a non-NULL pointer to a DataArray<T> object */
{ m_GoodVoxels = m_GoodVoxelsPtr.lock()->getPointer(0); } /* Now assign the raw pointer to data from the DataArray<T> object */
}
tempPath.update(getDataContainerName(), getCellFeatureAttributeMatrixName(), getActiveArrayName() );
m_ActivePtr = getDataContainerArray()->createNonPrereqArrayFromPath<DataArray<bool>, AbstractFilter, bool>(this, tempPath, true, dims); /* Assigns the shared_ptr<> to an instance variable that is a weak_ptr<> */
if( NULL != m_ActivePtr.lock().get() ) /* Validate the Weak Pointer wraps a non-NULL pointer to a DataArray<T> object */
{ m_Active = m_ActivePtr.lock()->getPointer(0); } /* Now assign the raw pointer to data from the DataArray<T> object */
}
示例15: dataCheck
// -----------------------------------------------------------------------------
//
// -----------------------------------------------------------------------------
void RegularizeZSpacing::dataCheck()
{
setErrorCondition(0);
if (getNewZRes() <= 0)
{
QString ss = QObject::tr("The new Z resolution Y (%1) must be positive").arg(getNewZRes());
setErrorCondition(-5555);
notifyErrorMessage(getHumanLabel(), ss, getErrorCondition());
}
std::ifstream inFile;
inFile.open(m_InputFile.toLatin1().data());
if (!inFile.good())
{
QString ss = QObject::tr("Unable to open input file with name '%1'").arg(getInputFile());
setErrorCondition(-5556);
notifyErrorMessage(getHumanLabel(), ss, getErrorCondition());
return;
}
ImageGeom::Pointer image = getDataContainerArray()->getPrereqGeometryFromDataContainer<ImageGeom, AbstractFilter>(this, getCellAttributeMatrixPath().getDataContainerName());
AttributeMatrix::Pointer cellAttrMat = getDataContainerArray()->getPrereqAttributeMatrixFromPath<AbstractFilter>(this, getCellAttributeMatrixPath(), -301);
if(getErrorCondition() < 0) {
return;
}
float zval = 0.0f;
for (size_t iter = 0; iter < image->getZPoints() + 1; iter++)
{
inFile >> zval;
}
size_t zP = static_cast<size_t>(zval / getNewZRes());
if(zP == 0) {
zP = 1;
}
if (getInPreflight())
{
image->setDimensions(image->getXPoints(), image->getYPoints(), zP);
QVector<size_t> tDims(3, 0);
tDims[0] = image->getXPoints();
tDims[1] = image->getYPoints();
tDims[2] = zP;
cellAttrMat->resizeAttributeArrays(tDims);
}
inFile.close();
}