I am using @chauffeur for the first time and am having an issue getting the correctly generated color palette to map the the correct colors on the montage.
We are using the command below and it creates the correct color scale, but that color scale does not appear to be what is used when the montage is created.
We also tried using the alternative option for -colorscale_idx_file CI CF with the following file contents, but we got an error and might not be using that command correctly either.
Can you please give us some guidance on how to use this program correctly? As you can see from the file below, we have an overlay with 8 values and we only want some of them to be included in the montage.
-ulay tse.nii.gz \
-olay hipp.nii.gz \
-prefix TESTtrain002 \
-montx 5 -monty 5 \
-set_xhairs OFF \
-pbar_saveim PBS.jpg \
-colorscale_idx_file [00, 08] montage_colorscale.txt \
-cbar_ncolors 8 \
There are a few points here to clarify (and I will update the help file in @chauffeur_afni, too).
This colorbar input is only for continuous colorbars, not for discrete ones. Therefore, you should not include the options:
-cbar_ncolors 8 \
The first argument in the
-colorscale_idx_file .. opt should be a 2 digit number, and not the "[00, 08]" text shown; it should be something to enumerate your color object, and you could just start with, say, "01".
In the "montage_colorscale.txt" file:
- The first line should be the reference name of the colorbar itself. So, put something like "MY_COLOR_BAR" on the top line of the text file.
- Quite confusingly (and I am just noticing this now), the allowed colorbar names here cannot have hyphens in them. Hex values are allowed, but the list of text file names is not the expected one, and it doesn't appear to include "none" as a keyword, either. In fact, the list of names is quite long, and is shown here: List of colors available in StarGenetics, with the further caveat that the names with spaces there are not allowed. So, in the top row, just:
- "snow", "GhostWhite", "WhiteSmoke", "gainsboro", "FloralWhite", "OldLace", "linen", ...,
and not "ghost white" or "white smoke". But that is a very long list of colors to choose
To set the max colorbar value, you could use the
-frange .. option in
If you would like a discrete colorbar, and one that does use the names like "oran-yell", etc., then you can use the formulation shown in Example D, say, for the colorbar part:
-ulay FT_anat+orig. \
-olay FT_anat+orig. \
-func_range_perc 95 \
-prefix AAA \
-pbar_saveim BBB.jpg \
-cbar_ncolors 6 \
-cbar_topval "" \
-cbar "1000=yellow 800=cyan 600=rbgyr20_10 400=rbgyr20_08 200=rbgyr20_05 100=rbgyr20_03 0=none"
How does that seem?
We are still having the same problem. The color palette that is being produced is correct, but the colors are still wrong on the montages. See the attached pictures. Also, it is labeling ROI#7, which should get a color of NONE. Instead it is being labeled with pink.
Do you know what might be the issue?
-montx 5 -monty 5
-cbar "8=hotpink 7=none 6=none 5=none 4=blue 3=LimeGreen 2=red 1=DarkOrange 0=none"
I am guessing your ROIs are integer valued between [1, 8], and therefore you probably want the colorbar to go between [0, 8]? Therefore, I would remove
-func_range_perc 95 and instead use:
-func_range 8 \
You can verify in the output PBS.txt file that the min/max colorbar values are 0 and 8, looking like:
pbar_bot :: "0"
pbar_top :: "8"
Also, there seems to be a bit of mixing at the integer boundary for this kind of specification, which I haven't noticed before, but adding a small epsilon to the boundary point avoids it:
-cbar "8=hotpink 7.001=none 6.001=none 5.001=none 4.001=blue 3.001=LimeGreen 2.001=red 1.001=DarkOrange 0=none" \
Does that look more appropriate?
It worked! Thanks for your help.