[Insight-users] help black window!
Renaud Winzenrieth
renaud . winzenrieth at utc . fr
Tue, 27 Aug 2002 10:35:16 +0200
Hi everybody,
I have a problem with the cannyfilter.
This is what I do:
vtkBMPReader *imageIn=vtkBMPReader::New();
imageIn->SetFileName("D:/renaud/These/Images/TE_00011.BMP");
> >
> > vtkImageLuminance *il=vtkImageLuminance::New();
> > il ->SetInput (imageIn-> GetOutput());
> >
> > vtkImageCast *cast=vtkImageCast::New();
> > cast->SetInput(il ->GetOutput());
> > cast->SetOutputScalarTypeToFloat ();
> >
> >
> > vtkImageExport* vtkExporter = vtkImageExport::New();
> > vtkExporter->SetInput(cast->GetOutput());
> > typedef itk::Image<float, 2> ImageType;
> > typedef itk::VTKImageImport<ImageType> ImageImportType;
> > ImageImportType::Pointer itkImporter = ImageImportType::New();
> > ConnectPipelines(vtkExporter, itkImporter);
> >
> > typedef itk::CannyEdgeDetectionImageFilter<ImageType, ImageType>
> > CannyFilterType;
> > CannyFilterType::Pointer cannyFilter=CannyFilterType::New();
> >
> > cannyFilter->SetInput(itkImporter->GetOutput());
> > cannyFilter->SetVariance(0.1);
> > cannyFilter->SetMaximumError(0.1);
> > cannyFilter->Update();
> >
> > typedef itk::VTKImageExport<ImageType> ImageExportType;
> > ImageExportType::Pointer itkExporter = ImageExportType::New();
> > itkExporter->SetInput(cannyFilter->GetOutput());
> > vtkImageImport* vtkImporter = vtkImageImport::New();
> > ConnectPipelines(itkExporter, vtkImporter);
> >
> > vtkImageCast *cast1=vtkImageCast::New();
> > cast1->SetInput(vtkImporter ->GetOutput());
> > cast1-> SetOutputScalarTypeToUnsignedChar();
> >
> > vtkImageActor* actor = vtkImageActor::New();
> > actor->SetInput(cast1->GetOutput());
> >
> > vtkRenderer* renderer = vtkRenderer::New();
> > vtkRenderWindow* renWin = vtkRenderWindow::New();
> > vtkRenderWindowInteractor* iren = vtkRenderWindowInteractor::New();
> >
> > renWin->SetSize(256, 256);
> > renWin->AddRenderer(renderer);
> > iren->SetRenderWindow(renWin);
> >
> > renderer->AddActor(actor);
> > renderer->SetBackground(0.4392, 0.5020, 0.5647);
> >
> > renWin->Render();
> > iren->Start();
> >
> >
> > If I just connect the pipeline without perform the connyfilter, all work
> > well. But when I use the filter, I only Obtain a black window.
> > What's wrong?
> > Is anybody can help me?
Thanks in advance ,
Renaud