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