<div dir="ltr"><div><div>Hi Girish,<br><br></div>the following additional events could help with formulating and maintaining your design:<br><br>vtkCommand::StartWindowLevelEvent  <br>   - record the shared (global) window and level initial values<br><br>vtkCommand::WindowLevelEvent  <br>  -  record current global window level vales, broadcast the event to all other listeners and have <br>   them  update to current window level values <br><br>vtkCommand::EndWindowLevelEvent <br></div>  - could delay updating all widget window level values until the current interactive widget is done<br><br><div>vtkCommand::ResetWindowLevelEvent <br>  - set the window level to all widgets back to the global initial values<br><br></div><div>- Dean<br></div><div><br><br></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Mar 2, 2017 at 3:55 AM, Girish Lande <span dir="ltr"><<a href="mailto:girish.lande@agiliad.com" target="_blank">girish.lande@agiliad.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Hi All,<div><br></div><div>I am creating 3 vtkImagePlaneWidgets Each showing some image.</div><div>I want to update their window/level at the same time.</div><div>that is when I update window level of one widget others should reflect the same.</div><div><br></div><div>For that I am using callbacks. (following is my code)</div><div>Each imageplanewidget is in different view. </div><div>Though window / level is updated its not refreshing changes.<br></div><div>I see changes only when I try to update window/level of other image plane widgets.</div><div><br></div><div>Could you please help me with this ? I want to refresh all widgets to see that </div><div>window level is getting updated simultaneouly</div><div><div><br></div>-- <br><div class="m_4419796695083657672gmail_signature"><div dir="ltr">thanks & regards,<div>Girish</div><div><br></div><div><br></div><div><div><br></div><div>void MainWindow::<wbr>RegisterCallbackWith2DPlaneWid<wbr>get()</div><div>{</div><div>    vtkSmartPointer<MyCallback> cbk =</div><div>            vtkSmartPointer<MyCallback>::<wbr>New();</div><div>    cbk->m_window = this;</div><div>    for (int i = 0; i < 3; i++)</div><div>    {</div><div>        cbk->m_PlaneWidget[i] = m_2DPlaneWidget[i];</div><div>        m_2DPlaneWidget[i]-><wbr>AddObserver(vtkCommand::<wbr>WindowLevelEvent,cbk);</div><div>    }</div><div>}</div><div><br></div><div><br></div><div>class MyCallback : public vtkCommand</div><div>{</div><div>public:</div><div>    static MyCallback *New()</div><div>    { return new MyCallback; }</div><div><br></div><div>    void Execute( vtkObject *caller, unsigned long ev,</div><div>                  void *callData )</div><div>    {</div><div>        if (ev == vtkCommand::WindowLevelEvent)</div><div>        {</div><div>            vtkImagePlaneWidget* ipw =</div><div>                    dynamic_cast< vtkImagePlaneWidget* >( caller );</div><div>            if (ipw)</div><div>            {</div><div>                double* wl = static_cast<double*>( callData );</div><div><br></div><div>                if ( ipw == this->m_PlaneWidget[0] )</div><div>                {</div><div>                    this->m_PlaneWidget[1]-><wbr>SetWindowLevel(wl[0],wl[1],1);</div><div>                    this->m_PlaneWidget[2]-><wbr>SetWindowLevel(wl[0],wl[1],1);</div><div>                }</div><div>                else if( ipw == this->m_PlaneWidget[1] )</div><div>                {</div><div>                    this->m_PlaneWidget[0]-><wbr>SetWindowLevel(wl[0],wl[1],1);</div><div>                    this->m_PlaneWidget[2]-><wbr>SetWindowLevel(wl[0],wl[1],1);</div><div>                }</div><div>                else if (ipw == this->m_PlaneWidget[2])</div><div>                {</div><div>                    this->m_PlaneWidget[0]-><wbr>SetWindowLevel(wl[0],wl[1],1);</div><div>                    this->m_PlaneWidget[1]-><wbr>SetWindowLevel(wl[0],wl[1],1);</div><div>                }</div><div>            }</div><div>            this->m_PlaneWidget[0]-><wbr>GetInteractor()-><wbr>GetRenderWindow()->Render();</div><div>            this->m_PlaneWidget[1]-><wbr>GetInteractor()-><wbr>GetRenderWindow()->Render();</div><div>            this->m_PlaneWidget[2]-><wbr>GetInteractor()-><wbr>GetRenderWindow()->Render();</div><div>            this->m_PlaneWidget[0]-><wbr>UpdatePlacement();</div><div>            this->m_PlaneWidget[1]-><wbr>UpdatePlacement();</div><div>            this->m_PlaneWidget[2]-><wbr>UpdatePlacement();</div><div>        } </div><div><span class="m_4419796695083657672gmail-Apple-tab-span" style="white-space:pre-wrap"> </span>}</div><div><pre style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(85,255,85)">vtkImagePlaneWidget</span><span style="color:rgb(170,170,170)">*</span><span style="color:rgb(192,192,192)"> </span>m_PlaneWidget<span style="color:rgb(170,170,170)">[</span><span style="color:rgb(255,85,255)">3</span><span style="color:rgb(170,170,170)">];</span></pre></div><div>}</div></div></div></div>
</div></div>

<br>
------------------------------<wbr>------------------------------<wbr>------------------------------<wbr>------------------------------<wbr>-<br><font face="Arial" size="2"><u><b>Disclaimer:</b></u> This email message including any attachments is confidential, and may be privileged and proprietary to Agiliad. If you are not the intended recipient, please notify us immediately by replying to this message and destroy all copies of this message including any attachments. You are NOT authorized to read, print, retain, copy, disseminate, distribute, or use this message or any part thereof. Thank you.</font><br>------------------------------<wbr>------------------------------<wbr>------------------------------<wbr>------------------------------<br>______________________________<wbr>_________________<br>
Powered by <a href="http://www.kitware.com" rel="noreferrer" target="_blank">www.kitware.com</a><br>
<br>
Visit other Kitware open-source projects at <a href="http://www.kitware.com/opensource/opensource.html" rel="noreferrer" target="_blank">http://www.kitware.com/<wbr>opensource/opensource.html</a><br>
<br>
Please keep messages on-topic and check the VTK FAQ at: <a href="http://www.vtk.org/Wiki/VTK_FAQ" rel="noreferrer" target="_blank">http://www.vtk.org/Wiki/VTK_<wbr>FAQ</a><br>
<br>
Search the list archives at: <a href="http://markmail.org/search/?q=vtkusers" rel="noreferrer" target="_blank">http://markmail.org/search/?q=<wbr>vtkusers</a><br>
<br>
Follow this link to subscribe/unsubscribe:<br>
<a href="http://public.kitware.com/mailman/listinfo/vtkusers" rel="noreferrer" target="_blank">http://public.kitware.com/<wbr>mailman/listinfo/vtkusers</a><br>
<br></blockquote></div><br></div>