I can't pick two points and draw line with MPR

I use vtkImagePlaneWidget to display four views of MPR. Now I want to pick two points with mouse and draw line at one view. but I find I can’t pick points and draw lines.

It seems that you are developing a medical image viewer from scratch. If you are doing this work for a course project or just for the fun of learning then just go on, this will be a useful learning experience.

If your goal is to have a functional medical image viewer application with some special features then you can get there much more quickly if you build on existing free, open-source medical image visualization and analysis application frameworks (such as 3D Slicer or MITK). You get all the general features of image import/export, display in 2D/3D, surface and volume rendering, annotations, measurements, registration, segmentation, etc. for free and you can just focus on implementing the features that are unique to your application.

thank you for your advice. it is really useful for me. I will study 3d slicer or MITK and compare their difference and choose one, but now I just need to draw a line on MPR, then it will work.

You may be implement a simple line drawing in a single view by using VTK widgets, but if your users are not happy with the limited functionality what these widgets provide then you can expect many weeks of development work (e.g., if users want to place line endpoint in any views, synchronizing display in all views, making sure that line is well visible regardless of background image content, screen resolution, and what other objects are shown; displaying labels, but only if the line is not occluded; drag-and-dropping the end points in any views, snap the line endpoint to planes or other objects in the views, making it work correctly with other interactions).

Since simple, seemingly trivial features may take weeks or months to develop, and there are hundreds of these even in a very basic medical image viewer, it may take several before you can ship a usable software.

When you develop a lot of custom code you are also slowing yourself down because the more code you develop the more time you need to spend with testing and maintenance. At some point, it will be very hard to add any more features because all your time is spent with just keeping your current code base functional (responding to user error reports, keeping underlying libraries up-to-date, etc.). This maintenance work is done for you for free when you use an existing application framework and you can keep focusing on the parts that makes your application unique.

I think what your advice in detail. you are right, it has so much risk. I will think it over.

hi,I am using vtk for some test. now I want to use vtkResliceImageViewer to display a vtkImageReslice as below

colorMap = vtkSmartPointer::New();

resliceImageViewer = vtkSmartPointer::New();

now I want to draw a line or draw a text, but why the line or the text doesn’t display, why?
textActor1 = vtkSmartPointer::New();
textActor1->SetPosition(10.0, 10.0);
textActor1->GetProperty()->SetColor(0.0, 1.0, 0.0);