本文整理汇总了C++中imagegeom::Pointer::setResolution方法的典型用法代码示例。如果您正苦于以下问题:C++ Pointer::setResolution方法的具体用法?C++ Pointer::setResolution怎么用?C++ Pointer::setResolution使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类imagegeom::Pointer
的用法示例。
在下文中一共展示了Pointer::setResolution方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: 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");
}
示例2: 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);
}
}
示例3: readHeader
//.........这里部分代码省略.........
return -100;
}
QByteArray buf;
buf = in.readLine(); // Read Line 1 - VTK Version Info
buf = in.readLine(); // Read Line 2 - User Comment
setComment(QString(buf.trimmed()));
buf = in.readLine(); // Read Line 3 - BINARY or ASCII
QString fileType(buf);
if (fileType.startsWith("BINARY") == true)
{
setFileIsBinary(true);
}
else if (fileType.startsWith("ASCII") == true)
{
setFileIsBinary(false);
}
else
{
err = -1;
qDebug()
<< "The file type of the VTK legacy file could not be determined. It should be ASCII' or 'BINARY' and should appear on line 3 of the file."
;
return err;
}
QList<QByteArray> tokens;
buf = in.readLine(); // Read Line 4 - Type of Dataset
{
tokens = buf.split(' ');
setDatasetType(QString(tokens[1]));
}
buf = in.readLine(); // Read Line 5 which is the Dimension values
bool ok = false;
int64_t dims[3];
tokens = buf.split(' ');
dims[0] = tokens[1].toLongLong(&ok, 10);
dims[1] = tokens[2].toLongLong(&ok, 10);
dims[2] = tokens[3].toLongLong(&ok, 10);
#if (CMP_SIZEOF_SSIZE_T==4)
int64_t max = std::numeric_limits<size_t>::max();
#else
int64_t max = std::numeric_limits<int64_t>::max();
#endif
if (dims[0] * dims[1] * dims[2] > max )
{
err = -1;
QString ss = QObject::tr("The total number of elements '%1' is greater than this program can hold. Try the 64 bit version.").arg(dims[0] * dims[1] * dims[2]);
setErrorCondition(err);
notifyErrorMessage(getHumanLabel(), ss, getErrorCondition());
return err;
}
if (dims[0] > max || dims[1] > max || dims[2] > max)
{
err = -1;
QString ss = QObject::tr("One of the dimensions is greater than the max index for this sysem. Try the 64 bit version. dim[0]=%1 dim[1]=%2im[2]=%3")\
.arg(dims[0]).arg(dims[1]).arg(dims[2]);
setErrorCondition(err);
notifyErrorMessage(getHumanLabel(), ss, getErrorCondition());
return err;
}
size_t dcDims[3] = { static_cast<size_t>(dims[0]), static_cast<size_t>(dims[1]), static_cast<size_t>(dims[2]) };
DataContainer::Pointer dc = getDataContainerArray()->getDataContainer(getDataContainerName());
if (dc.get() == NULL)
{
return -1;
}
ImageGeom::Pointer image = dc->getGeometryAs<ImageGeom>();
if (image.get() == NULL)
{
return -1;
}
image->setDimensions(dcDims);
buf = in.readLine(); // Read Line 6 which is the Origin values
float origin[3];
tokens = buf.split(' ');
origin[0] = tokens[1].toFloat(&ok);
origin[1] = tokens[2].toFloat(&ok);
origin[2] = tokens[3].toFloat(&ok);
image->setOrigin(origin);
buf = in.readLine(); // Read Line 7 which is the Scaling values
float resolution[3];
tokens = buf.split(' ');
resolution[0] = tokens[1].toFloat(&ok);
resolution[1] = tokens[2].toFloat(&ok);
resolution[2] = tokens[3].toFloat(&ok);
image->setResolution(resolution);
return err;
}