本文整理汇总了C++中imagegeom::Pointer::getZPoints方法的典型用法代码示例。如果您正苦于以下问题:C++ Pointer::getZPoints方法的具体用法?C++ Pointer::getZPoints怎么用?C++ Pointer::getZPoints使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类imagegeom::Pointer
的用法示例。
在下文中一共展示了Pointer::getZPoints方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: 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());
}
}
示例2: 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; }
}
示例3: getCurrentVolumeDataContainerDimensions
// -----------------------------------------------------------------------------
//
// -----------------------------------------------------------------------------
IntVec3_t CropImageGeometry::getCurrentVolumeDataContainerDimensions()
{
DataContainer::Pointer m = getDataContainerArray()->getDataContainer(getCellAttributeMatrixPath().getDataContainerName());
IntVec3_t data;
if (NULL != m.get() )
{
ImageGeom::Pointer image = m->getGeometryAs<ImageGeom>();
if (image.get() != NULL)
{
data.x = image->getXPoints();
data.y = image->getYPoints();
data.z = image->getZPoints();
}
else
{
data.x = 0;
data.y = 0;
data.z = 0;
}
}
else
{
data.x = 0;
data.y = 0;
data.z = 0;
}
return data;
}
示例4: 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();
}
示例5: dataCheck
// -----------------------------------------------------------------------------
//
// -----------------------------------------------------------------------------
void InitializeData::dataCheck()
{
setErrorCondition(0);
getDataContainerArray()->getPrereqAttributeMatrixFromPath<AbstractFilter>(this, getCellAttributeMatrixPath(), -301);
ImageGeom::Pointer image = getDataContainerArray()->getPrereqGeometryFromDataContainer<ImageGeom, AbstractFilter>(this, getCellAttributeMatrixPath().getDataContainerName());
if(NULL == image.get()) { return; }
if (getXMax() < getXMin())
{
QString ss = QObject::tr("X Max (%1) less than X Min (%2)").arg(getXMax()).arg(getXMin());
setErrorCondition(-5551);
notifyErrorMessage(getHumanLabel(), ss, getErrorCondition());
}
if (getYMax() < getYMin())
{
QString ss = QObject::tr("Y Max (%1) less than Y Min (%2)").arg(getYMax()).arg(getYMin());
setErrorCondition(-5552);
notifyErrorMessage(getHumanLabel(), ss, getErrorCondition());
}
if (getZMax() < getZMin())
{
QString ss = QObject::tr("Z Max (%1) less than Z Min (%2)").arg(getZMax()).arg(getZMin());
setErrorCondition(-5553);
notifyErrorMessage(getHumanLabel(), ss, getErrorCondition());
}
if (getXMin() < 0)
{
QString ss = QObject::tr("X Min (%1) less than 0").arg(getXMin());
setErrorCondition(-5554);
notifyErrorMessage(getHumanLabel(), ss, getErrorCondition());
}
if (getYMin() < 0)
{
QString ss = QObject::tr("Y Min (%1) less than 0").arg(getYMin());
setErrorCondition(-5555);
notifyErrorMessage(getHumanLabel(), ss, getErrorCondition());
}
if (getZMin() < 0)
{
QString ss = QObject::tr("Z Min (%1) less than 0").arg(getZMin());
setErrorCondition(-5556);
notifyErrorMessage(getHumanLabel(), ss, getErrorCondition());
}
if (getXMax() > (static_cast<int64_t>(image->getXPoints()) - 1))
{
QString ss = QObject::tr("The X Max you entered of %1 is greater than your Max X Point of %2").arg(getXMax()).arg(static_cast<int64_t>(image->getXPoints()) - 1);
setErrorCondition(-5557);
notifyErrorMessage(getHumanLabel(), ss, getErrorCondition());
}
if (getYMax() > (static_cast<int64_t>(image->getYPoints()) - 1))
{
QString ss = QObject::tr("The Y Max you entered of %1 is greater than your Max Y Point of %2").arg(getYMax()).arg(static_cast<int64_t>(image->getYPoints()) - 1);
setErrorCondition(-5558);
notifyErrorMessage(getHumanLabel(), ss, getErrorCondition());
}
if (getZMax() > (static_cast<int64_t>(image->getZPoints()) - 1))
{
QString ss = QObject::tr("The Z Max you entered of %1) greater than your Max Z Point of %2").arg(getZMax()).arg(static_cast<int64_t>(image->getZPoints()) - 1);
setErrorCondition(-5559);
notifyErrorMessage(getHumanLabel(), ss, getErrorCondition());
}
}
示例6: dataCheck
// -----------------------------------------------------------------------------
//
// -----------------------------------------------------------------------------
void InitializeData::dataCheck()
{
setErrorCondition(0);
if (m_CellAttributeMatrixPaths.size() <= 0)
{
QString ss = "At least one data array must be selected.";
setErrorCondition(-5550);
notifyErrorMessage(getHumanLabel(), ss, getErrorCondition());
return;
}
DataArrayPath attributeMatrixPath(m_CellAttributeMatrixPaths[0].getDataContainerName(), m_CellAttributeMatrixPaths[0].getAttributeMatrixName(), "");
getDataContainerArray()->getPrereqAttributeMatrixFromPath<AbstractFilter>(this, attributeMatrixPath, -301);
ImageGeom::Pointer image = getDataContainerArray()->getPrereqGeometryFromDataContainer<ImageGeom, AbstractFilter>(this, attributeMatrixPath.getDataContainerName());
if(NULL == image.get()) { return; }
if (getXMax() < getXMin())
{
QString ss = QObject::tr("X Max (%1) less than X Min (%2)").arg(getXMax()).arg(getXMin());
setErrorCondition(-5551);
notifyErrorMessage(getHumanLabel(), ss, getErrorCondition());
}
if (getYMax() < getYMin())
{
QString ss = QObject::tr("Y Max (%1) less than Y Min (%2)").arg(getYMax()).arg(getYMin());
setErrorCondition(-5552);
notifyErrorMessage(getHumanLabel(), ss, getErrorCondition());
}
if (getZMax() < getZMin())
{
QString ss = QObject::tr("Z Max (%1) less than Z Min (%2)").arg(getZMax()).arg(getZMin());
setErrorCondition(-5553);
notifyErrorMessage(getHumanLabel(), ss, getErrorCondition());
}
if (getXMin() < 0)
{
QString ss = QObject::tr("X Min (%1) less than 0").arg(getXMin());
setErrorCondition(-5554);
notifyErrorMessage(getHumanLabel(), ss, getErrorCondition());
}
if (getYMin() < 0)
{
QString ss = QObject::tr("Y Min (%1) less than 0").arg(getYMin());
setErrorCondition(-5555);
notifyErrorMessage(getHumanLabel(), ss, getErrorCondition());
}
if (getZMin() < 0)
{
QString ss = QObject::tr("Z Min (%1) less than 0").arg(getZMin());
setErrorCondition(-5556);
notifyErrorMessage(getHumanLabel(), ss, getErrorCondition());
}
if (getXMax() > (static_cast<int64_t>(image->getXPoints()) - 1))
{
QString ss = QObject::tr("The X Max you entered of %1 is greater than your Max X Point of %2").arg(getXMax()).arg(static_cast<int64_t>(image->getXPoints()) - 1);
setErrorCondition(-5557);
notifyErrorMessage(getHumanLabel(), ss, getErrorCondition());
}
if (getYMax() > (static_cast<int64_t>(image->getYPoints()) - 1))
{
QString ss = QObject::tr("The Y Max you entered of %1 is greater than your Max Y Point of %2").arg(getYMax()).arg(static_cast<int64_t>(image->getYPoints()) - 1);
setErrorCondition(-5558);
notifyErrorMessage(getHumanLabel(), ss, getErrorCondition());
}
if (getZMax() > (static_cast<int64_t>(image->getZPoints()) - 1))
{
QString ss = QObject::tr("The Z Max you entered of %1) greater than your Max Z Point of %2").arg(getZMax()).arg(static_cast<int64_t>(image->getZPoints()) - 1);
setErrorCondition(-5559);
notifyErrorMessage(getHumanLabel(), ss, getErrorCondition());
}
DataContainer::Pointer m = getDataContainerArray()->getDataContainer(attributeMatrixPath.getDataContainerName());
size_t udims[3] =
{ 0, 0, 0 };
m->getGeometryAs<ImageGeom>()->getDimensions(udims);
QString attrMatName = attributeMatrixPath.getAttributeMatrixName();
QList<QString> voxelArrayNames = DataArrayPath::GetDataArrayNames(m_CellAttributeMatrixPaths);
for (QList<QString>::iterator iter = voxelArrayNames.begin(); iter != voxelArrayNames.end(); ++iter)
{
IDataArray::Pointer p = m->getAttributeMatrix(attrMatName)->getAttributeArray(*iter);
QString type = p->getTypeAsString();
if (type == "int8_t")
{
checkInitialization<int8_t>(p);
}
else if (type == "int16_t")
{
checkInitialization<int16_t>(p);
}
else if (type == "int32_t")
{
//.........这里部分代码省略.........