[vtkusers] vtkDICOMImageReader does not display images - VTK 5.0
Andres Munarriz
munarriz.a at gmail.com
Tue Jul 18 12:39:14 EDT 2006
Hello everyone,
I'm trying to read DICOM images using the vtkDICOMImageReader and
display it in a wxWidgets window. Everything seems to be working ok
except that the image isn't displayed at all. If I call the viewer-
>Render() method a new window is opened but the image isn't
displayed either. I'm running MacOSX 10.4. I believe the code is fine.
The following snippet is used to construct the wxWidget frame to
display the file (or series)
ImageFrame::ImageFrame(wxMDIParentFrame *pp_Parent, const wxString&
p_strTitle, const wxPoint& p_Pos, const wxSize& p_Size, const long
p_lStyle):wxMDIChildFrame(pp_Parent, -1, p_strTitle, p_Pos, p_Size,
p_lStyle | wxNO_FULL_REPAINT_ON_RESIZE)
{
vtk_interactor = new wxVTKRenderWindowInteractor(
this, MDI_VTK_MINI_WINDOW);
vtk_interactor->UseCaptureMouseOn();
viewer = vtkImageViewer2::New();
viewer->SetupInteractor(vtk_interactor);
viewer->SetColorWindow(WINDOW_VALUE);
viewer->SetColorLevel(LEVEL_VALUE);
}
bool ImageFrame::OpenSeries(wxString path)
{
atImage = fachade->srvOpenSeries(path);
viewer->SetInput(atImage);
viewer->SetupInteractor(vtk_interactor);
// viewer->Update();
// viewer->Render();
return (atImage != NULL);
}
the Fachada object returns a vtkImageData* after calling the
ImageProcessingCore OpenSeries method.
vtkImageData* ImageProcessingCore::OpenSeries(const char* path){
reader->SetDirectoryName(path);
reader->Update();
return reader->GetOutput();
}
thanks for your help in advance,
Andres E. Munarriz Soto
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20060718/f11a3041/attachment.htm>
More information about the vtkusers
mailing list