Reply-To: | | [log in to unmask][log in to unmask]> wrote:
From: Lars Riisgaard Ribe <[log in to unmask]> Subject: Re: [SPM] Check Reg Figures SPM8 - size and arrangement To: "Vladimir Bogdanov" <[log in to unmask]> Date: Friday, March 4, 2011, 7:49 PM
Hi VladimirI have made a change in spm_check_registration, that causes the Graphics window to extend to the maximum in the beginning of checkreg, and the images are thus not stretched but only scaled. If you're nat afraid of patching spm, you could try the replacing the following in spm_check_registration.m:delete: n = round(mn^0.4); m = ceil(mn/n); change to: %The part of the screen to avoid because of menus in the OS %May be lowered to 50 on Windows and/or Linux menusheight = 100; S0 = spm('WinSize','0',1); ww = S0(3); wh = S0(4)-menusheight; %remove 100 to menu bars etc. ns = 1:ceil(sqrt(mn)); %Find the maximum size of one square block taken monitor aspect ratio %into account ms = ceil(mn./ns); blocksizes = [ww./ns; wh./ms]; [maxsize,n] = max(min(blocksizes, [], 1)); m = ceil(mn/n); ww = floor(n*maxsize); wh = floor(m*maxsize); % Avoid the window being too narrow Rect = spm('WinSize','Graphics'); if Rect(3) > ww ww = Rect(3); end % Now set the position position = [S0(1)+round((S0(3)-ww)/2) S0(2)+menusheight ww wh]; set(fg, 'Position', position);
Best, Lars
#yiv1540991629 p.yiv1540991629p1 {margin:0.0px 0.0px 0.0px 0.0px;font:12.0px Helvetica;} #yiv1540991629 p.yiv1540991629p2 {margin:0.0px 0.0px 0.0px 0.0px;font:10.0px Helvetica;color:#616161;} Lars Riisgaard Ribe MSc. Center of Functionally Integrative Neuroscience (CFIN) Building 10G, 4th floor Aarhus University Hospital NBG 8000 Aarhus C Denmark [log in to unmask] Phone: +45 89 49 40 95 On Wed, Feb 23, 2011 at 12:04 PM, Vladimir Bogdanov <[log in to unmask]> wrote: Thank you, Guillaume!
This was very helpful. But I faced other difficulty. The position parameters are in relative units and if we change the proportions of the figure, the images are stretched. I suppose, I need to get the real size of the figure and to incorporate this in the script to keep correct proportions of the images, but I do not know, how to do it.
Thank you in advance for your help and sorry for my primitive questions.
Sincerely yours, Vladimir
--- On Tue, 2/22/11, Guillaume Flandin <[log in to unmask]> wrote:
> From: Guillaume Flandin <[log in to unmask]> > Subject: Re: [SPM] Check Reg Figures SPM8 - size and arrangement > To: "Vladimir Bogdanov" <[log in to unmask]> > Date: Tuesday, February 22, 2011, 4:49 PM > Dear Vladimir, > > the following code should get you started (to be executed > when images > are displayed with checkreg): > > global st > h = 1; > for i=1:nnz(~cellfun('isempty',st.vols)) > p1 = get(st.vols{i}.ax{1}.ax,'Position'); > p2 = get(st.vols{i}.ax{2}.ax,'Position'); > p3 = get(st.vols{i}.ax{3}.ax,'Position'); > l = p1(3) + p2(3) + p3(3); sc = > (1-0.01)/l; > p1 = p1*sc; p2 = p2 * sc; p3 = p3 * sc; > set(st.vols{i}.ax{1}.ax,'Position',... > [0 h-p1(4) p1(3) p1(4)]); > set(st.vols{i}.ax{2}.ax,'Position',... > [p1(3)+0.005 h-p2(4) p2(3) > p2(4)]);
|