<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="gmail_signature"><div dir="ltr">thanks & regards,<div>Girish</div><div><br></div><div><br></div><div><div><br></div><div>void MainWindow::RegisterCallbackWith2DPlaneWidget()</div><div>{</div><div>    vtkSmartPointer<MyCallback> cbk =</div><div>            vtkSmartPointer<MyCallback>::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]->AddObserver(vtkCommand::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]->SetWindowLevel(wl[0],wl[1],1);</div><div>                    this->m_PlaneWidget[2]->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]->SetWindowLevel(wl[0],wl[1],1);</div><div>                    this->m_PlaneWidget[2]->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]->SetWindowLevel(wl[0],wl[1],1);</div><div>                    this->m_PlaneWidget[1]->SetWindowLevel(wl[0],wl[1],1);</div><div>                }</div><div>            }</div><div>            this->m_PlaneWidget[0]->GetInteractor()->GetRenderWindow()->Render();</div><div>            this->m_PlaneWidget[1]->GetInteractor()->GetRenderWindow()->Render();</div><div>            this->m_PlaneWidget[2]->GetInteractor()->GetRenderWindow()->Render();</div><div>            this->m_PlaneWidget[0]->UpdatePlacement();</div><div>            this->m_PlaneWidget[1]->UpdatePlacement();</div><div>            this->m_PlaneWidget[2]->UpdatePlacement();</div><div>        } </div><div><span class="gmail-Apple-tab-span" style="white-space:pre">   </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>------------------------------