[vtkusers] vtkImagePlaneWidget contrast control

Jothy jothybasu at gmail.com
Fri Apr 30 12:24:01 EDT 2010


I think the rmin and rmax should be your scalar value minimum and maximum.

Jothy

On Fri, Apr 30, 2010 at 5:18 PM, somi <seesomi at gmail.com> wrote:
> Hi Jothy,
> On digging further, I found the right click was linked to
> vtkImagePlaneWidget::WindowLevel
>
> Where window size and leve of the histogram were calculated and modified
> based on mouse movements, to get rmin and rmax .
> Finally , the lookuptable was modified LookupTable->SetTableRange( rmin,
> rmax ); to adjust brightness/contrast.
>
> So, I am planning to do the following:
>
> from my vtkImagePLanewidget I would  GetLookupTable () and set its table
> range rmin/rmax based on the Qt slider.
> However I am not very clear between the relation of brightness/contrast
> and   rmin/rmax in  LookupTable->SetTableRange( rmin, rmax );
>
> I think the window/level refer to the following in a histogram:
>
>              ____________
>
>             /
>            /
> __________/
>          | ^ |
>            L
>          <-W->
>
> and they are related to brightness/contrast by the following:
>
>    minval = min(image)
>    maxval = max(image)
>    level = (1-brightness/100.)*(maxVal - minVal) + minVal
>    window = (1-contrast/100.)*(maxVal - minVal)
> where brightness/contrast can vary from 0 to 100.
>
> So what value should I use for rmin/rmax in LookupTable->SetTableRange(
> rmin, rmax ); ?
>
> Regards,
> Somi
>
> On Fri, Apr 30, 2010 at 11:29 AM, Jothy <jothybasu at gmail.com> wrote:
>>
>> I don't have exact answer for this. But , I think you need to
>> manipulate the observers.HAve a look at this
>>
>> http://www.cmake.org/Wiki/VTK_Examples#User_Interaction
>>
>> Jothy
>>
>> On Fri, Apr 30, 2010 at 3:58 PM, somi <seesomi at gmail.com> wrote:
>> > Hi Jothy,
>> > I want the brightness/control through a user control slider (in Qt). I
>> > also
>> > show the surface overlaid over the image plane widget
>> >
>> >  Which function should I override to implement my own
>> > brightness/contrast
>> > control ? I didn't find anything specific @
>> > http://www.vtk.org/doc/nightly/html/classvtkInteractorStyleImage.html
>> >
>> > Also while playing with the interactor, I noticed that if my mouse is
>> > over
>> > an image and I drag left/right I can adjust contrast and if I click and
>> > drag
>> > up/down I can adjust contrast.
>> > Do I have to imement my own interactor style and override right click ?
>> > Isn't there any SetContrast/SetBrightness interface ?
>> >
>> > Regards,
>> > Somi
>> >
>> >
>> >
>> > On Fri, Apr 30, 2010 at 10:44 AM, Jothy <jothybasu at gmail.com> wrote:
>> >>
>> >> I think by  setting Interacto Style to InteractorStyleToImage
>> >>
>> >> Jothy
>> >>
>> >> On Fri, Apr 30, 2010 at 3:31 PM, somi <seesomi at gmail.com> wrote:
>> >> > Hi,
>> >> > I have a 3D volume (vtkImage) which I show through 3 orthogonal
>> >> > vtkImagePlaneWidgets. How can I add brightness and contrast control
>> >> > to
>> >> > this
>> >> > widget ?
>> >> >
>> >> > Regards, Somi
>> >> >
>> >> > _______________________________________________
>> >> > Powered by www.kitware.com
>> >> >
>> >> > Visit other Kitware open-source projects at
>> >> > http://www.kitware.com/opensource/opensource.html
>> >> >
>> >> > Please keep messages on-topic and check the VTK FAQ at:
>> >> > http://www.vtk.org/Wiki/VTK_FAQ
>> >> >
>> >> > Follow this link to subscribe/unsubscribe:
>> >> > http://www.vtk.org/mailman/listinfo/vtkusers
>> >> >
>> >> >
>> >
>> >
>
>



More information about the vtkusers mailing list