[Ctk-developers] ctkTransferFunctionWidget examples

Ricardo Ortiz ricardo.ortiz at kitware.com
Wed Nov 19 18:19:01 UTC 2014


Hi Julien,

Thanks for the feedback...

On Wed, Nov 19, 2014 at 12:16 PM, Julien Finet <julien.finet at kitware.com>
wrote:

> Hi Ricardo,
>
> ctkTransferFunctionWidget is obsolete, please use the VTK charts instead:
>
> https://github.com/commontk/CTK/blob/master/Libs/Visualization/VTK/Widgets/ctkVTKChartView.h
>
> In your case you might want to use ctkVTKScalarsToColorsWidget
> <https://github.com/commontk/CTK/blob/master/Libs/Visualization/VTK/Widgets/ctkVTKScalarsToColorsWidget.h>
>

This is the widget that I am using (sorry I meant to say
ctkVTKScalarsToColorsWidget in the thread below).
I am looking at how the Volume Rendering (VolumePropertiesWidget) module is
using this widget, and my understanding is that ctkVTKVolumePropertiyWidget
(used by VolumePropertiesWidget) uses a vtkColorTransferFunction to update
the view.

The main problem is that for some reason the widget does not display
anything (only white).

Here is a snippet of how I update the ctkVTKScalarsToColorsWidget widget
(or see the updateTransferFunction() in the attached file):

void updateTransferFunction()
{
...
  d->ColorTransferFunction->SetAlpha(1.0);
  d->ColorTransferFunction->Build();


d->HistogramWidget->view()->setColorTransferFunctionToPlots(d->ColorTransferFunction);
}

Where d->HistogramWidget is an instance of ctkVTKScalarsToColorsWidget.

Thanks,

/Ricardo


> Hth,
> Julien.
>
> On Wed, Nov 19, 2014 at 5:19 PM, Ricardo Ortiz <ricardo.ortiz at kitware.com>
> wrote:
>
>> To give a bit more context...
>>
>> I am using ctkScalarsToColorsWidget in order to create a color histogram
>> of the displayed volume using a vtkColorTransferFunction.
>>
>> The problem is that the widget is not displaying anything.
>> I am using the widget's view (ctkScalarsToColorsView) and
>> calling setColorTransferFunctionToPlots to update its color transfer
>> function (once I have updated it).
>>
>> Is this the correct way to have the widget display the colors?
>>
>> Thanks in advance,
>>
>> /Ricardo
>>
>>
>>
>> On Wed, Nov 19, 2014 at 10:19 AM, Ricardo Ortiz <
>> ricardo.ortiz at kitware.com> wrote:
>>
>>> Hello folks,
>>>
>>> Does anyone knows of any examples that use transfer function widgets. I
>>> am trying to create a simple histogram widget (and being able to select
>>> points within the widget).
>>>
>>> Thanks in advance,
>>>
>>> /Ricardo
>>>
>>
>>
>> _______________________________________________
>> Ctk-developers mailing list
>> Ctk-developers at public.kitware.com
>> http://public.kitware.com/mailman/listinfo/ctk-developers
>>
>>
> ​​​
 qSlicerScalarVolumeIntensitySegmenterHistogramWidget.cxx
<https://docs.google.com/a/kitware.com/file/d/0B5C_y6Y3RlVnZWxQMXlpUFRjV28/edit?usp=drive_web>
​
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/ctk-developers/attachments/20141119/9bae08fd/attachment.htm>


More information about the Ctk-developers mailing list