Visualisation Module PAQ - Previously Asked Questions
Questions that have previously been asked regarding this module,
the practicals and the assignments. Please check here before emailing me.
VTK related questions are marked as such. See also the VTK FAQ.
-
Q: Will there be formal tutorials/practicals for this course?
A: No. There are non-assessed practical exercises and assignments
which you are required to do (see main course page).
-
Q: Can I do the practicals in Java or C++?
A: Yes. We (the School of Informatics) support TCL for these practicals
and assignments. The java bindings on DICE appear to work
so you are welcome to use Java. With C++ you are on your own. All assignment
submissions must include documented source code and an executable that works on DICE.
-
Q: Can I do the practicals in Python?
A: No. TCL, Java or C++ only. Sorry.
-
Q: Can I do this course without any programming experience?
A: Yes, you can. But this is an final year honours/M.Sc. course in Informatics
so you WILL struggle without prior experience in this area. The school cannot make
allowances for those who choose to take this course without relevant prior experience.
Would you do a final year/M.Sc. physics course if you had no knowledge of physics?
-
Q: Is there a course textbook?
A: See lecture note 1. Also reading list on main course page.
-
Q: (VTK) Where can I get VTK from for use at home / on my laptop?
A: VTK download Linux RPMs from DICE
-
Q: (VTK) How do I get Java and VTK to work on DICE ?
A: A very brief DICE/JAVA/VTK how-to
-
Q: (VTK) I cannot find class vtkX in VTK. Where is it ?
A: See VTK manual
alphabetic class list, lecture 2 URLs and VTK tutorial handout.
-
Q: (VTK) Why does vtkExtractVOI not improve my program performance?
A: It should improve the speed. Check that you have definitely "plugged"
this filter into the pipeline so the contourFilter takes the output of the subsampler which
in turn takes output from the SLC file reader. e.g. :
vtkSLCReader reader
reader SetFileName "myfile.slc"
vtkExtractVOI subsampler
subsampler SetSampleRate 3 3 3
subsampler SetInput [reader GetOutput]
vtkContourFilter contourFilter
contourFilter SetValue 0 80
contourFilter SetInput [subsampler GetOutput]
-
Q: (VTK) Why is 3D VTK slow on DICE?
A: Graphics provision is not great universally. Try a different machine (type).
If its really bad report the machine in question as faulty (to support, not me).
-
Q: (VTK) Why is my MPEG movie got several seconds during the movie
that are completely black?
A: If you switch windows or desktops so that the VTK window is not
rendering directly to screen (or even if it is not the current window
in focus) the "demand-driven" visualisation pipeline of VTK (lecture 3) will not
update the pipeline - as there is no user demand. Hence, you get blank images as
captures from the visualisation and hence blank sections of encoded MPEG video.
-
Q: If the assignment says make a ~X second MPEG video and the encoder does Y frames a second,
do I need to produce X*Y JPEGs as an input to the MPEG encoder?
A: Yes. As the assignment advises - use /tmp for space. It sounds like a lot of
data (and it is) but often in visualisation we deal in large quantities of data. MPEG compression
is one method of visualising this data whilst minimising the storage requirements.
-
Q: I see the requirements for the assignment are open-ended. If I don't do part X
will I still get a good mark?
A:
The mark break-down is stated on the assignment handout. If you do not submit a
portion of the assignment (or a limited part thereof) then your marks for that
part will obviously be reduced depending on what you submit.
As a golden rule - submitting something is better than nothing.
No part X = no marks for part X.
=> Total possible mark = 100% - (percentage for part X + any others parts
reliant on part X)
-
Q: The assignment suggests using other visualisation techniques in the design
of a final open-ended visualisation/interaction. Do we need to use any
advanced techniques we have not covered in the course?
A:
You can if you wish - you will not be penalised, but you have to be able to explain
why you choose to use them and show the program/script is your own work. Generally, the
techniques presented in lectures and available through wider reading of the VTK manual,
online VTK examples, course practical excercises and consideration of what would improve the
visualisation will suffice for a good mark in this section. I am not looking for anything
beyond the techniques and VTK examples that have been presented (with TCL code) in lectures.
-
Q: (VTK) Where are the Rotate [X,Y,Z] method in the vtkActor object?
A: It doesn't have one. Use the RotateX(), RotateY(), RotateZ () or
SetOrientation () command. vtkActor
inherits these from the vtkProp3D class.
-
Q: (VTK) Where are the Rotate [X,Y,Z] method in the vtkCamera object?
A: It doesn't have one. vtkCamera
uses Roll, Azimuth, Yaw as stated in Practical handout 3.
-
Q: (VTK) Where is method X of the vtkX' object?
A: See the alphabetical manual index.
Remember OO programming (like VTK) works in a class hierarchy - look up the hierarchy to
determine methods inherited from super-classes.
-
Q: (VTK) In TCL is there a way of concatenating two strings/variables together?
A: In TCL all variables are strings (lecture 2). See "format" command in
practical handout 3. From the TCL manual (lecture 2):
format
-
Q: (VTK) Can I visualise other DICOM format medical data in VTK?
A: See: VTK FAQ DICOM
-
Q: (VTK) I would like to assign these to various key presses to functions in my visualisation.
Is it possible to add multiple key commands as opposed to only having the one "u" key?
A: Investigate the associated classes and methods - vtkInteractor* etc. in the VTK
manual.
Remember the "u" key press event can also be used as a single event to index into a state machine
- each press cycles the visualisation through a number of states.
See custom interaction example at: /usr/share/doc/vtk-examples-4.2.4/Examples/GUI/Tcl/CustomInteraction.tcl
-
Q: (VTK) Is it possible to have multiple synchronised VTK renderers ?
A: See see dividing cubes example (dcubes.tcl) from lectures.
-
Q: (VTK) Why does the dividing cubes example (dcubes.tcl) from lectures
not work in MS windows ?
A: This is because it is a patented algorithm that is not compiled by default
in the standard MS Windows VTK distribution from kitware.
It is, however, in the VTK distribution installed on DICE. Solution: use linux.
-
Q: [How do I do X | Is it possible to X] in VTK ?
A: Fully examine all of the available VTK resources presented to you
in lectures and suggested as support materials to the assignments.
Remember the additional examples at: /usr/share/doc/vtk-examples-4.2.4/Examples/
The answer is out there.
-
Q: (VTK) Why do I only get a black window from VTK ?
A: Check the following
- Your VTK pipeline is properly connected.
- Try setting background to white:
vtkRenderer ren
ren SetBackground 1 1 1
- It may be taking a while to display (as the SLC data file is large)
- try using the vtkExtractVOI object to sub-sample the data.
Check the
load on the machine your are using as this has an effect.
- Try setting the colour of the data to something other than black
(colourmap / iso-surface colour etc).
- Ensure the window is in focus.
- Toggle scalar visibility:
vtkPolyDataMapper mapper
....
mapper ScalarVisibilityOff
-
Q: (VTK) Is there a way to move a 3D object around in VTK?
A: See the vtk3DWidget set of classes.
-
Q: (VTK) How do I set 3D object properties of an object in VTK ?
A: Each vtkActor object inherits methods from
vtkProp3D
which has Get/Set methods for position, orientation and scale (in X,Y & Z).
Additionally it has useful methods for getting bounds and ranges from the actor data.
-
Q: (VTK) The following VTK code does not work. I cannot work out why. Can you take a
look for me and find the bug?
A: No, I will only answer specific queries. Debugging a program is a skill in itself
and one that you must develop if you are to progress in the field of software development/computer science. Use a
systematic approach to testing and simplify your program until you understand
the problem. Identify a potential bug, make changes, test, add features, re-test and progress in this manner towards your goal.
Look at the VTK resources provided for VTK related problems and see other
entries on this page for other specific VTK related problems.
-
Q: Why does gmplayer not work for my ".mpg" file?
A: Check your file contains data and is in fact a movie file. For example
(using a short movie clip of a small screen area):
user@dicebox[~] file output.mpg
output.mpg: RIFF (little-endian) data, AVI, 552 x 480, 25.00 fps,
video: Microsoft MPEG-4 v2
user@dicebox[~] du -h output.mpg
200K output.mpg
See the documentation for mplayer package - Locally on dice :
file:///usr/share/doc/mplayer-1.0/DOCS/HTML/en/index.html
or on mplayer project website. Also try mplayer
command.
If the movie file is created by xvidcap ensure you correctly copied the settings file to
your home directory as follows (stated in handout 3):
cp /group/teaching/cs4/vis/xvidcap/xvidcap.scf ~/.xvidcap.scf
If you still have problems, check the following gmplayer setting:
Run gmlayer, right click on the interface and choose preferences.
Go to video tab, then change the driver to xv. Now try and play the file. (credit for this fix to M. Conventry on eduni.inf.ug4)
-
Q: Where is xvidcap? It is not installed on dice.
A: See handout 3 where is says run the command as /group/teaching/cs4/vis/xvidcap/xvidcap
BUT AFTER running the following command to copy the settings across:
cp /group/teaching/cs4/vis/xvidcap/xvidcap.scf ~/.xvidcap.scf
-
Q: xvidcap produces an error message as follows - ?
Output not a video file or no counter in filename
Disabling autocontinue!
A: Ignore this. It refers to the output file specified on the command line
but this is hard coded as output.mpg
in the settings file that you have
been told to copy.
-
Q: When I run xvidcap my VTK interaction stops working?
A: Check the load on the machine you are using. If it is high due to background
processes then use another machine. Check you are not capturing an
excessively large screen area (try capturing a smaller area or make you
VTK windows smaller - they should show the same information, just at a smaller scale).
Also try starting xvidcap in /tmp so that it writes data to the local disk rather than your network mounted home directory.
-
Q: When I change into /group nothing appears?
A: This is an automount directory. Change into the full course
path /group/teaching/cs4/vis/ and you will see all the course files.
-
Q: What will be in the exam ?
A: Questions based on your knowledge and understanding of the course content
together those requiring applied reasoning based on the course topics.
[
Visualisation Home Page]
This page is maintained by the course lecturer, Taku Komura,
room 2107B JCMB, ext 513445