Tweaking The Registration
The following is a movie of the Registration process:
A log of the work I am doing at the UC Davis School Of Medicine, Neurology Department in Professor Carmichael's Lab on Brain Image Processing. Specifically, the implementation of software related to the process of Registering Images along with its visualization.
The above is a snapshot of the final iteration in the Registration process that features the now working vtkXYPlotActor and all my previous implementation of the point set and the brain image registration.
I was finally able to get vtkPlotActor to work properly. The problem was in the ordering of the linked libraries in the CMakeLists.txt file that is used by CMake. It seems that if a library is listed last, then anything dependent on it will not be able to define itself properly. Another issue could have been that certain objects were being defined multiple times to further cause errors. So once I was able to remove all the 'undeclared reference' errors I could then begin experimenting with what the vtkXYPlotActor was capable of doing. It seems to be a very versatile class with the ability for the axes to be scaled to whatever a user designated or for it to automatically compensate for the appropriate amount of space for the points. Using these tools, I can scale the y-axis whenever there are points that overreach a certain boundary. The class also contains incremental labels for both axes where the user can specify a number that the class will try to adhere. There is also infrastructure to allow for the separate coloring of the labels and the lines. The input of the graph is in the form of a vtkPolyData object where the scalars are the values for each of the y-axis points. So when plotting, it will take the scalars as the y-points and the point number in the data structure as the x-points. Compared to actually building a vtkPolyData object using points, cells, scalars, and connections between points, this is much easier. I was also able to fit it in nicely into my real time registration structure by simply reloading the vtkPolyData every iteration.
Now that these steps have been completed, I am beginning to try to figure out how to introduce the ability to scroll through the x-axis. Basically, be able to increase the length of the graph in the x direction but still have it be contained in the same space. This may be possible by introducing the VTK widgets that allow for user control of certain aspects of the graphics. The other step is to be able to transform the set of points in the registration and then display them. In the metric, this is done one point at a time and that may be the only way. Because of all this added computation, the registration process may turn out to be very slow.
The vtkXYPlotActor itself has much of the functionality that I am trying to recreate. To alleviate some of the issues that I have been having with it to get it to work with Linux I have declared some of the undeclared referenced classes in the calling program and that has helped with many of the errors. Then I came upon difficulties with the vtkMapper2D that I am having trouble declaring properly. It seems that the problem stems from some of the libraries in VTK are not being declared properly in the context of this class. I tried recompiling VTK with turning off the shared libraries and setting the path name correctly but neither seemed to help.
The preceding graph was made using the VTK class vtkXYPlotActor. It is able to represent the points as a line and has a nice way to label the axis. The problem is that I was only able to get the class working in Windows. In Linux the compiler would complain every time it would start linking, I am not sure why it is doing that so I have been taking elements from this graph and putting them into my own graph class. The labels suit the purpose very well in that they are much clearer then using a .png file for the background. One issue with it is that it uses the vtkAxisActor2D, and by looking at the above graph it can readily be seen that it is not working properly. The areas where the label is "HPQ" should be the value of the position at that point in the axis. When I tried using the class alone it would not even display properly. This class, if it does what it purports to do, would save a great deal of time in creating my graph class.
Once these problems have been solved, I can start working on making the desired points into a vtkDataSet that is the input the line would take. Either points or a smooth line can represent the line. These specific graphs classes seem to be less robust then the other more standard VTK classes and it might be due to being platform dependant or the classes it depends on being altered as VTK has been updated.