[vtkusers] A VTK Bug

Vidyadhar vidyadhar at lucidindia.com
Thu Oct 11 00:39:36 EDT 2007


Hi,
Do these things. 1) Get HWND for your MFC control (I think you are using Picture). 2) Get its client rect (width and height). 3) Invoke viewer->SetParentId method and pass HWND to it. 4) Invoke viewer->SetSize(width,height).
This is not a bug.
HTH
Vidyadhar
  ----- Original Message ----- 
  From: JohnMark 
  To: vtkusers at vtk.org 
  Sent: Wednesday, October 10, 2007 3:48 PM
  Subject: [vtkusers] A VTK Bug 


  hello , vtk users and developers , 
      
      I find a vtk BUG now . and the bug is just as follows :
      I use VC++ and VTK to show a dcm image . and I build a project , its base class is CFormView . and 
  then I use vtkDICOMImageReader and vtkImageViewer2 to show the image in an Picture of MFC . but here 
  is the bug :
      all of my code are just : 
  vtkDICOMImageReader * reader = vtkDICOMImageReader::New();
      reader->SetDataByteOrderToLittleEndian();
      reader->SetFileName("D:/Data");
      reader->Update();
  vtkImageViewer2 * viewer = vtkImageViewer::New();
      viewer->SetInput(reader->GetOutput());
      viewer->SetSlice(0);
   
      and then I run it , I find the dcm image appears ! however , the dcm image is not in the Picture 
  of MFC , but in a vtk render window . how surprising ! because I do not use the function Render ! at 
  the same time , if I use vtkImageViewer , it will be OK . 
      So , I want to ask : is this a vtk BUG ? or vtkImageViewer2 can not show the dcm image ? but from 
  the description of this class , we can see : vtkImageViewer2 is a convenience class for displaying a 
  2D image . or this class is not perfect and we can not use this class now ?
      if this is not a bug , why does this happen ? and what is wrong with my code ? how can I use this 
  class correctly ?
   
      thank you for any help !
   
      Mark
   
   
    
   
   


------------------------------------------------------------------------------
  使用新一代 Hotmail,更强大、更安全、更多存储空间! 立刻体验! 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20071011/d6b7b3ee/attachment.htm>


More information about the vtkusers mailing list