Skip to content

Commit

Permalink
Merge branch 'master' into master
Browse files Browse the repository at this point in the history
  • Loading branch information
kerim371 authored Jul 25, 2021
2 parents 120b24c + ee50c56 commit c298529
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Libs/Core/ctkUtils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -417,7 +417,7 @@ qint64 ctk::msecsTo(const QDateTime& t1, const QDateTime& t2)
//------------------------------------------------------------------------------
QString ctk::absolutePathFromInternal(const QString& internalPath, const QString& basePath)
{
if (internalPath.isEmpty())
if (internalPath.isEmpty() || basePath.isEmpty())
{
return internalPath;
}
Expand All @@ -435,7 +435,7 @@ QString ctk::absolutePathFromInternal(const QString& internalPath, const QString
//------------------------------------------------------------------------------
QString ctk::internalPathFromAbsolute(const QString& absolutePath, const QString& basePath)
{
if (absolutePath.isEmpty())
if (absolutePath.isEmpty() || basePath.isEmpty())
{
return absolutePath;
}
Expand Down
6 changes: 6 additions & 0 deletions Libs/Visualization/VTK/Widgets/ctkVTKVolumePropertyWidget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -218,6 +218,7 @@ void ctkVTKVolumePropertyWidget::updateFromVolumeProperty()
vtkColorTransferFunction* colorTransferFunction = 0;
vtkPiecewiseFunction* opacityFunction = 0;
vtkPiecewiseFunction* gradientFunction = 0;
bool scalarColorMapping = true;
if (d->VolumeProperty)
{
colorTransferFunction =
Expand All @@ -229,6 +230,7 @@ void ctkVTKVolumePropertyWidget::updateFromVolumeProperty()
gradientFunction =
d->VolumeProperty->GetGradientOpacity()->GetSize() ?
d->VolumeProperty->GetGradientOpacity() : 0;
scalarColorMapping = d->VolumeProperty->GetIndependentComponents();
}

d->ScalarOpacityThresholdWidget->setPiecewiseFunction(
Expand All @@ -254,6 +256,10 @@ void ctkVTKVolumePropertyWidget::updateFromVolumeProperty()
d->ScalarColorWidget->view()->setColorTransferFunctionToPlots(colorTransferFunction);
d->GradientWidget->view()->setPiecewiseFunctionToPlots(gradientFunction);

// If color is specified by dependent components (RGBA volume) then do not show scalar color transfer
// function, because that function has no effect.
d->ScalarColorGroupBox->setVisible(scalarColorMapping);

if (d->VolumeProperty)
{
d->InterpolationComboBox->setCurrentIndex(
Expand Down

0 comments on commit c298529

Please sign in to comment.