[vtkusers] Bug in vtkContourWidget?

itkvtk123 at gmx.net itkvtk123 at gmx.net
Mon Oct 26 16:34:27 EDT 2009


Hey guys,

I think I found a bug while experimenting with vtkContourWidget today.

How to reproduce the bug (first way):
1. Zoom out using the mousewheel to see the entire image.
2. Left click inside image area to place first contour point
3. Right click outside image area to cancel/finish contour operation
4. Press Mousewheel and drag image -> crash

How to reproduce the bug (second way):
1. Zoom out using the mousewheel to see the entire image.
2. Left click inside image area to place first contour point
3. Right click outside image area to cancel/finish contour operation
4. Hold Ctrl, Left Click Mouse and drag to rotate image
5. Left click inside image area to place second contour point -> crash

Minimal code example:

#include "vtkImageViewer2.h"
#include "vtkRenderWindowInteractor.h"
#include "vtkContourWidget.h"
#include "vtkPNGReader.h"
#include "vtkOrientedGlyphContourRepresentation.h"
#include "vtkImageActorPointPlacer.h"

int main(int argc, char*argv[])
{
	//Setting Up Viewer
	vtkImageViewer2* viewer = vtkImageViewer2::New();
	vtkRenderWindowInteractor *iren = vtkRenderWindowInteractor::New();
	viewer->SetupInteractor(iren);

	//Read Image
	vtkPNGReader* reader = vtkPNGReader::New();
	reader->SetFileName("BrainProtonDensitySlice.png");
	viewer->SetInput(reader->GetOutput());

	//Initialize Widget
	vtkContourWidget* widget = vtkContourWidget::New();
	widget->SetInteractor(iren);
	vtkOrientedGlyphContourRepresentation *rep = vtkOrientedGlyphContourRepresentation::New();
	widget->SetRepresentation(rep);

	//Initialize Point Placer
	vtkImageActorPointPlacer* pointPlacer = vtkImageActorPointPlacer::New();
	pointPlacer->SetImageActor(viewer->GetImageActor());
	rep->SetPointPlacer(pointPlacer);

	//Start Interaction
	viewer->Render();
	widget->On();
	iren->Start();

	return 0;
}
-- 
GRATIS für alle GMX-Mitglieder: Die maxdome Movie-FLAT!
Jetzt freischalten unter http://portal.gmx.net/de/go/maxdome01



More information about the vtkusers mailing list