本文整理汇总了C++中ctkLogger类的典型用法代码示例。如果您正苦于以下问题:C++ ctkLogger类的具体用法?C++ ctkLogger怎么用?C++ ctkLogger使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了ctkLogger类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: insert
//------------------------------------------------------------------------------
void ctkDICOMDatabase::insert ( const QString& filePath, bool storeFile, bool generateThumbnail, bool createHierarchy, const QString& destinationDirectoryName)
{
Q_D(ctkDICOMDatabase);
Q_UNUSED(createHierarchy);
Q_UNUSED(destinationDirectoryName);
/// first we check if the file is already in the database
if (fileExistsAndUpToDate(filePath))
{
logger.debug( "File " + filePath + " already added.");
return;
}
logger.debug( "Processing " + filePath );
std::string filename = filePath.toStdString();
DcmFileFormat fileformat;
ctkDICOMDataset ctkDataset;
ctkDataset.InitializeFromFile(filePath);
if ( ctkDataset.IsInitialized() )
{
d->insert( ctkDataset, filePath, storeFile, generateThumbnail );
}
else
{
logger.warn(QString("Could not read DICOM file:") + filePath);
}
}
开发者ID:benjaminlong,项目名称:CTK,代码行数:31,代码来源:ctkDICOMDatabase.cpp
示例2: setRange
//-----------------------------------------------------------------------------
void ctkVTKHistogram::setRange(qreal minRange, qreal maxRange)
{
Q_D(const ctkVTKHistogram);
if (d->DataArray.GetPointer() == 0)
{
//Q_ASSERT(d->DataArray.GetPointer());
logger.warn("no data array. range will be reset when setting array.");
minRange = 1.; // set incorrect values
maxRange = 0.;
return;
}
if (minRange >= maxRange)
{
//Q_ASSERT(d->DataArray.GetPointer());
logger.warn("minRange >= maxRange");
qreal pivot = minRange;
minRange = maxRange;
maxRange = pivot;
}
int numberOfBinsBefore = d->computeNumberOfBins();
d->Range[0] = minRange;
d->Range[1] = maxRange;
if (d->computeNumberOfBins() != numberOfBinsBefore)
{
this->build();
}
}
开发者ID:151706061,项目名称:CTK,代码行数:29,代码来源:ctkVTKHistogram.cpp
示例3: initializeSCU
//------------------------------------------------------------------------------
bool ctkDICOMRetrievePrivate::initializeSCU( const QString& studyInstanceUID,
const QString& seriesInstanceUID,
const RetrieveType retrieveType,
DcmDataset *retrieveParameters)
{
if ( !this->Database )
{
logger.error ( "No Database for retrieve transaction" );
return false;
}
// If we like to query another server than before, be sure to disconnect first
if (this->SCU.isConnected() && this->ConnectionParamsChanged)
{
this->SCU.closeAssociation(DCMSCU_RELEASE_ASSOCIATION);
}
// Connect to server if not already connected
if (!this->SCU.isConnected())
{
// Check and initialize networking parameters in DCMTK
if ( !this->SCU.initNetwork().good() )
{
logger.error ( "Error initializing the network" );
return false;
}
// Negotiate (i.e. start the) association
logger.debug ( "Negotiating Association" );
if ( !this->SCU.negotiateAssociation().good() )
{
logger.error ( "Error negotiating association" );
return false;;
}
}
this->ConnectionParamsChanged = false;
// Setup query about what to be received from the PACS
logger.debug ( "Setting Retrieve Parameters" );
if ( retrieveType == RetrieveSeries )
{
retrieveParameters->putAndInsertString ( DCM_QueryRetrieveLevel, "SERIES" );
retrieveParameters->putAndInsertString ( DCM_SeriesInstanceUID,
seriesInstanceUID.toStdString().c_str() );
// Always required to send all highler level unique keys, so add study here (we are in Study Root)
retrieveParameters->putAndInsertString ( DCM_StudyInstanceUID,
studyInstanceUID.toStdString().c_str() ); //TODO
}
else
{
retrieveParameters->putAndInsertString ( DCM_QueryRetrieveLevel, "STUDY" );
retrieveParameters->putAndInsertString ( DCM_StudyInstanceUID,
studyInstanceUID.toStdString().c_str() );
}
return true;
}
开发者ID:benjaminlong,项目名称:CTK,代码行数:56,代码来源:ctkDICOMRetrieve.cpp
示例4: resetRange
//-----------------------------------------------------------------------------
void ctkVTKHistogram::resetRange()
{
Q_D(ctkVTKHistogram);
if (d->DataArray.GetPointer() == 0)
{
//Q_ASSERT(d->DataArray.GetPointer());
logger.warn("no dataArray");
d->Range[0] = 1.; // set incorrect values
d->Range[1] = 0.;
return;
}
if (d->DataArray->GetDataType() == VTK_CHAR ||
d->DataArray->GetDataType() == VTK_SIGNED_CHAR ||
d->DataArray->GetDataType() == VTK_UNSIGNED_CHAR)
{
d->Range[0] = d->DataArray->GetDataTypeMin();
d->Range[1] = d->DataArray->GetDataTypeMax();
}
else
{
d->DataArray->GetRange(d->Range, d->Component);
if (d->DataArray->GetDataType() == VTK_FLOAT ||
d->DataArray->GetDataType() == VTK_DOUBLE)
{
d->Range[1] += 0.01;
}
//else
// {
// this->Range[1] += 1;
// }
}
}
开发者ID:151706061,项目名称:CTK,代码行数:34,代码来源:ctkVTKHistogram.cpp
示例5: validate
// --------------------------------------------------------------------------
void ctkWorkflowStep::validate(const QString& desiredBranchId)
{
Q_D(ctkWorkflowStep);
logger.info(QString("validate - validating the input from %1").arg(d->Name));
this->validationComplete(true, desiredBranchId);
}
开发者ID:benoitbleuze,项目名称:CTK,代码行数:8,代码来源:ctkWorkflowStep.cpp
示例6: maxValue
//-----------------------------------------------------------------------------
QVariant ctkVTKColorTransferFunction::maxValue()const
{
Q_D(const ctkVTKColorTransferFunction);
if (d->ColorTransferFunction.GetPointer() == 0)
{
//Q_ASSERT(d->ColorTransferFunction.GetPointer());
logger.warn("no ColorTransferFunction");
return -1;
}
double rgb[3];
QColor minValue = QColor::fromRgbF(0.,0.,0.);
for (int i = 0; i < this->count(); ++i)
{
d->ColorTransferFunction->GetColor(i, rgb);
Q_ASSERT(rgb[0] >= 0. && rgb[0] <= 1. &&
rgb[1] >= 0. && rgb[1] <= 1. &&
rgb[2] >= 0. && rgb[2] <= 1.);
QColor color = QColor::fromRgbF(rgb[0], rgb[1], rgb[2]);
if ( qGray(color.red(), color.green(), color.blue()) >
qGray(minValue.red(), minValue.green(), minValue.blue()))
{
minValue = color;
}
}
return minValue;
}
开发者ID:151706061,项目名称:CTK,代码行数:27,代码来源:ctkVTKColorTransferFunction.cpp
示例7: forceRender
//----------------------------------------------------------------------------
void ctkVTKSliceView::forceRender()
{
Q_D(ctkVTKSliceView);
if (!d->RenderEnabled || !this->isVisible())
{
return;
}
logger.trace("forceRender");
d->RenderWindow->Render();
d->RenderPending = false;
}
开发者ID:xplanes,项目名称:CTK,代码行数:12,代码来源:ctkVTKSliceView.cpp
示例8: setId
// --------------------------------------------------------------------------
void ctkWorkflowStep::setId(const QString& newId)
{
Q_D(ctkWorkflowStep);
if (d->Workflow && d->Workflow->hasStep(newId) && !this->id().isEmpty())
{
logger.error(QString("ctkWorkflowStep - Failed to change id from '%1' to '%2' - "
"Step already added to a workflow !").arg(this->id()).arg(newId));
return;
}
d->Id = newId;
}
开发者ID:benoitbleuze,项目名称:CTK,代码行数:12,代码来源:ctkWorkflowStep.cpp
示例9: updateGroupBox
// --------------------------------------------------------------------------
void ctkWorkflowGroupBox::updateGroupBox(ctkWorkflowStep* currentStep)
{
Q_D(ctkWorkflowGroupBox);
d->StepShownPreviously = d->StepShownCurrently;
d->StepShownCurrently = currentStep;
if (currentStep)
{
this->setTitle(currentStep->name());
this->setSubTitle(currentStep->description());
this->setErrorText(currentStep->statusText());
// don't show textual elements if they are empty
d->SubTitleTextBrowser->setVisible(!this->subTitle().isEmpty());
d->PreTextBrowser->setVisible(!this->preText().isEmpty());
d->PostTextBrowser->setVisible(!this->postText().isEmpty());
d->ErrorTextBrowser->setVisible(!this->errorText().isEmpty());
}
// disable/hide the previously shown step
if (ctkWorkflowWidgetStep* prevStep = dynamic_cast<ctkWorkflowWidgetStep*>(d->StepShownPreviously))
{
logger.debug(QString("updateClientArea - hiding %1").arg(prevStep->name()));
if (QWidget* stepArea = prevStep->stepArea())
{
stepArea->setEnabled(false);
if (d->HideWidgetsOfNonCurrentSteps)
{
stepArea->hide();
}
}
}
ctkWorkflowWidgetStep* currentWidgetStep = dynamic_cast<ctkWorkflowWidgetStep*>(currentStep);
// show/enable the current step
if (currentWidgetStep)
{
currentWidgetStep->showUserInterface();
if (QWidget* stepArea = currentWidgetStep->stepArea())
{
// add the step's client area to the widget if we haven't before
if (!this->isAncestorOf(stepArea))
{
d->ClientAreaLayout->addWidget(stepArea);
}
stepArea->setEnabled(true);
stepArea->show();
}
}
}
开发者ID:benoitbleuze,项目名称:CTK,代码行数:55,代码来源:ctkWorkflowGroupBox.cpp
示例10: registerCompressionLibraries
//------------------------------------------------------------------------------
void ctkDICOMDatabasePrivate::registerCompressionLibraries(){
logger.debug("Register compression libraries");
// Register the JPEG libraries in case we need them
// (registration only happens once, so it's okay to call repeatedly)
// register global JPEG decompression codecs
DJDecoderRegistration::registerCodecs();
// register global JPEG compression codecs
DJEncoderRegistration::registerCodecs();
// register RLE compression codec
DcmRLEEncoderRegistration::registerCodecs();
// register RLE decompression codec
DcmRLEDecoderRegistration::registerCodecs();
}
开发者ID:jhnstrk,项目名称:CTK,代码行数:14,代码来源:ctkDICOMDatabase.cpp
示例11: range
//-----------------------------------------------------------------------------
void ctkVTKHistogram::range(qreal& minRange, qreal& maxRange)const
{
Q_D(const ctkVTKHistogram);
if (d->DataArray.GetPointer() == 0)
{
//Q_ASSERT(d->DataArray.GetPointer());
logger.warn("no dataArray");
minRange = 1.; // set incorrect values
maxRange = 0.;
return;
}
minRange = d->Range[0];
maxRange = d->Range[1];
}
开发者ID:151706061,项目名称:CTK,代码行数:15,代码来源:ctkVTKHistogram.cpp
示例12: loggedExec
//------------------------------------------------------------------------------
bool ctkDICOMDatabasePrivate::loggedExec(QSqlQuery& query, const QString& queryString)
{
bool success;
if (queryString.compare(""))
{
success = query.exec(queryString);
}
else
{
success = query.exec();
}
if (!success)
{
QSqlError sqlError = query.lastError();
logger.debug( "SQL failed\n Bad SQL: " + query.lastQuery());
logger.debug( "Error text: " + sqlError.text());
}
else
{
logger.debug( "SQL worked!\n SQL: " + query.lastQuery());
}
return (success);
}
开发者ID:benjaminlong,项目名称:CTK,代码行数:24,代码来源:ctkDICOMDatabase.cpp
示例13: setWorkflow
// --------------------------------------------------------------------------
void ctkWorkflowWidget::setWorkflow(ctkWorkflow* newWorkflow)
{
Q_D(ctkWorkflowWidget);
if (!newWorkflow)
{
logger.error(QString("setWorkflow - cannot set workflow to NULL"));
return;
}
if (d->Workflow)
{
QObject::disconnect(d->Workflow, SIGNAL(currentStepChanged(ctkWorkflowStep*)), this, SLOT(onCurrentStepChanged(ctkWorkflowStep)));
}
开发者ID:xplanes,项目名称:CTK,代码行数:15,代码来源:ctkWorkflowWidget.cpp
示例14: scheduleRender
//----------------------------------------------------------------------------
void ctkVTKSliceView::scheduleRender()
{
Q_D(ctkVTKSliceView);
logger.trace("scheduleRender");
if (!d->RenderEnabled)
{
return;
}
if (!d->RenderPending)
{
d->RenderPending = true;
QTimer::singleShot(0, this, SLOT(forceRender()));
}
}
开发者ID:xplanes,项目名称:CTK,代码行数:16,代码来源:ctkVTKSliceView.cpp
示例15: range
//-----------------------------------------------------------------------------
void ctkVTKColorTransferFunction::range(qreal& minRange, qreal& maxRange)const
{
Q_D(const ctkVTKColorTransferFunction);
if (d->ColorTransferFunction.GetPointer() == 0)
{
//Q_ASSERT(d->ColorTransferFunction.GetPointer());
logger.warn("no ColorTransferFunction");
minRange = 1.;
maxRange = 0.;
return;
}
double rangeValues[2];
d->ColorTransferFunction->GetRange(rangeValues);
minRange = rangeValues[0];
maxRange = rangeValues[1];
}
开发者ID:151706061,项目名称:CTK,代码行数:17,代码来源:ctkVTKColorTransferFunction.cpp
示例16: associateStepWithPage
// --------------------------------------------------------------------------
void ctkWorkflowAbstractPagedWidget::associateStepWithPage(ctkWorkflowStep* step, int index)
{
Q_D(ctkWorkflowAbstractPagedWidget);
if (index < 0)
{
logger.error(QString("Cannot associate step with a page of index -1"));
return;
}
if (step)
{
d->StepToIndexMap[step] = index;
if (!d->IndexToGroupBoxMap.contains(index))
{
d->IndexToGroupBoxMap[index] = 0;
}
}
}
开发者ID:xplanes,项目名称:CTK,代码行数:21,代码来源:ctkWorkflowAbstractPagedWidget.cpp
示例17: displayImage
// -------------------------------------------------------------------------
void ctkDICOMDatasetView::displayImage(int imageIndex){
Q_D(ctkDICOMDatasetView);
if(d->CurrentImageIndex.isValid())
{
QModelIndex seriesIndex = d->CurrentImageIndex.parent();
ctkDICOMModel* model = const_cast<ctkDICOMModel*>(qobject_cast<const ctkDICOMModel*>(seriesIndex.model()));
if(model)
{
if(imageIndex >= 0 && imageIndex < model->rowCount(seriesIndex))
{
this->onModelSelected(model->index(imageIndex, 0, seriesIndex));
}
else
{
logger.debug("out of index");
}
}
}
}
开发者ID:jhnstrk,项目名称:CTK,代码行数:22,代码来源:ctkDICOMDatasetView.cpp
示例18: pix
//----------------------------------------------------------------------------
void ctkDICOMThumbnailListWidgetPrivate
::addThumbnailWidget(const QModelIndex& imageIndex,
const QModelIndex& sourceIndex, const QString &text)
{
ctkDICOMModel* model = const_cast<ctkDICOMModel*>(
qobject_cast<const ctkDICOMModel*>(imageIndex.model()));
if(!model)
{
return;
}
QModelIndex seriesIndex = imageIndex.parent();
QModelIndex studyIndex = seriesIndex.parent();
QString thumbnailPath = this->DatabaseDirectory +
"/thumbs/" + model->data(studyIndex ,ctkDICOMModel::UIDRole).toString() + "/" +
model->data(seriesIndex ,ctkDICOMModel::UIDRole).toString() + "/" +
model->data(imageIndex, ctkDICOMModel::UIDRole).toString() + ".png";
if(!QFileInfo(thumbnailPath).exists())
{
return;
}
ctkThumbnailLabel* widget = new ctkThumbnailLabel(this->ScrollAreaContentWidget);
QString widgetLabel = text;
widget->setText( widgetLabel );
QPixmap pix(thumbnailPath);
logger.debug("Setting pixmap to " + thumbnailPath);
if(this->ThumbnailSize.isValid())
{
widget->setFixedSize(this->ThumbnailSize);
}
widget->setPixmap(pix);
QVariant var;
var.setValue(QPersistentModelIndex(sourceIndex));
widget->setProperty("sourceIndex", var);
this->addThumbnail(widget);
}
开发者ID:151706061,项目名称:CTK,代码行数:41,代码来源:ctkDICOMThumbnailListWidget.cpp
示例19: setSetting
// --------------------------------------------------------------------------
void ctkSettingsPanel::setSetting(const QString& key, const QVariant& newVal)
{
Q_D(ctkSettingsPanel);
QSettings* settings = d->settings(key);
if (!settings)
{
return;
}
QVariant oldVal = settings->value(key);
settings->setValue(key, newVal);
d->Properties[key].setValue(newVal);
if (settings->status() != QSettings::NoError)
{
logger.warn( QString("Error #%1 while writing setting \"%2\"")
.arg(static_cast<int>(settings->status()))
.arg(key));
}
if (oldVal != newVal)
{
emit settingChanged(key, newVal);
}
}
开发者ID:dtglidden,项目名称:CTK,代码行数:23,代码来源:ctkSettingsPanel.cpp
示例20: QString
//----------------------------------------------------------------------------
void ctkDICOMThumbnailListWidgetPrivate
::addSeriesThumbnails(const QModelIndex &index)
{
QModelIndex studyIndex = index.parent();
QModelIndex seriesIndex = index;
ctkDICOMModel* model = const_cast<ctkDICOMModel*>(qobject_cast<const ctkDICOMModel*>(index.model()));
if (!model)
{
return;
}
model->fetchMore(seriesIndex);
const int imageCount = model->rowCount(seriesIndex);
logger.debug(QString("Thumbs: %1").arg(imageCount));
for (int i = 0 ; i < imageCount ; i++ )
{
QModelIndex imageIndex = seriesIndex.child(i,0);
this->addThumbnailWidget(imageIndex, imageIndex, QString("Image %1").arg(i));
}
}
开发者ID:151706061,项目名称:CTK,代码行数:24,代码来源:ctkDICOMThumbnailListWidget.cpp
注:本文中的ctkLogger类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论