MINC/VisualTools/Display

From Wikibooks, open books for an open world
< MINC‎ | VisualTools
Jump to: navigation, search

Display is a hugely versatile program, and perhaps is best explained by example. Its main purposes are segmenting, visualizing/overlaying several MINC files and visualization of 3D objects.

Overlaying images[edit]

This will be an overview of overlaying images in Display by example. In particular, the example will show an overlay of a t-statistics map and a final non-linear average of a mouse brain. The two input files are:

Display MINC toolkit overlay images input

What we want to do is create an image that shows which areas of the brain have a certain t-statistic related to them. Ideally we want to show areas that have negative t-stats and positive t-stats using different colours. The end result should look something like this:

Final result of overlay mousebrain anatomy and two coloured tstats in Display from the MINC toolkit

You can load multiple files into Display. In the example above the red shows areas where the t-statistics are at least 4 (and thus positive), and the blue areas indicate areas where the t-statistics are at most -4. All this information comes from one file: the tstats.mnc file. In order to create two different colours using that one file, you will have to load it in twice in Display. That is the first step

Step 1: load input files[edit]

  $ Display final-nlin.mnc tstats.mnc tstats.mnc

Step 2: load hotred colour for the positive t-statistics[edit]

MINC toolkit Display controls window

Overview of steps in Display:

  • click "space Pop Menu" or press space bar to get to the main menu if you were not there already
  • click "T File" or press "t"
  • click "Y Load UserDef ColCo" or press "y"
  • On the command line type: "/micehome/jlerch/luts/hotred" and press "enter"

Display has a control panel. You can click on the buttons with your mouse, or use the keys on the keyboard (e.g, clicking on "D Colour Coding" will do the same thing as pressing the "d" on your keyboard). When you click on "D Colour Coding" you get to a menu that allows you to change the colours to gray, hot metal, spectral... Try them out and see what they do. In our case, we want to use user defined colours, and so we will need to load those in. These are text files that indicate which colours belong to which points along the colour bar. See below for an example. If you went into the Colour Coding tab in Display, press the space bar or "space Pop Menu" to get back to the main menu. There go the "T File", and then to "Y Load UserDef ColCo". As soon as you pressed the latter, Display will become unresponsive because it is awaiting input from the command line. So go to the shell which started Display. If will say:

  $ Display final-nlin.mnc tstats.mnc tstats.mnc
  Inputting final-nlin.mnc.
  Objects input.
  Inputting tstats.mnc.
  Objects input.
  Inputting tstats.mnc.
  Objects input.
  Enter name of piecewise colour coding file to load:

Here you can now enter the name of the look-up table you want to use (and press enter):

 Enter name of piecewise colour coding file to load: /where/the/lookup/table/is/hotred

This is what the lookup table should contain for "hotred". Each line in the file provides a point on the interval and its colour. The last 3 numbers stand for Red, Green, Blue (0 = nothing, 1=full), the first number indicated where on the interval this colour should occur. So in this case, at the beginning of the interval (0.00) is black (0.0 0.0 0.0) meaning non of each of the colors. Halfway (0.50) it's full red with half blue (1.0 0.0 0.5) and at the end of the hotred spectrum it is white (1.0 1.0 1.0)

  $ cat /where/the/lookup/table/is/hotred
  0.00 0.0 0.0 0.0
  0.25 0.5 0.0 0.0
  0.50 1.0 0.0 0.5
  0.75 1.0 0.5 1.0
  1.00 1.0 1.0 1.0

Back in Display you will see the change in colour.

Step 3: transparency[edit]

Display overlaying images transparency step 1 MINC toolkit

Overview of steps in Display:

  • click "space Pop Menu" or press space bar to get to the main menu if you were not there already
  • click "D Colour Coding" or press "d"
  • click "Z Under Col: BLACK" or press "z"
  • On the command line enter "transparent" and press "enter"
  • Adjust the thresholds for the colour on the left of the Display screen

In Display, on the left side of the screen you see a slider for the colour which acts on the colours of the current visible layer. After you have switched the "under colour" to transparent, you can drag the indicators for the lower and upper colour to the desired levels. You can see that with the transparency turned on, as soon as you change the visible colour range, the next layer (in default "hot metal" colours) shows up.

Step 4: work on the second layer[edit]

Display overlaying images transparency step 2 MINC toolkit

All of what we have done so far is work on the "top" layer, which is the last argument to Display (tstats.mnc in this example). The three arguments we gave it in the beginning were final-nlin.mnc, tstats.mnc and tstats.mnc again. We will now go to the second layer (tstats.mnc) and use that layer to show the negative t-statistic values.

Overview of steps in Display:

  • click "space Pop Menu" or press space bar to get to the main menu if you were not there already
  • click "S Slice View" or press "s"
  • click "T Curr Volume: 3" or press "t"
  • click "T Curr Volume: 1" or press "t" (again, so that we are now working on layer 2)
  • click "space Pop Menu" or press space bar to get to the main menu
  • click "T File" or press "t"
  • click "Y Load UserDef ColCo" or press "y"
  • On the command line type: "/where/the/lookup/table/is/hotblue" and press "enter"
  • click "space Pop Menu" or press space bar to get to the main menu
  • click "D Colour Coding" or press "d"
  • click "Z Under Col: BLACK" or press "z"
  • On the command line enter "transparent" and press "enter"
  • Adjust the thresholds for the colour on the left of the Display screen

This is what the hotblue file should contain:

  $ cat /where/the/lookup/table/is/hotblue
  0.00 0.0 0.0 0.0
  0.25 0.0 0.0 0.5
  0.50 0.0 0.5 1.0
  0.75 0.5 1.0 1.0
  1.00 1.0 1.0 1.0

In this case, make sure that you drag the indicator for the top/upper end of the displayed range below the indicator for the lower/bottom end of the range.

Step 5: work on the first layer and clean up[edit]

Display overlaying images final result with cursor removed and trinlinear interpolation

The last things we need to do is change the colour of the brain (gray looks better with the blue and red), get rid of the cursor that is visible in, and make the interpolation of the layers look better.

Overview of steps in Display:

  • click "space Pop Menu" or press space bar to get to the main menu if you were not there already
  • click "S Slice View" or press "s"
  • click "T Curr Volume: 2" or press "t"
  • click "T Curr Volume: 3" or press "t" (again, so that we are now working on layer 1)
  • click "space Pop Menu" or press space bar to get to the main menu
  • click "D Colour Coding" or press "d"
  • click "D Gray Scale" or press "d"
  • click "space Pop Menu" or press space bar to get to the main menu
  • ### Getting rid of the visible cursor ###
  • click "F Segmenting" or press "f"
  • click "4 Cursor Vis: On" or press "4"
  • click "space Pop Menu" or press space bar to get to the main menu
  • ### Improving the interpolation quality ###
  • click "Q Volume Config" or press "q"
  • click "S Interp: near neigh" or press "s"
  • (you could press s again, to change the interpolation from trilinear ot tricubic)