Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug: ColorbarSize ignored by Mosaic function #20

Closed
mzunhammer opened this issue Apr 11, 2018 · 2 comments
Closed

Bug: ColorbarSize ignored by Mosaic function #20

mzunhammer opened this issue Apr 11, 2018 · 2 comments

Comments

@mzunhammer
Copy link

Thank you for the additional colorbar-options in the last update of MRIcroGL.
I've noticed a bug when setting the Font/Colorbar size in Preferences > Advanced.
After editing MRIcroGL.ini (e.g. by changing ColorbarSize=0.03500000015 to
ColorbarSize=0.01500000015) the colorbar is resized for all display options, with the exception of MOSAIC, which ignores the ColorbarSize (regardless of whether the GUI or the script is used).
Generally, a function to flexibly change ColorbarSize or Font sizes in Scripting would be awesome.
Cheers, Matthias

@neurolabusc
Copy link
Owner

The pre-release [v1.0.20180402(https://github.com/neurolabusc/MRIcroGL/releases/tag/v1.0.20180402) adjusts this - I have uploaded a MacOS compiled version, for Linux or Windows you can build your own or wait a few days. This new release includes the scripting function COLORBARSIZE, so the code colorbarsize(0.05); will attempt to find a nice colorbar size that is about 5% of the image dimension. This now also impacts the mosaic views.

Note you can not specify the font size, but it does scale with the colorbar size. The font size is dependent on your colorbar range, with a colorbar that has the range -1024..1024 requiring a smaller font that a color bar with the range 1..4 to display the precision. In general, you may want to use PhotoShop or another image editor to precisely tune your font.

Also note that mosaics are very different from the other views. All the other views always scale to your computer screen resolution. The idea of a mosaic is to generate an image for publication, and therefore when you use File/Save and File/Copy with the mosaic view the resolution is determined by the base resolution of your image, not the current resolution of your screen (to minimize interpolation). This often means that the saved mosaics often look a little different to the ones shown on screen, as they optimize the aspect ratio. This is a feature, not a defect.

Additional features are described in the release notes, but some of these are shown below. Specifically, if you drop a folder with several DICOM series onto the toolbar, you will get the option to open one series. MacOS users get an experimental dark mode. The tool panel now allows the user to select the line color and line thickness of lines (and you have script commands for this). Note that line colors are not allowed to be precisely the same color as the background, so if your background is pure white (255,255,255), then a white line will be shown as black (to enhance contrast). If you really wanted a white line in this case, you could set the line color to (255,255,254). The mosaics allow you to show renderings (R) and the orthogonal lines (X). These two scripts showcase some of these features

BEGIN
	RESETDEFAULTS;
	COLORBARVISIBLE(false);
	LOADIMAGE('mni152_2009bet');
	MOSAIC('A R 20 A R -20 S R -20; C R 0 CR -20 S R 20');
	OVERLAYLOAD('motor');
	OVERLAYMINMAX(1, 4, 4);
END.
BEGIN
	RESETDEFAULTS;
	COLORBARVISIBLE(false);
	LOADIMAGE('mni152_2009bet');
	OVERLAYLOAD('motor');
	OVERLAYMINMAX(1, -4, -4);
	CLIPAZIMUTHELEVATION(0.5, 90, 0);
	MOSAIC('V -0.2 H -0.2 A -24 -16 40 50; 60 70 S X R 20');
	XBARTHICK(3);
	XBARCOLOR(255, 255, 255);
END.

dcmload
cross_lines
render_mosaic

@mzunhammer
Copy link
Author

Thank you! New version is looking great!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants